next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: random(Module,Module)

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} | -18             0   0  |
     {-2} | 29x+39y         -3  0  |
     {-3} | -23x2+36xy-46y2 x-y 24 |

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

o3 = | 183145198666 5157641273 183567385471 36149710521 15324441742
     | 8600348936   242198650  8620174995   1697561080  719623324  
     | 60688666382  1709083106 60828565517  11978898156 5078046971 
     ------------------------------------------------------------------------
     786325449829 |
     36925201149  |
     260563985200 |

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

o4 = | 5 0 5 0 0 0 0 0 1 3 |
     | 0 2 0 0 4 0 5 3 9 0 |
     | 0 0 0 7 0 0 9 0 0 0 |

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

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