gives the Frobenius decomposition of a square matrix a as a list {s,c}, such that
where s is a similarity matrix and c is a block companion diagonal matrix.
FrobeniusDecomposition
gives the Frobenius decomposition of a square matrix a as a list {s,c}, such that
where s is a similarity matrix and c is a block companion diagonal matrix.
Details and Options
- FrobeniusDecomposition is also known as rational canonical decomposition or Frobenius canonical decomposition. The c matrix is the Frobenius normal form.
- FrobeniusDecomposition is typically used to analyze and solve systems of linear differential equations or linear difference equations.
- The characteristic polynomial
of a above has the form
, and each companion matrix ci=CompanionMatrix[{pi[x],x}]. Furthermore,
divides
, and also
is the MatrixMinimalPolynomial of a. - FrobeniusDecomposition[m] always exists for a matrix m; EigenvalueDecomposition[m] only exists if the JordanDecomposition[m] is diagonal.
- FrobeniusDecomposition uses only rational operations on the input, so is often a more efficient choice than JordanDecomposition.
- FrobeniusDecomposition works for exact and approximate matrices. However, it is numerically unstable, and for many numerical problems, the stable SchurDecomposition is a better choice.
Examples
open all close allBasic Examples (2)
Compute the Frobenius decomposition of a matrix:
FrobeniusDecomposition[{{2, 3, 1}, {3, 1, 2}, {3, 2, 4}}]MatrixForm[%[[2]]]Compute the Frobenius decomposition of a matrix:
{s, c} = FrobeniusDecomposition[{{1, 0, 0, 0}, {0, 1, 0, 0}, {-2, -2, 0, 1}, {-2, 0, -1, 2}}]mat = {{1, 0, 0, 0}, {0, 1, 0, 0}, {-2, -2, 0, 1}, {-2, 0, -1, 2}};s.c.Inverse[s] == matScope (2)
mat = {{1 + I, 0, 3 - I}, {-2 - 3I, 1, 4I}, {2, -5 + 2I, 0}};
{s, f} = FrobeniusDecomposition[mat]s.f.Inverse[s] == matmat = {{1 + x, y}, {-2z ^ 2 + x, 4y z}};
{s, f} = FrobeniusDecomposition[mat]Together[s.f.Inverse[s]] == matOptions (1)
Modulus (1)
FrobeniusDecomposition can work modulo a prime:
m = {{-11, 5, -7}, {9, -19, -6}, {-2, 1, 5}};
{s, f} = FrobeniusDecomposition[m, Modulus -> 19]Mod[s.f.Inverse[s, Modulus -> 19] - m, 19]Properties & Relations (2)
Compute the Frobenius decomposition of a matrix:
m = (| | | | | | | | |
| -- | -- | -- | -- | -- | --- | -- | -- |
| 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 |);
{s, f} = FrobeniusDecomposition[m];
MatrixForm[f]The polynomial Smith reduction can be used to compute the rational canonical form of a matrix (the second element in the Frobenius decomposition).
m = (| | | | | | | | |
| -- | -- | -- | -- | -- | --- | -- | -- |
| 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 |);Compute the Smith form of a characteristic matrix and extract the diagonal:
s = PolynomialSmithReduce[m - x * IdentityMatrix[Length[m]], x];
diag = Diagonal[s]Obtain the diagonal elements of positive degree, corresponding to companion matrix polynomials:
polys = Select[diag, (Exponent[#, x] > 0)&]Check the last one is the matrix minimal polynomial:
Last[polys] == Expand[MatrixMinimalPolynomial[m, x]]Check that their product is the matrix characteristic polynomial:
Expand[Times@@polys] == Expand[CharacteristicPolynomial[m, x]]Use these to create companion matrix blocks:
companionMatrix[poly_, x_] := Module[
{clist = CoefficientList[poly, x], len = Exponent[poly, x], cmat},
cmat = ConstantArray[0, {len, len}];
Do[cmat[[i, i - 1]] = 1, {i, 2, len}];
cmat[[All, -1]] = -Most[clist] / Last[clist];
cmat
]
compmats = Map[companionMatrix[#, x]&, polys]Use SparseArray and Band to reconstruct the companion matrix for m as a diagonal block matrix:
compmat = Normal[SparseArray[Band[{1, 1}] -> (compmats)]]compmat == FrobeniusDecomposition[m][[2]]Neat Examples (1)
Frobenius decomposition of a sparse matrix:
(m = {{0, 0, 0, 0, 0, -2, 0, 0}, {0, 0, 0, 0, 0, 0, -3, 0}, {0, 0, 0, -4, 0, 0, 0, 1}, {0, 0, 1, -7, 0, 0, 0, 0}, {1, 0, 0, 0, 0, -4, 0, 0}, {0, 0, 0, 0, 1, -7, 0, 0}, {0, 1, 0, 0, 0, 0, -5, 0}, {0, 0, 0, -2, 0, 0, 0, 0}} * 3)//MatrixFormFrobeniusDecomposition[m][[2]]//MatrixFormRelated Guides
History
Text
Wolfram Research (2025), FrobeniusDecomposition, Wolfram Language function, https://reference.wolfram.com/language/ref/FrobeniusDecomposition.html.
CMS
Wolfram Language. 2025. "FrobeniusDecomposition." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FrobeniusDecomposition.html.
APA
Wolfram Language. (2025). FrobeniusDecomposition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FrobeniusDecomposition.html
BibTeX
@misc{reference.wolfram_2026_frobeniusdecomposition, author="Wolfram Research", title="{FrobeniusDecomposition}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/FrobeniusDecomposition.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_frobeniusdecomposition, organization={Wolfram Research}, title={FrobeniusDecomposition}, year={2025}, url={https://reference.wolfram.com/language/ref/FrobeniusDecomposition.html}, note=[Accessed: 12-June-2026]}