Skip to content

Commit

Permalink
Fix error in RECOG.SmallHomomorphicImageProjectiveGroup (#336)
Browse files Browse the repository at this point in the history
This unexpected error was triggered by a matrix group with compressed matrices
over GF(q^k), k > 1, as generator, where the matrix entries actually all were
over the subfield GF(q). So the matrix generators were compressed over a field
that is larger than necessary. This can easily happen when considering
subgroups of a larger matrix group.

Unfortunately multiplying a compressed matrix over GF(q) by a matrix over
GF(q^k) produces an uncompressed matrix, and this then trips up the hash
functions used by orb, resulting in an unexpected error.

This issue was revealed by tests in the ClassicalMaximals package.
  • Loading branch information
fingolfin authored Jan 21, 2025
1 parent c8736e1 commit abf8316
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
17 changes: 13 additions & 4 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
This file describes changes in the recog package.

1.4.4 (2025-01-DD)
- Fix an unexpected error during recognition when trying to split
group as direct products (in `RECOG.DirectFactorsFinder`)
- Fix an unexpected error in `RECOG.SmallHomomorphicImageProjectiveGroup`
- Fix an unexpected error in the C6 recognition code (a call to
`ConvertToMatrixRep` was missing)
- Remove left-over debug message which sometimes printed "With 2" or
similar messages during recognition

1.4.3 (2024-10-16)
- Stop overriding the system library function `MTX.InvariantBilinearForm`
with an old version (this was meant to fix a bug in GAP but has been
unnecessary for a couple years, and now impedes improvements for this
function in GAP)
- Stop overriding the system library function `MTX.InvariantBilinearForm`
with an old version (this was meant to fix a bug in GAP but has been
unnecessary for a couple years, and now impedes improvements for this
function in GAP)
- Various internal and janitorial changes

1.4.2 (2022-09-27)
Expand Down
8 changes: 4 additions & 4 deletions gap/matrix/matimpr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ RECOG.IndexMaxSub := function( hm, grp, d )
sub := MTX.ProperSubmoduleBasis(hm);
sub := MutableCopyMat( sub ); # make mutable copy
# FIXME: this will be unnecessary:
ConvertToMatrixRep(sub);
ConvertToMatrixRep(sub,hm.field);
lastsub := fail;
lastorb := fail;
repeat
Expand Down Expand Up @@ -98,7 +98,7 @@ RECOG.IndexMaxSub := function( hm, grp, d )
fi;
# we try intersecting the subspaces in the orbit:
Info(InfoRecog,2,"Calculating intersections...");
f := FieldOfMatrixGroup(grp);
f := hm.field;
sp := VectorSpace(f,orb[1]);
dim := Dimension(sp);
for i in [2..Length(orb)] do
Expand All @@ -120,15 +120,15 @@ RECOG.IndexMaxSub := function( hm, grp, d )
lastorb := orb;
sub := MutableCopyMat(AsList(Basis(sp)));
# FIXME: This will vanish:
ConvertToMatrixRep(sub);
ConvertToMatrixRep(sub,hm.field);
until false;
end;

RECOG.SmallHomomorphicImageProjectiveGroup := function ( grp )

local hm, findred, ans, fld, d, i, gens;

fld := FieldOfMatrixGroup(grp);
fld := DefaultFieldOfMatrixGroup(grp);
d := DimensionOfMatrixGroup(grp);

findred := function( gens )
Expand Down
17 changes: 17 additions & 0 deletions tst/working/quick/bugfix.tst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ gap> RecogniseGroup(SL(2,5));
gap> RECOG.IsThisSL2Natural([ [ [ 0*Z(5), Z(5^2)^9 ], [ Z(5^2)^3, 0*Z(5) ] ], [ [ Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^3 ] ] ], GF(5^2));
false

# Bug in RECOG.SmallHomomorphicImageProjectiveGroup triggered by given matrix
# group generated by compressed matrices over GF(q^k), k > 1, where the matrix
# entries actually all were over the subfield GF(q).
#
# Unfortunately multiplying a compressed matrix over GF(q) by a matrix over
# GF(q^k) produces an uncompressed matrix, and this then trips up the hash
# functions used by orb, resulting in an unexpected error.
gap> gens:=Z(3)^0*[ # all generators over GF(3)
> [[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1]],
> [[0,0,0,0,2],[0,1,0,0,0],[0,0,2,0,0],[0,0,0,1,0],[2,0,0,0,0]],
> [[1,1,0,0,0],[2,0,0,0,0],[1,1,1,0,0],[2,2,0,1,2],[0,1,2,1,0]],
> [[1,1,1,1,0],[1,1,1,0,1],[1,1,0,1,1],[1,0,1,1,1],[0,1,1,1,1]],
> ];;
gap> G:=Group(List(gens, g -> ImmutableMatrix(GF(9), g)));; # ... but compress generators over GF(9)
gap> RECOG.SmallHomomorphicImageProjectiveGroup(G); # this call used to raise an error
fail

#
gap> SetInfoLevel(InfoRecog, oldInfoLevel);
gap> STOP_TEST("bugfix.tst");

0 comments on commit abf8316

Please sign in to comment.