next | previous | forward | backward | up | top | index | toc | home

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} | -26           0      0   |
     {-2} | -29x-42y      47     0   |
     {-3} | 9x2+11xy-22y2 -4x-2y -34 |

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

o3 = | 23  12813 78863  898  9710  703  |
     | 20  14631 86008  1091 10589 737  |
     | 151 88460 538558 6288 66309 4765 |

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

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

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

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