Hermite normal form of a matrix

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


linalg::hermiteForm(A, <All>)


linalg::hermiteForm(A) computes the Hermite normal form of a non-singular integer square matrix A. This is an upper-triangular matrix H such that Hjj ≥ 0 and for j > i. In the case, A is not a square matrix or a singular matrix, the matrix H is simply an upper-triangular matrix.

If the matrix A is not of the domain Dom::Matrix(Dom::Integer) then A is converted into a matrix of this domain for intermediate computations.

If this conversion fails, then an error message is returned.

linalg::hermiteForm(A, All) computes a transformation matrix U and a matrix H such that H = UA.


Example 1

We compute the Hermite normal form of the matrix:

A := Dom::Matrix(Dom::Rational)(
   [[9, -36, 30], [-36, 192, -180], [30, -180, 180]]


We may also compute the transformation matrix by giving the option All:

linalg::hermiteForm(A, All)

Let us check the result:

U := linalg::hermiteForm(A, All)[2]:
U * A



An integer matrix of category Cat::Matrix



Returns the list [H, U] with the hermite normal form H of A and the corresponding transformation matrix U

Return Values

Either a matrix of the same domain type as A or the list [H, U] when the option All is given.


Let A be an n×n matrix with coefficients in . Then there exists an n×n matrix H = (hij) in Hermite normal form such that H = AU with .

Note that H is unique, if A has full row rank. The matrix U is not unique. U may be computed by using the option All.

If A is a square matrix, then the product of the diagonal elements of its Hermite normal form is, up to the sign, the determinant of A.

Was this topic helpful?