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} | -1             0        0  |
     {-2} | 10x-48y        -11      0  |
     {-3} | 22x2+14xy+27y2 -39x-35y 33 |

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

o3 = | 20011902199 7993943124 2968845 219703210 4001766623 1998417493 |
     | 3248400202  1297604115 481911  35662974  649580404  324389944  |
     | 2848245654  1137758581 422552  31269827  569561767  284429926  |

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

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

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

o5 = | 0 2 0 7 2 9 |
     | 0 0 4 7 7 4 |
     | 0 0 0 7 8 2 |
     | 0 0 0 0 1 0 |
     | 0 0 0 0 0 7 |
     | 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