Skip to content

Commit

Permalink
Fix Centre for pc groups giving wrong results
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Sep 9, 2022
1 parent fa8d50a commit 7a04992
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
34 changes: 6 additions & 28 deletions lib/grppcatr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -717,37 +717,15 @@ end);
#F NextStepCentralizer( <gens>, <cent>, <pcgsF>, <field> )
##
NextStepCentralizer := function( gens, cent, pcgsF, field )
local g, newgens, matlist, notcentral, h, comm, null, j, elm;
local g, matlist, null;

for g in gens do
if Length( cent ) = 0 then return []; fi;

newgens := [];
matlist := [];
notcentral := [];
for h in cent do
comm := ExponentsOfPcElement( pcgsF, Comm( h, g ) ) * One(field);
if comm = Zero( field ) * comm then
Add( newgens, h );
else
Add( notcentral, h );
Add( matlist, comm );
fi;
od;

if Length( matlist ) > 0 then

# get nullspace
null := TriangulizedNullspaceMat( matlist );

# calculate elements corresponding to null
for j in [1..Length(null)] do
elm := PcElementByExponentsNC( pcgsF, notcentral, null[j] );
Add( newgens, elm );
od;
fi;
cent := newgens;
matlist := List( cent, x -> ExponentsOfPcElement(pcgsF, Comm(x,g)));
null := TriangulizedNullspaceMat(matlist*One(field));
cent := List( null, x -> PcElementByExponentsNC(pcgsF, cent, x));
od;

return cent;
end;

Expand Down
6 changes: 6 additions & 0 deletions tst/testbugfix/2022-09-07-Centre.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Centre for PcGroups sometimes returned wrong results.
# See https://github.com/gap-system/gap/issues/3940
#
gap> G:=SmallGroup(2^9,261648);;
gap> Size(Center(G)); # This used to return 4
8

0 comments on commit 7a04992

Please sign in to comment.