Mathwords logoMathwords

Unimodular Matrix — Definition, Formula & Example

A unimodular matrix is a square matrix whose entries are all integers and whose determinant is exactly 1 or −1. Because of this, you can undo it with another integer matrix, with no fractions anywhere.

An n×nn \times n matrix AA is unimodular if A∈Zn×nA \in \mathbb{Z}^{n\times n} and det⁡A=±1\det A = \pm 1. Equivalently, AA is invertible and A−1∈Zn×nA^{-1} \in \mathbb{Z}^{n\times n}. The two conditions match because det⁡A⋅det⁡A−1=1\det A \cdot \det A^{-1} = 1, and the only integers whose product is 1 are 1⋅11 \cdot 1 and (−1)(−1)(-1)(-1). The unimodular n×nn \times n matrices form the group GLn(Z)GL_n(\mathbb{Z}). Some texts reserve the word for det⁡A=+1\det A = +1 only, which is the subgroup SLn(Z)SL_n(\mathbb{Z}).

Key Formula

det⁡A=±1⟹A−1=1det⁡A adj⁡(A)=± adj⁡(A)\det A = \pm 1 \quad\Longrightarrow\quad A^{-1} = \frac{1}{\det A}\,\operatorname{adj}(A) = \pm\,\operatorname{adj}(A)
Where:
  • AA = a square matrix with integer entries
  • det⁡A\det A = the determinant of A, which must equal 1 or −1
  • adj⁡(A)\operatorname{adj}(A) = the adjugate of A, the transpose of its cofactor matrix. Its entries are integers whenever A has integer entries.

Worked Example

Problem: Show that A=[3512]A = \begin{bmatrix} 3 & 5 \\ 1 & 2 \end{bmatrix} is unimodular. Then use its inverse to solve Ax=[73]A\mathbf{x} = \begin{bmatrix} 7 \\ 3 \end{bmatrix}.
Step 1: All entries are integers. Compute the determinant.
det⁡A=(3)(2)−(5)(1)=6−5=1\det A = (3)(2) - (5)(1) = 6 - 5 = 1
Step 2: Since det⁡A=1\det A = 1, the inverse equals the adjugate. For a 2×2 matrix, swap the diagonal entries and negate the off-diagonal ones. Every entry is an integer.
A−1=[2−5−13]A^{-1} = \begin{bmatrix} 2 & -5 \\ -1 & 3 \end{bmatrix}
Step 3: Multiply A−1A^{-1} by the integer right-hand side. The solution comes out in integers automatically.
x=[2(7)−5(3)−1(7)+3(3)]=[−12]\mathbf{x} = \begin{bmatrix} 2(7) - 5(3) \\ -1(7) + 3(3) \end{bmatrix} = \begin{bmatrix} -1 \\ 2 \end{bmatrix}
Answer: AA is unimodular because det⁡A=1\det A = 1, and A−1=[2−5−13]A^{-1} = \begin{bmatrix} 2 & -5 \\ -1 & 3 \end{bmatrix}. The solution is x=−1x = -1, y=2y = 2. Check: 3(−1)+5(2)=73(-1) + 5(2) = 7 and −1+2(2)=3-1 + 2(2) = 3.

Why It Matters

In number theory and cryptography, two bases describe the same lattice exactly when a unimodular matrix converts one into the other. Lattice-reduction algorithms such as LLL depend on this fact. Unimodular row and column operations also produce the Hermite and Smith normal forms, which are the standard tools for solving systems of linear Diophantine equations.

Common Mistakes

Mistake: Calling any matrix with determinant ±1 unimodular, such as [20012]\begin{bmatrix} 2 & 0 \\ 0 & \tfrac{1}{2} \end{bmatrix}.
Correction: The entries must be integers as well. This matrix has determinant 1, but its inverse [12002]\begin{bmatrix} \tfrac{1}{2} & 0 \\ 0 & 2 \end{bmatrix} contains a fraction, so it is not unimodular. Also, do not confuse this term with a totally unimodular matrix. That stronger condition requires every square submatrix to have determinant 0, 1, or −1.

Related Terms

  • Matrix — The array of numbers a unimodular matrix is
  • Adjugate — Equals the inverse up to sign for unimodular matrices
  • Cramer's Rule — Shows integer right sides give integer solutions here
  • Coefficient Matrix — If unimodular, integer constants always yield integer solutions
  • Cofactor — Integer entries make every cofactor an integer
  • Cofactor Matrix — Its transpose is the integer adjugate used for the inverse
  • Classical Adjoint — Older name for the adjugate that gives the inverse