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} | 7              0        0  |
     {-2} | -31x+35y       24       0  |
     {-3} | 36x2+14xy-16y2 -10x-45y 36 |

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

o3 = | 2087   2434814   3446237484   8374275    119989680   857865701    |
     | 49625  57895951  81945973783  199126769  2853161227  20398663929  |
     | 317175 370038470 523752737586 1272706708 18235807501 130376827351 |

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

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

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

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