diff --git a/lib/recognition_new.gi b/lib/recognition_new.gi index 5fb035e..e91f7c7 100644 --- a/lib/recognition_new.gi +++ b/lib/recognition_new.gi @@ -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 diff --git a/tst/adv/test_pres_sesforms3.tst b/tst/adv/test_pres_sesforms3.tst new file mode 100644 index 0000000..4509298 --- /dev/null +++ b/tst/adv/test_pres_sesforms3.tst @@ -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, 0, 2, 2, 1 ], +> [ 1, 2, 0, 0, 1, 0, 2, 2 ], +> [ 0, 0, 0, 1, 0, 1, 2, 1 ], +> [ 1, 0, 2, 1, 1, 1, 0, 0 ], +> [ 0, 1, 0, 2, 1, 1, 1, 1 ], +> [ 1, 2, 1, 0, 0, 0, 2, 2 ], +> [ 0, 1, 0, 1, 1, 1, 2, 2 ] ], +> [ [ 0, 2, 0, 1, 1, 2, 1, 0 ], +> [ 2, 0, 1, 2, 2, 1, 0, 2 ], +> [ 2, 2, 0, 0, 0, 0, 2, 1 ], +> [ 1, 1, 1, 1, 0, 0, 1, 2 ], +> [ 1, 1, 2, 0, 2, 0, 1, 2 ], +> [ 0, 2, 0, 1, 2, 0, 2, 0 ], +> [ 1, 0, 1, 2, 2, 1, 0, 1 ], +> [ 0, 2, 0, 2, 2, 1, 1, 0 ] ] +> ]);; +gap> forms := PreservedSesquilinearForms(grp); +[ < bilinear 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 );