# Finding the Smith Normal Form of an integer matrix

I want to put the following integer matrix into Smith Normal Form:

$$\begin{pmatrix} -9 & 6 \\ 5 & -2 \\ 6 & 3 \end{pmatrix}$$

I have done this and found the answer to be $$\begin{pmatrix} 1 & 0 \\ 0 & 3 \\ 0 & 0\end{pmatrix}$$

Could someone verify whether this is correct or not?

• If you have access to Mathematica, try SmithDecomposition[ {{-9,6},{5,-2},{6,3}} ]. Too bad this does not work in WA. – lhf Feb 25 at 13:46
• However, HermiteDecomposition[ {{-9,6},{5,-2},{6,3}} ] does work in WA and gives a matrix that is almost in Smith Normal Form. – lhf Feb 26 at 0:25

$$\begin{pmatrix}-9 & 6 \\ 5 & -2 \\ 6 & 3\end{pmatrix}\to\begin{pmatrix}2 & -5 \\ 6 & -9 \\ 3 & 6\end{pmatrix}\to \begin{pmatrix}2 & -5 \\ 0 & 6 \\ 1 & 11\end{pmatrix}\to\begin{pmatrix}1 & 11 \\ 0 & 6 \\ 0 & -27\end{pmatrix}\to\begin{pmatrix}1 & 0 \\ 0 & 6 \\ 0 & 3\end{pmatrix}\to\begin{pmatrix}1 & 0 \\ 0 & 3 \\ 0 & 0\end{pmatrix}$$ Rearrange rows and columns, reduce, rearrange again, reduce (twice), rearrange and reduce.