Skip to content

Commit e5b4f36

Browse files
committed
reworked the proposal
Now the declaration of `CSp` and those methods for it that do not involve forms will be added to the GAP library. Also, the implementation of `Sp` in GAP admits already an optional filter that defines the representation of the matrices, and the delegation between its methods has been changed as for `CSp` (the methods with argument `q` delegate to those with argument `GF(q)`, not the other way round). For this pull request, this means that - the files involving code and tests involving `CSp` are read only if GAP provides the variable `CSp`, - the delegation between methods for `Sp` that are provided by the Forms package has been changed as well, - the methods in the Forms package now support a `baseDomain` component in the attributes describing invariant forms, - calls of `FieldOfMatrixGroup` are replaced by access to the new `baseDomain` component of form records where applicable (for backwards compatibility with older GAP versions, the helper function `Forms_FieldOfDefinition` calls `FieldOfMatrixGroup` if no `baseDomain` component is available).
1 parent 602c828 commit e5b4f36

File tree

8 files changed

+167
-455
lines changed

8 files changed

+167
-455
lines changed

init.g

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@
1414

1515
ReadPackage("forms","lib/forms.gd");
1616
ReadPackage("forms","lib/recognition.gd");
17-
ReadPackage("forms","lib/conformal.gd");
17+
18+
if IsBound( ConformalSymplecticGroup ) then
19+
ReadPackage("forms","lib/conformal.gd");
20+
fi;

lib/classic.gi

Lines changed: 68 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ if not IsBound(IsMatrixOrMatrixObj) then
1212
BindGlobal("IsMatrixOrMatrixObj", IsMatrixObj);
1313
fi;
1414

15+
# Compatibility with GAP < 4.15
16+
BindGlobal( "Forms_FieldOfDefinition",
17+
function( G, form_record )
18+
if IsBound( form_record.baseDomain ) then
19+
return form_record.baseDomain;
20+
else
21+
# perhaps smaller than the intended field
22+
return FieldOfMatrixGroup( G );
23+
fi;
24+
end );
25+
1526
# We cannot use the function 'IsEqualProjective' from the recog package
1627
# because the matrices that describe forms can have zero rows.
1728
BindGlobal( "_IsEqualModScalars",
@@ -54,7 +65,7 @@ BindGlobal("Forms_OrthogonalGroup",
5465
return g;
5566
fi;
5667

57-
gf:= FieldOfMatrixGroup( g );
68+
gf:= Forms_FieldOfDefinition( g, InvariantQuadraticForm( g ) );
5869
d:= DimensionOfMatrixGroup( g );
5970

6071
# Compute a base change matrix.
@@ -80,14 +91,15 @@ BindGlobal("Forms_OrthogonalGroup",
8091
SetName( gg, Name( g ) );
8192
fi;
8293

83-
SetInvariantQuadraticForm( gg, rec( matrix:= form!.matrix ) );
94+
SetInvariantQuadraticForm( gg,
95+
rec( matrix:= form!.matrix, baseDomain:= gf ) );
8496
if HasIsFullSubgroupGLorSLRespectingQuadraticForm( g ) then
8597
SetIsFullSubgroupGLorSLRespectingQuadraticForm( gg,
8698
IsFullSubgroupGLorSLRespectingQuadraticForm( g ) );
8799
fi;
88100

89101
mat:= matinv * InvariantBilinearForm( g ).matrix * TransposedMat( matinv );
90-
SetInvariantBilinearForm( gg, rec( matrix:= mat ) );
102+
SetInvariantBilinearForm( gg, rec( matrix:= mat, baseDomain:= gf ) );
91103
if Characteristic( gf ) <> 2 and
92104
HasIsFullSubgroupGLorSLRespectingBilinearForm( g ) then
93105
SetIsFullSubgroupGLorSLRespectingBilinearForm( gg,
@@ -138,7 +150,7 @@ InstallMethod( GeneralOrthogonalGroupCons,
138150
{ filt, G } -> GeneralOrthogonalGroupCons( filt,
139151
QuadraticFormByMatrix(
140152
InvariantQuadraticForm( G ).matrix,
141-
FieldOfMatrixGroup( G ) ) ) );
153+
Forms_FieldOfDefinition( G, InvariantQuadraticForm( G ) ) ) ) );
142154

143155
InstallMethod( GeneralOrthogonalGroupCons,
144156
"matrix group for form",
@@ -278,7 +290,7 @@ InstallMethod( SpecialOrthogonalGroupCons,
278290
{ filt, G } -> SpecialOrthogonalGroupCons( filt,
279291
QuadraticFormByMatrix(
280292
InvariantQuadraticForm( G ).matrix,
281-
FieldOfMatrixGroup( G ) ) ) );
293+
Forms_FieldOfDefinition( G, InvariantQuadraticForm( G ) ) ) ) );
282294

283295
InstallMethod( SpecialOrthogonalGroupCons,
284296
"matrix group for form",
@@ -455,7 +467,7 @@ InstallMethod( OmegaCons,
455467
{ filt, G } -> OmegaCons( filt,
456468
QuadraticFormByMatrix(
457469
InvariantQuadraticForm( G ).matrix,
458-
FieldOfMatrixGroup( G ) ) ) );
470+
Forms_FieldOfDefinition( G, InvariantQuadraticForm( G ) ) ) ) );
459471

460472
InstallMethod( OmegaCons,
461473
"matrix group for form",
@@ -563,7 +575,7 @@ InstallMethod( GeneralUnitaryGroupCons,
563575
{ filt, G } -> GeneralUnitaryGroupCons( filt,
564576
HermitianFormByMatrix(
565577
InvariantSesquilinearForm( G ).matrix,
566-
FieldOfMatrixGroup( G ) ) ) );
578+
Forms_FieldOfDefinition( G, InvariantSesquilinearForm( G ) ) ) ) );
567579

568580
InstallMethod( GeneralUnitaryGroupCons,
569581
"matrix group for form",
@@ -619,7 +631,9 @@ InstallMethod( GeneralUnitaryGroupCons,
619631
IsPosInt,
620632
IsHermitianForm ],
621633
function( filt, d, q, form )
622-
local g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
634+
local F, g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
635+
636+
F:= GF(q^2);
623637

624638
# Create the default generators and form.
625639
g:= GeneralUnitaryGroupCons( filt, d, q );
@@ -632,7 +646,7 @@ InstallMethod( GeneralUnitaryGroupCons,
632646

633647
# Compute a base change matrix.
634648
# (Check that the canonical forms are equal.)
635-
wanted:= HermitianFormByMatrix( stored, GF(q^2) );
649+
wanted:= HermitianFormByMatrix( stored, F );
636650
mat1:= BaseChangeToCanonical( form );
637651
mat2:= BaseChangeToCanonical( wanted );
638652
if mat1 * form!.matrix * TransposedFrobeniusMat( mat1, q ) <>
@@ -652,7 +666,8 @@ InstallMethod( GeneralUnitaryGroupCons,
652666
SetName( gg, Name( g ) );
653667
fi;
654668

655-
SetInvariantSesquilinearForm( gg, rec( matrix:= form!.matrix ) );
669+
SetInvariantSesquilinearForm( gg,
670+
rec( matrix:= form!.matrix, baseDomain:= F ) );
656671
if HasIsFullSubgroupGLorSLRespectingSesquilinearForm( g ) then
657672
SetIsFullSubgroupGLorSLRespectingSesquilinearForm( gg,
658673
IsFullSubgroupGLorSLRespectingSesquilinearForm( g ) );
@@ -708,7 +723,7 @@ InstallMethod( SpecialUnitaryGroupCons,
708723
{ filt, G } -> SpecialUnitaryGroupCons( filt,
709724
HermitianFormByMatrix(
710725
InvariantSesquilinearForm( G ).matrix,
711-
FieldOfMatrixGroup( G ) ) ) );
726+
Forms_FieldOfDefinition( G, InvariantSesquilinearForm( G ) ) ) ) );
712727

713728
InstallMethod( SpecialUnitaryGroupCons,
714729
"matrix group for form",
@@ -748,7 +763,9 @@ InstallMethod( SpecialUnitaryGroupCons,
748763
IsPosInt,
749764
IsHermitianForm ],
750765
function( filt, d, q, form )
751-
local g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
766+
local F, g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
767+
768+
F:= GF(q^2);
752769

753770
# Create the default generators and form.
754771
g:= SpecialUnitaryGroupCons( filt, d, q );
@@ -761,7 +778,7 @@ InstallMethod( SpecialUnitaryGroupCons,
761778

762779
# Compute a base change matrix.
763780
# (Check that the canonical forms are equal.)
764-
wanted:= HermitianFormByMatrix( stored, GF(q^2) );
781+
wanted:= HermitianFormByMatrix( stored, F );
765782
mat1:= BaseChangeToCanonical( form );
766783
mat2:= BaseChangeToCanonical( wanted );
767784
if mat1 * form!.matrix * TransposedFrobeniusMat( mat1, q ) <>
@@ -781,7 +798,8 @@ InstallMethod( SpecialUnitaryGroupCons,
781798
SetName( gg, Name( g ) );
782799
fi;
783800

784-
SetInvariantSesquilinearForm( gg, rec( matrix:= form!.matrix ) );
801+
SetInvariantSesquilinearForm( gg,
802+
rec( matrix:= form!.matrix, baseDomain:= F ) );
785803
if HasIsFullSubgroupGLorSLRespectingSesquilinearForm( g ) then
786804
SetIsFullSubgroupGLorSLRespectingSesquilinearForm( gg,
787805
IsFullSubgroupGLorSLRespectingSesquilinearForm( g ) );
@@ -794,8 +812,8 @@ end );
794812
#############################################################################
795813
##
796814
#O SymplecticGroupCons( <filter>, <form> )
797-
#O SymplecticGroupCons( <filter>, <d>, <q>, <form> )
798815
#O SymplecticGroupCons( <filter>, <d>, <R>, <form> )
816+
#O SymplecticGroupCons( <filter>, <d>, <q>, <form> )
799817
##
800818
## 'SymplecticGroup' is a plain function that is defined in the GAP
801819
## library.
@@ -807,10 +825,10 @@ Perform(
807825
[ IsMatrixOrMatrixObj, IsBilinearForm, IsGroup and HasInvariantBilinearForm ],
808826
function( obj )
809827
DeclareConstructor( "SymplecticGroupCons", [ IsGroup, obj ] );
810-
DeclareConstructor( "SymplecticGroupCons",
811-
[ IsGroup, IsPosInt, IsPosInt, obj ] );
812828
DeclareConstructor( "SymplecticGroupCons",
813829
[ IsGroup, IsPosInt, IsRing, obj ] );
830+
DeclareConstructor( "SymplecticGroupCons",
831+
[ IsGroup, IsPosInt, IsPosInt, obj ] );
814832
end );
815833

816834

@@ -830,14 +848,14 @@ InstallMethod( SymplecticGroupCons,
830848
{ filt, G } -> SymplecticGroupCons( filt,
831849
BilinearFormByMatrix(
832850
InvariantBilinearForm( G ).matrix,
833-
FieldOfMatrixGroup( G ) ) ) );
851+
Forms_FieldOfDefinition( G, InvariantBilinearForm( G ) ) ) ) );
834852

835853
InstallMethod( SymplecticGroupCons,
836854
"matrix group for form",
837855
[ IsMatrixGroup and IsFinite, IsBilinearForm ],
838856
{ filt, form } -> SymplecticGroupCons( filt,
839857
NumberRows( form!.matrix ),
840-
Size( form!.basefield ), form ) );
858+
form!.basefield, form ) );
841859

842860

843861
#############################################################################
@@ -850,7 +868,7 @@ InstallMethod( SymplecticGroupCons,
850868
IsPosInt,
851869
IsPosInt,
852870
IsMatrixOrMatrixObj ],
853-
{ filt, d, q, mat } -> SymplecticGroupCons( filt, d, q,
871+
{ filt, d, q, mat } -> SymplecticGroupCons( filt, d, GF(q),
854872
BilinearFormByMatrix( mat, GF(q) ) ) );
855873

856874
InstallMethod( SymplecticGroupCons,
@@ -859,7 +877,7 @@ InstallMethod( SymplecticGroupCons,
859877
IsPosInt,
860878
IsPosInt,
861879
IsGroup and HasInvariantBilinearForm ],
862-
{ filt, d, q, G } -> SymplecticGroupCons( filt, d, q,
880+
{ filt, d, q, G } -> SymplecticGroupCons( filt, d, GF(q),
863881
BilinearFormByMatrix(
864882
InvariantBilinearForm( G ).matrix, GF(q) ) ) );
865883

@@ -869,24 +887,41 @@ InstallMethod( SymplecticGroupCons,
869887
IsPosInt,
870888
IsPosInt,
871889
IsBilinearForm ],
872-
function( filt, d, q, form )
873-
local g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
890+
{ filt, d, q, form } -> SymplecticGroupCons( filt, d, GF(q), form ) );
891+
892+
893+
#############################################################################
894+
##
895+
#M SymplecticGroupCons( <filt>, <d>, <F>, <form> )
896+
##
897+
InstallMethod( SymplecticGroupCons,
898+
"matrix group for dimension, finite field, form",
899+
[ IsMatrixGroup and IsFinite,
900+
IsPosInt,
901+
IsField and IsFinite,
902+
IsBilinearForm ],
903+
function( filt, d, F, form )
904+
local q, g, stored, form_matrix, wanted, mat1, mat2, mat, matinv, gens, gg;
874905

875906
# Create the default generators and form.
876-
g:= SymplecticGroupCons( filt, d, q );
907+
q:= Size( F );
908+
g:= SymplecticGroupCons( filt, d, F );
877909
stored:= InvariantBilinearForm( g ).matrix;
878910

879911
# If the prescribed form fits then just return.
880-
if stored = form!.matrix then
912+
form_matrix:= Matrix( form!.matrix, stored );
913+
#T This 'Matrix' call should become unnecessary.
914+
#T For that, the functions used below have to support 'IsMatrixObj' arguments.
915+
if stored = form_matrix then
881916
return g;
882917
fi;
883918

884919
# Compute a base change matrix.
885920
# (Check that the canonical forms are equal.)
886-
wanted:= BilinearFormByMatrix( stored, GF(q) );
887-
mat1:= BaseChangeToCanonical( form );
888-
mat2:= BaseChangeToCanonical( wanted );
889-
if mat1 * form!.matrix * TransposedMat( mat1 ) <>
921+
wanted:= BilinearFormByMatrix( stored, F );
922+
mat1:= Matrix( BaseChangeToCanonical( form ), stored );
923+
mat2:= Matrix( BaseChangeToCanonical( wanted ), stored );
924+
if mat1 * form_matrix * TransposedMat( mat1 ) <>
890925
mat2 * stored * TransposedMat( mat2 ) then
891926
Error( "canonical forms of <form> and <wanted> differ" );
892927
fi;
@@ -903,7 +938,8 @@ InstallMethod( SymplecticGroupCons,
903938
SetName( gg, Name( g ) );
904939
fi;
905940

906-
SetInvariantBilinearForm( gg, rec( matrix:= form!.matrix ) );
941+
SetInvariantBilinearForm( gg,
942+
rec( matrix:= form_matrix, baseDomain:= F ) );
907943
if HasIsFullSubgroupGLorSLRespectingBilinearForm( g ) then
908944
SetIsFullSubgroupGLorSLRespectingBilinearForm( gg,
909945
IsFullSubgroupGLorSLRespectingBilinearForm( g ) );
@@ -912,18 +948,13 @@ InstallMethod( SymplecticGroupCons,
912948
return gg;
913949
end );
914950

915-
916-
#############################################################################
917-
##
918-
#M SymplecticGroupCons( <filt>, <d>, <R>, <form> )
919-
##
920951
InstallMethod( SymplecticGroupCons,
921952
"matrix group for dimension, finite field, matrix of form",
922953
[ IsMatrixGroup and IsFinite,
923954
IsPosInt,
924955
IsField and IsFinite,
925956
IsMatrixOrMatrixObj ],
926-
{ filt, d, F, form } -> SymplecticGroupCons( filt, d, Size( F ),
957+
{ filt, d, F, form } -> SymplecticGroupCons( filt, d, F,
927958
BilinearFormByMatrix( form, F ) ) );
928959

929960
InstallMethod( SymplecticGroupCons,
@@ -932,14 +963,6 @@ InstallMethod( SymplecticGroupCons,
932963
IsPosInt,
933964
IsField and IsFinite,
934965
IsGroup and HasInvariantBilinearForm ],
935-
{ filt, d, F, G } -> SymplecticGroupCons( filt, d, Size( F ),
966+
{ filt, d, F, G } -> SymplecticGroupCons( filt, d, F,
936967
BilinearFormByMatrix(
937968
InvariantBilinearForm( G ).matrix, F ) ) );
938-
939-
InstallMethod( SymplecticGroupCons,
940-
"matrix group for dimension, finite field, form",
941-
[ IsMatrixGroup and IsFinite,
942-
IsPosInt,
943-
IsField and IsFinite,
944-
IsBilinearForm ],
945-
{ filt, d, F, form } -> SymplecticGroupCons( filt, d, Size( F ), form ) );

0 commit comments

Comments
 (0)