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} | 39             0      0   |
     {-2} | 4x+25y         -23    0   |
     {-3} | -41x2+38xy-6y2 14x+3y -18 |

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

o3 = | 2107431 1853702 32037384 11216590 80946512  122965 |
     | 4895379 4302732 74419623 26053937 188030819 285421 |
     | 419590  369052  6378648  2233218  16116464  24481  |

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

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

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

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