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} | 45              0        0  |
     {-2} | -2x-39y         28       0  |
     {-3} | -48x2-19xy-10y2 -22x+43y 31 |

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

o3 = | 121385424  289435789  2115976731  1195379747  15196717481  1711167434 
     | 1253218880 2988220318 21845966846 12341452520 156895386195 17666596485
     | 3214825    7665517    56040233    31658848    402474973    45319144   
     ------------------------------------------------------------------------
     |
     |
     |

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

o4 = | 4 5 7 0 0 0 0 1 7 0 |
     | 0 0 0 0 0 0 0 4 1 0 |
     | 0 0 8 0 0 0 0 5 4 0 |

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

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