linalg::minpoly
-- minimal
polynomial of a matrixlinalg::minpoly
(A, x)
computes the minimal
polynomial of the square matrix A in x, i.e., the
monic polynomial of lowest degree annihilating the matrix
A.
linalg::minpoly(A, x)
A |
- | a square matrix of a domain of category Cat::Matrix |
x |
- | an indeterminate |
a polynomial of the domain
Dom::DistributedPolynomial([x],R)
, where R
is
the component ring of A
.
linalg::charpoly
,
linalg::frobeniusForm
A
divides the characteristic
polynomial of A
, by Cayley-Hamilton theorem.A
must be a field, i.e., a
domain of category Cat::Field
.We define the following matrix over the rational numbers:
>> A := Dom::Matrix(Dom::Rational)( [[0, 2, 0], [0, 0, 2], [2, 0, 0]] )
+- -+ | 0, 2, 0 | | | | 0, 0, 2 | | | | 2, 0, 0 | +- -+
The minimal polynomial of the matrix A in the variable x is then given by:
>> delete x: linalg::minpoly(A, x)
3 x - 8
In this case, the minimal polynomial is in fact equal to the characteristic polynomial of A:
>> linalg::charpoly(A, x)
3 x - 8
The minimal polynomial of the matrix:
>> B := matrix([[0, 1, 0], [0, 0, 0], [0, 0, 0]])
+- -+ | 0, 1, 0 | | | | 0, 0, 0 | | | | 0, 0, 0 | +- -+
is a polynomial of degree 2:
>> m := linalg::minpoly(B, x)
2 x
The characteristic polynomial of B has degree 3 and is divided by the minimal polynomial of B:
>> p := linalg::charpoly(B, x)
3 x
>> p / m
x