How to compute group cohomology $H^2_\sigma(\mathbb{Z}\times \mathbb{Z}, \mathbb{Z}_2\times \mathbb{Z}_2)$ with nontrivial $G$-module How to compute group cohomology $H^2_\sigma(\mathbb{Z}\times \mathbb{Z}, \mathbb{Z}_2\times \mathbb{Z}_2)$ with nontrivial group action $\sigma$.
$$\mathbb{Z}\times \mathbb{Z}= \langle a,b| a b =ba\rangle$$
$$\mathbb{Z}_2\times \mathbb{Z}_2= \langle c,d| c^2=1=d^2,c d =dc\rangle$$
If I require the group action is $\sigma(a): c\rightarrow d$, $\sigma(a): d\rightarrow c$, $\sigma(b): c\rightarrow d$, $\sigma(b): d\rightarrow c$
My questions:


*

*how to compute group cohomology $H^2_\sigma(\mathbb{Z}\times \mathbb{Z}, \mathbb{Z}_2\times \mathbb{Z}_2)$?

*What's the group  $(\mathbb{Z}_2\times \mathbb{Z}_2) \rtimes_\sigma (\mathbb{Z}\times \mathbb{Z} )$ ?
 A: You can resolve these two questions using the polycyclic package, which comes bundled with GAP. There are multiple ways to input the enter the problem into GAP. I'll choose one via matrix modules: The group $G := \mathbb{Z}^2$ with generators $a,b$ is acting here on the vector space $\mathbb{F}_2$ (with basis $c,d$), with both generators of $G$ acting via the matrix $\left(\begin{smallmatrix} 0&1\\1&0\end{smallmatrix}\right)$. So:
gap> LoadPackage("polycyclic");
true
gap> G:=AbelianPcpGroup([0,0]);
Pcp-group with orders [ 0, 0 ]
gap> m:=[[0,1],[1,0]]*Z(2);;
gap> cr:=CRRecordByMats(G,[m,m]);;
gap> h2:=TwoCohomologyCR(cr);;

Unfortunately, $h2$ is not a nice group object; one has to read the documentation of TwoCohomologyCR to learn how to interpret its output. Here, we are interested in h2.factor, which is:
gap> h2.factor;
rec( denom := [ <a GF2 vector of length 4> ],
  gens := [ [ Z(2)^0 ] ],
  imgs := [ [ Z(2)^0 ], [ Z(2)^0 ] ],
  prei := [ <an immutable GF2 vector of length 4> ].
  rels := [ 2 ] )

This output means that the second cohomology group has one generator (in gens), with relative order 2 -- i.e. it is $\mathbb{Z}_2$. 
To get the corresponding extensions, use $ExtensionClassesCR$:
gap> exts:=ExtensionClassesCR(cr);
[ Pcp-group with orders [ 0, 0, 2, 2 ],
  Pcp-group with orders [ 0, 0, 2, 2 ] ]

A: I think it's reasonable to do this by hand. The following is analogous to the computation of group cohomology for the group $G = \mathbb{Z}$.
Let $A := \mathbb{Z}[t_{1}^{\pm},t_{2}^{\pm}]$ be the group ring of the group $G := \mathbb{Z} \times \mathbb{Z}$. Then the $A$-module $\mathbb{Z} \simeq A/(t_{1}-1,t_{2}-1)A$ has an $A$-module resolution $$ \dotsb \to 0 \to A e_{2,1} \stackrel{f_{2}}{\to} A e_{1,1} \oplus A e_{1,2} \stackrel{f_{1}}{\to} A e_{0,1} \to \mathbb{Z} \to 0 $$ where $f_{2}(e_{2,1}) = (t_{2}-1)e_{1,1} - (t_{1}-1)e_{1,2}$ and $f_{1}(e_{1,i}) = (t_{i}-1)e_{0,1}$ for $i=1,2$. Let $$ M := \mathbb{Z}/(2) \oplus \mathbb{Z}/(2) $$ be the $A$-module as above. Applying $\operatorname{Hom}_{A}(-,M)$ to the above resolution gives a complex $$ M \stackrel{f_{1}^{\ast}}{\to} M^{\oplus 2} \stackrel{f_{2}^{\ast}}{\to} M \to 0 \to \dotsb $$ of $A$-modules, and taking cohomology at the $i$th cohomological degree gives $\mathrm{H}^{i}(G,M)$. In particular we have $$ \mathrm{H}^{2}(G, M) \simeq \operatorname{coker}(M^{\oplus 2} \stackrel{f_{2}^{\ast}}{\to} M) $$ where the map $f_{2}^{\ast} : M^{\oplus 2} \to M$ sends $(m_{1},m_{2}) \mapsto (t_{2}-1)m_{1} - (t_{1}-1)m_{2}$. Say $m_{i} \in M$ is of the form $(n_{i,1},n_{i,2})$ with $n_{i,\ell} \in \mathbb{Z}/(2)$. Then $\operatorname{im} f_{2}^{\ast}$ consists of the subgroup of $M$ generated by elements of the form $$ (n_{1,2}-n_{1,1} , n_{1,1}-n_{1,2}) - (n_{2,2}-n_{2,1} , n_{2,1}-n_{2,2}) $$ for $n_{i,\ell} \in \mathbb{Z}/(2) = \{0,1\}$, in other words $\{(0,0),(1,1)\}$.

One can generalize this to compute group cohomology for the group $G = \mathbb{Z}^{\oplus n}$ for any positive integer $n$, the point being that $\{t_{1}-1 , \dotsc , t_{n}-1\}$ is a regular sequence on $A := \mathbb{Z}[t_{1}^{\pm} , \dotsc , t_{n}^{\pm}]$ so that the Koszul complex gives a resolution of $\mathbb{Z}$ by free $A$-modules as above.
