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} | -31             0        0 |
     {-2} | 50x+10y         -36      0 |
     {-3} | -44x2-34xy-20y2 -32x+23y 8 |

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

o3 = | 5907412955  2095872235 1455555617 1490349251 298983767 19190417 |
     | 12961963807 4598732300 3193758780 3270104113 656025761 42107360 |
     | 472246715   167546950  116359150  119140558  23901181  1534108  |

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

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

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

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