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} | -45            0       0   |
     {-2} | -39x-19y       -23     0   |
     {-3} | 47x2+21xy-48y2 15x-34y -20 |

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

o3 = | 2942725 2824835043 10077744163 70967747213 288122661 90702640192 |
     | 2249129 2159028060 7702443606  54240816385 220212824 69324241584 |
     | 907292  870944554  3107139449  21880560114 88833103  27965162333 |

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

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

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

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