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

random and generic matrices

Sections:

  • random matrices
  • matrices of variables
  • genericSymmetricMatrix
  • genericSkewMatrix
  • random matrices

    To construct a random m by n matrix with entries in a ring R use the function random by typing random(R^m,R^n).

    i1 : R = GF(3^2,Variable => a);
    i2 : random(R^3,R^4)

    o2 = | a+1 a    a  0   |
         | a-1 -a+1 1  0   |
         | a   -1   -a a+1 |

                 3       4
    o2 : Matrix R  <--- R

    matrices of variables

    To build an m by n matrix of variables drawn from the ring R, use genericMatrix. The syntax is genericMatrix(R,x,m,n) where R is the ring, x is the variable where we start and m and n specify the size of the matrix.

    i3 : S = R[p..z];
    i4 : genericMatrix(S,t,3,2)

    o4 = | t w |
         | u x |
         | v y |

                 3       2
    o4 : Matrix S  <--- S

    Note that to use the function genericMatrix the number of variables in the ring R must be at least as large as m*n.

    genericSymmetricMatrix

    To construct an n by n symmetric matrix whose entries on and above the diagonal are the variables of R use genericSymmetricMatrix. The syntax is genericSymmetricMatrix(R,x,n) where R is the ring, x is the variable you want to start with and n is the size of the matrix.

    i5 : genericSymmetricMatrix(S,s,3)

    o5 = | s t u |
         | t v w |
         | u w x |

                 3       3
    o5 : Matrix S  <--- S

    genericSkewMatrix

    To construct an n by n skew symmetric matrix whose entries above the diagonal are the variables of R use genericSkewMatrix. The syntax is genericSkewMatrix(R,x,n) where R is the ring, x is the variable you want to start with and n is the size of the matrix.

    i6 : genericSymmetricMatrix(S,u,3)

    o6 = | u v w |
         | v x y |
         | w y z |

                 3       3
    o6 : Matrix S  <--- S


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