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} | 2              0       0   |
     {-2} | -8x-49y        31      0   |
     {-3} | -2x2+20xy-16y2 42x+28y -24 |

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

o3 = | 56670755305   6685407   78219681   128457731  1164754880  9338739726  
     | 201382245324  23756969  277957840  456480689  4139012206  33185658636 
     | 1720471909072 202963137 2374680265 3899858244 35360884282 283515528680
     ------------------------------------------------------------------------
     |
     |
     |

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

o4 = | 0 0 0 3 1 0 0 0 0 0 |
     | 2 0 3 9 0 0 0 1 0 7 |
     | 0 0 0 0 0 0 0 0 0 8 |

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

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