Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 31, 2024
1 parent 3daa5ed commit 22d9148
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions experimental/LieAlgebras/test/WeylGroup-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ include(

@testset "WeylGroup Group conformace test for $(Wname)" for (Wname, W) in [
("A1", weyl_group(:A, 1)),
("A5", weyl_group(:A, 5)),
("B4", weyl_group(root_system(:B, 4))),
("D5", weyl_group(cartan_matrix(:D, 5))),
("F4+G2", weyl_group((:F, 4), (:G, 2))),
Expand Down Expand Up @@ -118,6 +119,41 @@ include(
end
end
end

if has_root_system_type(root_system(W))
type, ordering = root_system_type_with_ordering(root_system(W))
if length(type) == 1 && issorted(ordering) && only(type)[1] == :A # only implemented for A_n (yet)
@testset "isomorphism(PermGroup, ::WeylGroup; set_properties=$set_properties)" for set_properties in
[
false, true
]
G = permutation_group(W; set_properties)
if (is_finite(W) && ngens(W) < 6) || set_properties #= for sane runtime =#
@test is_finite(G) == is_finite(W)
is_finite(W) && @test order(G) == order(W)
end

iso = isomorphism(PermGroup, W; set_properties)
@test W == domain(iso)
G = codomain(iso)
if (is_finite(W) && ngens(W) < 6) || set_properties #= for sane runtime =#
@test is_finite(G) == is_finite(W)
is_finite(W) && @test order(G) == order(W)
if ngens(W) < 10 #= for sane runtime =#
for _ in 1:5
if is_finite(W) # remove once rand(W) is implemented for infinite groups
w = rand(W)
@test w == inv(iso)(iso(w))
end
g = rand_pseudo(G)
@test g == iso(inv(iso)(g))
end
end
end
end
end
end

end

@testset "<(x::WeylGroupElem, y::WeylGroupElem)" begin
Expand Down

0 comments on commit 22d9148

Please sign in to comment.