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} | -14            0       0  |
     {-2} | -3x+25y        32      0  |
     {-3} | -12x2-42xy+4y2 14x+37y 23 |

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

o3 = | 3529146265  2683274  31724644  85688647  667288176  1759236120  |
     | 3341601200  2541069  30032000  81135056  631826744  1665747205  |
     | 25114643665 19095166 225762910 609790498 4748656834 12519341778 |

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

o4 = | 0 0 4 0 0 0 0 0 0 0 |
     | 0 0 1 0 0 0 0 0 0 8 |
     | 1 5 0 0 6 0 8 0 5 0 |

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

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