Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tests for group constructors and some fixes #1053

Merged
merged 14 commits into from
Jan 13, 2017
Merged
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
30 changes: 3 additions & 27 deletions grp/basic.gd
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ BindGlobal( "AbelianGroup", function ( arg )

if Length(arg) = 2 then
return AbelianGroupCons( arg[1], arg[2] );

elif Length(arg) = 3 then
return AbelianGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: AbelianGroup( [<filter>, ]<ints> )" );
Expand Down Expand Up @@ -200,7 +197,7 @@ BindGlobal( "AlternatingGroup", function ( arg )
return AlternatingGroupCons( arg[1], arg[2] );
fi;
fi;
Error( "usage: AlternatingGroup( [<filter>, ]<deg> )" );
Error( "usage: AlternatingGroup( [<filter>, ]<deg> )" );

end );

Expand Down Expand Up @@ -263,9 +260,6 @@ BindGlobal( "CyclicGroup", function ( arg )

if Length(arg) = 2 then
return CyclicGroupCons( arg[1], arg[2] );

elif Length(arg) = 3 then
return CyclicGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: CyclicGroup( [<filter>, ]<size> )" );
Expand Down Expand Up @@ -320,9 +314,6 @@ BindGlobal( "DihedralGroup", function ( arg )

if Length(arg) = 2 then
return DihedralGroupCons( arg[1], arg[2] );

elif Length(arg) = 3 then
return DihedralGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: DihedralGroup( [<filter>, ]<size> )" );
Expand Down Expand Up @@ -380,9 +371,6 @@ BindGlobal( "QuaternionGroup", function ( arg )

if Length(arg) = 2 then
return QuaternionGroupCons( arg[1], arg[2] );

elif Length(arg) = 3 then
return QuaternionGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: QuaternionGroup( [<filter>, ]<size> )" );
Expand Down Expand Up @@ -437,9 +425,6 @@ BindGlobal( "ElementaryAbelianGroup", function ( arg )

if Length(arg) = 2 then
return ElementaryAbelianGroupCons( arg[1], arg[2] );

elif Length(arg) = 3 then
return ElementaryAbelianGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: ElementaryAbelianGroup( [<filter>, ]<size> )" );
Expand Down Expand Up @@ -492,12 +477,9 @@ BindGlobal( "FreeAbelianGroup", function ( arg )

if Length(arg) = 2 then
return FreeAbelianGroupCons( arg[1], arg[2] );

elif Length(arg) = 3 then
return FreeAbelianGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: FreeAbelianGroup( [<filter>, ]<size> )" );
Error( "usage: FreeAbelianGroup( [<filter>, ]<rank> )" );

end );

Expand Down Expand Up @@ -560,9 +542,6 @@ BindGlobal( "ExtraspecialGroup", function ( arg )

if Length(arg) = 3 then
return ExtraspecialGroupCons( arg[1], arg[2], arg[3] );

elif Length(arg) = 4 then
return ExtraspecialGroupCons( arg[1], arg[2], arg[3], arg[4] );
fi;
fi;
Error( "usage: ExtraspecialGroup( [<filter>, ]<order>, <exponent> )" );
Expand Down Expand Up @@ -616,9 +595,6 @@ BindGlobal( "MathieuGroup", function( arg )

if Length( arg ) = 2 then
return MathieuGroupCons( arg[1], arg[2] );

elif Length( arg ) = 3 then
return MathieuGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: MathieuGroup( [<filter>, ]<degree> )" );
Expand Down Expand Up @@ -683,7 +659,7 @@ BindGlobal( "SymmetricGroup", function ( arg )
return SymmetricGroupCons( arg[1], arg[2] );
fi;
fi;
Error( "usage: SymmetricGroup( [<filter>, ]<deg> )" );
Error( "usage: SymmetricGroup( [<filter>, ]<deg> )" );

end );

Expand Down
12 changes: 6 additions & 6 deletions grp/classic.gi
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ BindGlobal( "Oplus45", function()

# construct the group without calling 'Group'
g := [ phi*tau2, tau*eichler*delta ];
g:=List(g,i->ImmutableMatrix(f,i),true);
g:=List(g,i->ImmutableMatrix(f,i));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this code ever work, out of interest? What's that true supposed to do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it worked until 814a0f6 broke it by making List validate its arguments more agressively. My guess is that the true in there was an accident.

g := GroupWithGenerators( g );
SetDimensionOfMatrixGroup( g, 4 );
SetFieldOfMatrixGroup( g, f );
Expand Down Expand Up @@ -1418,16 +1418,16 @@ InstallMethod( GeneralOrthogonalGroupCons,

# <e> must be -1, 0, +1
if e <> -1 and e <> 0 and e <> +1 then
Error( "sign <e> must be -1, 0, +1\n" );
Error( "sign <e> must be -1, 0, +1" );
fi;

# if <e> = 0 then <d> must be odd
if e = 0 and d mod 2 = 0 then
Error( "sign <e> = 0 but dimension <d> is even\n" );
Error( "sign <e> = 0 but dimension <d> is even" );

# if <e> <> 0 then <d> must be even
elif e <> 0 and d mod 2 = 1 then
Error( "sign <e> <> 0 but dimension <d> is odd\n" );
Error( "sign <e> <> 0 but dimension <d> is odd" );
fi;

# construct the various orthogonal groups
Expand Down Expand Up @@ -1945,11 +1945,11 @@ InstallMethod( OmegaCons,

# if <e> = 0 then <d> must be odd
if e = 0 and d mod 2 = 0 then
Error( "sign <e> = 0 but dimension <d> is even\n" );
Error( "sign <e> = 0 but dimension <d> is even" );

# if <e> <> 0 then <d> must be even
elif e <> 0 and d mod 2 = 1 then
Error( "sign <e> <> 0 but dimension <d> is odd\n" );
Error( "sign <e> <> 0 but dimension <d> is odd" );
fi;

# construct the various orthogonal groups
Expand Down
9 changes: 6 additions & 3 deletions grp/glzmodmz.gi
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ local f,M2,o,e,MM,i;
end);

BindGlobal("SPRingGeneric",function(n,ring)
local t,geni,m,slmats,gens,f,rels,i,j,k,l,mat,mat1,mats,id,nh;
local t,geni,m,slmats,gens,f,rels,i,j,k,l,mat,mat1,mats,id,nh,g;
nh:=n;
n:=2*n;
t:=function(i,j)
Expand All @@ -136,7 +136,7 @@ local t,geni,m,slmats,gens,f,rels,i,j,k,l,mat,mat1,mats,id,nh;
geni:=List([1..n],x->[]);
mats:=[];
slmats:=[];
id:=IdentityMat(n,One(ring));
id:=IdentityMat(n,ring);
m:=0;
for i in [1..nh] do
#t_{i,n+i}
Expand Down Expand Up @@ -170,7 +170,10 @@ local t,geni,m,slmats,gens,f,rels,i,j,k,l,mat,mat1,mats,id,nh;
od;
od;

return Group(slmats);
g := Group(slmats);
mat := Concatenation(id{[nh+1..n]},-id{[1..nh]});
SetInvariantBilinearForm(g,rec(matrix:=mat));
return g;
end);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to trust this is right.. I assume these is a test for it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- indeed, writing the tests for Sp(2*n, Integers mod p^k) lead me to discover that the invariant form was missing for p=2, and hence I added this to make the tests pass. so this was TDD (test driven development) :-).


InstallGlobalFunction("ConstructFormPreservingGroup",function(arg)
Expand Down
1 change: 0 additions & 1 deletion grp/perf.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


PERFRec := fail; # indicator that perf0.grp is not loaded
PERFSELECT := [];
PERFGRP := [];


Expand Down
22 changes: 2 additions & 20 deletions grp/perf.grp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#F PerfGrpLoad(<size>) force loading of secondary files, return index
##
InstallGlobalFunction( PerfGrpLoad, function(sz)
local p,sel,i,pos;
local p,pos;
if PERFRec=fail then
ReadGrp("perf0.grp");
fi;
Expand All @@ -23,30 +23,12 @@ local p,sel,i,pos;
if pos=fail then
return fail;
fi;
if PERFSELECT[pos] then
if IsBound(PERFGRP[pos]) then
return pos;
fi;
# get the file number
p:=PositionSorted(PERFRec.covered,pos);
if SizeBlist(PERFSELECT)>50 then
# throw away old to free memory
sel:=Filtered([1..PERFRec.length],i->PERFSELECT[i]);
sel:=sel{[1..Length(sel)-25]};
for i in sel do
Unbind(PERFGRP[i]);
PERFSELECT[i]:=false;
od;
fi;
ReadGrp(Concatenation("perf",String(p),".grp"));
# store loaded info
if p=1 then
p:=[0,PERFRec.covered[p]];
else
p:=PERFRec.covered{[p-1,p]};
fi;
for i in [p[1]+1..p[2]] do
PERFSELECT[i]:=true;
od;
return pos;
end );

Expand Down
1 change: 0 additions & 1 deletion grp/suzuki.gd
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ DeclareSynonym( "Sz", SuzukiGroup );
#############################################################################
##
#E

6 changes: 3 additions & 3 deletions grp/suzuki.gi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function ( filter, q )

if not IsPrimePowerInt(q)
or SmallestRootInt(q) <> 2 or LogInt(q,2) mod 2 = 0
then Error("<q> must be a non-square power of 2\n"); fi;
then Error("<q> must be a non-square power of 2"); fi;

f := GF(q);
G := GroupByGenerators(
Expand Down Expand Up @@ -74,7 +74,7 @@ function ( filter, q )

if not IsPrimePowerInt(q)
or SmallestRootInt(q) <> 2 or LogInt(q,2) mod 2 = 0
then Error("<q> must be a non-square power of 2\n"); fi;
then Error("<q> must be a non-square power of 2"); fi;

f := GF(q);
r := RootInt(2 * q);
Expand All @@ -101,4 +101,4 @@ end );

#############################################################################
##
#E suzuki.gi . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
#E suzuki.gi . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
2 changes: 0 additions & 2 deletions tst/teststandard/ctbl.tst → tst/testinstall/ctbl.tst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
##
#Y Copyright (C) 1998, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
##
## Exclude from testinstall.g: why?
##
gap> START_TEST("ctbl.tst");

# `ClassPositionsOf...' for the trivial group (which usually causes trouble)
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions tst/testinstall/eigen.tst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
##
#Y Copyright (C) 1998, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
##
## Exclude from testinstall.g: why?
##
gap> START_TEST("eigen.tst");
gap> A := GL(4,3).1;
[ [ Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
##
#Y Copyright (C) 1996, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
##
## Exclude from testinstall.g: why?
##
gap> START_TEST("fldabnum.tst");
gap> CF( 1 ); CF( 6 ); CF( 4 ); CF( 5 ); CF( 36 );
Expand Down
File renamed without changes.
Loading