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} | -4              0       0   |
     {-2} | 9x+35y          27      0   |
     {-3} | -24x2-37xy+14y2 27x-39y -15 |

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

o3 = | 490201943913372 17648762750137892 91961879086391 11836738502198817
     | 14726602646557  530202540915602   2762710488507  355598231948024  
     | 81445061404338  2932270228103360  15279092590406 1966626012215566 
     ------------------------------------------------------------------------
     4412175917831663 1972737236078994 |
     132550191518819  59264794361843   |
     733065103099724  327762277000417  |

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

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

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

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