From aadf1fcfab404217a98f30946e7f1522069e359f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Mon, 25 Nov 2024 12:28:10 +0100 Subject: [PATCH] Adapt tests --- .../LieAlgebras/test/LieAlgebraModule-test.jl | 237 ++++++++++-------- 1 file changed, 132 insertions(+), 105 deletions(-) diff --git a/experimental/LieAlgebras/test/LieAlgebraModule-test.jl b/experimental/LieAlgebras/test/LieAlgebraModule-test.jl index b84ba94c5c55..cd650596fe44 100644 --- a/experimental/LieAlgebras/test/LieAlgebraModule-test.jl +++ b/experimental/LieAlgebras/test/LieAlgebraModule-test.jl @@ -780,138 +780,155 @@ end @testset "dominant_character" begin - is_dominant_weight = Oscar.LieAlgebras.is_dominant_weight - function check_dominant_character( LR::Union{LieAlgebra,RootSystem}, hw::Vector{<:Oscar.IntegerUnion} ) domchar = @inferred dominant_character(LR, hw) - @test domchar[Int.(hw)] == 1 - @test issetequal(keys(domchar), dominant_weights(Vector{Int}, LR, hw)) - @test all(is_dominant_weight, keys(domchar)) + R = LR isa RootSystem ? LR : root_system(LR) + @test domchar isa Dict{WeightLatticeElem,Int} + @test domchar[WeightLatticeElem(R, hw)] == 1 + @test issetequal(keys(domchar), dominant_weights(LR, hw)) + @test all(is_dominant, keys(domchar)) @test all(>=(1), values(domchar)) + + domchar_ZZ = @inferred dominant_character(ZZRingElem, LR, hw) + @test domchar_ZZ isa Dict{WeightLatticeElem,ZZRingElem} + @test domchar_ZZ == Dict{WeightLatticeElem,ZZRingElem}(domchar) + return domchar end # All concrete test results have been computed using the LiE CAS (http://wwwmathlabo.univ-poitiers.fr/~maavl/LiE/) v2.2.2 let R = root_system(Tuple{Symbol,Int}[]), hw = Int[] domchar = check_dominant_character(R, hw) - @test domchar == Dict(Int[] => 1) + @test domchar == Dict(WeightLatticeElem(R, Int[]) => 1) end let L = lie_algebra(QQ, :A, 2), hw = [0, 0] domchar = check_dominant_character(L, hw) - @test domchar == Dict([0, 0] => 1) + R = root_system(L) + @test domchar == Dict(WeightLatticeElem(R, [0, 0]) => 1) end let L = lie_algebra(QQ, :A, 3), hw = ZZ.([1, 1, 1]) domchar = check_dominant_character(L, hw) - @test domchar == Dict([1, 1, 1] => 1, [2, 0, 0] => 2, [0, 0, 2] => 2, [0, 1, 0] => 4) + R = root_system(L) + @test domchar == Dict( + WeightLatticeElem(R, [1, 1, 1]) => 1, + WeightLatticeElem(R, [2, 0, 0]) => 2, + WeightLatticeElem(R, [0, 0, 2]) => 2, + WeightLatticeElem(R, [0, 1, 0]) => 4, + ) end let L = lie_algebra(QQ, :C, 3), hw = [2, 0, 1] domchar = check_dominant_character(L, hw) + R = root_system(L) @test domchar == Dict( - [2, 0, 1] => 1, - [0, 1, 1] => 1, - [3, 0, 0] => 1, - [1, 1, 0] => 3, - [0, 0, 1] => 6, - [1, 0, 0] => 7, + WeightLatticeElem(R, [2, 0, 1]) => 1, + WeightLatticeElem(R, [0, 1, 1]) => 1, + WeightLatticeElem(R, [3, 0, 0]) => 1, + WeightLatticeElem(R, [1, 1, 0]) => 3, + WeightLatticeElem(R, [0, 0, 1]) => 6, + WeightLatticeElem(R, [1, 0, 0]) => 7, ) end let L = lie_algebra(QQ, :D, 4), hw = [0, 3, 1, 0] domchar = check_dominant_character(L, hw) + R = root_system(L) @test domchar == Dict( - [0, 3, 1, 0] => 1, - [1, 1, 2, 1] => 1, - [1, 2, 0, 1] => 2, - [2, 0, 3, 0] => 1, - [2, 0, 1, 2] => 2, - [0, 0, 3, 2] => 1, - [2, 1, 1, 0] => 3, - [0, 1, 3, 0] => 2, - [0, 1, 1, 2] => 3, - [0, 2, 1, 0] => 7, - [3, 0, 0, 1] => 4, - [1, 0, 2, 1] => 8, - [1, 0, 0, 3] => 4, - [1, 1, 0, 1] => 12, - [2, 0, 1, 0] => 16, - [0, 0, 3, 0] => 12, - [0, 0, 1, 2] => 16, - [0, 1, 1, 0] => 26, - [1, 0, 0, 1] => 36, - [0, 0, 1, 0] => 56, + WeightLatticeElem(R, [0, 3, 1, 0]) => 1, + WeightLatticeElem(R, [1, 1, 2, 1]) => 1, + WeightLatticeElem(R, [1, 2, 0, 1]) => 2, + WeightLatticeElem(R, [2, 0, 3, 0]) => 1, + WeightLatticeElem(R, [2, 0, 1, 2]) => 2, + WeightLatticeElem(R, [0, 0, 3, 2]) => 1, + WeightLatticeElem(R, [2, 1, 1, 0]) => 3, + WeightLatticeElem(R, [0, 1, 3, 0]) => 2, + WeightLatticeElem(R, [0, 1, 1, 2]) => 3, + WeightLatticeElem(R, [0, 2, 1, 0]) => 7, + WeightLatticeElem(R, [3, 0, 0, 1]) => 4, + WeightLatticeElem(R, [1, 0, 2, 1]) => 8, + WeightLatticeElem(R, [1, 0, 0, 3]) => 4, + WeightLatticeElem(R, [1, 1, 0, 1]) => 12, + WeightLatticeElem(R, [2, 0, 1, 0]) => 16, + WeightLatticeElem(R, [0, 0, 3, 0]) => 12, + WeightLatticeElem(R, [0, 0, 1, 2]) => 16, + WeightLatticeElem(R, [0, 1, 1, 0]) => 26, + WeightLatticeElem(R, [1, 0, 0, 1]) => 36, + WeightLatticeElem(R, [0, 0, 1, 0]) => 56, ) end let R = root_system(:E, 6), hw = [1, 0, 1, 0, 1, 0] domchar = check_dominant_character(R, hw) @test domchar == Dict( - [1, 0, 1, 0, 1, 0] => 1, - [0, 0, 0, 1, 1, 0] => 2, - [2, 1, 0, 0, 0, 1] => 3, - [0, 1, 1, 0, 0, 1] => 6, - [2, 0, 1, 0, 0, 0] => 10, - [1, 0, 0, 0, 1, 1] => 16, - [1, 2, 0, 0, 0, 0] => 15, - [0, 0, 2, 0, 0, 0] => 20, - [1, 0, 0, 1, 0, 0] => 44, - [0, 1, 0, 0, 0, 2] => 36, - [0, 1, 0, 0, 1, 0] => 92, - [2, 0, 0, 0, 0, 1] => 104, - [0, 0, 1, 0, 0, 1] => 204, - [1, 1, 0, 0, 0, 0] => 425, - [0, 0, 0, 0, 0, 2] => 416, - [0, 0, 0, 0, 1, 0] => 836, - [1, 0, 0, 0, 0, 0] => 1600, + WeightLatticeElem(R, [1, 0, 1, 0, 1, 0]) => 1, + WeightLatticeElem(R, [0, 0, 0, 1, 1, 0]) => 2, + WeightLatticeElem(R, [2, 1, 0, 0, 0, 1]) => 3, + WeightLatticeElem(R, [0, 1, 1, 0, 0, 1]) => 6, + WeightLatticeElem(R, [2, 0, 1, 0, 0, 0]) => 10, + WeightLatticeElem(R, [1, 0, 0, 0, 1, 1]) => 16, + WeightLatticeElem(R, [1, 2, 0, 0, 0, 0]) => 15, + WeightLatticeElem(R, [0, 0, 2, 0, 0, 0]) => 20, + WeightLatticeElem(R, [1, 0, 0, 1, 0, 0]) => 44, + WeightLatticeElem(R, [0, 1, 0, 0, 0, 2]) => 36, + WeightLatticeElem(R, [0, 1, 0, 0, 1, 0]) => 92, + WeightLatticeElem(R, [2, 0, 0, 0, 0, 1]) => 104, + WeightLatticeElem(R, [0, 0, 1, 0, 0, 1]) => 204, + WeightLatticeElem(R, [1, 1, 0, 0, 0, 0]) => 425, + WeightLatticeElem(R, [0, 0, 0, 0, 0, 2]) => 416, + WeightLatticeElem(R, [0, 0, 0, 0, 1, 0]) => 836, + WeightLatticeElem(R, [1, 0, 0, 0, 0, 0]) => 1600, ) end let L = lie_algebra(QQ, :G, 2), hw = [1, 2] domchar = check_dominant_character(L, hw) + R = root_system(L) @test domchar == Dict( - [1, 2] => 1, - [4, 0] => 1, - [2, 1] => 2, - [0, 2] => 2, - [3, 0] => 3, - [1, 1] => 5, - [2, 0] => 7, - [0, 1] => 7, - [1, 0] => 10, - [0, 0] => 10, + WeightLatticeElem(R, [1, 2]) => 1, + WeightLatticeElem(R, [4, 0]) => 1, + WeightLatticeElem(R, [2, 1]) => 2, + WeightLatticeElem(R, [0, 2]) => 2, + WeightLatticeElem(R, [3, 0]) => 3, + WeightLatticeElem(R, [1, 1]) => 5, + WeightLatticeElem(R, [2, 0]) => 7, + WeightLatticeElem(R, [0, 1]) => 7, + WeightLatticeElem(R, [1, 0]) => 10, + WeightLatticeElem(R, [0, 0]) => 10, ) end let L = special_linear_lie_algebra(QQ, 2), hw = [7] # type A_1 but without known root system domchar = check_dominant_character(L, hw) + R = root_system(L) @test domchar == Dict( - [7] => 1, - [5] => 1, - [3] => 1, - [1] => 1, + WeightLatticeElem(R, [7]) => 1, + WeightLatticeElem(R, [5]) => 1, + WeightLatticeElem(R, [3]) => 1, + WeightLatticeElem(R, [1]) => 1, ) end let L = special_orthogonal_lie_algebra(QQ, 7), hw = ZZ.([1, 2, 0]) # type B_3 but without known root system domchar = check_dominant_character(L, hw) + R = root_system(L) @test domchar == Dict( - [1, 2, 0] => 1, - [2, 0, 2] => 1, - [2, 1, 0] => 1, - [0, 1, 2] => 2, - [0, 2, 0] => 2, - [3, 0, 0] => 2, - [1, 0, 2] => 3, - [1, 1, 0] => 6, - [2, 0, 0] => 6, - [0, 0, 2] => 9, - [0, 1, 0] => 9, - [1, 0, 0] => 15, - [0, 0, 0] => 15, + WeightLatticeElem(R, [1, 2, 0]) => 1, + WeightLatticeElem(R, [2, 0, 2]) => 1, + WeightLatticeElem(R, [2, 1, 0]) => 1, + WeightLatticeElem(R, [0, 1, 2]) => 2, + WeightLatticeElem(R, [0, 2, 0]) => 2, + WeightLatticeElem(R, [3, 0, 0]) => 2, + WeightLatticeElem(R, [1, 0, 2]) => 3, + WeightLatticeElem(R, [1, 1, 0]) => 6, + WeightLatticeElem(R, [2, 0, 0]) => 6, + WeightLatticeElem(R, [0, 0, 2]) => 9, + WeightLatticeElem(R, [0, 1, 0]) => 9, + WeightLatticeElem(R, [1, 0, 0]) => 15, + WeightLatticeElem(R, [0, 0, 0]) => 15, ) end end @@ -921,44 +938,53 @@ LR::Union{LieAlgebra,RootSystem}, hw::Vector{<:Oscar.IntegerUnion} ) char = @inferred character(LR, hw) - @test char[Int.(hw)] == 1 + R = LR isa RootSystem ? LR : root_system(LR) + @test char isa Dict{WeightLatticeElem,Int} + @test char[WeightLatticeElem(R, hw)] == 1 @test all(>=(1), values(char)) @test sum(values(char)) == dim_of_simple_module(LR, hw) domchar = @inferred dominant_character(LR, hw) @test all(w -> domchar[w] == char[w], keys(domchar)) + + char_ZZ = @inferred character(ZZRingElem, LR, hw) + @test char_ZZ isa Dict{WeightLatticeElem,ZZRingElem} + @test char_ZZ == Dict{WeightLatticeElem,ZZRingElem}(char) + return char end # All concrete test results have been computed using the LiE CAS (http://wwwmathlabo.univ-poitiers.fr/~maavl/LiE/) v2.2.2 let R = root_system(Tuple{Symbol,Int}[]), hw = Int[] domchar = check_character(R, hw) - @test domchar == Dict(Int[] => 1) + @test domchar == Dict(WeightLatticeElem(R, Int[]) => 1) end let L = lie_algebra(QQ, :A, 2), hw = [0, 0] domchar = check_character(L, hw) - @test domchar == Dict([0, 0] => 1) + R = root_system(L) + @test domchar == Dict(WeightLatticeElem(R, [0, 0]) => 1) end let L = lie_algebra(QQ, :A, 3), hw = ZZ.([1, 1, 0]) char = check_character(L, hw) + R = root_system(L) @test char == Dict( - [1, 1, 0] => 1, - [2, -1, 1] => 1, - [-1, 2, 0] => 1, - [2, 0, -1] => 1, - [0, 0, 1] => 2, - [1, -2, 2] => 1, - [0, 1, -1] => 2, - [-2, 1, 1] => 1, - [1, -1, 0] => 2, - [-1, -1, 2] => 1, - [-2, 2, -1] => 1, - [1, 0, -2] => 1, - [-1, 0, 0] => 2, - [0, -2, 1] => 1, - [-1, 1, -2] => 1, - [0, -1, -1] => 1, + WeightLatticeElem(R, [1, 1, 0]) => 1, + WeightLatticeElem(R, [2, -1, 1]) => 1, + WeightLatticeElem(R, [-1, 2, 0]) => 1, + WeightLatticeElem(R, [2, 0, -1]) => 1, + WeightLatticeElem(R, [0, 0, 1]) => 2, + WeightLatticeElem(R, [1, -2, 2]) => 1, + WeightLatticeElem(R, [0, 1, -1]) => 2, + WeightLatticeElem(R, [-2, 1, 1]) => 1, + WeightLatticeElem(R, [1, -1, 0]) => 2, + WeightLatticeElem(R, [-1, -1, 2]) => 1, + WeightLatticeElem(R, [-2, 2, -1]) => 1, + WeightLatticeElem(R, [1, 0, -2]) => 1, + WeightLatticeElem(R, [-1, 0, 0]) => 2, + WeightLatticeElem(R, [0, -2, 1]) => 1, + WeightLatticeElem(R, [-1, 1, -2]) => 1, + WeightLatticeElem(R, [0, -1, -1]) => 1, ) end @@ -980,15 +1006,16 @@ let L = special_linear_lie_algebra(QQ, 2), hw = [7] # type A_1 but without known root system char = check_character(L, hw) + R = root_system(L) @test char == Dict( - [7] => 1, - [5] => 1, - [3] => 1, - [1] => 1, - [-1] => 1, - [-3] => 1, - [-5] => 1, - [-7] => 1, + WeightLatticeElem(R, [7]) => 1, + WeightLatticeElem(R, [5]) => 1, + WeightLatticeElem(R, [3]) => 1, + WeightLatticeElem(R, [1]) => 1, + WeightLatticeElem(R, [-1]) => 1, + WeightLatticeElem(R, [-3]) => 1, + WeightLatticeElem(R, [-5]) => 1, + WeightLatticeElem(R, [-7]) => 1, ) end