diff --git a/experimental/LieAlgebras/test/RootSystem-test.jl b/experimental/LieAlgebras/test/RootSystem-test.jl index 55c3f6f308fc..42189cab5714 100644 --- a/experimental/LieAlgebras/test/RootSystem-test.jl +++ b/experimental/LieAlgebras/test/RootSystem-test.jl @@ -1,19 +1,21 @@ -@testset "root_system(cartan_matrix::ZZMatrix)" begin - R = root_system(:F, 4) - @test num_positive_roots(R) == 24 - @test num_roots(R) == 48 +@testset "LieAlgebras.RootSystem" begin + @testset "root_system(cartan_matrix::ZZMatrix)" begin + R = root_system(:F, 4) + @test num_positive_roots(R) == 24 + @test num_roots(R) == 48 - R = root_system(:G, 2) - @test num_positive_roots(R) == 6 - @test num_roots(R) == 12 + R = root_system(:G, 2) + @test num_positive_roots(R) == 6 + @test num_roots(R) == 12 - @test coefficients(positive_root(R, 1)) == QQ[1 0] - @test coefficients(positive_root(R, 2)) == QQ[0 1] -end + @test coefficients(positive_root(R, 1)) == QQ[1 0] + @test coefficients(positive_root(R, 2)) == QQ[0 1] + end -@testset "WeightLatticeElem" begin - R = root_system(:A, 2) - w = WeightLatticeElem(R, [2, 2]) + @testset "WeightLatticeElem" begin + R = root_system(:A, 2) + w = WeightLatticeElem(R, [2, 2]) - @test root_system(w) === R + @test root_system(w) === R + end end diff --git a/experimental/LieAlgebras/test/WeylGroup-test.jl b/experimental/LieAlgebras/test/WeylGroup-test.jl index aaf5de8c6915..16fa7d72609b 100644 --- a/experimental/LieAlgebras/test/WeylGroup-test.jl +++ b/experimental/LieAlgebras/test/WeylGroup-test.jl @@ -1,4 +1,4 @@ -@testset "WeylGroup" begin +@testset "LieAlgebras.WeylGroup" begin @testset "weyl_group(cartan_matrix::ZZMatrix)" begin W = weyl_group(cartan_matrix(:A, 2)) @test isfinite(W) == true @@ -48,84 +48,84 @@ W = weyl_group(:G, 2) @test word(longest_element(W)) == UInt8[2, 1, 2, 1, 2, 1] end -end -@testset "Base.:(*)(x::WeylGroupElem, y::WeylGroupElem)" begin - # test A2 - W = weyl_group(:A, 2) - s = gens(W) + @testset "Base.:(*)(x::WeylGroupElem, y::WeylGroupElem)" begin + # test A2 + W = weyl_group(:A, 2) + s = gens(W) - @test parent(s[1] * s[2]) === parent(s[1]) === parent(s[2]) + @test parent(s[1] * s[2]) === parent(s[1]) === parent(s[2]) - @test word(s[2] * s[1]) == UInt[2, 1] - @test word(s[1] * s[2]) == UInt[1, 2] + @test word(s[2] * s[1]) == UInt[2, 1] + @test word(s[1] * s[2]) == UInt[1, 2] - @test word(s[1] * s[2] * s[1]) == UInt[1, 2, 1] - @test word(s[2] * s[1] * s[2]) == UInt[1, 2, 1] + @test word(s[1] * s[2] * s[1]) == UInt[1, 2, 1] + @test word(s[2] * s[1] * s[2]) == UInt[1, 2, 1] - # test A3 - W = weyl_group(:A, 3) - s = gens(W) + # test A3 + W = weyl_group(:A, 3) + s = gens(W) - @test parent(s[1] * s[2]) === parent(s[1]) === parent(s[2]) + @test parent(s[1] * s[2]) === parent(s[1]) === parent(s[2]) - @test word(s[2] * s[1]) == UInt8[2, 1] - @test word(s[1] * s[2]) == UInt8[1, 2] + @test word(s[2] * s[1]) == UInt8[2, 1] + @test word(s[1] * s[2]) == UInt8[1, 2] - @test word(s[3] * s[1]) == UInt8[3, 1] - @test word(s[1] * s[3]) == UInt8[3, 1] + @test word(s[3] * s[1]) == UInt8[3, 1] + @test word(s[1] * s[3]) == UInt8[3, 1] - @test word(s[3] * s[2]) == UInt8[3, 2] - @test word(s[2] * s[3]) == UInt8[2, 3] + @test word(s[3] * s[2]) == UInt8[3, 2] + @test word(s[2] * s[3]) == UInt8[2, 3] - @test word(s[1] * s[3] * s[1]) == UInt8[3] - @test word(s[3] * s[1] * s[3]) == UInt8[1] + @test word(s[1] * s[3] * s[1]) == UInt8[3] + @test word(s[3] * s[1] * s[3]) == UInt8[1] - @test word(s[1] * s[2] * s[1]) == UInt8[1, 2, 1] - @test word(s[2] * s[1] * s[2]) == UInt8[1, 2, 1] + @test word(s[1] * s[2] * s[1]) == UInt8[1, 2, 1] + @test word(s[2] * s[1] * s[2]) == UInt8[1, 2, 1] - @test word(s[2] * s[3] * s[2]) == UInt8[2, 3, 2] - @test word(s[3] * s[2] * s[3]) == UInt8[2, 3, 2] -end + @test word(s[2] * s[3] * s[2]) == UInt8[2, 3, 2] + @test word(s[3] * s[2] * s[3]) == UInt8[2, 3, 2] + end -@testset "Base.:(*)(x::WeylGroupElem, w::WeightLatticeElem)" begin - R = root_system(:A, 2) - W = weyl_group(R) - - rho = weyl_vector(R) - @test longest_element(W)*rho == -rho -end + @testset "Base.:(*)(x::WeylGroupElem, w::WeightLatticeElem)" begin + R = root_system(:A, 2) + W = weyl_group(R) + + rho = weyl_vector(R) + @test longest_element(W) * rho == -rho + end -@testset "ReducedExpressionIterator" begin - W = weyl_group(:A, 3) - s = gens(W) - - # test for s1 - iter = reduced_expressions(s[1]) - @test iter.el === s[1] - @test iter.up_to_commutation == false - - re = collect(iter) - @test length(re) == 1 - @test re[1] == word(s[1]) - - # test for w0 - w0 = longest_element(W) - iter = reduced_expressions(w0) - @test iter.el === w0 - @test iter.up_to_commutation == false - - re = collect(iter) - @test length(re) == 16 - @test re[1] == word(w0) - @test re[16] == UInt8[3, 2, 1, 3, 2, 3] - - iter = reduced_expressions(w0; up_to_commutation=true) - @test iter.el === w0 - @test iter.up_to_commutation == true - - re = collect(iter) - @test length(re) == 8 - @test re[1] == word(w0) - @test re[8] == UInt8[3, 2, 3, 1, 2, 3] + @testset "ReducedExpressionIterator" begin + W = weyl_group(:A, 3) + s = gens(W) + + # test for s1 + iter = reduced_expressions(s[1]) + @test iter.el === s[1] + @test iter.up_to_commutation == false + + re = collect(iter) + @test length(re) == 1 + @test re[1] == word(s[1]) + + # test for w0 + w0 = longest_element(W) + iter = reduced_expressions(w0) + @test iter.el === w0 + @test iter.up_to_commutation == false + + re = collect(iter) + @test length(re) == 16 + @test re[1] == word(w0) + @test re[16] == UInt8[3, 2, 1, 3, 2, 3] + + iter = reduced_expressions(w0; up_to_commutation=true) + @test iter.el === w0 + @test iter.up_to_commutation == true + + re = collect(iter) + @test length(re) == 8 + @test re[1] == word(w0) + @test re[8] == UInt8[3, 2, 3, 1, 2, 3] + end end