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

Canonical Forms

Subsections

Canonical Forms for Matrices over Euclidean Domains

The functions given here apply to matrices defined over Euclidean Domains.

EchelonForm(a) : AlgMatElt -> AlgMatElt, AlgMatElt
The (row) echelon form of matrix a belonging to a submodule of the module M_n(S). This function returns two values:
ElementaryDivisors(a) : AlgMatElt -> [RngElt]
The elementary divisors of the matrix a belonging to a submodule of the module M_n(S). The divisors are returned as a sequence [e_1, ..., e_d], e_i | e_(i + 1) (i=1 , ..., d - 1) of d elements of R, where d is the rank of a.

HermiteForm(a) : AlgMatElt -> AlgMatElt, AlgMatElt
The row Hermite normal form of an matrix a belonging to a submodule of the module M_n(S), where S is a Euclidean Domain. This function returns two values:
SmithForm(a) : AlgMatElt -> AlgMatElt, AlgMatElt, AlgMatElt
The Smith normal form for the matrix a belonging to a submodule of the module M_n(S), where S is a Euclidean Domain. This function returns two values:

Example AlgMat_EchelonForm (H36E6)

We illustrate some of these operations in the context of the algebra M_4(K), where K is the field GF(8).

> K<w> := FiniteField(8);
> M := MatrixAlgebra(K, 4);
> A := M ! [1, w, w^5, 0,  w^3, w^4, w, 1,  w^6, w^3, 1, w^4, 1, w, 1, w ];
> print A;
[  1   w w^5   0]
[w^3 w^4   w   1]
[w^6 w^3   1 w^4]
[  1   w   1   w]
> print EchelonForm(A);
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]

Canonical Forms for Matrices over a Field

The functions in this group apply to elements of matrix algebras whose coefficient rings are fields. Some functions, such as CharacteristicPolynomial, also apply to matrices over the integers.

CharacteristicPolynomial(a: parameters) : AlgMatElt -> RngUPolElt
    Al: MonStg                          Default: "Modular"
    Proof: BoolElt                      Default: true
The characteristic polynomial of the element a belonging to the algebra M_n(R), R a domain. The parameter Al may be used to specify the algorithm used. The algorithm Modular (the default) can be used for matrices over Z and Q---in such a case the parameter Proof can also be used to suppress proof of correctness. The algorithm Hessenberg, allowed for matrices over fields, works by first reducing the matrix to Hessenberg form. The algorithm Interpolation, allowed for matrices over Z and Q, works by evaluating the characteristic matrix of a at various points and then interpolating. The algorithm Trace, allowed for matrices over fields, works by calculating the traces of powers of a.
Eigenvalues(a) : AlgMatElt -> { <FldElt, RngIntElt> }
The eigenvalues of the matrix a returned as a set of pairs, each of which gives the value of a distinct eigenvalue and its multiplicity.
Eigenspace(a, e) : AlgMatElt, FldElt -> ModTup
The eigenspace of the matrix a, corresponding to the eigenvalue e, returned as a submodule of the base module for the parent algebra of a (i.e. the kernel of a - eI). If the ring element e is not a eigenvalue for the matrix a then the trivial space is returned.
InvariantFactors(a) : AlgMatElt -> [ AlgPolElt ]
The invariant factors of the matrix a. This is the same as the third return value of RationalForm(a).
IsSimilar(a, b) : AlgMatElt, AlgMatElt -> BoolElt, AlgMatElt
True iff a is similar to b. If so, a matrix t is also returned with t * a * t^(-1)=b.
JordanForm(a) : AlgMatElt -> AlgMatElt, AlgMatElt, [ <RngUPolElt, RngIntElt ]
The (generalized) Jordan canonical form for the matrix a belonging to the algebra M_n(K), where K is a field. This function returns three values:
MinimalPolynomial(a) : AlgMatElt -> RngUPolElt
The minimal polynomial of the element a belonging to the module M_n(R), where R is a field or Z.
PrimaryInvariantFactors(a) : AlgMatElt -> [ <RngUPolElt, RngIntElt ]
The primary invariant factors of the matrix a. This is the same as the third return value of PrimaryRationalForm(a) or JordanForm(a).
PrimaryRationalForm(a) : AlgMatElt -> AlgMatElt, AlgMatElt, [ <RngUPolElt, RngIntElt ]
The primary rational canonical form of a matrix a belonging to M_n(K). Each block corresponds to a power of an irreducible polynomial. This function returns three values:

RationalForm(a) : AlgMatElt -> AlgMatElt, AlgMatElt, [ RngUPolElt ]
The rational canonical form of a matrix a belonging to M_n(K). For each block before the last block, the polynomial corresponding to that block divides the polynomial corresponding to the next block. This function returns three values:


Example AlgMat_ElementaryDivisors (H36E7)

We consider the algebra M_5(P), where P is the polynomial ring in indeterminate x over the field GF(5). We take the matrix having x^i + x^j in its (i, j)-th position.

> K := GaloisField(5);
> P<x> := PolynomialAlgebra(K);
> M := MatrixAlgebra(P, 5);
> a := M ! [x^i + x^j: i, j in [1..5]];
> print a;
[      2*x   x^2 + x   x^3 + x   x^4 + x   x^5 + x]
[  x^2 + x     2*x^2 x^3 + x^2 x^4 + x^2 x^5 + x^2]
[  x^3 + x x^3 + x^2     2*x^3 x^4 + x^3 x^5 + x^3]
[  x^4 + x x^4 + x^2 x^4 + x^3     2*x^4 x^5 + x^4]
[  x^5 + x x^5 + x^2 x^5 + x^3 x^5 + x^4     2*x^5]
> print ElementaryDivisors(a);
[
       x,
       x^3 + 3*x^2 + x
]

Example AlgMat_CanonicalForms (H36E8)

We construct a 5 by 5 matrix over the finite field with 5 elements and then calculate various canonical forms. We verify the correctness of the polynomial invariant factors corresponding to the rational form by calculating the Smith form of the characteristic matrix of the original matrix.

> K := GF(5);
> P<x> := PolynomialRing(K);    
> A := MatrixAlgebra(K, 5);
> a := A !
>    [
>   	0, 2, 4, 2, 0,
>   	2, 2, 2, 3, 3,
>   	3, 4, 4, 1, 3,
>   	0, 0, 0, 0, 1,
>   	0, 0, 0, 1, 0
>    ];
> print a;
[0 2 4 2 0]
[2 2 2 3 3]
[3 4 4 1 3]
[0 0 0 0 1]
[0 0 0 1 0]
> print PrimaryInvariantFactors(a);
[
       <x + 1, 1>,
       <x + 1, 1>,
       <x + 4, 1>,
       <x + 4, 1>,
       <x + 4, 1>
]
> r, t, f := RationalForm(a);
> print r;
[1 0 0 0 0]
[0 0 1 0 0]
[0 1 0 0 0]
[0 0 0 0 1]
[0 0 0 1 0]
> print t;
[1 3 0 2 1]
[2 1 2 2 0]
[3 4 3 4 1]
[1 0 0 0 0]
[0 2 4 2 0]
> print f;
[
       x + 4,
       x^2 + 4,
       x^2 + 4
]
> PA := MatrixAlgebra(P, 5);
> ax := PA ! x - PA ! a;
> print ax;
[    x     3     1     3     0]
[    3 x + 3     3     2     2]
[    2     1 x + 1     4     2]
[    0     0     0     x     4]
[    0     0     0     4     x]
> print SmithForm(ax);
[      1       0       0       0       0]
[      0       1       0       0       0]
[      0       0   x + 4       0       0]
[      0       0       0 x^2 + 4       0]
[      0       0       0       0 x^2 + 4]

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