next | previous | forward | backward | up | top | index | toc | Macaulay2 web site

random(Module,Module) -- make a random module map

Synopsis

Description

i1 : R = ZZ/101[x,y];
i2 : random(R^{1,2,3},R^{1,2,3})

o2 = {-1} | -27            0        0   |
     {-2} | 24x+43y        -44      0   |
     {-3} | 48x2-13xy-45y2 -15x+19y -22 |

             3       3
o2 : Matrix R  <--- R
i3 : random(ZZ^3,ZZ^6,MaximalRank=>true)

o3 = | 35159051 187550 100273359 8026595 17158747 49526973 |
     | 4897558  26132  13967743  1118068 2390170  6898938  |
     | 34980259 186646 99763029  7985673 17071522 49274886 |

              3        6
o3 : Matrix ZZ  <--- ZZ
i4 : random(ZZ^3,ZZ^10,Density=>.3)

o4 = | 0 0 0 7 6 0 6 0 2 9 |
     | 0 0 0 0 0 0 0 0 0 9 |
     | 4 0 0 0 6 9 0 0 0 2 |

              3        10
o4 : Matrix ZZ  <--- ZZ
i5 : random(ZZ^6,ZZ^6,UpperTriangular=>true)

o5 = | 0 0 5 4 3 2 |
     | 0 0 4 6 5 9 |
     | 0 0 0 2 2 0 |
     | 0 0 0 0 2 0 |
     | 0 0 0 0 0 4 |
     | 0 0 0 0 0 0 |

              6        6
o5 : Matrix ZZ  <--- ZZ

Caveat

Over a polynomial ring, specifying MaximalRank=>true will yield a non-homogeneous matrix.

See also