<s>[INST] 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?
 [/INST] $$\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.
</s>