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} | 9              0        0  |
     {-2} | -22x-5y        -32      0  |
     {-3} | 16x2+11xy-35y2 -46x-13y -2 |

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

o3 = | 182118773 3646334 206420878 1460804116 802908326 55737 |
     | 2378559   47623   2694785   19078714   10483832  728   |
     | 25571106  511978  28982697  205109924  112734125 7826  |

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

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

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

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