From 2f99f40a907bd2cf51d43a3413df240655100875 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Tue, 23 Mar 2021 21:49:39 +0100 Subject: [PATCH] added the group constructors `PGO` and `PSO` and changed `POmega` to use the same mechanism --- doc/ref/grplib.xml | 2 + grp/classic.gd | 155 +++++++++++++++++++++++------ tst/testinstall/grp/classic-PG.tst | 50 +++++++++- tst/testinstall/grp/classic-PS.tst | 21 +++- 4 files changed, 195 insertions(+), 33 deletions(-) diff --git a/doc/ref/grplib.xml b/doc/ref/grplib.xml index 6fbc9e766b..383dd466e7 100644 --- a/doc/ref/grplib.xml +++ b/doc/ref/grplib.xml @@ -147,6 +147,8 @@ gap> AsSSortedList(DihedralGroup(12:generatorNames:=["a","b","c"])); <#Include Label="ProjectiveGeneralUnitaryGroup"> <#Include Label="ProjectiveSpecialUnitaryGroup"> <#Include Label="ProjectiveSymplecticGroup"> +<#Include Label="ProjectiveGeneralOrthogonalGroup"> +<#Include Label="ProjectiveSpecialOrthogonalGroup"> <#Include Label="ProjectiveOmega"> <#Include Label="ProjectiveGeneralSemilinearGroup"> <#Include Label="ProjectiveSpecialSemilinearGroup"> diff --git a/grp/classic.gd b/grp/classic.gd index e015025ce0..dfe8234a9c 100644 --- a/grp/classic.gd +++ b/grp/classic.gd @@ -993,7 +993,125 @@ DeclareSynonym( "PSp", PSP ); ############################################################################# ## -#O ProjectiveOmegaCons( , , , ) +#F DECLARE_PROJECTIVE_ORTHOGONAL_GROUPS_OPERATION( ... ) +## +BindGlobal("DECLARE_PROJECTIVE_ORTHOGONAL_GROUPS_OPERATION", + # ( , , ) + function( nam, abbr, szf ) + local pnam,cons,opr; + + opr:= VALUE_GLOBAL( nam ); + pnam:= Concatenation( "Projective", nam ); + cons:= NewConstructor( Concatenation( pnam, "Cons" ), + [ IsGroup, IsInt, IsInt, IsInt ] ); + BindGlobal( Concatenation( pnam, "Cons" ), cons ); + BindGlobal( pnam, function( arg ) + if Length( arg ) = 2 then + return cons( IsPermGroup, 0, arg[1], arg[2] ); + elif Length( arg ) = 3 and ForAll( arg, IsInt ) then + return cons( IsPermGroup, arg[1], arg[2], arg[3] ); + elif IsOperation( arg[1] ) then + if Length( arg ) = 3 then + return cons( arg[1], 0, arg[2], arg[3] ); + elif Length( arg ) = 4 then + return cons( arg[1], arg[2], arg[3], arg[4] ); + fi; + fi; + Error( "usage: ", pnam, "( [, ][, ], )" ); + end ); + + DeclareSynonym( Concatenation( "P", abbr ), VALUE_GLOBAL( pnam ) ); + + # Install a method to get the permutation action on lines. + InstallMethod( cons, "action on lines", + [ IsPermGroup, IsInt, IsPosInt, IsPosInt ], + function( filter, e, n, q ) + local g, p; + + g:= opr( IsMatrixGroup, e, n, q ); + p:= ProjectiveActionOnFullSpace( g, GF( q ), n ); + if szf <> fail then + SetSize( p, szf( e, n, q, g ) ); + fi; + + return p; + end ); +end ); + + +############################################################################# +## +#F ProjectiveGeneralOrthogonalGroup( [, ][, ], ) +#F PGO( [, ][, ], ) +## +## <#GAPDoc Label="ProjectiveGeneralOrthogonalGroup"> +## +## +## +## +## +## constructs a group isomorphic to the projective group +## PGO( e, d, q ) +## of GO( e, d, q ), +## modulo the centre +## (see ), +## in the category given by the filter filt. +##

+## If filt is not given it defaults to , +## and the returned group is the action on lines of the underlying vector +## space. +## +## +## <#/GAPDoc> +## +DECLARE_PROJECTIVE_ORTHOGONAL_GROUPS_OPERATION( "GeneralOrthogonalGroup", "GO", + function( e, n, q, g ) + if ( n mod 2 = 0 and ( q^(n/2) - e ) mod 2 = 0 ) or + ( n mod 2 = 1 and ( q - 1 ) mod 2 = 0 ) then + return Size( g ) / 2; + else + return Size( g ); + fi; + end ); + + +############################################################################# +## +#F ProjectiveSpecialOrthogonalGroup( [, ][, ], ) +#F PSO( [, ][, ], ) +## +## <#GAPDoc Label="ProjectiveSpecialOrthogonalGroup"> +## +## +## +## +## +## constructs a group isomorphic to the projective group +## PSO( e, d, q ) +## of SO( e, d, q ), +## modulo the centre +## (see ), +## in the category given by the filter filt. +##

+## If filt is not given it defaults to , +## and the returned group is the action on lines of the underlying vector +## space. +## +## +## <#/GAPDoc> +## +DECLARE_PROJECTIVE_ORTHOGONAL_GROUPS_OPERATION( "SpecialOrthogonalGroup", "SO", + function( e, n, q, g ) + if n mod 2 = 0 and ( q^(n/2) - e ) mod 2 = 0 then + return Size( g ) / 2; + else + return Size( g ); + fi; + end ); + + +############################################################################# +## #F ProjectiveOmega( [, ][, ], ) #F POmega( [, ][, ], ) ## @@ -1017,39 +1135,14 @@ DeclareSynonym( "PSp", PSP ); ## ## <#/GAPDoc> ## -DeclareConstructor( "ProjectiveOmegaCons", [ IsGroup, IsInt, IsInt, IsInt ] ); - -BindGlobal( "ProjectiveOmega", function( arg ) - if Length( arg ) = 2 then - return ProjectiveOmegaCons( IsPermGroup, 0, arg[1], arg[2] ); - elif Length( arg ) = 3 and IsInt( arg[1] ) then - return ProjectiveOmegaCons( IsPermGroup, arg[1], arg[2], arg[3] ); - elif Length( arg ) = 3 and IsOperation( arg[1] ) then - return ProjectiveOmegaCons( arg[1], 0, arg[2], arg[3] ); - elif IsOperation( arg[1] ) and Length( arg ) = 4 then - return ProjectiveOmegaCons( arg[1], arg[2], arg[3], arg[4] ); - fi; - Error( "usage: ProjectiveOmega( [, ][, ], )" ); - end ); - -DeclareSynonym( "POmega", ProjectiveOmega ); - -InstallMethod( ProjectiveOmegaCons, - "action on lines", - [ IsPermGroup, IsInt, IsPosInt, IsPosInt ], - function( filter, e, n, q ) - local g, p; - - g:= Omega( IsMatrixGroup, e, n, q ); - p:= ProjectiveActionOnFullSpace( g, GF( q ), n ); +DECLARE_PROJECTIVE_ORTHOGONAL_GROUPS_OPERATION( "Omega", "Omega", + function( e, n, q, g ) if n mod 2 = 0 and ( q^(n/2) - e ) mod 4 = 0 then - SetSize( p, Size( g ) / 2 ); + return Size( g ) / 2; else - SetSize( p, Size( g ) ); + return Size( g ); fi; - - return p; - end); + end ); ############################################################################# diff --git a/tst/testinstall/grp/classic-PG.tst b/tst/testinstall/grp/classic-PG.tst index 9e6583cd40..7711f271bb 100644 --- a/tst/testinstall/grp/classic-PG.tst +++ b/tst/testinstall/grp/classic-PG.tst @@ -1,5 +1,6 @@ # -# Tests for the "projective general" group constructors: PGL, POmega, PGU, PGammaL +# Tests for the "projective general" group constructors: +# PGL, PGO, POmega, PGU, PGammaL # gap> START_TEST("classic-PG.tst"); @@ -17,6 +18,24 @@ Error, usage: ProjectiveGeneralLinearGroup( [, ], ) gap> PGL(3,6); Error, usage: GeneralLinearGroup( [, ], ) +# +gap> G:= PGO( 3, 5 );; Size( G ); +120 +gap> G = PGO( 0, 3, 5 ); +true +gap> G = PGO( IsPermGroup, 3, 5 ); +true +gap> G = PGO( IsPermGroup, 0, 3, 5 ); +true +gap> G:= PGO( 1, 4, 5 );; Size( G ); +14400 +gap> G = PGO( IsPermGroup, 1, 4, 5 ); +true +gap> G:= PGO( -1, 4, 5 );; Size( G ); +15600 +gap> G = PGO( IsPermGroup, -1, 4, 5 ); +true + # gap> G := POmega(3,7); @@ -58,6 +77,35 @@ Error, sign = 0 but dimension is even gap> POmega(0,4,9); Error, sign = 0 but dimension is even +# +gap> for d in [ 1, 3, 5, 7 ] do +> for q in [ 2, 3, 4, 5 ] do +> for cons in [ PGO, PSO, POmega ] do +> G:= cons( d, q ); +> if Size( G ) <> Size( GroupByGenerators( GeneratorsOfGroup( G ), +> One( G ) ) ) then +> Error( "problem with group order for ", [ d, q ], "\n" ); +> fi; +> od; +> od; +> od; +gap> for d in [ 2, 4, 6 ] do +> for q in [ 2, 3, 4, 5 ] do +> for cons in [ PGO, PSO, POmega ] do +> G:= cons( 1, d, q ); +> if Size( G ) <> Size( GroupByGenerators( GeneratorsOfGroup( G ), +> One( G ) ) ) then +> Error( [ d, q ] ); +> fi; +> G:= cons( -1, d, q ); +> if Size( G ) <> Size( GroupByGenerators( GeneratorsOfGroup( G ), +> One( G ) ) ) then +> Error( [ d, q ] ); +> fi; +> od; +> od; +> od; + # gap> PGU(3,5); diff --git a/tst/testinstall/grp/classic-PS.tst b/tst/testinstall/grp/classic-PS.tst index 199ad1d771..4445547c96 100644 --- a/tst/testinstall/grp/classic-PS.tst +++ b/tst/testinstall/grp/classic-PS.tst @@ -1,5 +1,6 @@ # -# Tests for the "projective special" group constructors: PSL, PSU, PSp, PSigmaL +# Tests for the "projective special" group constructors: +# PSL, PSO, PSU, PSp, PSigmaL # gap> START_TEST("classic-PS.tst"); @@ -17,6 +18,24 @@ Error, usage: ProjectiveSpecialLinearGroup( [, ], ) gap> PSL(3,6); Error, usage: SpecialLinearGroup( [, ], ) +# +gap> G:= PSO( 3, 5 );; Size( G ); +120 +gap> G = PSO( 0, 3, 5 ); +true +gap> G = PSO( IsPermGroup, 3, 5 ); +true +gap> G = PSO( IsPermGroup, 0, 3, 5 ); +true +gap> G:= PSO( 1, 4, 5 );; Size( G ); +7200 +gap> G = PSO( IsPermGroup, 1, 4, 5 ); +true +gap> G:= PSO( -1, 4, 5 );; Size( G ); +7800 +gap> G = PSO( IsPermGroup, -1, 4, 5 ); +true + # gap> PSU(3,5);