Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions lib/recognition_new.gi
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ InstallGlobalFunction( ClassicalForms_PossibleScalarsSesquilinear,
##
InstallGlobalFunction( ClassicalForms_GeneratorsWithBetterScalarsSesquilinear,
function( grp, frob )
local tries, gens, field, m1, a1, new, i, scalars, root, improvegenerator, res, newgens, champion, len, qq, q;
local tries, gens, field, m1, a1, new, i, scalars, improvegenerator, res, newgens, champion, len, qq, q;

# the aim of this function is to replace the matrix m1 by a
# matrix that has as few solutions to the scalar equation
Expand All @@ -114,7 +114,7 @@ InstallGlobalFunction( ClassicalForms_GeneratorsWithBetterScalarsSesquilinear,
# if it is possible to change the matrix to multiple that preserves up to scalar one, this is achieved.

improvegenerator := function(m1,i,count,len)
local a1, s, j, k, scalars, root; #I think root should be declare locally here!
local a1, s, j, k, scalars;

a1 := ClassicalForms_PossibleScalarsSesquilinear(field,m1,frob);
#Recall that the scalars satisfy the equation lambda^a[1] = a[2]
Expand All @@ -123,15 +123,11 @@ InstallGlobalFunction( ClassicalForms_GeneratorsWithBetterScalarsSesquilinear,
fi;

if IsList(a1) then
root := NthRoot(field,a1[2],a1[1]);
if a1[1] = 1 then # the matrix m1 has scalar a1[2]
#if a1[2] has a square root, we can replace m1 with m1*sqrt{a1[2]};
if LogFFE(a1[2],PrimitiveRoot(field)) mod 2 = 0 then
return [m1/NthRoot(field,a1[2],2),[One(field)]];
if LogFFE(a1[2],PrimitiveRoot(field)) mod (q+1) = 0 then
return [m1/NthRoot(field,a1[2],q+1),[One(field)]];
fi;
return [m1,[a1[2]]]; #originally, the three lines above this return were not there. Those three lines make sure scalar becomes 1 if possible (basicaly if there is a sqrt).
elif LogFFE(root,PrimitiveRoot(field)) mod (q+1) = 0 then
return [m1/NthRoot(field,root,q+1),[One(field)]]; #either frob = id, then q+1 = 2, or frob is not trivial, then we take q+1-st root. In both cases, modify m1 to a matrix that has scalar one.
return [m1,[a1[2]]]; #originally, the three lines above this return were not there. Those three lines make sure scalar becomes 1 if possible (basically if there is a q+1-st root).
else
scalars := AsList(Group(NthRoot(field,a1[2],a1[1]))); # add all possible scalars for m1
if count = 0 then
Expand Down
81 changes: 81 additions & 0 deletions tst/adv/test_pres_sesforms3.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
gap> START_TEST("Forms: test_pres_sesforms3.tst");

# Regression tests for issue #83:
# examples where sesquilinear forms preserved up to scalars
# were not detected due to scalar normalization issues.
gap> grp := Group([
> [ [ Z(3^2)^3, Z(3^2)^6, Z(3^2)^7 ],
> [ Z(3^2)^7, Z(3^2)^2, Z(3)^0 ],
> [ Z(3^2)^7, Z(3^2)^7, 0*Z(3) ] ],
> [ [ 0*Z(3), 0*Z(3), Z(3) ],
> [ Z(3^2)^7, Z(3)^0, Z(3^2)^7 ],
> [ Z(3), Z(3^2), Z(3) ] ],
> [ [ Z(3^2), 0*Z(3), 0*Z(3) ],
> [ 0*Z(3), Z(3^2), 0*Z(3) ],
> [ 0*Z(3), 0*Z(3), Z(3^2) ] ]
> ]);;
gap> forms := PreservedSesquilinearForms(grp);
[ < hermitian form > ]
gap> TestPreservedSesquilinearForms(grp, forms);
true
gap> grp := Group(Z(3)^0*[
> [ [ 0, 1, 2, 2, 0, 1, 1, 0 ],
> [ 0, 1, 0, 2, 0, 1, 0, 2 ],
> [ 1, 2, 2, 0, 0, 0, 2, 2 ],
> [ 0, 0, 0, 1, 0, 0, 0, 0 ],
> [ 0, 0, 0, 0, 1, 0, 1, 1 ],
> [ 0, 0, 0, 0, 0, 0, 0, 1 ],
> [ 0, 0, 0, 0, 0, 1, 1, 2 ],
> [ 0, 0, 0, 0, 0, 2, 0, 2 ] ],
> [ [ 2, 1, 0, 2, 2, 2, 0, 1 ],
> [ 0, 0, 0, 1,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 0, 0, 1, 0, 0, 0, 0 ],
> [ 0, 0, 0, 0, 0, 0, 1, 0 ],
> [ 2, 2, 3, 1, 3, 3, 2, 4 ],
> [ 3, 0, 0, 0, 0, 0, 0, 0 ],
> [ 1, 0, 2, 1, 0, 3, 2, 1 ],
> [ 1, 3, 2, 4, 3, 1, 2, 2 ],
> [ 0, 3, 0, 0, 0, 0, 0, 0 ],
> [ 0, 1, 3, 0, 3, 1, 0, 1 ] ]
> ]);;
gap> forms := PreservedSesquilinearForms(grp);
[ < bilinear form > ]
gap> TestPreservedSesquilinearForms(grp, forms);
true
gap> STOP_TEST("test_pres_sesforms3.tst", 10000 );
Loading