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} | 19              0        0   |
     {-2} | 49x+44y         31       0   |
     {-3} | -35x2+28xy+49y2 -12x-34y -50 |

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

o3 = | 15130903 31238338899 53040338 3438389 4376930415 4822140 |
     | 42203    87130173    147940   9590    12208162   13450   |
     | 2112278  4360880247  7404445  480000  611020626  673172  |

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

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

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

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