[next][previous][up][top][index]
search for:

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 all the examples.

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

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

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

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

             3       5
o2 : Matrix R  <--- R

We can also make a skew symmetric matrix with genericSkewMatrix or a symmetric matrix with genericSymmetricMatrix.

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

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

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

o5 = | a b c |
     | b d e |
     | 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 from the generic symmetric matrix gs above.

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

o7 = | 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 = | 42x-50y+39z 9x-15y-22z   50x+45y-29z |
     | 9x-15y-22z  -39x+30y+19z -38x+2y-4z  |
     | 50x+45y-29z -38x+2y-4z   -36x-16y-6z |

             3       3
o8 : Matrix S  <--- S


[next][previous][up][top][index]
search for: