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} | 2              0       0   |
     {-2} | -4x-12y        -15     0   |
     {-3} | -5x2-22xy-31y2 40x+10y -44 |

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

o3 = | 71477128233  42685859  4540724  2909834496 5938737066  11823704323 |
     | 204206127965 121951095 12972593 8313233199 16966637176 33779657043 |
     | 94251542475  56286649  5987513  3836981093 7830968349  15591034471 |

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

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

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

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