Commit d11ea54f authored by Kaashif Hymabaccus's avatar Kaashif Hymabaccus

move test utils into main package

it's useful
parent 6b605bb4
Pipeline #46908362 passed with stage
in 30 seconds
......@@ -226,3 +226,23 @@ InstallGlobalFunction( PermToLinearRep, function(rho)
return ComposeHomFunction(rho, perm -> PermutationMat(perm, n));
end );
# Check a subspace is really G-invariant (action given by rho)
IsGInvariant@ := function(rho, space)
local G, v, g;
G := Source(rho);
if not IsVectorSpace(space) then
return fail;
fi;
for v in Basis(space) do
for g in GeneratorsOfGroup(G) do
if not Image(rho, g) * v in space then
return false;
fi;
od;
od;
return true;
end;
gap> Read("tst/utils.g");;
gap> G := SmallGroup(78, 5);;
gap> irreps := IrreducibleRepresentations(G);;
gap> rho := DirectSumRepList([irreps[2], irreps[3]]);;
......
gap> Read("tst/utils.g");;
gap> G := SmallGroup(56, 3);;
gap> irreps := IrreducibleRepresentations(G);;
gap> rho := DirectSumRepList([irreps[1], irreps[2], irreps[5]]);;
......
gap> Read("tst/utils.g");;
gap> G := SmallGroup(48, 3);;
gap> irreps := IrreducibleRepresentations(G);;
gap> my_irreps := [irreps[2], irreps[3], irreps[4]];;
......@@ -13,5 +12,5 @@ gap> spaces := Flat(decomp.decomposition);;
gap> # check dims of spaces and degrees of reps match up
gap> SortedList(List(spaces, Dimension)) = SortedList(List(my_irreps, DegreeOfRepresentation));
true
gap> List(spaces, space -> IsGInvariant(rho, space)); # check the spaces are actually subrepresentations
gap> List(spaces, space -> IsGInvariant@RepnDecomp(rho, space)); # check the spaces are actually subrepresentations
[true, true, true]
\ No newline at end of file
gap> Read("tst/utils.g");;
gap> G := SmallGroup(48, 4);;
gap> irreps := IrreducibleRepresentations(G);;
gap> my_irreps := [irreps[2], irreps[3], irreps[4]];;
......@@ -14,5 +13,5 @@ gap> spaces := Flat(decomp.decomposition);;
gap> # check dims of spaces and degrees of reps match up
gap> SortedList(List(spaces, Dimension)) = SortedList(List(my_irreps, DegreeOfRepresentation));
true
gap> List(spaces, space -> IsGInvariant(rho, space)); # check the spaces are actually subrepresentations
gap> List(spaces, space -> IsGInvariant@RepnDecomp(rho, space)); # check the spaces are actually subrepresentations
[true, true, true]
\ No newline at end of file
gap> Read("tst/utils.g");;
gap> G := DirectProduct(SymmetricGroup(3), SymmetricGroup(3));;
gap> irreps := IrreducibleRepresentations(G);;
gap> rho := DirectSumRepList([irreps[2], irreps[2], irreps[2]]);;
......@@ -7,19 +6,19 @@ gap> summand := Cyclotomics^3;;
gap> # and each axis is an irreducible G-invariant space, we should get
gap> # something resembling that (all G-inv, right number of summands)
gap> decomp := DecomposeCanonicalSummandFast@RepnDecomp(rho, irreps[2], summand);;
gap> ForAll(decomp, r -> IsGInvariant(rho, VectorSpace(Cyclotomics, r.basis)));
gap> ForAll(decomp, r -> IsGInvariant@RepnDecomp(rho, VectorSpace(Cyclotomics, r.basis)));
true
gap> Length(decomp);
3
gap> # something more complicated
gap> rho := DirectSumRepList([irreps[1], irreps[2], irreps[2], irreps[3]]);;
gap> decomp := DecomposeCanonicalSummandFast@RepnDecomp(rho, irreps[2], VectorSpace(Cyclotomics, [[0,1,0,0],[0,0,1,0]]));;
gap> ForAll(decomp, r -> IsGInvariant(rho, VectorSpace(Cyclotomics, r.basis)));
gap> ForAll(decomp, r -> IsGInvariant@RepnDecomp(rho, VectorSpace(Cyclotomics, r.basis)));
true
gap> Length(decomp);
2
gap> decomp := DecomposeCanonicalSummandFast@RepnDecomp(rho, irreps[3], VectorSpace(Cyclotomics, [[0,0,0,1]]));;
gap> ForAll(decomp, r -> IsGInvariant(rho, VectorSpace(Cyclotomics, r.basis)));
gap> ForAll(decomp, r -> IsGInvariant@RepnDecomp(rho, VectorSpace(Cyclotomics, r.basis)));
true
gap> Length(decomp);
1
\ No newline at end of file
gap> Read("tst/utils.g");;
gap> G := SmallGroup(12, 2);;
gap> irreps := IrreducibleRepresentations(G);;
gap> rho := DirectSumRepList([irreps[1], irreps[3], irreps[5], irreps[5]]);;
......
gap> Read("tst/utils.g");
gap> G:=AlternatingGroup(5);;
gap> P:=PermutationGModule(G,Rationals);;
gap> h:=GroupHomomorphismByImages(G,Group(P.generators));;
......@@ -6,7 +5,7 @@ gap> h:=ConvertRhoIfNeeded@RepnDecomp(h);;
gap> l:=IrreducibleDecomposition(h); # check the dimensions are correct
[ <vector space over Cyclotomics, with 1 generators>,
<vector space over Cyclotomics, with 4 generators> ]
gap> ForAll(l, space -> IsGInvariant(h, space)); # check the spaces are actually subrepresentations
gap> ForAll(l, space -> IsGInvariant@RepnDecomp(h, space)); # check the spaces are actually subrepresentations
true
gap> G:=SymmetricGroup(3);;
gap> R:=RegularActionHomomorphism(G);;
......@@ -17,5 +16,5 @@ gap> l:=IrreducibleDecomposition(h); # check the dimensions are correct
<vector space over Cyclotomics, with 1 generators>,
<vector space over Cyclotomics, with 2 generators>,
<vector space over Cyclotomics, with 2 generators> ]
gap> ForAll(l, space -> IsGInvariant(h, space)); # check the spaces are actually subrepresentations
gap> ForAll(l, space -> IsGInvariant@RepnDecomp(h, space)); # check the spaces are actually subrepresentations
true
......@@ -22,5 +22,5 @@ gap> rho := GroupHomomorphismByImages(G, Image(h, G));;
gap> linear_rho := ConvertRhoIfNeeded@RepnDecomp(rho);;
gap> # check block sizes are right and spaces are really G-invariant
gap> coeffs := DecomposeCharacter@RepnDecomp(linear_rho, IrrWithCorrectOrdering@RepnDecomp(G, irreps));;
gap> ForAll([1..Length(irreps)], function(i) local V; V := IrrepCanonicalSummand@RepnDecomp(rho, irreps[i]); return Dimension(V) = coeffs[i]*DegreeOfRepresentation(irreps[i]) and IsGInvariant(linear_rho, V); end );
gap> ForAll([1..Length(irreps)], function(i) local V; V := IrrepCanonicalSummand@RepnDecomp(rho, irreps[i]); return Dimension(V) = coeffs[i]*DegreeOfRepresentation(irreps[i]) and IsGInvariant@RepnDecomp(linear_rho, V); end );
true
\ No newline at end of file
gap> Read("tst/utils.g");;
gap> G := SmallGroup(32, 5);;
gap> irreps := IrreducibleRepresentations(G);;
gap> rho := DirectSumRepList([irreps[10], irreps[19], irreps[20], irreps[20]]);;
......
# These are functions for testing, they don't implement anything
# interesting
LoadPackage("RepnDecomp");
# Check a subspace is really G-invariant (action given by rho)
IsGInvariant := function(rho, space)
local G, v, g;
G := Source(rho);
if not IsVectorSpace(space) then
return fail;
fi;
for v in Basis(space) do
for g in GeneratorsOfGroup(G) do
if not Image(rho, g) * v in space then
return false;
fi;
od;
od;
return true;
end;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment