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

Canonical Forms for Elements

The functions defined here apply to matrices defined over fields or Euclidean domains. See also the section on Reduction in the Lattices chapter for a description of the function LLL and related functions.

EchelonForm(X) : ModMatRngElt -> ModMatRngElt, ModMatRngElt
The (row) echelon form of matrix X belonging to a submodule of the module Hom_R(M, N). This function returns two values:
ElementaryDivisors(X) : ModMatRngElt -> [RngElt]
The elementary divisors of the matrix X belonging to a submodule of the module Hom_R(M, N). 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 X. If R is a field, the result is always the empty sequence over R.
HermiteForm(X) : ModMatRngElt -> ModMatRngElt, ModMatRngElt
    Al: MonStg                          Default: "LLL"
    Optimize: BoolElt                   Default: true
    Integral: BoolElt                   Default: true
The row Hermite normal form of an matrix X belonging to a submodule of the module Hom_R(M, N). The coefficient ring R must be an Euclidean domain. This function returns two values: If R is the ring of integers Z and the matrix T is requested (i.e., if an assignment statement is used with two variables on the left side), then the LLL algorithm will be used by default to improve T (using the kernel of X) so that the size of its entries are very small. If the parameter Optimize is set to false, then this will not happen (which will be faster but the entries of T will not be as small). If the parameter Integral is set to true, then the integral (de Weger) LLL method will be used in the LLL step, instead of the default floating point method. The integral method will often be faster if the rank of the kernel of X is very large (say 200 or more).

If R is the ring of integers Z and the parameter Al is set to the string "Sort", then the sorting-gcd algorithm will be used. However, the new algorithm will practically always perform better than the sorting-gcd algorithm.

Rank(X) : ModMatRngElt -> RngIntElt
Given a matrix X belonging to the matrix ring R over the Euclidean domain S, return the rank of X.
SmithForm(X) : ModMatRngElt -> ModMatRngElt, ModMatRngElt, ModMatRngElt
The Smith normal form for the matrix X belonging to a submodule of the module Hom_R(M, N). This function returns three values:

Example HMod_Forms1 (H43E10)

We illustrate some of these operations in the context of the module Hom_R(M, N), where M and N are, respectively, the 4-dimensional and 3-dimensional vector spaces over GF(8).

> K<w> := GaloisField(8);
> V3 := VectorSpace(K, 3);
> V4 := VectorSpace(K, 4);
> M := Hom(V4, V3);
> A := M ! [1, w, w^5, 0,  w^3, w^4, w, 1,  w^6, w^3, 1, w^4 ];
> A;
[  1   w w^5]
[  0 w^3 w^4]
[  w   1 w^6]
[w^3   1 w^4]
> EchelonForm(A);
[  1   0   0]
[  0   1   0]
[  0   0   1]
[  0   0   0]

Example HMod_Forms2 (H43E11)

We illustrate these operations in the context of the module Hom_(R)(M, N), where M and N are, respectively, the 4-dimensional and 5-dimensional modules over the ring of integers Z.

> Z  := Integers();
> Z4 := RSpace(Z, 4);
> Z5 := RSpace(Z, 5);
> M  := Hom(Z4, Z5);
> x  := M ! [ 2, -4, 12, 7, 0,   
>             3, -3,  5, -1,  4,
>             2, -1, -4, -5,-12,    
>             0,  3,  6, -2,  0 ];
> x;
[  2  -4  12   7   0]
[  3  -3   5  -1   4]
[  2  -1  -4  -5 -12]
[  0   3   6  -2   0]
> Rank(x);
4
> HermiteForm(x);
[   1    1    1    6 -164]
[   0    3    0   16 -348]
[   0    0    2   13 -200]
[   0    0    0   19 -316]
> SmithForm(x);
[1 0 0 0 0]
[0 1 0 0 0]
[0 0 1 0 0]
[0 0 0 2 0]
> ElementaryDivisors(x);
[ 2 ]

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