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} | -11             0        0   |
     {-2} | -50x+11y        9        0   |
     {-3} | -30x2+25xy-22y2 -46x-48y -32 |

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

o3 = | 147774887065  2890046280  2217864236  2890230305  4442919248 
     | 1055392026408 20640393368 15839743014 20641707704 31730841761
     | 334168679639  6535365843  5015336358  6535781991  10046933477
     ------------------------------------------------------------------------
     26014450275  |
     185792348951 |
     58827414263  |

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

o4 = | 3 0 0 3 0 0 7 0 9 0 |
     | 0 0 0 8 0 0 0 0 0 3 |
     | 0 0 5 8 2 0 0 0 0 0 |

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

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