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} | 43             0       0  |
     {-2} | -11x-46y       -2      0  |
     {-3} | 12x2-28xy+24y2 16x+14y -7 |

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

o3 = | 3681048   13660315  680687740   92567965   222319957  3852453677   |
     | 24841930  92188045  4593691571  624704449  1500349191 25998681801  |
     | 126893043 470898267 23464663061 3191002056 7663811904 132801756249 |

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

o4 = | 0 0 1 5 0 0 8 0 6 0 |
     | 0 3 0 0 6 0 4 0 0 8 |
     | 1 1 0 9 8 0 1 3 6 0 |

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

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