gives the minimal polynomial for the square matrix m in the variable x.
MatrixMinimalPolynomial
gives the minimal polynomial for the square matrix m in the variable x.
Details and Options
- The minimal polynomial of a square matrix m is a polynomial
of lowest degree such that the matrix polynomial
is the zero matrix. » - MatrixMinimalPolynomial[m,x] divides CharacteristicPolynomial[m,x]. Often they agree; that is, the quotient is a constant. »
- The matrix minimal polynomial is only defined up to a constant factor, but it is generally normalized by being made monic. »
- m must be a square matrix with numeric or symbolic entries.
- The following options can be given:
-
Extension Automatic algebraic number extensions Modulus 0 prime modulus to use - MatrixMinimalPolynomial[m,Modulusp] computes the polynomial modulo the prime p. If p is zero, ordinary arithmetic is used. »
Examples
open all close allBasic Examples (2)
Find the minimal polynomial of a matrix:
MatrixMinimalPolynomial[(| | |
| -- | --- |
| 22 | -16 |
| 25 | -18 |), x]The corresponding matrix polynomial is zero:
MatrixPolynomialValue[%, (| | |
| -- | --- |
| 22 | -16 |
| 25 | -18 |), x]The zero matrix has the simplest possible minimal polynomial:
MatrixMinimalPolynomial[ConstantArray[0, {10, 10}], λ]The identity matrix has the next to simplest possible:
MatrixMinimalPolynomial[IdentityMatrix[10], λ]Scope (11)
Basic Uses (6)
Minimal polynomial of a numeric matrix:
MatrixMinimalPolynomial[(| | | | | |
| ---- | ---- | ---- | --- | ---- |
| -2.2 | -1.3 | 1.2 | 1.2 | 0.1 |
| -3. | -2.8 | -2.8 | 1.7 | 3.8 |
| -3.7 | 0.5 | 2.3 | 4. | -0.1 |
| 0.4 | -1.8 | -1.5 | 1.2 | 3.4 |
| 1.6 | 1.2 | -3.4 | 0.9 | -2.6 |), x]Minimal polynomial of an arbitrary-precision matrix:
MatrixMinimalPolynomial[RandomReal[1, {10, 10}, WorkingPrecision -> 10], x]The precision of the result is generally lower than the precision of the input:
Precision[%]Minimal polynomial of a complex matrix:
MatrixMinimalPolynomial[(| | |
| ----- | --------- |
| 2 + I | 3I / 2 |
| 5 - I | 8 / 7 - I |), x]MatrixMinimalPolynomial[{{(1/3), (1/2), (3/5)}, {(1/2), (4/5), 1}, {(3/5), 1, (9/7)}}, x]Plot[%, {x, -1.5, 2.5}]Minimal polynomial of a symbolic matrix:
MatrixMinimalPolynomial[(| | | |
| - | - | - |
| a | b | c |
| e | e | d |
| f | g | h |), x]Minimal polynomial of a matrix m with finite field elements:
ℱ = FiniteField[43, 2];
m = {{ℱ[12], ℱ[23], ℱ[34]}, {ℱ[45], ℱ[56], ℱ[67]}, {ℱ[78], ℱ[89], ℱ[90]}};
MatrixMinimalPolynomial[m, x]The polynomial evaluated at m yields a matrix of zeros in the finite field:
MatrixPolynomialValue[%, m, x]Special Matrices (5)
Minimal polynomials of sparse matrices:
SparseArray[{{1, 3} -> 2, {2, 2} -> 3, {3, 1} -> 1, {4, 2} -> 5}, {4, 4}]MatrixMinimalPolynomial[%, x]SparseArray[{{x_, y_} /; Abs[x - y] < 3 -> 1}, {10, 10}]MatrixMinimalPolynomial[%, x]Minimal polynomials of structured matrices:
SymmetrizedArray[{{1, 1} -> 2, {1, 2} -> 1}, {2, 2}, Symmetric[All]]MatrixMinimalPolynomial[%, x]QuantityArray[{{1, 2}, {3, 4}}, {"Meters", "Meters"}]MatrixMinimalPolynomial[%, x]The minimal polynomial of a diagonal matrix has linear terms in the distinct diagonal entries:
MatrixMinimalPolynomial[DiagonalMatrix[{1, 2, 2, a, b, b}], λ]//FactorFor multiples of the identity matrix, this becomes a single linear factor:
MatrixMinimalPolynomial[a IdentityMatrix[10], λ]The minimal polynomial of JordanMatrix[λ,n]:
JordanMatrix[1.5, 4]//MatrixFormMatrixMinimalPolynomial[%, x]PolynomialQuotient[(x - λ)^4, %, x]The minimal polynomial of CompanionMatrix[{c0,c1,…,cn}]:
CompanionMatrix[{c0, c1, c2, c3}]//MatrixFormMatrixMinimalPolynomial[%, x]Options (3)
Modulus (1)
Compute a minimal polynomial modulo 19:
mpmod = MatrixMinimalPolynomial[(| | |
| -- | --- |
| 22 | -16 |
| 25 | -18 |), x, Modulus -> 19]Modulo 19, this agrees with the non-modular minimal polynomial.
PolynomialMod[MatrixMinimalPolynomial[(| | |
| -- | --- |
| 22 | -16 |
| 25 | -18 |), x] - mpmod, 19]Extension (2)
Compute a minimal polynomial where some matrix elements depend on algebraic numbers:
alg = {t1 ^ 2 + 1, t2 ^ 2 + t1};
mat = {{t1, 1, 0}, {t1 + t2, 2, 1}, {1, 3, t1 * t2 + 1}};
minpoly = MatrixMinimalPolynomial[mat, x, Extension -> alg]The algebraic relations can be interpreted as replacing t1 with and t2 with
:
(minpoly /. t2 -> Sqrt[-t1]) /. t1 -> ICompare this to a direct computation using these algebraic numbers explicitly:
mat2 = (mat /. t2 -> Sqrt[-t1]) /. t1 -> I;
minpoly2 = Together[Simplify@MatrixMinimalPolynomial[mat2, x], Extension -> {Sqrt[-I]}]((minpoly /. t2 -> Sqrt[-t1]) /. t1 -> I) - minpoly2//SimplifyFind the minimal polynomial of a matrix that has a parameter as well as an algebraic extension:
mat = {{t1, 1, 0}, {t1 + t2, 2, 1}, {1, 3, t1 * t2 + 1}};
alg = {t1 ^ 2 + 1};
minpoly = MatrixMinimalPolynomial[mat, x, Extension -> alg]//SimplifyNow repeat using a prime modulus:
minpolymod = MatrixMinimalPolynomial[mat, x, Extension -> alg, Modulus -> Prime[222]]PolynomialMod[minpoly - minpolymod, Prime[222]]Applications (2)
The factored form of the matrix minimal polynomial gives important information about the eigenspaces of the matrix. Namely, it indicates how much larger the generalized eigenspace for
is than its ordinary eigenspace. Consider the follow matrix
:
m = (1/756)(| | | | | | | |
| ----- | ----- | ----- | ---- | ---- | ----- | ----- |
| 829 | -444 | -405 | 2295 | 2039 | -311 | -985 |
| -4276 | 552 | -1836 | 4104 | 976 | 3128 | 220 |
| 453 | 828 | 4239 | -81 | 2535 | -2427 | -2001 |
| -3590 | -2388 | -1458 | 6750 | 2138 | 1966 | -130 |
| -326 | 2076 | 918 | 594 | 6470 | -3230 | -3358 |
| -73 | 1956 | 1161 | -27 | 1741 | 311 | -2039 |
| -4489 | -3372 | -2187 | 4833 | 2017 | 3383 | 2773 |);Compute its minimal polynomial
:
μ = MatrixMinimalPolynomial[m, λ]//FactorAnd its characteristic polynomial
:
CharacteristicPolynomial[m, λ]//FactorBecause
has a linear term in
, its generalized and ordinary eigenspaces are equal. The eigenspace is:
NullSpace[m - 3IdentityMatrix[7]]The geometric multiplicity of
,
, matches its algebraic multiplicity, the power of
in
:
Length[%]Confirm the generalized eigenspace is the ordinary eigenspace by showing
and
have the same null spaces:
%% == NullSpace[MatrixPower[m - 3IdentityMatrix[7], 2]]The presence of
in
means
has a larger null space than
:
NullSpace[m - 4IdentityMatrix[7]]The generalized eigenspace is now larger than the ordinary eigenspace:
NullSpace[MatrixPower[m - 4IdentityMatrix[7], 2]]Since the algebraic multiplicity of
is
, higher powers of
have the same null space:
NullSpace[MatrixPower[m - 4IdentityMatrix[7], 3]]Finally, the presence of
in
means that
has larger null spaces for
and
but not
:
Column[Table[NullSpace[MatrixPower[m - 5IdentityMatrix[7], k]], {k, 4}], Spacings -> 1.5]Use the minimal polynomial to compute the DrazinInverse:
mat = (| | | | | | | | | |
| -- | ---- | --- | ---- | ---- | --- | ---- | ---- | --- |
| 1 | -83 | -23 | 43 | -56 | 8 | 16 | 48 | -30 |
| 2 | -225 | -50 | 89 | -140 | 23 | 52 | 104 | -95 |
| 0 | 475 | 110 | -200 | 300 | -50 | -100 | -225 | 200 |
| -1 | 131 | 28 | -45 | 81 | -16 | -35 | -55 | 58 |
| -3 | 12 | 0 | 5 | 5 | -2 | -11 | 0 | 6 |
| 1 | 295 | 69 | -122 | 186 | -33 | -64 | -137 | 125 |
| -2 | -137 | -30 | 58 | -84 | 15 | 26 | 63 | -61 |
| 0 | -139 | -30 | 49 | -86 | 17 | 36 | 59 | -62 |
| -2 | 245 | 57 | -104 | 155 | -23 | -52 | -119 | 100 |);
mpoly = MatrixMinimalPolynomial[mat, x]//ExpandThe coefficients can be used to compute the Drazin inverse:
mc = CoefficientList[mpoly, x];
id = LengthWhile[mc, # == 0&];
il = (Rest[#] / First[#])&[Drop[mc, id]];
drazin = (-1) ^ (id + 1)MatrixPower[mat, id].MatrixPower[MatrixPolynomialValue[il, mat], id + 1]Verify some properties of the Drazin inverse:
{drazin.mat.drazin == drazin, drazin.mat == mat.drazin}Compare with the result of DrazinInverse:
drazin == DrazinInverse[mat]Properties & Relations (6)
The minimal polynomial of
is the lowest-order monic polynomial
for which
yields a zero matrix:
m = (| | | | | | | | |
| --- | -- | -- | --- | -- | --- | -- | -- |
| 2 | 1 | -3 | -1 | 0 | 1 | -3 | 0 |
| 11 | 8 | -6 | -15 | 0 | 15 | -2 | -2 |
| -11 | -7 | 3 | 15 | 0 | -15 | -2 | 2 |
| 0 | 0 | 1 | -1 | 0 | 0 | 1 | 0 |
| 6 | 5 | -4 | -8 | -1 | 9 | -1 | -1 |
| -12 | -8 | 8 | 14 | 0 | -15 | 4 | 2 |
| 11 | 7 | -4 | -15 | 0 | 15 | 1 | -2 |
| -6 | -4 | 3 | 8 | 0 | -8 | 1 | 1 |);
μ = MatrixMinimalPolynomial[m, x]The polynomial
is monic (coefficient of the highest term is 1):
Coefficient[μ, x ^ 5]Confirm that
is an
zero matrix:
MatrixPolynomialValue[μ, m, x] == SymbolicZerosArray[{8, 8}]Since
is quintic, no quadric (or lower-order) polynomial can give zero when evaluated at
:
Solve[MatrixPolynomialValue[{a, b, c, d, 1}, m] == SymbolicZerosArray[{8, 8}], {a, b, c, d}]The degree of a matrix minimal polynomial can be anywhere from 1 to the matrix dimension n:
m = (| | | |
| - | -- | -- |
| 0 | -1 | 1 |
| 1 | 2 | -1 |
| 1 | 1 | 0 |);MatrixMinimalPolynomial[m, t]This is different from the characteristic polynomial, which always has degree n:
CharacteristicPolynomial[m, t]The minimal polynomial divides the characteristic polynomial with a (possibly constant) polynomial quotient:
mat = (| | | |
| - | -- | -- |
| 0 | -1 | 1 |
| 1 | 2 | -1 |
| 1 | 1 | 0 |);
PolynomialQuotientRemainder[CharacteristicPolynomial[mat, t], MatrixMinimalPolynomial[mat, t], t]The minimal polynomial and the characteristic polynomial have the same distinct roots:
a = (| | | | |
| -- | -- | - | - |
| -6 | 4 | 0 | 9 |
| -3 | 0 | 1 | 6 |
| -1 | -2 | 1 | 0 |
| -4 | 4 | 0 | 7 |);
χ = CharacteristicPolynomial[a, λ];
μ = MatrixMinimalPolynomial[a, λ];
Roots[μ == 0, λ] == DeleteDuplicates[Roots[χ == 0, λ]]In particular, this means
divides
raised to the
power:
PolynomialRemainder[μ ^ LCM@@(Max@Cases[#, λ ^ k_ :> k, -1]& /@ {μ, χ}), χ, λ]A matrix minimal polynomial is often the same as the characteristic polynomial up to a constant factor:
m = {{2, 1}, {1, 2}};Together[(CharacteristicPolynomial[m, t]/MatrixMinimalPolynomial[m, t])]Estimate the fraction of zero–one
matrices for which this is true:
Counts[Table[With[{m = RandomInteger[{0, 1}, {3, 3}]}, Together[(CharacteristicPolynomial[m, t]/MatrixMinimalPolynomial[m, t])]], {1000}]] / 1000.mat = (| | | | | | | | |
| -- | -- | -- | -- | -- | --- | -- | -- |
| 4 | -1 | -4 | 9 | -2 | -3 | 6 | 1 |
| -5 | 1 | 0 | -2 | 2 | 2 | -3 | 0 |
| 8 | -2 | -5 | 14 | -4 | -6 | 10 | 2 |
| 4 | -1 | -4 | 8 | -2 | -3 | 5 | 1 |
| 7 | -1 | -4 | 15 | -4 | -6 | 10 | 1 |
| 5 | -1 | -4 | 7 | -3 | -3 | 4 | 1 |
| -3 | 1 | 4 | -7 | 1 | 2 | -5 | -1 |
| 15 | -3 | -8 | 27 | -8 | -11 | 20 | 4 |);
MatrixMinimalPolynomial[mat, x]//ExpandThe last element in the diagonal of the Smith normal form of a characteristic matrix gives the minimal polynomial:
PolynomialSmithReduce[IdentityMatrix[Length[mat]]x - mat, x][[-1, -1]]Find the last block in the Frobenius normal form:
bdmat = BlockDiagonalMatrix[FrobeniusDecomposition[mat][[2]]];
minpolyblock = bdmat["Blocks"][[-1]]clist = minpolyblock[[All, -1]]This gives the negatives of the minimal polynomial coefficients with lead coefficient implicitly set to 1:
x ^ 5 - clist.x ^ Range[0, 4]Possible Issues (1)
The polynomial returned by MatrixMinimalPolynomial is generally made monic:
MatrixMinimalPolynomial[RandomReal[1, {6, 6}], λ]An exception is the case of algebraic extension, when normalization is skipped due to its high cost:
Coefficient[MatrixMinimalPolynomial[(| | |
| -------------- | - |
| I | 1 |
| I - (-1)^3 / 4 | 2 |), x, Extension -> Sqrt[-I]], x ^ 2]However, the polynomial is often implicitly monic, despite the lack of explicit normalization:
RootReduce[%]Related Guides
Text
Wolfram Research (2025), MatrixMinimalPolynomial, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixMinimalPolynomial.html (updated 2026).
CMS
Wolfram Language. 2025. "MatrixMinimalPolynomial." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. https://reference.wolfram.com/language/ref/MatrixMinimalPolynomial.html.
APA
Wolfram Language. (2025). MatrixMinimalPolynomial. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MatrixMinimalPolynomial.html
BibTeX
@misc{reference.wolfram_2026_matrixminimalpolynomial, author="Wolfram Research", title="{MatrixMinimalPolynomial}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/MatrixMinimalPolynomial.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_matrixminimalpolynomial, organization={Wolfram Research}, title={MatrixMinimalPolynomial}, year={2026}, url={https://reference.wolfram.com/language/ref/MatrixMinimalPolynomial.html}, note=[Accessed: 12-June-2026]}