"Source: Text/Algebra/AlgMat.text";
"Line: 2238";
"Date: Wed Sep 19 23:00:01 2018";
"Main: Thu May 25 10:02:38 2023";
// original file: Text/Algebra/AlgMat.text, line: 2238
// Example: H90E8 ()
print "Example: H90E8";
ei := GetEchoInput();
SetEchoInput(true);
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
];
a;
PrimaryInvariantFactors(a);
r, t, f := RationalForm(a);
r;
t;
f;
PA := MatrixAlgebra(P, 5);
ax := PA ! x - PA ! a;
ax;
SmithForm(ax);
ElementaryDivisors(ax);
SetEchoInput(ei);
