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

Linear Algebra

Matrices can be formed over p-adic rings and fields and arithmetic operations and such can be carried out with them. Echelonization has been provided for matrices over p-adic rings and fields, however, due to the nature of p-adic elements which can lose precision under some operations it has been found to be inappropriate. Since echelonization does not look for a pivot of lowest valuation in the matrix, undesirable consequences occur with imprecise elements. Because of this an alternative algorithm (manhattan form) has been implemented which will reduce the matrix to a similar form without causing as great a loss in precision. The two forms are compared in the example below.

Finding the kernel of a matrix uses the manhattan algorithm, however, when it is returned as an R-space the basis is echelonized. The kernel found as a matrix does not require this and will not suffer from any such precision loss.

KernelMatrix(M) : Mtrx -> ModMatRngElt
SmithForm(M) : AlgMatElt -> AlgMatElt, AlgMatElt, AlgMatElt
ManhattanForm(M) : Mtrx -> Mtrx, AlgMatElt
Returns a matrix that is a permutation of columns of an upper triangular matrix and a transformation matrix which when multiplied by M gives the manhattan form. The manhattan algorithm always looks for a pivot of lowest valuation and eliminates entries with respect to this. When this pivot is divided into an entry in the same column, precision is lost to its valuation but when the quotient is multiplied by the other elements in the row the precision is replaced due to their non-minimal valuation and the net result is that the minimum (absolute) precision of the entries in the matrix is not decreased.

Example RngPad_ech-man (H42E10)

This example compares the results given by echelonization and ManhattanForm for a matrix over a p-adic field.

> Zp<p> := pAdicField(3, 10);
> MA := MatrixAlgebra(Zp, 3);
> M := MA![-9 + O(p^5), 6 + O(p^4), 1 + O(p^4), 27 + O(p^5), 9 + O(p^4), 
> 3 + O(p^2), -27 + O(p^4), -54 + O(p^5), 27 + O(p^5)];
> M;
[  -p^2 + O(p^5)    2*p + O(p^4)      1 + O(p^4)]
[   p^3 + O(p^5)    p^2 + O(p^4)      p + O(p^2)]
[  -p^3 + O(p^4) -2*p^3 + O(p^5)    p^3 + O(p^5)]
> [RelativePrecision(c) : c in Eltseq(M)]; 
[ 3, 3, 4, 2, 2, 1, 1, 2, 2 ]
> [AbsolutePrecision(c) : c in Eltseq(M)]; 
[ 5, 4, 4, 5, 4, 2, 4, 5, 5 ]
> EchelonForm(M);
[1 + O(p^3)       O(1)    O(p^-1)]
[    O(p^4)   1 + O(p)       O(1)]
[    O(p^5)     O(p^4)   1 + O(p)]
> [RelativePrecision(c) : c in Eltseq($1)];
[ 3, 0, 0, 0, 1, 0, 0, 0, 1 ]
> [AbsolutePrecision(c) : c in Eltseq($2)];
[ 3, 0, -1, 4, 1, 0, 5, 4, 1 ]
> ManhattanForm(M);
[-p^2 + O(p^5)  2*p + O(p^4)    1 + O(p^4)]
[-p^3 + O(p^4)  p^3 + O(p^5)        O(p^5)]
[-p^2 + O(p^3)        O(p^3)        O(p^2)]
> [RelativePrecision(c) : c in Eltseq($1)];
[ 3, 3, 4, 1, 2, 0, 1, 0, 0 ]

> [AbsolutePrecision(c) : c in Eltseq($2)]; [ 5, 4, 4, 4, 5, 5, 3, 3, 2 ]

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