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

Matrix Operations

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 (H21E3)

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]

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

g[i] : GrpMatElt, RngIntElt -> ModTupElt
Given a matrix g of the group G, return the i-th row of g as an element of the natural module of G.
g[i, j] : GrpMatElt, RngIntElt, RngIntElt -> RngElt
Given a matrix g of the group G, return the (i, j)-th entry of g as an element of the coefficient ring of G.
Degree(g) : GrpMatElt -> RngIntElt
NumberOfRows(g) : GrpMatElt -> RngIntElt
Nrows(g) : GrpMatElt -> RngIntElt
NumberOfColumns(g) : GrpMatElt -> RngIntElt
Ncols(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 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.
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.
Transpose(g) : GrpMatElt -> GrpMatElt
The transpose of the matrix g returned as an element of the general linear group containing g.
CharacteristicPolynomial(g: parameters) : GrpMatElt -> RngPolElt
    Al: MonStg                          Default: "Modular"
    Proof: BoolElt                      Default: true
Given a matrix g belonging to a subgroup of GL(n, R), where R is a field of 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 Matrix Algebra chapter.
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.
Eigenvalues(g) : GrpMatElt -> { <RngElt, RngIntElt> }
Given a matrix g belonging to a subgroup of GL(n, R), where R has a polynomial roots algorithm, return the eigenvalues of g as a set of pairs consisting of an eigenvalue of g and its multiplicity.
Eigenspace(g, a) : GrpMatElt, FldElt -> Mod
Given a matrix g belonging to a subgroup G of GL(n, R), where R is a field or Euclidean Domain, return the eigenspace of g corresponding to the eigenvalue a. The eigenspace is returned as a subspace of the natural module for G.
RationalForm(g) : GrpMatElt -> AlgMatElt, AlgMatElt, [ RngUPolElt ]
Given a matrix g belonging to a subgroup G of GL(n, K), where K is a field, return the rational form of g. For each block other than the last block, the polynomial corresponding to that block divides the polynomial corresponding to the next block. This function returns three values:

PrimaryRationalForm(g) : GrpMatElt -> AlgMatElt, AlgMatElt, [ <RngUPolElt, RngIntElt> ]
Given a matrix g belonging to a subgroup G of GL(n, K), where K is a field, return the primary rational canonical form p of g. Each block of p corresponds to a power of an irreducible polynomial. This function returns three values:

JordanForm(g) : GrpMatElt -> AlgMatElt, AlgMatElt, [ <RngUPolElt, RngIntElt> ]
Given a matrix g belonging to a subgroup G of GL(n, K), where K is a field, return the (generalized) Jordan canonical form of g. This function returns three values:

InvariantFactors(g) : GrpMatElt -> [ RngUPolElt ]
The invariant factors of the matrix g belonging to the matrix group G. This is the same as the third return value of RationalForm(g).
PrimaryInvariantFactors(g) : GrpMatElt -> [ <RngUPolElt, RngIntElt> ]
Given a matrix g belonging to a subgroup G of GL(n, K), where K is a field, return the primary invariant factors of g. This is the same as the third value returned by PrimaryRationalForm(g) or JordanForm(g).

Example GrpMat_Invariants (H21E4)

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

Coercion between Matrix Structures

A square non-singular matrix may be defined as an element of any of the following structures:

The coercion operator may be used to transfer matrices between any two of these three structures.
R ! g : AlgMat, GrpMatElt -> RngMatElt
Transfer the matrix g from a group into a matrix ring R.
G ! r : GrpMat, RngMatElt -> GrpMatElt
Transfer the matrix r from a ring into a matrix group G.
M ! g : ModMat, GrpMatElt -> ModMatElt
Transfer the matrix g from a group into a matrix module M.
G ! m : GrpMat, ModMatElt -> GrpMatElt
Transfer the matrix m from a module into a matrix group G.
[Next] [Prev] [Right] [Left] [Up] [Index] [Root]