Skip to content

Commit

Permalink
Add more tests for group constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed May 2, 2018
1 parent 69d8c12 commit 464b1fc
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 11 deletions.
56 changes: 51 additions & 5 deletions tst/testinstall/grp/basic.tst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ gap> AbelianGroup(IsPcGroup,[2,3]);
<pc group of size 6 with 2 generators>
gap> AbelianGroup(IsPermGroup,[2,3]);
Group([ (1,2), (3,4,5) ])
gap> AbelianGroup(IsFpGroup,[2,3]);
gap> A:=AbelianGroup(IsFpGroup,[2,3]);
<fp group of size 6 on the generators [ f1, f2 ]>
gap> A.1^-1;
f1
gap> A.2^-1;
f2^2
#
gap> AbelianGroup([2,0]);
Expand All @@ -45,8 +49,10 @@ Error, no 2nd choice method found for `AbelianGroupCons' on 2 arguments
gap> AbelianGroup(IsPermGroup,[2,0]);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `AbelianGroupCons' on 2 arguments
gap> AbelianGroup(IsFpGroup,[2,0]);
gap> A:=AbelianGroup(IsFpGroup,[2,0]);
<fp group of size infinity on the generators [ f1, f2 ]>
gap> A.1*A.2^-3*A.1*A.2^4;
f2
#
gap> AbelianGroup(2,3);
Expand Down Expand Up @@ -121,6 +127,11 @@ gap> CyclicGroup(IsPermGroup,1);
Group(())
gap> CyclicGroup(IsFpGroup,1);
<fp group of size 1 on the generators [ a ]>
gap> G:=CyclicGroup(IsMatrixGroup, 1);
Group([ [ [ 1 ] ] ])
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
Rationals
1
gap> G:=CyclicGroup(IsMatrixGroup, GF(2), 1);
Group([ <an immutable 1x1 matrix over GF2> ])
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
Expand All @@ -136,18 +147,29 @@ gap> CyclicGroup(IsPermGroup,4);
Group([ (1,2,3,4) ])
gap> CyclicGroup(IsFpGroup,4);
<fp group of size 4 on the generators [ a ]>
gap> G:=CyclicGroup(IsMatrixGroup, GF(2), 12);
<matrix group of size 12 with 1 generators>
gap> G:=CyclicGroup(IsMatrixGroup, 6);
<matrix group of size 6 with 1 generators>
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
Rationals
6
gap> G:=CyclicGroup(IsMatrixGroup, GF(2), 6);
<matrix group of size 6 with 1 generators>
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
GF(2)
12
6
#
gap> CyclicGroup(2,3);
Error, usage: CyclicGroup( [<filter>, ]<size> )
gap> CyclicGroup(IsRing,3);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `CyclicGroupCons' on 2 arguments
gap> CyclicGroup(0);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `CyclicGroupCons' on 2 arguments
gap> CyclicGroup(IsFpGroup,0);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `CyclicGroupCons' on 2 arguments

#
# dihedral groups
Expand Down Expand Up @@ -205,6 +227,10 @@ Error, no 2nd choice method found for `DihedralGroupCons' on 2 arguments
#
# quaternion groups
#
gap> IdGroup(QuaternionGroup(4));
[ 4, 1 ]
gap> IdGroup(QuaternionGroup(IsFpGroup,4));
[ 4, 1 ]
gap> QuaternionGroup(8);
<pc group of size 8 with 3 generators>
gap> QuaternionGroup(IsPcGroup,8);
Expand All @@ -218,18 +244,38 @@ gap> G:=QuaternionGroup(IsMatrixGroup, 8);
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
Rationals
4
gap> G:=QuaternionGroup(IsMatrixGroup, GF(2), 8);
<matrix group of size 8 with 2 generators>
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
GF(2)
8
gap> G:=QuaternionGroup(IsMatrixGroup, GF(3), 8);
<matrix group of size 8 with 2 generators>
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
GF(3)
4
gap> F:=FunctionField(GF(3),["t"]);
FunctionField(...,[ t ])
gap> G:=QuaternionGroup(IsMatrixGroup, F, 8);
<matrix group of size 8 with 2 generators>
gap> DimensionOfMatrixGroup(G);
4
#
gap> QuaternionGroup(2,3);
Error, usage: QuaternionGroup( [<filter>, ]<size> )
gap> QuaternionGroup(IsRing,3);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `QuaternionGroupCons' on 2 arguments
gap> QuaternionGroup(0);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `QuaternionGroupCons' on 2 arguments
gap> QuaternionGroup(1);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `QuaternionGroupCons' on 2 arguments
gap> QuaternionGroup(IsFpGroup,1);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `QuaternionGroupCons' on 2 arguments
#
# elementary abelian groups
Expand Down
77 changes: 71 additions & 6 deletions tst/testinstall/grp/classic-G.tst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ gap> G:=GL(5,3);; List([2,3,5,11,13], p-> Size(SylowSubgroup(G,p)));
gap> G:=GL(5,4);; List([2,3,5,11,13], p-> Size(SylowSubgroup(G,p)));
[ 1048576, 729, 25, 11, 1 ]

# special case: DefaultFieldOfMatrixGroup <> FieldOfMatrixGroup
gap> G:=GL(2,9);
GL(2,9)
gap> H:=Subgroup(G,[G.1^4,G.2]);;
gap> G := GL(2,3);
GL(2,3)
gap> IsNaturalGL(H) and (G=H);
true
gap> DefaultFieldOfMatrixGroup(H);
GF(3^2)
gap> FieldOfMatrixGroup(H);
GF(3)
gap> ForAll([2,3,5], p -> IsConjugate(G, SylowSubgroup(G,2), SylowSubgroup(H,2)));
true

#
gap> G := GO(3,5);
GO(0,3,5)
Expand Down Expand Up @@ -97,20 +112,70 @@ gap> GammaL(2,5);
GL(2,5)
gap> GammaL(3,5);
GL(3,5)
gap> GammaL(1,9);
gap> GammaL(1,9); Size(last) = SizeGL(1,9) * 2;
GammaL(1,9)
gap> GammaL(2,9);
true
gap> GammaL(2,9); Size(last) = SizeGL(2,9) * 2;
GammaL(2,9)
gap> GammaL(3,9);
true
gap> GammaL(3,9); Size(last) = SizeGL(3,9) * 2;
GammaL(3,9)
gap> GammaL(IsPermGroup,3,9);
true
gap> GammaL(IsPermGroup,3,9); Size(last) = SizeGL(3,9) * 2;
Perm_GammaL(3,9)
gap> Size(last) / Size(GL(3,9));
2
true
gap> GammaL(3);
Error, usage: GeneralSemilinearGroup( [<filter>, ]<d>, <q> )
gap> GammaL(3,6);
Error, <subfield> must be a prime or a finite field

#
gap> Omega(3,2);
Omega(0,3,2)
gap> Omega(3,3);
Omega(0,3,3)
gap> Omega(5,2);
GO(0,5,2)
gap> Omega(5,3);
Omega(0,5,3)

#
gap> Omega(+1,2,2);
Omega(+1,2,2)
gap> Omega(+1,2,3);
Omega(+1,2,3)
gap> Omega(+1,4,2);
Omega(+1,4,2)
gap> Omega(+1,4,3);
Omega(+1,4,3)

#
gap> Omega(-1,4,2);
Omega(-1,4,2)
gap> Omega(-1,4,3);
Omega(-1,4,3)

#
gap> Omega(0,2);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `Omega' on 2 arguments
gap> Omega(-1,0,2);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `Omega' on 3 arguments
gap> Omega(IsPermGroup,3,2);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `OmegaCons' on 4 arguments
gap> Omega(IsPermGroup,0,3,2);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `OmegaCons' on 4 arguments

#
gap> Omega(1,2);
Error, <d> must be at least 3
gap> Omega(2,2);
Error, sign <e> = 0 but dimension <d> is even
gap> Omega(-1,2,2);
Error, <d> = 2 is not supported

#
gap> STOP_TEST("classic-G.tst", 1);
7 changes: 7 additions & 0 deletions tst/testinstall/grp/classic-S.tst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
gap> START_TEST("classic-S.tst");

#
gap> SL(0,5);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `SpecialLinearGroupCons' on 3 arguments
gap> SL(1,5);
SL(1,5)
gap> ForAll([2,3,4,5,7,9,11], q -> IsTrivial(SL(1,q)));
true
gap> SL(2,5);
SL(2,5)
gap> last = SL(2,GF(5));
Expand Down
30 changes: 30 additions & 0 deletions tst/testinstall/grp/classic-forms.tst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ gap> CheckBilinearForm := function(G)
> return ForAll(GeneratorsOfGroup(G),
> g -> g*M*TransposedMat(g) = M);
> end;;
gap> CheckQuadraticForm := function(G)
> local M, Q;
> M := InvariantBilinearForm(G).matrix;
> Q := InvariantQuadraticForm(G).matrix;
> return Q+TransposedMat(Q) = M;
> end;;
gap> frob := function(g,aut)
> return List(g,row->List(row,x->x^aut));
> end;;
Expand All @@ -43,6 +49,8 @@ gap> ForAll(grps, CheckGeneratorsInvertible);
true
gap> ForAll(grps, CheckBilinearForm);
true
gap> ForAll(grps, CheckQuadraticForm);
true

# even-dimensional general orthogonal groups
gap> grps:=[];;
Expand All @@ -56,6 +64,8 @@ gap> ForAll(grps, CheckGeneratorsInvertible);
true
gap> ForAll(grps, CheckBilinearForm);
true
gap> ForAll(grps, CheckQuadraticForm);
true

# odd-dimensional special orthogonal groups
gap> grps:=[];;
Expand All @@ -68,6 +78,8 @@ gap> ForAll(grps, CheckGeneratorsSpecial);
true
gap> ForAll(grps, CheckBilinearForm);
true
gap> ForAll(grps, CheckQuadraticForm);
true

# even-dimensional special orthogonal groups
gap> grps:=[];;
Expand All @@ -81,6 +93,10 @@ gap> ForAll(grps, CheckGeneratorsSpecial);
true
gap> ForAll(grps, CheckBilinearForm);
true
gap> ForAll(grps, CheckQuadraticForm);
true

# TODO: add forms to Omega, check them here

#
# unitary groups
Expand Down Expand Up @@ -110,5 +126,19 @@ true
gap> ForAll(grps, CheckSesquilinearForm);
true

#
# symplectic groups
#
gap> grps:=[];;
gap> for d in [2,4,6,8] do
> for q in [2,3,4,5,7,8,9] do
> Add(grps, Sp(d,q));
> od;
> od;
gap> ForAll(grps, CheckGeneratorsSpecial);
true
gap> ForAll(grps, CheckBilinearForm);
true

#
gap> STOP_TEST("classic-forms.tst", 1);

0 comments on commit 464b1fc

Please sign in to comment.