making generic matrices

Here a few commands for making various sorts of generic matrices. A generic matrix is one whose entries are independent variables from the ring, subject to certain relations.

We begin by making a ring with enough variables to accomodate the examples.

i1 : R = ZZ/101[a..z];

We can make a general generic matrix. We specify the ring, the starting variable and the dimensions.

i2 : genericMatrix(R,c,3,5)

o2 = {0} | c f i l o |
     {0} | d g j m p |
     {0} | e h k n q |

             3       5
o2 : Matrix R  <--- R

We can also make a skew symmetric matrix or a symmetric matrix.

i3 : R = ZZ/101[a..i];
i4 : genericSkewMatrix(R,c,3)

o4 = {0} | 0  c  d |
     {0} | -c 0  e |
     {0} | -d -e 0 |

             3       3
o4 : Matrix R  <--- R
i5 : gs = genericSymmetricMatrix(R,a,3)

o5 = {0} | a b c |
     {0} | b d e |
     {0} | c e f |

             3       3
o5 : Matrix R  <--- R

Suppose we need a random symmetric matrix of linear forms in three variables. We can use random and substitute to obtain it.

i6 : S = ZZ/101[x,y,z];
i7 : rn = random(S^1, S^{9:-1})

o7 = {0} | 42x-50y+39z 9x-15y-22z 50x+45y-29z -39x+30y+19z -38x+2y-4z -36x-16y-6z -32x+31y-32z -38x+31y+24z -42x-50y-41z |

             1       9
o7 : Matrix S  <--- S
i8 : substitute(gs, rn)

o8 = {0} | 42x-50y+39z 9x-15y-22z   50x+45y-29z |
     {0} | 9x-15y-22z  -39x+30y+19z -38x+2y-4z  |
     {0} | 50x+45y-29z -38x+2y-4z   -36x-16y-6z |

             3       3
o8 : Matrix S  <--- S


topindexpreviousupnext