snf
Smith normal form (SNF) is a canonical diagonal form for integer matrices that can be obtained through unimodular transformations. For an m-by-n integer matrix A, there exist unimodular matrices U (m-by-m) and V (n-by-n) with determinant ±1 such that UAV = D, where D is diagonal with entries d1, d2, ..., dr, followed by zeros. The diagonal entries satisfy d1 divides d2 divides ... divides dr, and r is the rank of A. The nonzero diagonal entries are called the invariant factors of A.
The SNF is unique up to multiplication of the diagonal entries by units in the integers (typically
In a broader algebraic sense, SNF is tied to the structure theorem for finitely generated modules over
Computationally, SNF is obtained via a sequence of elementary row and column operations corresponding to unimodular