Smith normal form help I want to find the structure of the abelian group:
$$G=\frac{\mathbb{Z}^{3}}{\langle (2,0,10),(0,4,8),(4,-4,12) \rangle}$$
The Smith normal form of the matrix associated to $G$ is:
$$P= \left( \begin{array}{ccc}
2 & 0 & 0 & 0\\
0 & 4 & 0 & 0\\
0 & 0 & 0 & 0\end{array} \right),$$
which is correct (verified it with software). Thus the decomposition of $G$ as a direct sum of cyclic groups is $\mathbb{Z}_{2} \oplus \mathbb{Z}_{4} \oplus \mathbb{Z}$ yes? why the answer is $\mathbb{Z}_{2} \oplus \mathbb{Z}_{4} \oplus \mathbb{Z} \oplus \mathbb{Z}$, i.e why the extra summand $\mathbb{Z}$?. I thought that we only look at the elements of the diagonal of $P$ which in this case there are only three: $2,4,0$. 
What am I doing incorrect? Can you please explain?

You are correct that the decomposition of $G$ is $\mathbb{Z}_2 \oplus \mathbb{Z}_4 \oplus \mathbb{Z}$.  If the computer is telling you that the answer is $\mathbb{Z}_2 \oplus \mathbb{Z}_4 \oplus \mathbb{Z} \oplus \mathbb{Z}$, the most likely explanation is that the matrix for $G$ was somehow transposed at some point during your calculation.  For example, if you originally entered the transpose of the original matrix for $G$, then you would get the transpose of the Smith normal form.
Note that there isn't an established convention for which direction a matrix presentation for an abelian group should go.  In some books (and in some computer programs), the rows correspond to generators and the columns correspond to relations, while in other books (and computer programs) this convention is reversed.
