Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# linalg::hermiteForm

Hermite normal form of a matrix

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

```linalg::hermiteForm(A, <All>)
```

## Description

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.

## Examples

### 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]]
)```

`linalg::hermiteForm(A)`

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`

## Parameters

 A An integer matrix of category Cat::Matrix

## Options

 All 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.

## Algorithms

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.