I am not sure whether this is the right forum to ask such a question, if not please let me know.
In the context of my masters thesis, I am working on writing a program to compute simplicial homology of certain spaces $X$. The idea is to give the program the differentials $\partial_k:C_k \rightarrow C_{k-1}$ as (quite large) matrices, and compute the homology $\frac{kern\partial_k}{im \partial_{k+1}}$ by bringing both matrices in Smith Normal Form. For integral coefficients one can then use $$H(X; \mathbb{Z}) = \mathbb{Z}^{r-t} \oplus_{i=1}^{t} \mathbb{Z}/{s_i}\mathbb{Z},$$ with $s_i$ the diagonal entries in the SNF of $\partial_{i+1}$ and $r = rankC_i - rank(\partial_i)$ .
As the computation with integral coefficients is too computationally expensive, the idea is to compute $H(X,\mathbb{Z}/ d\mathbb{Z})$ for some $d$ to get the torsion parts of the integral homology using the Universal Coefficient Theorem.
As $\mathbb{Z}/ d\mathbb{Z}$ contains zero divisors, the kernel of $\partial_i$ may be a torsion module, if the $s_i$ in the SNF of $\partial_i$ are not units (e.g. not 1). Thus one should keep track of the basis change while computing the SNF to exactly know how the image of $\partial_{i+1}$ lies in the kernel of $\partial_{i}$ to get the homology in the form torsion part + free part as above.
How do I do that? I somehow have to compute the SNFs simultaneously, and I do not see how that can work. Maybe I am missing something trivial, but I seem to be stuck here.
Thank you!