#####################################################
#####################################################
BogomolovMultiplierModP:=function(G,p)
local R, MaxAbelian, maxab, homs, HOMS, H, gensH, newh, Kers,
InducedHom, h, iso;
#####Some easy cases##################
if IsAbelian(G) then return []; fi;
if not IsPGroup(G) then
if GroupCohomology(G,2,2)=[] then return []; fi;
fi;
######################################
R:=ResolutionGenericGroup(G,3);
#####################################################
MaxAbelian:=function(G)
local AbSubs, A, x, g, bool;
##Probably a clumsy method for finding all maximal abelian subgroups
##
AbSubs:=ConjugacyClassesSubgroups(G);
AbSubs:=Filtered(AbSubs,x->IsAbelian(Representative(x)));
AbSubs:=List(AbSubs,a->Representative(a));
AbSubs:=List(AbSubs,b->ConjugateSubgroups(G,b));
AbSubs:=Concatenation(AbSubs);
AbSubs:=Filtered(AbSubs,x->Order(x)>1);
A:=[];
for g in AbSubs do
bool:=true;
for x in AbSubs do
if not g=x and IsSubgroup(x,g) then bool:=false; break;fi;
od;
if bool then Add(A,g); fi;
od;
return A;
end;
####################################################
maxab:=MaxAbelian(G);
####################################################
InducedHom:=function(R,A)
local G, S, f;
G:=R!.group;
S:=ResolutionFiniteGroup(A,3);
f:=GroupHomomorphismByFunction(A,G,x->x);
f:=EquivariantChainMap(S,R,f);
f:=HomToIntegersModP(f,p);
f:=Cohomology(f,2);
return f;
end;
####################################################
homs:=List(maxab,A->InducedHom(R,A));
HOMS:=[];
H:=Source(homs[1]);
#iso:=IsomorphismPcGroup(H);
iso:=NqEpimorphismNilpotentQuotient(H,1);
gensH:=List(GeneratorsOfGroup(H),x -> Image(iso,x));
H:=Range(iso);
for h in homs do
newh:=GroupHomomorphismByImagesNC(H,Range(h),gensH, h!.MappingGeneratorsImages[2]);
Add(HOMS,newh);
od;
Kers:=List(HOMS,Kernel);
return AbelianInvariants(Intersection(Kers));
end;
#####################################################
#####################################################