From 3855110a6d28c0b9bf5ada8f395ec7c06d21fcb3 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Wed, 29 Jan 2025 15:37:27 +0100 Subject: [PATCH 01/14] Add map_word and parabolic_subgroup(_with_projection) and corresponding exports --- experimental/LieAlgebras/src/WeylGroup.jl | 94 ++++++++++++++++++ experimental/LieAlgebras/src/exports.jl | 4 + .../LieAlgebras/test/WeylGroup-test.jl | 95 ++++++++++++++++++- 3 files changed, 192 insertions(+), 1 deletion(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index f433fb8de75e..7992ad2e1f60 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -257,3 +257,97 @@ function isomorphism(::Type{PermGroup}, W::WeylGroup; set_properties::Bool=true) return MapFromFunc(W, G, iso, isoinv) end + +@doc raw""" + map_word(w::WeylGroupElem, genimgs::Vector; init = nothing) + +If `init` is `nothing` and `word(w) = [UInt(`$i_1$`), ..., UInt(`$i_n$`)]`, then return the product $R_1 R_2 \cdots R_n$ +with $R_j =$ `genimgs[`$i_j$`]`. +Otherwise return the product $xR_1 R_2 \cdots R_n$ where $x =$ `init`. + +The length of `genimgs` must be equal to the rank of the parent of `w`. +In particular, it must not be empty. +If `w` is the trivial element, then `init` is returned if it is different +from `nothing`, and otherwise `one(genimgs[1])` is returned. + +See also: [`map_word(::Union{FPGroupElem, SubFPGroupElem}, ::Vector)`](@ref), +[`map_word(::Union{PcGroupElem, SubPcGroupElem}, ::Vector)`](@ref). +Note that `map_word(::WeylGroupElem)` does not provide a `genimgs_inv` parameter +because the generators of a Weyl group are always self-inverse. + +# Examples +```jldoctest +julia> W = weyl_group(:B, 3); imgs = [2, 3, 5]; + +julia> map_word(one(W), imgs) +1 + +julia> map_word(W([1]), imgs) +2 + +julia> map_word(W([1]), imgs, init=7) +14 + +julia> map_word(W([1,2,1]), imgs) +12 + +julia> map_word(W([2,1,2]), imgs) # W([2,1,2]) == W([1,2,1]) +12 + +julia> map_word(W([3, 2, 1, 3, 2, 3]), imgs) +2250 +``` +""" +function map_word(w::WeylGroupElem, genimgs::Vector; init=nothing) + @req length(genimgs) == number_of_generators(parent(w)) "Length of vector of images does not equal rank of Weyl group" + return Oscar.map_word([Int(i) for i in word(w)], genimgs, init=init) +end + +@doc raw""" + parabolic_subgroup(W::WeylGroup, vec::Vector{<:Integer}, w::WeylGroupElem) -> WeylGroup, Map{WeylGroup, WeylGroup} + +Returns two objects: The subgroup `U` of `W` generated by `[inv(w)*u*w for u in gens(W)[vec]]`, whose generators are set to be this vector and which is itself a `WeylGroup`, and the embedding of `U` into `W`. The elements of `vec` must be pairwise distinct integers in `1:number_of_generators(W)` and `vec` must be non-empty. +""" +function parabolic_subgroup(W::WeylGroup, vec::Vector{<:Integer}, w::WeylGroupElem=one(W)) + @req length(unique(vec)) == length(vec) "Elements of vector are not pairwise distinct" + cm = cartan_matrix(root_system(W))[vec, vec] + para = weyl_group(cm) + genimgs = map(x -> inv(w) * x * w, gens(W)[vec]) + emb = function(u::WeylGroupElem) + return map_word(u, genimgs) + end + return para, MapFromFunc(para, W, emb) +end + +@doc raw""" + parabolic_subgroup_with_projection(W::WeylGroup, vec::Vector{<:Integer}) -> WeylGroup, Map{WeylGroup, WeylGroup}, Map{WeylGroup, WeylGroup} + +Returns a triple `(U, emb, proj)` that describes a factor of `W`, that is, a product of irreducible factors. +Here the parabolic subgroup `U` and its embedding into `W` are as returned by [`parabolic_subgroup`](@ref)`(W, vec)` +and `proj` is the projection map from `W` onto `U`. +If `U` is not a factor of `W`, an error occurs. +""" +function parabolic_subgroup_with_projection(W::WeylGroup, vec::Vector{<:Integer}; check_factor::Bool=true) + if check_factor + # Check that every generator in gens(W)[vec] commutes with every other generator. + # In other words, vec describes a union of irreducible components of the Coxeter diagram. + cm = cartan_matrix(root_system(W)) + for i in vec + for j in setdiff(1:number_of_generators(W), vec) + @req coxeter_matrix_entry_from_cartan_matrix(cm, i, j) == 2 "Input vector does not describe a factor of the Weyl group, so there is no projection homomorphism" + end; + end + end + + factor, emb = parabolic_subgroup(W, vec) + # Generators of W are mapped to the corresponding generators of factor, + # or to 1 if there is no corresponding generator + proj_gen_imgs = [one(factor) for _ in 1:number_of_generators(W)] + for i in 1:length(vec) + proj_gen_imgs[vec[i]] = gen(factor, i) + end + proj = function(w::WeylGroupElem) + return map_word(w, proj_gen_imgs) + end + return factor, emb, MapFromFunc(W, factor, proj) +end \ No newline at end of file diff --git a/experimental/LieAlgebras/src/exports.jl b/experimental/LieAlgebras/src/exports.jl index 9cac5995d5f7..4a25582e4493 100644 --- a/experimental/LieAlgebras/src/exports.jl +++ b/experimental/LieAlgebras/src/exports.jl @@ -51,3 +51,7 @@ export tensor_power export tensor_product_decomposition export trivial_module export universal_enveloping_algebra + +export parabolic_subgroup +export parabolic_subgroup_with_projection +export map_word \ No newline at end of file diff --git a/experimental/LieAlgebras/test/WeylGroup-test.jl b/experimental/LieAlgebras/test/WeylGroup-test.jl index 39b25bb94953..0bfbf5f16639 100644 --- a/experimental/LieAlgebras/test/WeylGroup-test.jl +++ b/experimental/LieAlgebras/test/WeylGroup-test.jl @@ -135,4 +135,97 @@ end end end -end + + @testset "WeylGroup parabolic subgroup test for $(Wname)" for (Wname, W, vec, check_proj) in [ + ("A1", weyl_group(:A, 1), [1], true), + ("A5", weyl_group(:A, 5), [1, 5, 3], false), + ("B2", weyl_group(:B, 2), [2, 1], false), + ("F4", weyl_group(:F, 4), [2, 3], false), + ("A5+E8+D4", weyl_group((:A, 5), (:E, 8), (:D, 4)), [6:13; 1:5], true), + ( + "A3 with non-canonical ordering of simple roots", + weyl_group(root_system([2 -1 -1; -1 2 0; -1 0 2])), + [2, 3], false + ), + ( + "B4 with non-canonical ordering of simple roots", + weyl_group(root_system([2 -1 -1 0; -1 2 0 -1; -2 0 2 0; 0 -1 0 2])), + [2, 4], false + ), + ( + "complicated case 1", + begin + cm = cartan_matrix((:A, 3), (:C, 3), (:E, 6), (:G, 2)) + for _ in 1:50 + i, j = rand(1:nrows(cm), 2) + if i != j + swap_rows!(cm, i, j) + swap_cols!(cm, i, j) + end + end + weyl_group(cm) + end, + unique(rand(1:14, 5)), false + ), + ( + "complicated case 2", + begin + cm = cartan_matrix((:F, 4), (:B, 2), (:E, 7), (:G, 2)) + for _ in 1:50 + i, j = rand(1:nrows(cm), 2) + if i != j + swap_rows!(cm, i, j) + swap_cols!(cm, i, j) + end + end + weyl_group(root_system(cm)) + end, + unique(rand(1:15, 6)), false + ), + ] + for k in 1:4 + if k == 1 + # In the first run, test the standard parabolics and projections + if check_proj + para, emb, proj = parabolic_subgroup_with_projection(W, vec) + else + para, emb = parabolic_subgroup(W, vec) + end + genimgs = [gen(W, i) for i in vec] # Desired images of gens(para) in W + else + # On subsequent runs, conjugate by random elements + conj = rand(W) + para, emb = parabolic_subgroup(W, vec, conj) + genimgs = [inv(conj) * gen(W, vec[i]) * conj for i in 1:length(vec)] + end + # Test that emb maps gens(para) to genimgs + for i in 1:length(vec) + @test emb(gen(para, i)) == genimgs[i] + end + # Test that emb is a homomorphism + for _ in 1:5 + p1 = rand(para) + p2 = rand(para) + @test emb(p1) * emb(p2) == emb(p1 * p2) + end + # Test proj + if k == 1 && check_proj + # Test that proj maps gens(para) to gens(W)[vec] + for i in 1:length(vec) + @test proj(gen(W, vec[i])) == gen(para, i) + end + # Test that proj is a homomorphism + for _ in 1:5 + w1 = rand(W) + w2 = rand(W) + @test proj(w1) * proj(w2) == proj(w1 * w2) + end + # Test that proj is the left-inverse of emb + for _ in 1:5 + p = rand(para) + @test proj(emb(p)) == p + end + end + end + end +end \ No newline at end of file From dac5ab099cf793414e277a22d79e7626932acdf1 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:40:10 +0100 Subject: [PATCH 02/14] Fix small issues --- experimental/LieAlgebras/src/LieAlgebras.jl | 1 + experimental/LieAlgebras/src/WeylGroup.jl | 108 ++++++++++++++---- experimental/LieAlgebras/src/exports.jl | 6 +- .../LieAlgebras/test/WeylGroup-test.jl | 16 +-- 4 files changed, 97 insertions(+), 34 deletions(-) diff --git a/experimental/LieAlgebras/src/LieAlgebras.jl b/experimental/LieAlgebras/src/LieAlgebras.jl index 8a80ebe3075b..0b4117b99c48 100644 --- a/experimental/LieAlgebras/src/LieAlgebras.jl +++ b/experimental/LieAlgebras/src/LieAlgebras.jl @@ -69,6 +69,7 @@ import ..Oscar: isomorphism, kernel, lower_central_series, + map_word, matrix, normalizer, number_of_generators, diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index 7992ad2e1f60..9263d22b87b0 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -259,20 +259,20 @@ function isomorphism(::Type{PermGroup}, W::WeylGroup; set_properties::Bool=true) end @doc raw""" - map_word(w::WeylGroupElem, genimgs::Vector; init = nothing) + map_word(w::WeylGroupElem, genimgs::Vector; genimgs_inv::Vector = genimgs, init = nothing) -If `init` is `nothing` and `word(w) = [UInt(`$i_1$`), ..., UInt(`$i_n$`)]`, then return the product $R_1 R_2 \cdots R_n$ -with $R_j =$ `genimgs[`$i_j$`]`. +If `init` is `nothing` and `word(w) = [`$i_1$`, ..., `$i_n$`]`, +then return the product $R_1 R_2 \cdots R_n$ with $R_j =$ `genimgs[`$i_j$`]`. Otherwise return the product $xR_1 R_2 \cdots R_n$ where $x =$ `init`. The length of `genimgs` must be equal to the rank of the parent of `w`. -In particular, it must not be empty. If `w` is the trivial element, then `init` is returned if it is different -from `nothing`, and otherwise `one(genimgs[1])` is returned. +from `nothing`, and otherwise `one(genimgs[1])` is returned if `genimgs` is non-empty. +If `w` is trivial, `init` is nothing and `genimgs` is empty, an error occurs. See also: [`map_word(::Union{FPGroupElem, SubFPGroupElem}, ::Vector)`](@ref), [`map_word(::Union{PcGroupElem, SubPcGroupElem}, ::Vector)`](@ref). -Note that `map_word(::WeylGroupElem)` does not provide a `genimgs_inv` parameter +Note that `map_word(::WeylGroupElem)` accepts but ignores the `genimgs_inv` keyword argument because the generators of a Weyl group are always self-inverse. # Examples @@ -285,7 +285,7 @@ julia> map_word(one(W), imgs) julia> map_word(W([1]), imgs) 2 -julia> map_word(W([1]), imgs, init=7) +julia> map_word(W([1]), imgs; init=7) 14 julia> map_word(W([1,2,1]), imgs) @@ -298,22 +298,57 @@ julia> map_word(W([3, 2, 1, 3, 2, 3]), imgs) 2250 ``` """ -function map_word(w::WeylGroupElem, genimgs::Vector; init=nothing) - @req length(genimgs) == number_of_generators(parent(w)) "Length of vector of images does not equal rank of Weyl group" - return Oscar.map_word([Int(i) for i in word(w)], genimgs, init=init) +function map_word( + w::WeylGroupElem, genimgs::Vector; genimgs_inv::Vector=genimgs, init=nothing +) + @req length(genimgs) == number_of_generators(parent(w)) begin + "Length of vector of images does not equal rank of Weyl group" + end + return map_word(Int.(word(w)), genimgs; init=init) end @doc raw""" - parabolic_subgroup(W::WeylGroup, vec::Vector{<:Integer}, w::WeylGroupElem) -> WeylGroup, Map{WeylGroup, WeylGroup} + parabolic_subgroup(W::WeylGroup, vec::Vector{<:Integer}, w::WeylGroupElem=one(W)) -> WeylGroup, Map{WeylGroup, WeylGroup} + +Return a Weyl group `P` and an embedding $f:P\to W$ such that $f(P)$ is +the subgroup `U` of `W` generated by `[inv(w)*u*w for u in gens(W)[vec]]`. +Further, `f` maps `gen(P, i)` to `inv(w)*gen(W, vec[i])*w`. +The elements of `vec` must be pairwise distinct integers in +`1:number_of_generators(W)` and `vec` must be non-empty. + +# Examples +```jldoctest +julia> W = weyl_group(:B, 3) +Weyl group + of root system of rank 3 + of type B3 + +julia> P1, f1 = parabolic_subgroup(W, [1, 2]) +(Weyl group of root system of type A2, Map: P1 -> W) + +julia> f1(P1[1] * P1[2]) == W[1] * W[2] +true + +julia> P2, f2 = parabolic_subgroup(W, [1, 2], W[1]) +(Weyl group of root system of type A2, Map: P2 -> W) + +julia> f2(P2[1]) == W[1] && f2(P2[2]) == W[1] * W[2] * W[1] +true + +julia> P3, f3 = parabolic_subgroup(W, [1,3,2]) +(Weyl group of root system of type B3 (non-canonical ordering), Map: P3 -> W) -Returns two objects: The subgroup `U` of `W` generated by `[inv(w)*u*w for u in gens(W)[vec]]`, whose generators are set to be this vector and which is itself a `WeylGroup`, and the embedding of `U` into `W`. The elements of `vec` must be pairwise distinct integers in `1:number_of_generators(W)` and `vec` must be non-empty. +julia> f3(P3[2]) == W[3] +true +``` """ function parabolic_subgroup(W::WeylGroup, vec::Vector{<:Integer}, w::WeylGroupElem=one(W)) - @req length(unique(vec)) == length(vec) "Elements of vector are not pairwise distinct" + @req allunique(vec) "Elements of vector are not pairwise distinct" + @req all(i -> 1 <= i <= number_of_generators(W), vec) "Invalid indices" cm = cartan_matrix(root_system(W))[vec, vec] para = weyl_group(cm) genimgs = map(x -> inv(w) * x * w, gens(W)[vec]) - emb = function(u::WeylGroupElem) + emb = function (u::WeylGroupElem) return map_word(u, genimgs) end return para, MapFromFunc(para, W, emb) @@ -322,20 +357,47 @@ end @doc raw""" parabolic_subgroup_with_projection(W::WeylGroup, vec::Vector{<:Integer}) -> WeylGroup, Map{WeylGroup, WeylGroup}, Map{WeylGroup, WeylGroup} -Returns a triple `(U, emb, proj)` that describes a factor of `W`, that is, a product of irreducible factors. -Here the parabolic subgroup `U` and its embedding into `W` are as returned by [`parabolic_subgroup`](@ref)`(W, vec)` -and `proj` is the projection map from `W` onto `U`. -If `U` is not a factor of `W`, an error occurs. +Return a triple `(P, emb, proj)` that describes a factor of `W`, that is, +a product of irreducible factors. +Here `P, emb = `[`parabolic_subgroup`](@ref)`(W, vec)` +and `proj` is the projection map from `W` onto `P`, +which is a left-inverse of `emb`. +If `P` is not a factor of `W`, an error occurs. + +# Examples +```jldoctest +julia> W = weyl_group([(:A, 3), (:B, 3)]) +Weyl group + of root system of rank 6 + of type A3 x B3 + +julia> P1, f1, p1 = parabolic_subgroup_with_projection(W, [1,2,3]) +(Weyl group of root system of type A3, Map: P1 -> W, Map: W -> P1) + +julia> p1(W[1]*W[4]*W[2]*W[6]) == P1[1] * P1[2] +true + +julia> P2, f2, p2 = parabolic_subgroup_with_projection(W, [4,6,5]) +(Weyl group of root system of type B3 (non-canonical ordering), Map: P2 -> W, Map: W -> P2) + +julia> p2(W[5]) == P2[3] +true +``` """ -function parabolic_subgroup_with_projection(W::WeylGroup, vec::Vector{<:Integer}; check_factor::Bool=true) +function parabolic_subgroup_with_projection( + W::WeylGroup, vec::Vector{<:Integer}; check_factor::Bool=true +) if check_factor # Check that every generator in gens(W)[vec] commutes with every other generator. # In other words, vec describes a union of irreducible components of the Coxeter diagram. cm = cartan_matrix(root_system(W)) for i in vec for j in setdiff(1:number_of_generators(W), vec) - @req coxeter_matrix_entry_from_cartan_matrix(cm, i, j) == 2 "Input vector does not describe a factor of the Weyl group, so there is no projection homomorphism" - end; + @req is_zero_entry(cm, i, j) begin + "Input vector does not describe a factor of the Weyl group, \ + so there is no projection homomorphism" + end + end end end @@ -346,8 +408,8 @@ function parabolic_subgroup_with_projection(W::WeylGroup, vec::Vector{<:Integer} for i in 1:length(vec) proj_gen_imgs[vec[i]] = gen(factor, i) end - proj = function(w::WeylGroupElem) + proj = function (w::WeylGroupElem) return map_word(w, proj_gen_imgs) end return factor, emb, MapFromFunc(W, factor, proj) -end \ No newline at end of file +end diff --git a/experimental/LieAlgebras/src/exports.jl b/experimental/LieAlgebras/src/exports.jl index 4a25582e4493..f162db6add27 100644 --- a/experimental/LieAlgebras/src/exports.jl +++ b/experimental/LieAlgebras/src/exports.jl @@ -40,6 +40,8 @@ export killing_matrix export lie_algebra export lower_central_series export matrix_repr_basis +export parabolic_subgroup +export parabolic_subgroup_with_projection export show_dynkin_diagram export simple_module export special_linear_lie_algebra @@ -51,7 +53,3 @@ export tensor_power export tensor_product_decomposition export trivial_module export universal_enveloping_algebra - -export parabolic_subgroup -export parabolic_subgroup_with_projection -export map_word \ No newline at end of file diff --git a/experimental/LieAlgebras/test/WeylGroup-test.jl b/experimental/LieAlgebras/test/WeylGroup-test.jl index 0bfbf5f16639..bee847954237 100644 --- a/experimental/LieAlgebras/test/WeylGroup-test.jl +++ b/experimental/LieAlgebras/test/WeylGroup-test.jl @@ -136,7 +136,9 @@ end end - @testset "WeylGroup parabolic subgroup test for $(Wname)" for (Wname, W, vec, check_proj) in [ + @testset "WeylGroup parabolic subgroup test for $(Wname)" for ( + Wname, W, vec, check_proj + ) in [ ("A1", weyl_group(:A, 1), [1], true), ("A5", weyl_group(:A, 5), [1, 5, 3], false), ("B2", weyl_group(:B, 2), [2, 1], false), @@ -145,12 +147,12 @@ ( "A3 with non-canonical ordering of simple roots", weyl_group(root_system([2 -1 -1; -1 2 0; -1 0 2])), - [2, 3], false + [2, 3], false, ), ( "B4 with non-canonical ordering of simple roots", weyl_group(root_system([2 -1 -1 0; -1 2 0 -1; -2 0 2 0; 0 -1 0 2])), - [2, 4], false + [2, 4], false, ), ( "complicated case 1", @@ -165,7 +167,7 @@ end weyl_group(cm) end, - unique(rand(1:14, 5)), false + unique(rand(1:14, 5)), false, ), ( "complicated case 2", @@ -180,12 +182,12 @@ end weyl_group(root_system(cm)) end, - unique(rand(1:15, 6)), false + unique(rand(1:15, 6)), false, ), ] for k in 1:4 if k == 1 - # In the first run, test the standard parabolics and projections + # On the first run, test the standard parabolics and projections if check_proj para, emb, proj = parabolic_subgroup_with_projection(W, vec) else @@ -228,4 +230,4 @@ end end end -end \ No newline at end of file +end From bc81b5fc743b6aac95a2a506043553c5a7896516 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 30 Jan 2025 15:05:01 +0100 Subject: [PATCH 03/14] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/LieAlgebras/src/WeylGroup.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index 9263d22b87b0..77df4f1bd733 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -394,8 +394,7 @@ function parabolic_subgroup_with_projection( for i in vec for j in setdiff(1:number_of_generators(W), vec) @req is_zero_entry(cm, i, j) begin - "Input vector does not describe a factor of the Weyl group, \ - so there is no projection homomorphism" + "Input vector does not describe a factor of the Weyl group, so there is no projection homomorphism" end end end From 90a055e9e197c20bae0fec4a1c45a7734b5e6797 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Thu, 30 Jan 2025 20:23:20 +0100 Subject: [PATCH 04/14] Use map_word in isomorphism(PermGroup, ...) --- experimental/LieAlgebras/src/WeylGroup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index 77df4f1bd733..47393cd5450f 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -247,7 +247,7 @@ function isomorphism(::Type{PermGroup}, W::WeylGroup; set_properties::Bool=true) end iso = function (w::WeylGroupElem) - reduce(*, (gen(G, Int(i)) for i in word(w)); init=one(G)) + map_word(w, gens(G); init=one(G)) end isoinv = function (p::PermGroupElem) From 1eb90771d2648297a92c0777e451ab98e4e6ea8d Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Thu, 30 Jan 2025 20:26:46 +0100 Subject: [PATCH 05/14] Add ref to map_word(::WeylGroupElem) in map_word(::FPGroupElem) and map_word(::PcGroupElem) --- src/Groups/GAPGroups.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Groups/GAPGroups.jl b/src/Groups/GAPGroups.jl index a876eeed8a43..1d5d5d0fef1b 100644 --- a/src/Groups/GAPGroups.jl +++ b/src/Groups/GAPGroups.jl @@ -2023,7 +2023,8 @@ If `init == nothing` and `genimgs` is empty, an error occurs. Thus the intended value for the empty word must be specified as `init` whenever it is possible that the elements in `genimgs` do not support `one`. -See also: [`map_word(::Union{PcGroupElem, SubPcGroupElem}, ::Vector)`](@ref). +See also: [`map_word(::Union{PcGroupElem, SubPcGroupElem}, ::Vector)`](@ref), +[`map_word(::WeylGroupElem, ::Vector)](@ref). # Examples ```jldoctest @@ -2106,7 +2107,8 @@ and $R_j =$ `genimgs[`$i_j$`]`$^{e_j}$. If `init` is different from `nothing`, return $x g_{i_1}^{e_1} g_{i_2}^{e_2} \cdots g_{i_n}^{e_n}$ where $x =$ `init`. -See also: [`map_word(::Union{FPGroupElem, SubFPGroupElem}, ::Vector)`](@ref). +See also: [`map_word(::Union{FPGroupElem, SubFPGroupElem}, ::Vector)`](@ref), +[`map_word(::WeylGroupElem, ::Vector)](@ref). # Examples ```jldoctest From 23b6b1ca130bc6570a08b57f1da5f0db596b2217 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:27:58 +0100 Subject: [PATCH 06/14] Adapt error message in parabolic_subgroup_with_projection Co-authored-by: Max Horn --- experimental/LieAlgebras/src/WeylGroup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index 47393cd5450f..39e67bbed96d 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -394,7 +394,7 @@ function parabolic_subgroup_with_projection( for i in vec for j in setdiff(1:number_of_generators(W), vec) @req is_zero_entry(cm, i, j) begin - "Input vector does not describe a factor of the Weyl group, so there is no projection homomorphism" + "Input vector must describe a direct factor of the Weyl group" end end end From 00a8b5bef3c5f59385ae46ce33ed050f46ae3e42 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:39:15 +0100 Subject: [PATCH 07/14] Use conj Co-authored-by: Max Horn --- experimental/LieAlgebras/src/WeylGroup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index 39e67bbed96d..f4381107e879 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -347,7 +347,7 @@ function parabolic_subgroup(W::WeylGroup, vec::Vector{<:Integer}, w::WeylGroupEl @req all(i -> 1 <= i <= number_of_generators(W), vec) "Invalid indices" cm = cartan_matrix(root_system(W))[vec, vec] para = weyl_group(cm) - genimgs = map(x -> inv(w) * x * w, gens(W)[vec]) + genimgs = [conj(W[i], w) for i in vec] emb = function (u::WeylGroupElem) return map_word(u, genimgs) end From 489da37c784626bc7e2e081c4b35f3dedeb43ea8 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:43:29 +0100 Subject: [PATCH 08/14] Use conj in parabolic subgroup test Co-authored-by: Max Horn --- experimental/LieAlgebras/test/WeylGroup-test.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/experimental/LieAlgebras/test/WeylGroup-test.jl b/experimental/LieAlgebras/test/WeylGroup-test.jl index bee847954237..2d0faed577c4 100644 --- a/experimental/LieAlgebras/test/WeylGroup-test.jl +++ b/experimental/LieAlgebras/test/WeylGroup-test.jl @@ -196,9 +196,9 @@ genimgs = [gen(W, i) for i in vec] # Desired images of gens(para) in W else # On subsequent runs, conjugate by random elements - conj = rand(W) - para, emb = parabolic_subgroup(W, vec, conj) - genimgs = [inv(conj) * gen(W, vec[i]) * conj for i in 1:length(vec)] + r = rand(W) + para, emb = parabolic_subgroup(W, vec, r) + genimgs = [conj(W[i], r) for i in vec] end # Test that emb maps gens(para) to genimgs for i in 1:length(vec) From cad4863e41af594e43a7d27e51637c3834900897 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:44:26 +0100 Subject: [PATCH 09/14] Clarify doc of map_word Co-authored-by: Max Horn --- experimental/LieAlgebras/src/WeylGroup.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index f4381107e879..d48be79ffb4d 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -272,8 +272,9 @@ If `w` is trivial, `init` is nothing and `genimgs` is empty, an error occurs. See also: [`map_word(::Union{FPGroupElem, SubFPGroupElem}, ::Vector)`](@ref), [`map_word(::Union{PcGroupElem, SubPcGroupElem}, ::Vector)`](@ref). -Note that `map_word(::WeylGroupElem)` accepts but ignores the `genimgs_inv` keyword argument -because the generators of a Weyl group are always self-inverse. +Note that `map_word(::WeylGroupElem)` accepts the `genimgs_inv` keyword argument +for consistency with other `map_word` methods, but ignores it because the +generators of a Weyl group are always self-inverse. # Examples ```jldoctest From f6b733fa59c9d5f914bec3485303aeefedece26d Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:47:25 +0100 Subject: [PATCH 10/14] Use fill for vector initialisation Co-authored-by: Max Horn --- experimental/LieAlgebras/src/WeylGroup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index d48be79ffb4d..f587b2549411 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -404,7 +404,7 @@ function parabolic_subgroup_with_projection( factor, emb = parabolic_subgroup(W, vec) # Generators of W are mapped to the corresponding generators of factor, # or to 1 if there is no corresponding generator - proj_gen_imgs = [one(factor) for _ in 1:number_of_generators(W)] + proj_gen_imgs = fill(one(factor), ngens(W)) for i in 1:length(vec) proj_gen_imgs[vec[i]] = gen(factor, i) end From 675603d4c3febbbac0185230e1425b4cb5ea8525 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:50:01 +0100 Subject: [PATCH 11/14] Switch for loops Co-authored-by: Max Horn --- experimental/LieAlgebras/src/WeylGroup.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index f587b2549411..e417a73a0edb 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -392,8 +392,8 @@ function parabolic_subgroup_with_projection( # Check that every generator in gens(W)[vec] commutes with every other generator. # In other words, vec describes a union of irreducible components of the Coxeter diagram. cm = cartan_matrix(root_system(W)) - for i in vec - for j in setdiff(1:number_of_generators(W), vec) + for i in setdiff(1:number_of_generators(W), vec) + for j in vec @req is_zero_entry(cm, i, j) begin "Input vector must describe a direct factor of the Weyl group" end From 6687dc15e7e09e4c428b64548029771a22cfc6b1 Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Tue, 4 Feb 2025 09:52:39 +0100 Subject: [PATCH 12/14] Document check --- experimental/LieAlgebras/src/WeylGroup.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index e417a73a0edb..2d536f5e16dc 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -363,7 +363,8 @@ a product of irreducible factors. Here `P, emb = `[`parabolic_subgroup`](@ref)`(W, vec)` and `proj` is the projection map from `W` onto `P`, which is a left-inverse of `emb`. -If `P` is not a factor of `W`, an error occurs. +If `check = true`, then it is checked whether `vec` actually describes +a union of irreducible components of the Dynkin diagram. # Examples ```jldoctest @@ -386,9 +387,9 @@ true ``` """ function parabolic_subgroup_with_projection( - W::WeylGroup, vec::Vector{<:Integer}; check_factor::Bool=true + W::WeylGroup, vec::Vector{<:Integer}; check::Bool=true ) - if check_factor + if check # Check that every generator in gens(W)[vec] commutes with every other generator. # In other words, vec describes a union of irreducible components of the Coxeter diagram. cm = cartan_matrix(root_system(W)) From 345cc85028c93312f739b5b915a2fe77ae4a2d5c Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Tue, 4 Feb 2025 11:10:06 +0100 Subject: [PATCH 13/14] Update experimental/LieAlgebras/src/WeylGroup.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/LieAlgebras/src/WeylGroup.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index 2d536f5e16dc..0e2fa062f96a 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -356,7 +356,7 @@ function parabolic_subgroup(W::WeylGroup, vec::Vector{<:Integer}, w::WeylGroupEl end @doc raw""" - parabolic_subgroup_with_projection(W::WeylGroup, vec::Vector{<:Integer}) -> WeylGroup, Map{WeylGroup, WeylGroup}, Map{WeylGroup, WeylGroup} + parabolic_subgroup_with_projection(W::WeylGroup, vec::Vector{<:Integer}; check::Bool=true) -> WeylGroup, Map{WeylGroup, WeylGroup}, Map{WeylGroup, WeylGroup} Return a triple `(P, emb, proj)` that describes a factor of `W`, that is, a product of irreducible factors. From 834868a4c1eb85774104776ae4b93a2e3be0069e Mon Sep 17 00:00:00 2001 From: Torben Wiedemann <7226617+TWiedemann@users.noreply.github.com> Date: Tue, 4 Feb 2025 11:10:52 +0100 Subject: [PATCH 14/14] Update experimental/LieAlgebras/src/WeylGroup.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lars Göttgens --- experimental/LieAlgebras/src/WeylGroup.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/experimental/LieAlgebras/src/WeylGroup.jl b/experimental/LieAlgebras/src/WeylGroup.jl index 0e2fa062f96a..9da551e098a2 100644 --- a/experimental/LieAlgebras/src/WeylGroup.jl +++ b/experimental/LieAlgebras/src/WeylGroup.jl @@ -363,6 +363,7 @@ a product of irreducible factors. Here `P, emb = `[`parabolic_subgroup`](@ref)`(W, vec)` and `proj` is the projection map from `W` onto `P`, which is a left-inverse of `emb`. + If `check = true`, then it is checked whether `vec` actually describes a union of irreducible components of the Dynkin diagram.