Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Röhrich <[email protected]>
  • Loading branch information
lgoettgens and felix-roehrich committed Nov 15, 2024
1 parent 1bce706 commit d95ac6f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion experimental/LieAlgebras/docs/src/root_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The relevant types around root systems are:
- `DualRootSpaceElem` for elements in the dual root space, i.e. coroots and linear combinations thereof,
- `WeightLatticeElem` for elements in the weight lattice, i.e. weights and linear combinations thereof.

!!! warn
!!! warning
Most functionality around root systems is currently only intended to be used with root systems of finite type.
For root systems of affine type, some documentation may be ill-phrased or incorrect, and some functions may not work as intended.

Expand Down
45 changes: 24 additions & 21 deletions experimental/LieAlgebras/src/RootSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@doc raw"""
root_system(cartan_matrix::ZZMatrix; check::Bool=true, detect_type::Bool=true) -> RootSystem
root_system(cartan_matrix::Matrix{<Integer}; check::Bool=true, detect_type::Bool=true) -> RootSystem
root_system(cartan_matrix::Matrix{<:Integer}; check::Bool=true, detect_type::Bool=true) -> RootSystem
Construct the root system defined by the given (generalized) Cartan matrix.
Expand Down Expand Up @@ -249,7 +249,7 @@ If the type is not known, it is determined and stored in `R`.
See also: [`root_system_type_with_ordering(::RootSystem)`](@ref).
!!! warn
!!! warning
This function will error if the type is not known yet and the Weyl group is infinite.
"""
function root_system_type(R::RootSystem)
Expand All @@ -269,7 +269,7 @@ If the type is not known, it is determined and stored in `R`.
See also: [`root_system_type(::RootSystem)`](@ref).
!!! warn
!!! warning
This function will error if the type is not known yet and the Weyl group is infinite.
"""
function root_system_type_with_ordering(R::RootSystem)
Expand Down Expand Up @@ -578,9 +578,9 @@ See also: [`positive_coroot(::RootSystem, ::Int)`](@ref).
```jldoctest
julia> positive_coroots(root_system(:A, 2))
3-element Vector{DualRootSpaceElem}:
a^v_1
a^v_2
a^v_1 + a^v_2
a_1^v
a_2^v
a_1^v + a_2^v
```
"""
function positive_coroots(R::RootSystem)
Expand Down Expand Up @@ -622,9 +622,9 @@ See also: [`negative_coroot(::RootSystem, ::Int)`](@ref).
```jldoctest
julia> negative_coroots(root_system(:A, 2))
3-element Vector{DualRootSpaceElem}:
-a^v_1
-a^v_2
-a^v_1 - a^v_2
-a_1^v
-a_2^v
-a_1^v - a_2^v
```
"""
function negative_coroots(R::RootSystem)
Expand Down Expand Up @@ -856,9 +856,10 @@ end
Return the coefficients of the root space element `r`
w.r.t. the simple roots as a row vector.
The return type may not be relied on;
we only guarantee that it is a one-dimensional iterable with `eltype` `QQFieldElem`
that can be indexed with integers.
!!! note
The return type may not be relied on;
we only guarantee that it is a one-dimensional iterable with `eltype` `QQFieldElem`
that can be indexed with integers.
"""
function coefficients(r::RootSpaceElem)
return r.vec
Expand Down Expand Up @@ -1213,9 +1214,10 @@ end
Return the coefficients of the dual root space element `r`
w.r.t. the simple coroots as a row vector.
The return type may not be relied on;
we only guarantee that it is a one-dimensional iterable with `eltype` `QQFieldElem`
that can be indexed with integers.
!!! note
The return type may not be relied on;
we only guarantee that it is a one-dimensional iterable with `eltype` `QQFieldElem`
that can be indexed with integers.
"""
function coefficients(r::DualRootSpaceElem)
return r.vec
Expand All @@ -1240,14 +1242,14 @@ function expressify(r::DualRootSpaceElem; context=nothing)
if is_unicode_allowed()
return expressify(r, :α̌; context)
else
return expressify(r, Symbol("a^v"); context)
return expressify(r, :a, Symbol("^v"); context)
end
end

function expressify(r::DualRootSpaceElem, s; context=nothing)
function expressify(r::DualRootSpaceElem, s, s_suffix=Symbol(""); context=nothing)
sum = Expr(:call, :+)
for i in 1:length(r.vec)
push!(sum.args, Expr(:call, :*, expressify(r.vec[i]; context), "$(s)_$(i)"))
push!(sum.args, Expr(:call, :*, expressify(r.vec[i]; context), "$(s)_$(i)$(s_suffix)"))
end
return sum
end
Expand Down Expand Up @@ -1555,9 +1557,10 @@ end
Return the coefficients of the weight lattice element `w`
w.r.t. the fundamental weights as a row vector.
The return type may not be relied on;
we only guarantee that it is a one-dimensional iterable with `eltype` `ZZRingElem`
that can be indexed with integers.
!!! note
The return type may not be relied on;
we only guarantee that it is a one-dimensional iterable with `eltype` `ZZRingElem`
that can be indexed with integers.
"""
function coefficients(w::WeightLatticeElem)
return w.vec
Expand Down
6 changes: 2 additions & 4 deletions experimental/LieAlgebras/src/WeylGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ julia> weyl_group([(:G, 2), (:D, 4)])
Weyl group
of root system of rank 6
of type G2 x D4
```
"""
function weyl_group(type::Vector{Tuple{Symbol,Int}})
return weyl_group(root_system(type))
Expand Down Expand Up @@ -542,10 +543,7 @@ end
Construct an isomorphism between `W` and a group of type `FPGroup`.
This is achieved by constructing a free group with the same rank as `W`,
and adding relations corresponding to the Coxeter relations of `W`.
Also see: [`fp_group(::WeylGroup)`](@ref).
The codomain of this isomorphism is [`fp_group(::WeylGroup)`](@ref).
"""
function isomorphism(::Type{FPGroup}, W::WeylGroup; set_properties::Bool=true)
R = root_system(W)
Expand Down

0 comments on commit d95ac6f

Please sign in to comment.