Algorithmically finding the quotient of two lattices as the product of cyclic groups Let $e_{1..n}$ be a basis of $\mathbb{R}^n$. Let $U$ and $V$ be sets of integral linear combinations of $e_{1..n}$. I know that the lattice spanned by $V$ is a subgroup of the lattice spanned by $U$, and I want to produce an algorithm that will determine the quotient of these lattices as a product of cyclic groups (The quotient of lattices will always be a product of cyclic groups, right?).
I think the first thing to do is determine subsets, $u$ and $v$, of $U$ and $V$ such that all elements of $u$ and $v$ are linearly independent. This can be accomplished by setting a multivector equal to one of the elements of in the initial set and looping through the rest of the set: for each new element, $a$ wedge the multivector with $a$ and if the wedge product is non-zero, set the multivector equal to this wedge product and add $a$ to the desired subset. This will naturally produce a set of linearly independent vectors, but I'm not sure it's necessarily the fastest way since the components of all vectors involved are integral (is there some trick that I'm not thinking of?).
Once we have the desired linearly independent sets, denote the lattice spanned by $u$ as $L_1$ and the one spanned by $v$ as $L_2$. Let $G=L_1 / L_2$ and assume it to be the trivial group. First take the difference in cardinalities between $u$ and $v$ and add that many factors of $\mathbb{Z}$ to $G$.
What I think must happen next is we must find a set $v'$ , with the same cardinality as $v$, made of linearly independent integral linear combinations of vectors in $v$ such that 
$$\forall v'_i \in v' \quad \exists u_i \in u,\, k\in \mathbb{N}\, (v_i=ku_i)$$
then for each element of $v'$ add a factor of $\mathbb{Z}_k$ to $G\,$(where $k$ is the factor corresponding to the particular element of $v'$ in the sentence above).
The trouble is, I have no idea to find $v'$.
$$hints > answers$$
 A: The solution is to represent the sub-lattice as a linear transformation into the super-lattice, i.e. the column matrix of all the basis vectors for the sub-lattice.
The aligned basis, as Keith Conrad calls it (see the comment), can be found by finding the Smith normal form of the matrix corresponding to the transformation. This wikipedia article describes how to find Smith normal form.
Once the Smith normal form has been found, look at the diagonal elements. The quotient is now $\mathbb{Z}^n/(a_0\mathbb{Z}\oplus a_1\mathbb{Z}\oplus ...a_i\mathbb{Z})$ where $a_k$ are the diagonal elements. This is because finding the Smith normal form just corresponds to a bunch of coordinate transformations on the sub-lattice and super-lattice.
Concretely, start with the identity group, for every 0 in the diagonal of the Smith normal form add a factor of $\mathbb{Z}$ to the quotient group, for every element k>1 add a factor of $\mathbb{Z}_k$, 1's correspond to a factor of the trivial group so nothing needs to be done with them.
