Determine the structure of the abelian group I had the following finitely presented group:
$$G=\langle a,b: 2a+4b=0, 3b=0\rangle$$
We can use elementary operations by rows and columns and scalar multiplication using integers, so
$$\begin{pmatrix}
2 & 4 \\
0 & 3
\end{pmatrix} \rightarrow \begin{pmatrix}
2 & 0 \\
0 & 3
\end{pmatrix}
$$
But I also get
$$\begin{pmatrix}
2 & 4 \\
0 & 3
\end{pmatrix} \rightarrow \begin{pmatrix}
3 & 0 \\
0 & 2
\end{pmatrix}
$$
Now to use the theorem the elements of the diagonal must divide, I mean
$$ \begin{pmatrix}
a & b \\
c & d
\end{pmatrix} \rightarrow\begin{pmatrix}
d_1 & 0 \\
0 & d_2
\end{pmatrix}$$
with $d_1|d_2$.
To work it out, I multiply by $2$ and $3$, to get the desired form in each matrix
$$ \begin{pmatrix}
2 & 0 \\
0 & 6
\end{pmatrix} \text{,   }\begin{pmatrix}
3 & 0 \\
0 & 6
\end{pmatrix}$$
Am I doing something wrong or this means that the finite presentation of the group gives us the groups $\mathbb{Z}_2 \times \mathbb{Z}_6$ and $\mathbb{Z}_3 \times \mathbb{Z}_6$?
Edit:
The algorithm I'm trying to use is the following:
Theorem: If $A$ is a abelian group with $n$ generators $\{ a_1,\ldots , a_n\}$ and $m$ relations, $r_{i1}a_1+\cdots +r_{in}a_n=0$, $i=1,\cdots ,m$, then we consider the matrix $R=(r_{ij})_{m \times n}$. If $R$ is similar to the diagonal matrix:
$$\begin{pmatrix}
d_1 &  &  & & & \\
 & \ddots &  & & & \\
 &  & d_s & & & \\
 &  & & 0 & & \\
& & & & \ddots & \\
& & & & & 0
\end{pmatrix}$$
By row and column operations and multiplication by integers, with $d_j\mid d_{j+1}$, $d_1\neq 0$, then
$A \cong \mathbb{Z}_{d_1} \oplus \cdots \oplus \mathbb{Z}_{d_s} \oplus \mathbb{Z} \oplus \cdots \oplus \mathbb{Z} $ (the sum of the $\mathbb{Z}$'s is $m-s$).
 A: You aren't done computing the Smith Normal Form; you still have work left to do. You should review the algorithm you have for computing the Smith Normal Form and follow it until it terminates. I'll do the final few steps ad hoc below, so the precise sequence may not match the algorithm you have/know/should have. Note in particular that you aren't allowed to multiply a row or column by anything other that $1$ or $-1$. You can exchange rows or columns; you can add integer multiples of one row to another, or one column to another; and you can multiply a row or column by $1$ or $-1$; these are "integral elementary row operations".
The gcd of the diagonal entries is $1$, so you'll need to do integral elementary row and column operations to get a first row and column with a $(1,1)$ entry equal to $1$ and zero in the other entries. We can achieve this by first adding first column to second column, then subtracting second row from first row, then do row and column exchanges to move the $1$ to the $(1,1)$ entry. Then use it to eliminate the $(2,1)$ entry, and then the $(1,2)$ entry. Below, something of the form $R_1\to$blah means "obtained by replacing row $1$ with the result of doing blah", etc.
$$\begin{align*}
\left(\begin{array}{cc}
2 & 0\\
0 & 3
\end{array}\right) &\to \left(\begin{array}{cc}
2 & 2\\
0 & 3
\end{array}\right)&(C_2\to C_1+C_2)\\
&\to \left(\begin{array}{rr}
2 & 2\\
-2 & 1
\end{array}\right)&(R_2\to R_2-R_1)\\
&\to \left(\begin{array}{rr}
2 & 2\\
1 & -2
\end{array}\right)&(C_1\leftrightarrow C_2)\\
&\to \left(\begin{array}{cc}
1 & -2\\
2 & 2
\end{array}\right)&(R_1\leftrightarrow R_2)\\
&\to \left(\begin{array}{cc}
1 & -2\\
0 & 6
\end{array}\right) &(R_2\to R_2-2R_1)\\
&\to \left(\begin{array}{cc}
1 & 0\\
0 & 6
\end{array}\right)&(C_2\to C_2+2C_1)
\end{align*}$$
which is of the desired form, and gives you that the resulting group is isomorphic to $\mathbb{Z}/1\mathbb{Z}\oplus \mathbb{Z}/6\mathbb{Z}\cong \mathbb{Z}/6\mathbb{Z}$.
