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} | -26            0        0  |
     {-2} | 23x-22y        -7       0  |
     {-3} | -8x2+48xy-28y2 -45x-42y 16 |

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

o3 = | 121558831 2132694 836962956 228702716 230186315 697318491 |
     | 54650310  958814  376281867 102820072 103487121 313500149 |
     | 14816061  259941  102012289 27875173  28056000  84991879  |

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

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

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

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