We know that group cohomology $H^2(G,U(1))$ consists of 2-cocycles $\beta(A,B)\in U(1)$ corresponding to elements in the group $H^2(G,U(1))$, where $A\in G,B \in G$. Note that $\beta(A,B)$ satisfies 2-cocycles conditions: $\frac{\beta(A,B)\beta(AB,C)}{\beta(A,BC)\beta(B,C)}=1$, with $A,B,C\in G$.

For example,

(1)$H^2(Z_2,U(1))=Z_1$

(2)$H^2(Z_2^2,U(1))=Z_2$

(3)$H^2(Z_2^3,U(1))=Z_2^3$

(4)$H^2(Z_n^k,U(1))=Z_n^{k(k-1)/2}$

(5)$H^2(Z_n \times Z_m,U(1))=Z_{gcd(n,m)}$.

We know (1)$H^2(Z_2,U(1))$ has a 2-cocycle $\beta(A,B)=1$ (up to a 2-coboundary term), this corresponds to the unique element in $Z_1$.

Questions: What are the explicit forms of 2-cocycles $\beta(A,B)$ for the cases of (2)$H^2(Z_2^2,U(1))$,(3)$H^2(Z_2^3,U(1))$?

The answer should look like: For (2), $\beta(A,B)=\beta_1^{n_1}$ with $n_1\in \{ 0,1\}=Z_2$, with $\beta_1$ as a generator of 2-cocycles. For (3), $\beta(A,B)=\beta_1^{n_1}\beta_2^{n_2}\beta_3^{n_3}$ with $n_1,n_2,n_3\in \{ 0,1\}=Z_2$, with $\beta_1,\beta_2,\beta_3$ as generators of 2-cocycles.

Similarly, any answer for explicit 2-cocycles for (4)$H^2(Z_n^k,U(1))$ and (5)$H^2(Z_n \times Z_m,U(1))$?

Any comments, concise/short reference or better understanding will be helpful. I am a physicist, on a modest level trying to absorb this http://arxiv.org/abs/hep-th/0001158. Thank you so much.