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} | -23            0       0   |
     {-2} | 7x+35y         -4      0   |
     {-3} | 22x2+47xy-23y2 25x+30y -35 |

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

o3 = | 848391252 94145120723 91375120485 124476173211 30856395735 21558856402
     | 204221312 22662232815 21995449590 29963401131  7427626823  5189560755 
     | 841000393 93324964546 90579095790 123391784493 30587586648 21371043991
     ------------------------------------------------------------------------
     |
     |
     |

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

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