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

random(Module,Module) -- get a random map of module

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^10, Density => .3)

o3 = | 8 0 0 0 2 3 0 0 8 0 |
     | 0 5 7 5 0 6 0 3 6 0 |
     | 0 0 8 0 0 0 0 6 9 0 |

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

o4 = | 35047412   3247979   11405872  504891598   50976553853   5614985894  
     | 1157543751 107274048 376712434 16675528353 1683650456951 185451405627
     | 389888849  36132505  126885897 5616722964  567094366108  62464537627 
     ------------------------------------------------------------------------
     |
     |
     |

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

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

Ways to use this method: