Computing Group Extension and $2$-cocycle in GAP

It is a well known theorem that $2$-cocycle are in bijection with Group extensions.

Suppose if I have group extension, say, for example, $$1\rightarrow C_2 \rightarrow D_{16}\rightarrow D_8\rightarrow 1 $$

Is there a way to find $2$-cocycle corresponding to this extension using GAP?


There are two implementations. One specific for solvable group (using TwoCohomology) and a newer one that also works for non-solvable groups (but whose implementation will work for solvable groups only in the next release). The generic algorithm used is describe in section 7 of the paper [Dietrich, H, Hulpke, A., Universal covers of finite groups. J. Algebra 569 (2021), 681–712].

Note that in either case, the 2-cocycle is given as a vector whose entries correspond to a presentation of the factor group, so just looking at the entries of the vector might be less informative.

For example:

gap> g:=DihedralGroup(8);;
gap> mo:=IrreducibleModules(g,GF(2));
[ Pcgs([ f1, f2, f3 ]),
  [ rec( IsOverFiniteField := true, absolutelyIrreducible := ~[2][1],
          dimension := 1, field := GF(2),
          generators := [ <an immutable 1x1 matrix over GF2>,
              <an immutable 1x1 matrix over GF2>,
              <an immutable 1x1 matrix over GF2> ], isMTXModule := true ) ] ]
gap> g:=Group(mo[1]);;mo:=mo[2];;

Now calculating cohomology using the PC-group only code:

gap> z:=TwoCocycles(g,mo[1]);
[ [ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ],
  [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ],
  [ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ],
  [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), Z(2)^0 ] ]
gap> b:=TwoCoboundaries(g,mo[1]);
[ [ 0*Z(2), Z(2)^0, Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ] ]
gap> cohom:=Elements(VectorSpace(GF(2),BaseSteinitzVectors(z,b).factorspace));
[ <an immutable GF2 vector of length 6>, <an immutable GF2 vector of length 6>,
  <an immutable GF2 vector of length 6>, <an immutable GF2 vector of length 6>,
  <an immutable GF2 vector of length 6>, <an immutable GF2 vector of length 6>,
  <an immutable GF2 vector of length 6>, <an immutable GF2 vector of length 6>
 ]
gap> e:=List(cohom,x->Extension(g,mo[1],x));;
gap> List(e,IdGroup);
[ [ 16, 11 ], [ 16, 8 ], [ 16, 3 ], [ 16, 7 ], [ 16, 4 ], [ 16, 8 ],
  [ 16, 3 ], [ 16, 9 ] ]
gap> IdGroup(DihedralGroup(16));
[ 16, 7 ]

This is in position 4, so the vector cohom[4] corresponds to the group $D_{16}$.

For completeness, let me also describe how to use the code that can handle non-solvable groups. (Alas, it will only be able to handle solvable groups in the next (4.12) release, which I'm using here):

gap> co:=TwoCohomologyGeneric(g,mo[1]);;
gap> Display(co.cohomology); # basis
 1 . . 1 . .
 . . . . 1 .
 . . . . . 1
gap> cohom:=Elements(VectorSpace(GF(2),co.cohomology));;
gap> e:=List(cohom,x->FpGroupCocycle(co,x,true));;
gap> List(e,IdGroup);
[ [ 16, 11 ], [ 16, 4 ], [ 16, 3 ], [ 16, 3 ], [ 16, 8 ], [ 16, 8 ],
  [ 16, 7 ], [ 16, 9 ] ]

In fact one can use compatible pairs to reduce on certain isomorphisms:

gap> cp:=CompatiblePairs(g,mo[1]);
<group of size 8 with 3 generators>
gap> cohom:=CompatiblePairOrbitRepsGeneric(cp,co); # gives only 6
[ <an immutable GF2 vector of length 6>, <an immutable GF2 vector of length 6>,
  <an immutable GF2 vector of length 6>, <an immutable GF2 vector of length 6>,
  <an immutable GF2 vector of length 6>, <an immutable GF2 vector of length 6>
 ]
gap> e:=List(cohom,x->FpGroupCocycle(co,x,true));;
gap> List(e,IdGroup);
[ [ 16, 11 ], [ 16, 4 ], [ 16, 3 ], [ 16, 8 ], [ 16, 7 ], [ 16, 9 ] ]