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} | -6             0       0  |
     {-2} | 11x-31y        42      0  |
     {-3} | -32x2-5xy+41y2 31x+14y -1 |

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

o3 = | 3455790627 3560647429 648127310 22209071949 17908941594 241347 |
     | 949988836  978813582  178168705 6105221548  4923125819  66347  |
     | 418983217  431696167  78579547  2692648292  2171296539  29261  |

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

o4 = | 0 0 0 4 0 8 0 0 5 0 |
     | 0 0 0 0 0 0 2 1 0 2 |
     | 0 8 0 0 0 0 0 0 0 8 |

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

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