Macaulay2 » Documentation
Packages » random > random(Module,Module)
next | previous | forward | backward | up | index | toc

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} | 24             0       0   |
     {-2} | -29x+19y       -36     0   |
     {-3} | -29x2-8xy-22y2 19x-10y -30 |

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

o3 = | 1944060808 5893633895  15562508275 12208320525 31350869218 
     | 8984899069 27238708403 71925510511 56423403296 144894847741
     | 106709069  323500272   854222648   670112044   1720842325  
     ------------------------------------------------------------------------
     79232613553  |
     366190722085 |
     4349060833   |

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

o4 = | 4 0 0 0 8 2 0 0 3 0 |
     | 0 8 3 8 0 8 0 7 0 0 |
     | 0 0 1 0 0 0 0 1 7 0 |

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

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

Ways to use this method: