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
4 changes: 4 additions & 0 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@

ReadPackage("forms","lib/forms.gd");
ReadPackage("forms","lib/recognition.gd");

if IsBound( ConformalSymplecticGroup ) then
ReadPackage("forms","lib/conformal.gd");
fi;
113 changes: 68 additions & 45 deletions lib/classic.gi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ if not IsBound(IsMatrixOrMatrixObj) then
BindGlobal("IsMatrixOrMatrixObj", IsMatrixObj);
fi;

# Compatibility with GAP < 4.15
BindGlobal( "Forms_FieldOfDefinition",
function( G, form_record )
if IsBound( form_record.baseDomain ) then
return form_record.baseDomain;
else
# perhaps smaller than the intended field
return FieldOfMatrixGroup( G );
fi;
end );

# We cannot use the function 'IsEqualProjective' from the recog package
# because the matrices that describe forms can have zero rows.
BindGlobal( "_IsEqualModScalars",
Expand Down Expand Up @@ -54,7 +65,7 @@ BindGlobal("Forms_OrthogonalGroup",
return g;
fi;

gf:= FieldOfMatrixGroup( g );
gf:= Forms_FieldOfDefinition( g, InvariantQuadraticForm( g ) );
d:= DimensionOfMatrixGroup( g );

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

SetInvariantQuadraticForm( gg, rec( matrix:= form!.matrix ) );
SetInvariantQuadraticForm( gg,
rec( matrix:= form!.matrix, baseDomain:= gf ) );
if HasIsFullSubgroupGLorSLRespectingQuadraticForm( g ) then
SetIsFullSubgroupGLorSLRespectingQuadraticForm( gg,
IsFullSubgroupGLorSLRespectingQuadraticForm( g ) );
fi;

mat:= matinv * InvariantBilinearForm( g ).matrix * TransposedMat( matinv );
SetInvariantBilinearForm( gg, rec( matrix:= mat ) );
SetInvariantBilinearForm( gg, rec( matrix:= mat, baseDomain:= gf ) );
if Characteristic( gf ) <> 2 and
HasIsFullSubgroupGLorSLRespectingBilinearForm( g ) then
SetIsFullSubgroupGLorSLRespectingBilinearForm( gg,
Expand Down Expand Up @@ -138,7 +150,7 @@ InstallMethod( GeneralOrthogonalGroupCons,
{ filt, G } -> GeneralOrthogonalGroupCons( filt,
QuadraticFormByMatrix(
InvariantQuadraticForm( G ).matrix,
FieldOfMatrixGroup( G ) ) ) );
Forms_FieldOfDefinition( G, InvariantQuadraticForm( G ) ) ) ) );

InstallMethod( GeneralOrthogonalGroupCons,
"matrix group for form",
Expand Down Expand Up @@ -278,7 +290,7 @@ InstallMethod( SpecialOrthogonalGroupCons,
{ filt, G } -> SpecialOrthogonalGroupCons( filt,
QuadraticFormByMatrix(
InvariantQuadraticForm( G ).matrix,
FieldOfMatrixGroup( G ) ) ) );
Forms_FieldOfDefinition( G, InvariantQuadraticForm( G ) ) ) ) );

InstallMethod( SpecialOrthogonalGroupCons,
"matrix group for form",
Expand Down Expand Up @@ -455,7 +467,7 @@ InstallMethod( OmegaCons,
{ filt, G } -> OmegaCons( filt,
QuadraticFormByMatrix(
InvariantQuadraticForm( G ).matrix,
FieldOfMatrixGroup( G ) ) ) );
Forms_FieldOfDefinition( G, InvariantQuadraticForm( G ) ) ) ) );

InstallMethod( OmegaCons,
"matrix group for form",
Expand Down Expand Up @@ -563,7 +575,7 @@ InstallMethod( GeneralUnitaryGroupCons,
{ filt, G } -> GeneralUnitaryGroupCons( filt,
HermitianFormByMatrix(
InvariantSesquilinearForm( G ).matrix,
FieldOfMatrixGroup( G ) ) ) );
Forms_FieldOfDefinition( G, InvariantSesquilinearForm( G ) ) ) ) );

InstallMethod( GeneralUnitaryGroupCons,
"matrix group for form",
Expand Down Expand Up @@ -619,7 +631,9 @@ InstallMethod( GeneralUnitaryGroupCons,
IsPosInt,
IsHermitianForm ],
function( filt, d, q, form )
local g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
local F, g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;

F:= GF(q^2);

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

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

SetInvariantSesquilinearForm( gg, rec( matrix:= form!.matrix ) );
SetInvariantSesquilinearForm( gg,
rec( matrix:= form!.matrix, baseDomain:= F ) );
if HasIsFullSubgroupGLorSLRespectingSesquilinearForm( g ) then
SetIsFullSubgroupGLorSLRespectingSesquilinearForm( gg,
IsFullSubgroupGLorSLRespectingSesquilinearForm( g ) );
Expand Down Expand Up @@ -708,7 +723,7 @@ InstallMethod( SpecialUnitaryGroupCons,
{ filt, G } -> SpecialUnitaryGroupCons( filt,
HermitianFormByMatrix(
InvariantSesquilinearForm( G ).matrix,
FieldOfMatrixGroup( G ) ) ) );
Forms_FieldOfDefinition( G, InvariantSesquilinearForm( G ) ) ) ) );

InstallMethod( SpecialUnitaryGroupCons,
"matrix group for form",
Expand Down Expand Up @@ -748,7 +763,9 @@ InstallMethod( SpecialUnitaryGroupCons,
IsPosInt,
IsHermitianForm ],
function( filt, d, q, form )
local g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
local F, g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;

F:= GF(q^2);

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

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

SetInvariantSesquilinearForm( gg, rec( matrix:= form!.matrix ) );
SetInvariantSesquilinearForm( gg,
rec( matrix:= form!.matrix, baseDomain:= F ) );
if HasIsFullSubgroupGLorSLRespectingSesquilinearForm( g ) then
SetIsFullSubgroupGLorSLRespectingSesquilinearForm( gg,
IsFullSubgroupGLorSLRespectingSesquilinearForm( g ) );
Expand All @@ -794,8 +812,8 @@ end );
#############################################################################
##
#O SymplecticGroupCons( <filter>, <form> )
#O SymplecticGroupCons( <filter>, <d>, <q>, <form> )
#O SymplecticGroupCons( <filter>, <d>, <R>, <form> )
#O SymplecticGroupCons( <filter>, <d>, <q>, <form> )
##
## 'SymplecticGroup' is a plain function that is defined in the GAP
## library.
Expand All @@ -807,10 +825,10 @@ Perform(
[ IsMatrixOrMatrixObj, IsBilinearForm, IsGroup and HasInvariantBilinearForm ],
function( obj )
DeclareConstructor( "SymplecticGroupCons", [ IsGroup, obj ] );
DeclareConstructor( "SymplecticGroupCons",
[ IsGroup, IsPosInt, IsPosInt, obj ] );
DeclareConstructor( "SymplecticGroupCons",
[ IsGroup, IsPosInt, IsRing, obj ] );
DeclareConstructor( "SymplecticGroupCons",
[ IsGroup, IsPosInt, IsPosInt, obj ] );
end );


Expand All @@ -830,14 +848,14 @@ InstallMethod( SymplecticGroupCons,
{ filt, G } -> SymplecticGroupCons( filt,
BilinearFormByMatrix(
InvariantBilinearForm( G ).matrix,
FieldOfMatrixGroup( G ) ) ) );
Forms_FieldOfDefinition( G, InvariantBilinearForm( G ) ) ) ) );

InstallMethod( SymplecticGroupCons,
"matrix group for form",
[ IsMatrixGroup and IsFinite, IsBilinearForm ],
{ filt, form } -> SymplecticGroupCons( filt,
NumberRows( form!.matrix ),
Size( form!.basefield ), form ) );
form!.basefield, form ) );


#############################################################################
Expand All @@ -850,7 +868,7 @@ InstallMethod( SymplecticGroupCons,
IsPosInt,
IsPosInt,
IsMatrixOrMatrixObj ],
{ filt, d, q, mat } -> SymplecticGroupCons( filt, d, q,
{ filt, d, q, mat } -> SymplecticGroupCons( filt, d, GF(q),
BilinearFormByMatrix( mat, GF(q) ) ) );

InstallMethod( SymplecticGroupCons,
Expand All @@ -859,7 +877,7 @@ InstallMethod( SymplecticGroupCons,
IsPosInt,
IsPosInt,
IsGroup and HasInvariantBilinearForm ],
{ filt, d, q, G } -> SymplecticGroupCons( filt, d, q,
{ filt, d, q, G } -> SymplecticGroupCons( filt, d, GF(q),
BilinearFormByMatrix(
InvariantBilinearForm( G ).matrix, GF(q) ) ) );

Expand All @@ -869,24 +887,41 @@ InstallMethod( SymplecticGroupCons,
IsPosInt,
IsPosInt,
IsBilinearForm ],
function( filt, d, q, form )
local g, stored, wanted, mat1, mat2, mat, matinv, gens, gg;
{ filt, d, q, form } -> SymplecticGroupCons( filt, d, GF(q), form ) );


#############################################################################
##
#M SymplecticGroupCons( <filt>, <d>, <F>, <form> )
##
InstallMethod( SymplecticGroupCons,
"matrix group for dimension, finite field, form",
[ IsMatrixGroup and IsFinite,
IsPosInt,
IsField and IsFinite,
IsBilinearForm ],
function( filt, d, F, form )
local q, g, stored, form_matrix, wanted, mat1, mat2, mat, matinv, gens, gg;

# Create the default generators and form.
g:= SymplecticGroupCons( filt, d, q );
q:= Size( F );
g:= SymplecticGroupCons( filt, d, F );
stored:= InvariantBilinearForm( g ).matrix;

# If the prescribed form fits then just return.
if stored = form!.matrix then
form_matrix:= Matrix( form!.matrix, stored );
#T This 'Matrix' call should become unnecessary.
#T For that, the functions used below have to support 'IsMatrixObj' arguments.
if stored = form_matrix then
return g;
fi;

# Compute a base change matrix.
# (Check that the canonical forms are equal.)
wanted:= BilinearFormByMatrix( stored, GF(q) );
mat1:= BaseChangeToCanonical( form );
mat2:= BaseChangeToCanonical( wanted );
if mat1 * form!.matrix * TransposedMat( mat1 ) <>
wanted:= BilinearFormByMatrix( stored, F );
mat1:= Matrix( BaseChangeToCanonical( form ), stored );
mat2:= Matrix( BaseChangeToCanonical( wanted ), stored );
if mat1 * form_matrix * TransposedMat( mat1 ) <>
mat2 * stored * TransposedMat( mat2 ) then
Error( "canonical forms of <form> and <wanted> differ" );
fi;
Expand All @@ -903,7 +938,8 @@ InstallMethod( SymplecticGroupCons,
SetName( gg, Name( g ) );
fi;

SetInvariantBilinearForm( gg, rec( matrix:= form!.matrix ) );
SetInvariantBilinearForm( gg,
rec( matrix:= form_matrix, baseDomain:= F ) );
if HasIsFullSubgroupGLorSLRespectingBilinearForm( g ) then
SetIsFullSubgroupGLorSLRespectingBilinearForm( gg,
IsFullSubgroupGLorSLRespectingBilinearForm( g ) );
Expand All @@ -912,18 +948,13 @@ InstallMethod( SymplecticGroupCons,
return gg;
end );


#############################################################################
##
#M SymplecticGroupCons( <filt>, <d>, <R>, <form> )
##
InstallMethod( SymplecticGroupCons,
"matrix group for dimension, finite field, matrix of form",
[ IsMatrixGroup and IsFinite,
IsPosInt,
IsField and IsFinite,
IsMatrixOrMatrixObj ],
{ filt, d, F, form } -> SymplecticGroupCons( filt, d, Size( F ),
{ filt, d, F, form } -> SymplecticGroupCons( filt, d, F,
BilinearFormByMatrix( form, F ) ) );

InstallMethod( SymplecticGroupCons,
Expand All @@ -932,14 +963,6 @@ InstallMethod( SymplecticGroupCons,
IsPosInt,
IsField and IsFinite,
IsGroup and HasInvariantBilinearForm ],
{ filt, d, F, G } -> SymplecticGroupCons( filt, d, Size( F ),
{ filt, d, F, G } -> SymplecticGroupCons( filt, d, F,
BilinearFormByMatrix(
InvariantBilinearForm( G ).matrix, F ) ) );

InstallMethod( SymplecticGroupCons,
"matrix group for dimension, finite field, form",
[ IsMatrixGroup and IsFinite,
IsPosInt,
IsField and IsFinite,
IsBilinearForm ],
{ filt, d, F, form } -> SymplecticGroupCons( filt, d, Size( F ), form ) );
28 changes: 28 additions & 0 deletions lib/conformal.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#############################################################################
##
## conformal.gd 'Forms' package
##

#############################################################################
##
#O ConformalSymplecticGroupCons( <filter>, <form> )
#O ConformalSymplecticGroupCons( <filter>, <matrix> )
#O ConformalSymplecticGroupCons( <filter>, <G> )
#O ConformalSymplecticGroupCons( <filter>, <d>, <R>, <form> )
#O ConformalSymplecticGroupCons( <filter>, <d>, <R>, <matrix> )
#O ConformalSymplecticGroupCons( <filter>, <d>, <R>, <G> )
#O ConformalSymplecticGroupCons( <filter>, <d>, <q>, <form> )
#O ConformalSymplecticGroupCons( <filter>, <d>, <q>, <matrix> )
#O ConformalSymplecticGroupCons( <filter>, <d>, <q>, <G> )
##
## Declare the variants involving a bilinear form as an argument.
##
Perform(
[ IsMatrixOrMatrixObj, IsBilinearForm, IsGroup ],
function( obj )
DeclareConstructor( "ConformalSymplecticGroupCons", [ IsGroup, obj ] );
DeclareConstructor( "ConformalSymplecticGroupCons",
[ IsGroup, IsPosInt, IsRing, obj ] );
DeclareConstructor( "ConformalSymplecticGroupCons",
[ IsGroup, IsPosInt, IsPosInt, obj ] );
end );
Loading