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} | -3            0       0  |
     {-2} | 38x+18y       -37     0  |
     {-3} | 13x2-24xy-7y2 -14x+8y 13 |

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

o3 = | 1794040281 81754060181 38469758 223954061 8970803011 9082444055 |
     | 145196709  6616584979  3113474  18125230  726032234  735067626  |
     | 595083938  27117857173 12760435 74285659  2975619243 3012650627 |

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

o4 = | 1 0 0 0 0 0 0 0 0 0 |
     | 0 0 0 5 0 0 0 0 0 0 |
     | 0 0 3 0 0 2 0 0 2 7 |

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

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