linalg::smithForm -- Smith
canonical form of a matrix
Introductionlinalg::smithForm(A) computes the Smith
canonical form of the n-dimensional square matrix
A, i.e., an n x n diagonal matrix S
such that S[i-1,i-1] divides S[i,i] for
i=2..n.
Call(s)linalg::smithForm(A)
ParametersA |
- | a square matrix of a domain of category Cat::Matrix |
Returnsa matrix of the same domain type as A.
Related
Functionslinalg::frobeniusForm,
linalg::hermiteForm, linalg::jordanForm
DetailsA is unique.A must be a Euclidean ring,
i.e., a domain of category Cat::EuclideanDomain.
Example
1We define a matrix over the integers:
>> MatZ := Dom::Matrix(Dom::Integer): A := MatZ([[9, -36, 30], [-36, 192, -180], [30, -180, 180]])
+- -+
| 9, -36, 30 |
| |
| -36, 192, -180 |
| |
| 30, -180, 180 |
+- -+
The Smith canonical form of A is then given
by:
>> linalg::smithForm(A)
+- -+
| 3, 0, 0 |
| |
| 0, 12, 0 |
| |
| 0, 0, 60 |
+- -+
Example
2We compute the Smith canonical form of a matrix over a ring of polynomials:
>> MatPoly := Dom::Matrix(Dom::DistributedPolynomial([x], Dom::Rational)):
B := MatPoly(
[[-(x - 3)^2*(x - 2),(x - 3)*(x - 2)*(x - 4)],
[(x - 3)*(x - 2)*(x - 4),-(x - 3)^2*(x - 4)]
])
+- -+
| 3 2 3 2 |
| - x + 8 x - 21 x + 18, x - 9 x + 26 x - 24 |
| |
| 3 2 3 2 |
| x - 9 x + 26 x - 24, - x + 10 x - 33 x + 36 |
+- -+
The Smith canonical form of the matrix B is
the following matrix:
>> linalg::smithForm(B)
+- -+
| x - 3, 0 |
| |
| 3 2 |
| 0, x - 9 x + 26 x - 24 |
+- -+