1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-13 14:00:27 +01:00
PropertyT.jl/test/actions.jl

205 lines
6.3 KiB
Julia
Raw Normal View History

2022-11-07 18:45:12 +01:00
function test_action(basis, group, act)
action = SymbolicWedderburn.action
return @testset "action definition" begin
@test all(basis) do b
e = one(group)
2023-03-19 23:28:36 +01:00
return action(act, e, b) == b
2022-11-07 18:45:12 +01:00
end
a = let a = rand(basis)
while isone(a)
a = rand(basis)
end
@assert !isone(a)
a
end
g, h = let g_h = rand(group, 2)
while any(isone, g_h)
g_h = rand(group, 2)
end
@assert all(!isone, g_h)
g_h
end
action = SymbolicWedderburn.action
@test action(act, g, a) in basis
@test action(act, h, a) in basis
@test action(act, h, action(act, g, a)) == action(act, g * h, a)
@test all([(g, h) for g in group for h in group]) do (g, h)
x = action(act, h, action(act, g, a))
y = action(act, g * h, a)
2023-03-19 23:28:36 +01:00
return x == y
2022-11-07 18:45:12 +01:00
end
if act isa SymbolicWedderburn.ByPermutations
@test all(basis) do b
2023-03-19 23:28:36 +01:00
return action(act, g, b) basis && action(act, h, b) basis
2022-11-07 18:45:12 +01:00
end
end
2019-07-05 18:57:39 +02:00
end
2022-11-07 18:45:12 +01:00
end
## Testing
@testset "Actions on SL(3,)" begin
n = 3
SL = MatrixGroups.SpecialLinearGroup{n}(Int8)
2023-03-19 23:28:36 +01:00
RSL, S, sizes = PropertyT.group_algebra(SL; halfradius = 2)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
@testset "Permutation action" begin
Γ = PermGroup(perm"(1,2)", Perm(circshift(1:n, -1)))
ΓpA = PropertyT.action_by_conjugation(SL, Γ)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
test_action(basis(RSL), Γ, ΓpA)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
@testset "mps is successful" begin
charsΓ =
SymbolicWedderburn.Character{
Rational{Int},
}.(SymbolicWedderburn.irreducible_characters(Γ))
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
= SymbolicWedderburn._group_algebra(Γ)
2019-07-05 18:57:39 +02:00
2023-03-19 23:28:36 +01:00
@time mps, ranks =
2022-11-07 18:45:12 +01:00
SymbolicWedderburn.minimal_projection_system(charsΓ, )
2023-03-19 23:28:36 +01:00
@test all(isone, ranks)
2022-11-07 18:45:12 +01:00
end
@testset "Wedderburn decomposition" begin
wd = SymbolicWedderburn.WedderburnDecomposition(
Rational{Int},
Γ,
ΓpA,
basis(RSL),
2023-03-19 23:28:36 +01:00
StarAlgebras.Basis{UInt16}(@view basis(RSL)[1:sizes[2]]),
2022-11-07 18:45:12 +01:00
)
@test length(invariant_vectors(wd)) == 918
2023-03-19 23:28:36 +01:00
@test SymbolicWedderburn.size.(direct_summands(wd), 1) ==
[40, 23, 18]
2022-11-07 18:45:12 +01:00
@test all(issimple, direct_summands(wd))
2019-07-05 18:57:39 +02:00
end
end
2022-11-07 18:45:12 +01:00
@testset "Wreath action" begin
Γ = let P = PermGroup(perm"(1,2)", Perm(circshift(1:n, -1)))
PropertyT.Constructions.WreathProduct(PermGroup(perm"(1,2)"), P)
end
ΓpA = PropertyT.action_by_conjugation(SL, Γ)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
test_action(basis(RSL), Γ, ΓpA)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
@testset "mps is successful" begin
charsΓ =
SymbolicWedderburn.Character{
Rational{Int},
}.(SymbolicWedderburn.irreducible_characters(Γ))
= SymbolicWedderburn._group_algebra(Γ)
2023-03-19 23:28:36 +01:00
@time mps, ranks =
2022-11-07 18:45:12 +01:00
SymbolicWedderburn.minimal_projection_system(charsΓ, )
2023-03-19 23:28:36 +01:00
@test all(isone, ranks)
2022-11-07 18:45:12 +01:00
end
@testset "Wedderburn decomposition" begin
wd = SymbolicWedderburn.WedderburnDecomposition(
Rational{Int},
Γ,
ΓpA,
basis(RSL),
2023-03-19 23:28:36 +01:00
StarAlgebras.Basis{UInt16}(@view basis(RSL)[1:sizes[2]]),
2022-11-07 18:45:12 +01:00
)
@test length(invariant_vectors(wd)) == 247
2023-03-19 23:28:36 +01:00
@test SymbolicWedderburn.size.(direct_summands(wd), 1) ==
[14, 9, 6, 14, 12]
2022-11-07 18:45:12 +01:00
@test all(issimple, direct_summands(wd))
2019-07-05 18:57:39 +02:00
end
end
end
2022-11-07 18:45:12 +01:00
@testset "Actions on SAut(F4)" begin
n = 4
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
SAutFn = SpecialAutomorphismGroup(FreeGroup(n))
2023-03-19 23:28:36 +01:00
RSAutFn, S, sizes = PropertyT.group_algebra(SAutFn; halfradius = 1)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
@testset "Permutation action" begin
Γ = PermGroup(perm"(1,2)", Perm(circshift(1:n, -1)))
ΓpA = PropertyT.action_by_conjugation(SAutFn, Γ)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
test_action(basis(RSAutFn), Γ, ΓpA)
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
@testset "mps is successful" begin
charsΓ =
SymbolicWedderburn.Character{
Rational{Int},
}.(SymbolicWedderburn.irreducible_characters(Γ))
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
= SymbolicWedderburn._group_algebra(Γ)
2023-03-19 23:28:36 +01:00
@time mps, ranks =
2022-11-07 18:45:12 +01:00
SymbolicWedderburn.minimal_projection_system(charsΓ, )
2023-03-19 23:28:36 +01:00
@test all(isone, ranks)
2022-11-07 18:45:12 +01:00
end
@testset "Wedderburn decomposition" begin
wd = SymbolicWedderburn.WedderburnDecomposition(
Rational{Int},
Γ,
ΓpA,
basis(RSAutFn),
2023-03-19 23:28:36 +01:00
StarAlgebras.Basis{UInt16}(@view basis(RSAutFn)[1:sizes[1]]),
2022-11-07 18:45:12 +01:00
)
@test length(invariant_vectors(wd)) == 93
2023-03-19 23:28:36 +01:00
@test SymbolicWedderburn.size.(direct_summands(wd), 1) ==
[4, 8, 5, 4]
2022-11-07 18:45:12 +01:00
@test all(issimple, direct_summands(wd))
2019-07-05 18:57:39 +02:00
end
end
2022-11-07 18:45:12 +01:00
@testset "Wreath action" begin
Γ = let P = PermGroup(perm"(1,2)", Perm(circshift(1:n, -1)))
PropertyT.Constructions.WreathProduct(PermGroup(perm"(1,2)"), P)
end
2019-07-05 18:57:39 +02:00
2022-11-07 18:45:12 +01:00
ΓpA = PropertyT.action_by_conjugation(SAutFn, Γ)
test_action(basis(RSAutFn), Γ, ΓpA)
@testset "mps is successful" begin
charsΓ =
SymbolicWedderburn.Character{
Rational{Int},
}.(SymbolicWedderburn.irreducible_characters(Γ))
= SymbolicWedderburn._group_algebra(Γ)
2019-07-05 18:57:39 +02:00
2023-03-19 23:28:36 +01:00
@time mps, ranks =
2022-11-07 18:45:12 +01:00
SymbolicWedderburn.minimal_projection_system(charsΓ, )
2023-03-19 23:28:36 +01:00
@test all(isone, ranks)
2022-11-07 18:45:12 +01:00
end
@testset "Wedderburn decomposition" begin
wd = SymbolicWedderburn.WedderburnDecomposition(
Rational{Int},
Γ,
ΓpA,
basis(RSAutFn),
2023-03-19 23:28:36 +01:00
StarAlgebras.Basis{UInt16}(@view basis(RSAutFn)[1:sizes[1]]),
2022-11-07 18:45:12 +01:00
)
@test length(invariant_vectors(wd)) == 18
2023-03-19 23:28:36 +01:00
@test SymbolicWedderburn.size.(direct_summands(wd), 1) ==
[1, 1, 2, 2, 1, 2, 2, 1]
2022-11-07 18:45:12 +01:00
@test all(issimple, direct_summands(wd))
end
end
2019-07-05 18:57:39 +02:00
end