Invariant factors So I was asked the following question: Let $ G = \{ 1 + a_1x + a_2x^2 +a_3x^3 : a_i \in \mathbb{Z}/2\mathbb{Z} \} $, and define a binary operation on $ G $ by $ p(x) * q(x) = p(x)q(x) \bmod{x^4} $. This makes $ G $ a $ \mathbb{Z} $-module. Find the invariant factors of $ G $. 
I understand that the operation makes $ G $ a finite abelian group ($ \mathbb{Z} $-module) hence we can apply the classification theorem. If I can find a set of generators and all possible relations between them then I know how to find the invariant factors. But I'm not sure how to do this. Any hints?

The elements we have are:
$$\{1,1+x,1+x^2,1+x+x^2,1+x^3,1+x+x^3,1+x^2+x^3,1+x+x^2+x^3\}$$
It can be useful to see what the subgroups $\langle g\rangle$ look like for all $g\in G$, as this gives us a good idea what to pick as generators.
Additionally, this is an abelian group of order $8$, so it's isomorphic to one of the following: $$\mathbb{Z}_8,\mathbb{Z}_4\times\mathbb{Z}_2,\mathbb{Z}_2\times\mathbb{Z}_2\times\mathbb{Z}_2$$
To distinguish these cases, it can be useful to find the order of some elements:
\begin{array}{cccc}
g & g^2 & g^3 & g^4\\\hline
1+x & 1+x^2 & 1+x+x^2+x^3 & 1 \\
1+x^2 & 1 &&\\
1+x+x^2 & 1+x^2 & 1+x+x^3 & 1 \\
1+x^3 & 1 \\
1+x+x^3 & 1+x^2 & 1+x+x^2 & 1 \\
1+x^2+x^3 & 1 \\
1+x+x^2+x^3 & 1+x^2 & 1+x & 1
\end{array}
This gives us a decent amount of information.
The big thing it tells us is all of the inverses in this group, and all of the orders.
We can see that $1+x$ and $1+x+x^2$ are two elements of order $4$ that aren't powers of a single generator.
So, one them is the other times the element of order $2$.
Now, note that:
$$(1+x)(1+x^3) = 1+x+x^3$$
So, if we fix $1+x = g$, and $1+x^3 = s$, we get that $|g| = 4$, $|s| = 2$, and that:
\begin{array}{cccccccc}
1 & 1+x & 1+x^2 & 1+x+x^2 & 1+x^3 & 1+x+x^3 & 1+x^2 +x^3 & 1+x+x^2+x^3 \\
1 & g & g^2 & g^3s & s & gs & g^2s & g^{3}  
\end{array}
Is how each element is expressed in terms of generators.
From here, it should be easy to establish the isomorphism with $\mathbb{Z}/4\mathbb{Z}\times\mathbb{Z}/ 2\mathbb{Z}$.
