Skip to content
Open
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
9 changes: 3 additions & 6 deletions lib/recognition_new.gi
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,10 @@ InstallGlobalFunction( ClassicalForms_GeneratorsWithBetterScalarsSesquilinear,
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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ilinear form > ]
gap> TestPreservedSesquilinearForms(grp, forms);
true
gap> grp := Group(Z(5)^0*[
> [ [ 0, 1, 0, 0, 0, 0, 0, 0 ],
> [ 0, 0, 0, 0, 1, 0, 0, 0 ],
> [ 0, 0, 0, 0, 0, 0, 0, 1 ],
> [ 2, 3, 4, 3, 1, 3, 2, 4 ],
> [ 1, 4, 0, 0, 1, 0, 0, 0 ],
> [ 0, 2, 2, 2, 4, 4, 2, 1 ],
> [ 2, 3, 4, 2, 1, 3, 3, 4 ],
> [ 2, 2, 3, 0, 1, 0, 0, 3 ] ],
> [ [ 0, 0, 1, 0, 0, 0, 0, 0 ],
> [ 0, 0, 0, 0, 0, 1, 0, 0 ],
> [ 2, 4, 0, 3, 2, 1, 2, 2 ],
> [ 2, 4, 0, 2, 4, 4, 4, 4 ],
> [ 4, 4, 1, 0, 1, 0, 3, 2 ],
> [ 1, 1, 2, 3, 2, 4, 1, 3 ],
> [ 3, 2, 0, 3, 1, 4, 1, 4 ],
> [ 3, 3, 1, 4, 0, 3, 4, 3 ] ],
> [ [ 0, 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 );