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} | -12            0    0   |
     {-2} | 39x+7y         3    0   |
     {-3} | 27x2-33xy+15y2 5x-y -20 |

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

o3 = | 5316942301 3283313345 2821261 1061636370 215621291 655428695  |
     | 8614218615 5319445026 4570901 1720005052 349337942 1061889787 |
     | 1365730877 843364852  724678  272696128  55385333  168356007  |

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

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

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

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