Calculadora de matrices

🌐 Español
A (3×3)
Filas: 3
Columnas: 3
B (3×3)
Filas: 3
Columnas: 3
Admite: fracciones (1/2), decimales (0.5), constantes (pi, e). Las celdas vacías se tratan como 0.

Resultados del cálculo

Forma normal de Hermite (HNF) - definición, ejemplos y práctica

This article explains the Hermite Normal Form (HNF) for integer matrices, gives the definition, practical computation ideas, worked examples, a summary of common mistakes, and practice problems with collapsible answers. It is designed as companion content for a Matrix Hermite Normal Form Calculator.


¿Qué es la forma normal de Hermite?

The Hermite Normal Form (HNF) is a canonical form for integer matrices under unimodular transformations (integer invertible operations). There are two standard conventions:

  • Row-style HNF (common): for an integer m×n matrix \(A\), there exists a unimodular integer matrix \(U\) (i.e. \(\det U=\pm1\)) such that \[ U A = H, \] where \(H\) is in row Hermite normal form (rows in echelon-like form, special positivity and remainder conditions). The matrix \(H\) is unique for \(A\) under this convention.
  • Column-style HNF: there exists unimodular \(V\) with \[ A V = H', \] where \(H'\) is in column Hermite normal form. This is the column-version and is also commonly used (the forms are closely related by transposition).

Below we use the row-style HNF convention for examples and exercises. Intuitively, computing HNF is like performing integer-preserving row operations (swap rows, add integer multiples of one row to another, multiply a row by -1) to reduce the matrix to a canonical echelon-like integer matrix.


Propiedades formales (HNF por filas)

  • \(H\) is an integer matrix in row-echelon form: there are pivots moving strictly to the right as you go down rows.
  • Each pivot (first nonzero entry in a non-zero row) is positive.
  • Entries in the pivot column above the pivot are zero (because rows above have earlier pivots).
  • Entries to the right of a pivot in the same row are reduced modulo the pivot into a standard range (convention-dependent). Combined with unimodular operations these conditions make \(H\) unique.
  • There exists a unimodular \(U\) (integer inverse) such that \(U A = H\).

Note: In practice implementations (e.g. in CAS or numeric libraries) use Euclidean/Gaussian-like integer algorithms to find \(U\) and \(H\). Your calculator may present row- or column-style HNF — be consistent with the chosen convention.


Cómo calcularla (idea práctica)

  1. Use integer row operations only: swap rows, replace a row by itself plus an integer multiple of another row, or multiply a row by -1. These operations are unimodular (they correspond to left-multiplying by unimodular matrices).
  2. Perform a column-reduction-like Euclidean algorithm to produce the smallest positive pivot in the first column (gcd-based), use it to clear other entries in that column, then move to the submatrix formed by remaining rows/columns.
  3. Reduce entries to the right of each pivot into a canonical remainder range (this ensures uniqueness).
  4. Stop when matrix is in echelon form with the Hermite conditions satisfied.

Ejemplo resuelto 1 (2×2)

Dado:

$$ A = \begin{pmatrix} 2 & 4 \\ 6 & 8 \end{pmatrix} $$

Objetivo: find unimodular \(U\) and HNF \(H\) with \(U A = H\).

Pasos clave con filas enteras (ilustrativos):

  1. Start with rows \(r_1=(2,4)\), \(r_2=(6,8)\).
  2. Replace \(r_2 \leftarrow r_2 - 3 r_1\) to clear first column below pivot: \(r_2 = (6,8) - 3(2,4) = (0,-4)\).
  3. Make pivot entries positive: multiply second row by -1: \(r_2 \leftarrow -r_2 = (0,4)\).
  4. Reduce the entry to the right of the pivot in row 1 by subtracting an integer multiple of row 2: \(r_1 \leftarrow r_1 - 1\cdot r_2 = (2,0)\).

Ahora la matriz está en forma normal de Hermite por filas:

$$ H = \begin{pmatrix} 2 & 0 \\ 0 & 4 \end{pmatrix} $$

Thus there exists unimodular integer \(U\) (product of the performed row-operations) such that \(U A = H\).


Ejemplo resuelto 2 (2×2)

Dado:

$$ A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} $$

Pasos clave con filas enteras:

  1. Swap rows to bring a small pivot (if needed). Here pivot 1 is already small.
  2. Eliminate below pivot: \(r_2 \leftarrow r_2 - 3 r_1 = (0,-2)\).
  3. Make the second pivot positive: multiply second row by -1: \(r_2 \leftarrow -r_2 = (0,2)\).
  4. Reduce the entry in row 1, column 2 modulo the pivot in row 2 (here subtract \(1\cdot r_2\) from \(r_1\)): \(r_1 \leftarrow r_1 - 1\cdot r_2 = (1,0)\).

HNF resultante por filas:

$$ H = \begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix} $$

Errores comunes (y consejos)

Common mistakeTip / correct approach
Usar operaciones por filas racionales arbitrarias (fracciones) Only allow integer unimodular row operations (swap rows, add integer multiple of a row, multiply a row by -1).
Confundir la HNF con la forma normal de Smith (SNF) HNF is upper (or lower) triangular canonical under unimodular left (or right) transformations; SNF is diagonal under both left and right unimodular transforms.
Olvidar la convención de unicidad (filas frente a columnas) Decide whether your calculator uses row-style (U A = H) or column-style (A V = H) and be consistent.
Detenerse antes de reducir los restos al rango canónico After clearing columns, reduce the entries to the right of each pivot modulo the pivot to enforce the canonical constraints that guarantee uniqueness.

Problemas de práctica (calcular HNF por filas)

Each exercise asks you to compute the row Hermite Normal Form \(H\) of the given integer matrix \(A\) (i.e. find integer unimodular operations so that \(U A = H\)). Click "Show Answer" to reveal a worked result.

Ejercicio 1

$$ A = \begin{pmatrix} 2 & 4 \\[4pt] 6 & 8 \end{pmatrix} $$
Mostrar respuesta
Result (row-style HNF): $$ H = \begin{pmatrix} 2 & 0 \\[4pt] 0 & 4 \end{pmatrix}. $$ Sketch of steps: 1) r2 <- r2 - 3 r1 = (0,-4) 2) r2 <- -r2 = (0,4) 3) r1 <- r1 - 1 r2 = (2,0) So there exists unimodular U with U A = H.

Ejercicio 2

$$ A = \begin{pmatrix} 1 & 2 \\[4pt] 3 & 4 \end{pmatrix} $$
Mostrar respuesta
Result (row-style HNF): $$ H = \begin{pmatrix} 1 & 0 \\[4pt] 0 & 2 \end{pmatrix}. $$ Sketch of steps: 1) r2 <- r2 - 3 r1 = (0,-2) 2) r2 <- -r2 = (0,2) 3) r1 <- r1 - 1 r2 = (1,0)

Ejercicio 3

$$ A = \begin{pmatrix} 2 & 4 & 6 \\ 0 & 2 & 8 \\ 0 & 0 & 4 \end{pmatrix} $$
Mostrar respuesta
Result (row-style HNF): this matrix is already upper-triangular with positive leading pivots, so the row-style HNF (with standard remainder reductions applied) is: $$ H = \begin{pmatrix} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 4 \end{pmatrix} $$ (One can reduce the off-diagonal entries modulo the pivot using integer row operations; the answer above shows the canonical reduced pivots.)

Ejercicio 4

$$ A = \begin{pmatrix} 3 & 6 & 9 \\ 6 & 15 & 12 \\ 0 & 3 & 6 \end{pmatrix} $$
Mostrar respuesta
Result (one valid row-style HNF; canonical H will match after full remainder reduction): One possible reduced HNF is $$ H = \begin{pmatrix} 3 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 3 \end{pmatrix}. $$ Sketch of method: - Use Euclidean integer row-combinations to extract gcds in the first column (gcd(3,6,0)=3) as first pivot and clear other entries in column 1. - Move to the 2×2 submatrix on remaining rows/columns and repeat (gcds lead to pivot 3). - Reduce entries to the right modulo pivots to achieve canonical remainders. Note: The calculator's exact H matrix will be unique under the row-style convention; the steps above outline the integer-GCD process to reach it.

Aprende multiplicación de matrices más fácilmente en solo 2 minutes with this juego gratuito.

Juego de multiplicación de matrices