next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: random(Module,Module)

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} | -44            0       0  |
     {-2} | -27x-y         24      0  |
     {-3} | 13x2-41xy-46y2 44x-40y 21 |

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

o3 = | 102055994  12534817  80546490   833493221   645812982   6119169   |
     | 3102723343 381091211 2448787507 25340001031 19634114498 186035971 |
     | 931989450  114471587 735561580  7611575753  5897653647  55881089  |

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

o4 = | 0 4 0 0 0 0 0 0 6 5 |
     | 0 0 9 0 0 0 0 0 1 0 |
     | 0 8 0 6 0 0 0 0 0 0 |

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

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