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} | -6x+34y         1    0  |
     {-3} | -12x2+43xy+43y2 -10x 13 |

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

o3 = | 376995195115 15970238939676 621194074 1742244355912 15683927468928
     | 89265144326  3781442580200  147086699 412529644512  3713649581563 
     | 46223568757  1958118955512  76164915  213617448764  1923014163394 
     ------------------------------------------------------------------------
     41681106886 |
     9869277036  |
     5110541288  |

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

o4 = | 0 0 0 0 0 0 0 0 1 0 |
     | 0 0 0 0 0 0 0 0 0 0 |
     | 0 0 0 0 0 7 0 0 0 0 |

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

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