Matrix canonical forms
Canonical and integer forms return structured decompositions when metadata such
as transformations, rank, pivots, or invariant factors is part of the result.
Every decomposition on this page carries the transformation matrices that
certify it, so the defining identity can be replayed exactly.
Ordinary matrix arithmetic, determinants, and spectral data are on
linear algebra; the shape of each returned record is
listed in structured results and the generated
result-type index.
UniffiMatrix method
func rationalCanonicalForm(variable: String) -> UniffiRationalCanonicalForm
Returns the certified Frobenius canonical form over the rationals. Its invariant factors are
monic and ordered by divisibility, and similarity satisfies
matrixsimilarity=similaritycanonical_form exactly.
UniffiMatrix method
func rationalCanonicalForm(variable: String) -> UniffiRationalCanonicalForm
UniffiRationalCanonicalForm method
func canonicalForm() -> UniffiMatrix
The Frobenius canonical form of the decomposed matrix.
invariant_factors#
The similarity, minimal_polynomial, and characteristic_polynomial getters return the
corresponding certified fields documented by their shared headings above.
UniffiMatrix method
func hermiteNormalForm() -> UniffiHermiteNormalFormDecomposition
Returns the canonical row-oriented Hermite normal form H, a unimodular
transformation U satisfying UM=H, the rank, and the strictly increasing
pivot-column indices. Entries must be exact integers. Every result is verified
for Hermite shape, the certificate identity, and unimodularity before return.
Notes: WASM returns a HermiteNormalFormDecomposition object with the
getters documented below.
UniffiMatrix method
func columnHermiteNormalForm() -> UniffiHermiteNormalFormDecomposition
The transpose-dual column form, returning H, a unimodular V satisfying
MV=H, the rank, and pivot metadata. Notes: WASM returns a
HermiteNormalFormDecomposition object.
UniffiMatrix method
func smithNormalForm() -> UniffiSmithNormalFormDecomposition
Returns the canonical integer Smith normal form D, unimodular transformations
U and V satisfying UMV=D, the rank, and the invariant factors including
trailing zeros. The nonnegative positive prefix is divisibility-ordered. Every
result is verified for diagonal shape, divisibility, the exact certificate, and
unimodularity of both transformations before return. Notes: WASM returns a
SmithNormalFormDecomposition object with the getters documented below.
integer_cokernel_structure#
UniffiMatrix method
func integerCokernelStructure() -> UniffiIntegerCokernelData
Returns the free rank and nontrivial torsion invariant factors of
Z^m / M Z^n. Notes: WASM returns an IntegerCokernelData object.
smith#
UniffiSmithNormalFormDecomposition method
func smith() -> UniffiMatrix
The Smith normal form S.
UniffiSmithNormalFormDecomposition method
func rowTransformation() -> UniffiMatrix
The unimodular row transformation U satisfying U * matrix * V == S.
UniffiSmithNormalFormDecomposition method
func columnTransformation() -> UniffiMatrix
The unimodular column transformation V satisfying U * matrix * V == S.
smith_invariant_factors#
free_rank#
torsion_invariant_factors#
integer_kernel_basis#
UniffiMatrix method
func integerKernelBasis() -> [UniffiMatrix]
A canonical basis of the integer kernel {x∈Zn:Mx=0}, returned as
column matrices.
integer_row_lattice_basis#
UniffiMatrix method
func integerRowLatticeBasis() -> [UniffiMatrix]
The nonzero rows of the row Hermite form, returned as row matrices; these form
the canonical basis of the integer row lattice.
integer_image_lattice_basis#
UniffiMatrix method
func integerImageLatticeBasis() -> [UniffiMatrix]
The nonzero columns of the column Hermite form, returned as column matrices;
these form the canonical basis of M Z^n.
hermite#
UniffiHermiteNormalFormDecomposition method
func hermite() -> UniffiMatrix
The Hermite normal form H.
UniffiHermiteNormalFormDecomposition method
func transformation() -> UniffiMatrix
pivot_columns#
The rank getter reuses the matrix rank heading above.
UniffiHermiteNormalFormDecomposition method
func pivotColumns() -> [UInt64]
The rank getter reuses the matrix rank heading above.
Example#
Additional API#
UniffiHermiteNormalFormDecomposition method
Rank via Bareiss fraction-free elimination.
UniffiRationalCanonicalForm method
func characteristicPolynomial() -> UniffiExpression
det(λI−M) as a polynomial in the named variable.
UniffiRationalCanonicalForm method
func invariantFactors() -> [UniffiExpression]
The certified invariant factors, monic and ordered by divisibility.
UniffiRationalCanonicalForm method
func minimalPolynomial() -> UniffiExpression
The monic minimal polynomial over the rationals. The matrix must have rational entries.
UniffiRationalCanonicalForm method
func similarity() -> UniffiMatrix
The certified change of basis S, satisfying matrix * S == S * canonical_form.
UniffiSmithNormalFormDecomposition method
func invariantFactors() -> [UniffiExpression]
The certified invariant factors, monic and ordered by divisibility.
UniffiSmithNormalFormDecomposition method
Rank via Bareiss fraction-free elimination.