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} | -50             0       0  |
     {-2} | 33x-33y         -37     0  |
     {-3} | -39x2-49xy-38y2 20x+45y 42 |

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

o3 = | 2116330 6012885688311  26776417184 3114447551270 3315034115 
     | 6746322 19167550307696 85356407896 9928066691122 10567485641
     | 2243446 6374045997702  28384726341 3301514942786 3514149616 
     ------------------------------------------------------------------------
     239482654872 |
     763409795733 |
     253867034388 |

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

o4 = | 0 5 0 5 0 5 0 2 0 0 |
     | 7 2 0 0 0 0 0 5 0 3 |
     | 6 7 0 0 0 0 0 0 0 3 |

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

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