[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Operations on Matrices

Subsections

Arithmetic with Matrices

g * h : GrpMatElt, GrpMatElt -> GrpMatElt
Product of matrix g and matrix h, where g and h belong to the same generic group U. If g and h both belong to the same proper subgroup G of U, then the result will be returned as an element of G; if g and h belong to subgroups H and K of a subgroup G of U then the product is returned as an element of G. Otherwise, the product is returned as an element of U.
g ^ n : GrpMatElt, RngIntElt -> GrpMatElt
The n-th power of the matrix g, where n is a positive or negative integer.
g / h : GrpMatElt, GrpMatElt -> GrpMatElt
Product of the matrix g by the inverse of the matrix h, i.e. the element g * h^(-1). Here g and h must belong to the same generic group U. The rules for determining the parent group of g / h are the same as for g * h.
g ^ h : GrpMatElt, GrpMatElt -> GrpMatElt
Conjugate of the matrix g by the matrix h, i.e. the element h^(-1) * g * h. Here g and h must belong to the same generic group U. The rules for determining the parent group of g^h are the same as for g * h.
(g, h) : GrpMatElt, GrpMatElt -> GrpMatElt
Commutator of the matrices g and h, i.e. the element g^(-1) * h^(-1) * g * h. Here g and h must belong to the same generic group U. The rules for determining the parent group of (g, h) are the same as those for g * h.
(g_1, ..., g_r) : GrpMatElt, ..., GrpMatElt -> GrpMatElt
Given r matrices g_1, ..., g_r belonging to a common group, return their commutator. Commutators are left-normed, so they are evaluated from left to right.

Example GrpMat_Arithmetic (H21E11)

These operations will be illustrated using the group GL(3, 4).

> K<w> := FiniteField(4);
> GL34 := GeneralLinearGroup(3, K);
> x := GL34 ! [1,w,0, 0,w,1, w^2,0,1];
> y := GL34 ! [1,0,0, 1,w,0, 1,1,w];
> x;
[  1   w   0]
[  0   w   1]
[w^2   0   1]
> y;
[1 0 0]
[1 w 0]
[1 1 w]
> x*y;
[w^2 w^2   0]
[w^2   w   w]
[  w   1   w]
> x^10;
[  w   w   1]
[  w   1   1]
[  w w^2   w]
> x^-1;
[w^2 w^2 w^2]
[  1   w   w]
[  w   w w^2]
> x^y;
[w^2 w^2   0]
[  0 w^2   1]
[w^2 w^2   w]
> x/y;
[  0   1   0]
[  0 w^2 w^2]
[  w   w w^2]
> (x, y);
[  0   w   w]
[  w w^2   1]
[w^2   w w^2]
> (x,y,y);
[w^2   w w^2]
[w^2   w   0]
[w^2   1   w]
Arithmetic with group elements is not limited to elements of finite groups. We illustrate with a group of degree 3 over a function field.

> P<a,b,c,m,x,y,z> := FunctionField(RationalField(), 7);
> S := MatrixGroup< 3, P | [1,a,b,0,1,c,0,0,1],    
>                          [1,0,m,0,1,0,0,0,1],   
>                          [1,x,y,0,1,z,0,0,1] >;
> 
> t := S.1 * S.2;
> t;
[    1     a b + m]
[    0     1     c]
[    0     0     1]
> t^-1;
[          1          -a a*c - b - m]
[          0           1          -c]
[          0           0           1]
> Determinant(t); 
1
> t^2;
[              1             2*a a*c + 2*b + 2*m]
[              0               1             2*c]
[              0               0               1]

Predicates for Matrices

g eq h : GrpMatElt, GrpMatElt -> BoolElt
Given matrices g and h belonging to the same generic group, return true if g and h are the same element, false otherwise.
g ne h : GrpMatElt, GrpMatElt -> BoolElt
Given matrices g and h belonging to the same generic group, return true if g and h are distinct elements, false otherwise.

IsIdentity(g) : GrpMatElt -> BoolElt
IsId(g) : GrpMatElt -> BoolElt
True if the matrix g is the identity matrix.

IsScalar(g) : GrpMatElt -> BoolElt
True if the matrix g is a scalar matrix.

Matrix Invariants

All of the operations defined for square matrices and described in the chapter on Matrices apply to the elements of a matrix group. The reader is referred to that chapter for a complete list.

Degree(g) : GrpMatElt -> RngIntElt
The degree of the matrix g, i.e. the number of rows/columns of g.
HasFiniteOrder(g) : GrpMatElt -> BoolElt, RngIntElt
True iff the matrix g has finite order. The second return value is the order if it is finite. The function rigorously proves its result (i.e., the result is not probable).
Order(g) : GrpMatElt -> RngIntElt
Order of the matrix g. If g has infinite order, an error ensues. For matrices over finite fields, the algorithm employed is that described in [CLG97a].
FactoredOrder(g) : GrpMatElt -> [ <RngIntElt, RngIntElt> ]
The order of the matrix g returned as a factorization sequence. It is more efficient to use this function than to factorize the result given by Order(g). If g has infinite order, an error ensues.
Determinant(g) : GrpMatElt -> RngElt
The determinant of the matrix g.
Trace(g) : GrpMatElt -> RngElt
The trace of the matrix g.
CharacteristicPolynomial(g: parameters) : GrpMatElt -> RngPolElt
    Al: MonStgElt                       Default: "Modular"
    Proof: BoolElt                      Default: true
Given a matrix g belonging to a subgroup of GL(n, R), where R is a field or Euclidean Domain, return the characteristic polynomial of g as an element of the univariate polynomial ring over R. For details on the parameters, see the function CharacteristicPolynomial in the chapter on matrices.
MinimalPolynomial(g) : GrpMatElt -> RngPolElt
Given a matrix g belonging to a subgroup of GL(n, R), where R is a field or Z, return the minimal polynomial of g as an element of the univariate polynomial ring over R.

Example GrpMat_Invariants (H21E12)

We illustrate the matrix operations by applying them to some elements of GL(3, 4).

> K<w> := FiniteField(4);
> GL34 := GeneralLinearGroup(3, K);
> x := GL34 ! [w,0,1, 0,1,0, 1,0,1];
> x;
[w 0 1]
[0 1 0]
[1 0 1]
> Degree(x);
3
> Determinant(x);
w^2
> Trace(x);
w
> Order(x);
15
> m<t> := MinimalPolynomial(x);
> m;
t^3 + w*t^2 + w^2
> Factorization(m);
[
    <t + 1, 1>,
    <t^2 + w^2*t + w^2, 1>
]
> c<t> := CharacteristicPolynomial(x);
> c;
t^3 + w*t^2 + w^2

Membership and Equality

g in G : GrpMatElt, GrpMat -> BoolElt
Given a matrix g and a matrix group G, return true if g is an element of G, false otherwise.
g notin G : GrpMatElt, GrpMat -> BoolElt
Given a matrix g and a matrix group G, return true if g is not an element of G, false otherwise.
S subset G : { GrpMatElt }, GrpMat -> BoolElt
Given a matrix group G and a set S of matrices belonging to a group H, where G and H belong to the same generic group, return true if S is a subset of G, false otherwise.
H subset G : GrpMat, GrpMat -> BoolElt
Given matrix groups G and H belonging to the same generic group, return true if H is a subgroup of G, false otherwise.
S notsubset G : { GrpMatElt }, GrpMat -> BoolElt
Given a matrix group G and a set S of matrices belonging to a group H, where G and H belong to the same generic group, return true if S is not a subset of G, false otherwise.
H notsubset G : GrpMat, GrpMat -> BoolElt
Given matrix groups G and H belonging to the same generic group, return true if H is not a subgroup of G, false otherwise.
H eq G : GrpMat, GrpMat -> BoolElt
Given matrix groups G and H belonging to the same generic group, return true if G and H are the same group, false otherwise.
H ne G : GrpMat, GrpMat -> BoolElt
Given matrix groups G and H belonging to the same generic group, return true if G and H are distinct groups, false otherwise.

Set Operations

The creation of a base and strong generating set for a matrix group G provides us with a very compact representation of the set of elements of G. A particular BSGS imposes an order on the elements of G (lexicographic ordering of base images). It thus makes sense to talk about the `number' of a group element relative to a particular BSGS.

NumberingMap(G) : GrpMat -> Map
A bijective mapping from the group G onto the set of integers { 1 ... |G| }. The actual mapping depends upon the base and strong generating set chosen for G.
RandomProcess(G) : GrpMat -> Process
    Slots: RngIntElt                    Default: 10
    Scramble: RngIntElt                 Default: 20
Create a process to generate randomly chosen elements from the finite group G. The process is based on the product-replacement algorithm of [CLGMetalchar+95], modified by the use of an accumulator. At all times, N elements are stored where N is the maximum of the specified value for Slots and Ngens(G) + 1. Initially, these are just the generators of G. As well, one extra group element is stored, the accumulator. Initially, this is the identity. Random elements are now produced by successive calls to Random(P), where P is the process created by this function. Each such call chooses one of the elements in the slots and multiplies it into the accumulator. The element in that slot is replaced by the product of it and another randomly chosen slot. The random value returned is the new accumulator value. Setting Scramble := m causes m such operations to be performed before the process is returned.
Random(G: parameters) : GrpMat -> GrpMatElt
    Short: BoolElt                      Default: false
A randomly chosen element for the group G. If a BSGS is known for G, then the element chosen will be genuinely random. If no BSGS is known, then the random element is chosen by multiplying out a random word in the generators. Since it is not usually practical to choose words long enough to properly sample the elements of G, the element returned will usually be biased. The boolean-valued parameter Short is used in this situation to indicate that a short word will suffice. Thus, if Random is invoked with Short assigned the value true then the element is constructed using a short word.
Random(P) : Process -> GrpMatElt
Given a random element process P created by the function RandomProcess(G) for the finite group G, construct a random element of G by forming a random product over the expanded generating set constructed when the process was created. For large degree groups, or groups for which a BSGS is not known, this function should be used in preference to Random(G).

Example GrpMat_Random (H21E13)

We use the random function to sample the orders of elements in the group GL(20, 16).

> G := GeneralLinearGroup(20, GF(16));
> RP := RandomProcess(G);
> [ FactoredOrder(Random(RP)) : i in [1..20] ];
[
    [ <3, 1>, <5, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>, 
    <61681, 1> ],
    [ <3, 1>, <5, 1>, <17, 1>, <23, 1>, <89, 1>, <257, 1>, <397, 1>, <683, 1>,
    <2113, 1> ],
    [ <3, 1>, <5, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>, 
    <61681, 1> ],
    [ <3, 1>, <31, 1>, <8191, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>, 
    <61681, 1> ],
    [ <3, 3>, <5, 1>, <7, 1>, <13, 1>, <17, 1>, <19, 1>, <29, 1>, <37, 1>, 
    <43, 1>, <73, 1>, <109, 1>, <113, 1>, <127, 1>, <257, 1> ],
    [ <5, 1> ],
    [ <3, 1>, <5, 1> ],
    [ <3, 1>, <5, 2>, <11, 1>, <17, 1>, <31, 1>, <41, 1>, <53, 1>, <157, 1>, 
    <1613, 1>, <2731, 1>, <8191, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <13, 1>, <17, 1>, <97, 1>, <241, 1>, <257, 1>, 
    <673, 1> ],
    [ <3, 1>, <5, 1>, <17, 1>, <29, 1>, <43, 1>, <113, 1>, <127, 1>, <257, 1>,
    <65537, 1> ],
    [ <3, 1>, <5, 2>, <11, 1>, <29, 1>, <31, 1>, <41, 1>, <43, 1>, <113, 1>, 
    <127, 1> ],
    [ <3, 1>, <5, 2>, <11, 1>, <17, 1>, <31, 1>, <41, 1>, <53, 1>, <157, 1>, 
    <1613, 1>, <2731, 1>, <8191, 1> ],
    [ <3, 2>, <5, 2>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>, <61, 1>, 
    <151, 1>, <257, 1>, <331, 1>, <1321, 1> ],
    [ <3, 1>, <5, 1>, <11, 1>, <31, 1>, <41, 1>, <257, 1>, <61681, 1>, 
    <4278255361, 1> ],
    [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <17, 1>, <31, 1>, <41, 1>, 
    <61681, 1> ],
    [ <3, 1>, <5, 1>, <17, 1>, <23, 1>, <89, 1>, <257, 1>, <397, 1>, <683, 1>,
    <2113, 1> ], [ <3, 2>, <5, 1>, <7, 1>, <11, 1>, <13, 1>, <23, 1>, <31, 1>,
    <41, 1>, <89, 1>, <397, 1>, <683, 1>, <2113, 1> ]
]

 [Next][Prev] [Right] [Left] [Up] [Index] [Root]