Skip to content

Commit

Permalink
User can input reduced expression through sum of roots instead of sea…
Browse files Browse the repository at this point in the history
…rching through GAP list
  • Loading branch information
lgoettgens committed Oct 23, 2023
1 parent 35a7a5d commit 4a2bad4
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import Oscar: dim, monomial_ordering, monomials

import Base: length

# TODO basis_lie_highest_weight_lustzig
# TODO basis_lie_highest_weight_string
# TODO basis_lie_highest_weight_feigin_fflv
# TODO basis_lie_highest_weight_nZ

# TODO (?) Maybe export and docstring:
# get_dim_weightspace
# orbit_weylgroup
Expand Down
62 changes: 41 additions & 21 deletions experimental/BasisLieHighestWeight/src/MainAlgorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ basis_lie_highest_weight(
type::Symbol,
rank::Int,
highest_weight::Vector{Int};
operators::Union{String, Vector{Int}} = "regular",
reduced_expression::Union{String, Vector{Union{Int, Vector{Int}}}} = "regular",
monomial_order::Union{String, Function} = "GRevLex",
)
Expand All @@ -124,7 +124,7 @@ Computes a monomial basis for the highest weight module with highest weight
- `type`: type of liealgebra we want to investigate, one of :A, :B, :C, :D, :E, :F, :G
- `rank`: rank of liealgebra
- `highest_weight`: highest-weight
- `operators`: list of operators, either "regular" or integer array. The functionality of choosing a random longest word
- `reduced_expression`: list of operators, either "regular" or integer array. The functionality of choosing a random longest word
is currently not implemented, because we used https://github.com/jmichel7/Gapjm.jl to work with coxeter
groups need a method to obtain all non left descending elements to extend a word
- `monomial_order`: monomial order in which our basis gets defined with regards to our operators
Expand Down Expand Up @@ -321,8 +321,7 @@ Monomial basis of a highest weight module
of dimension 64
with monomial ordering oplex
over lie-Algebra of type A and rank 3
where the birational sequence used consists of operators to the following weights (given as coefficients w.r.t. alpha_
i):
where the birational sequence used consists of operators to the following weights (given as coefficients w.r.t. alpha_i):
[1, 1, 1]
[0, 1, 1]
[1, 1, 0]
Expand Down Expand Up @@ -687,18 +686,17 @@ end
function get_operators_normal(
lie_algebra::LieAlgebraStructure,
chevalley_basis::NTuple{3,Vector{GAP.Obj}},
operators::Union{String,Vector{Int},Vector{GAP.GapObj},Any},
reduced_expression::Union{String,Vector{Union{Int,Vector{Int}}},Vector{GAP.GapObj},Any},
)::Vector{GAP.Obj}
"""
handles user input for operators
"regular" for all operators
"longest-word" for random longest-word in Weyl-group (currently not implemented)
operators::Vector{Int} for explicit longest-word
reduced_expression::Vector{Int} for explicit longest-word
"""
#if typeof(operators) == GAP.Obj # If user already submitted gap-roots as operators, keep
if typeof(operators) != String && typeof(operators) != Vector{Int}
return operators
elseif operators == "regular" # create standard operators, use operators as specified by GAP
if typeof(reduced_expression) == GAP.Obj # If user already submitted gap-roots as operators, keep
return reduced_expression
elseif reduced_expression == "regular" # create standard reduced_expression, use reduced_expression as specified by GAP
return chevalley_basis[1]
# The functionality longest-word required Coxetergroups from Gapjm.jl (https://github.com/jmichel7/Gapjm.jl and was
# temporarily deleted
Expand All @@ -710,20 +708,42 @@ function get_operators_normal(
# return operators
end

# use user defined operators
# wrong input
if !(typeof(operators) == Vector{Int})
println("operators needs to be of type Vector{Int}")
return -1
end
if !(all([(1 <= i <= lie_algebra.rank) for i in operators]))
println("all values of operators need to between 1 and the rank of the lie algebra.")
# use user defined operator
# Check for incorrect input:
for x in reduced_expression
if isa(x, Int)
if !(1 <= x <= lie_algebra.rank)
error(
"Each integer in reduced_expression should be between 1 and the rank of the lie-algebra",
)
end
elseif isa(x, Vector{Int})
if !(all(1 <= i <= lie_algebra.rank for i in x))
error(
"All integers in each vector of reduced_expression should be between 1 and the rank of the lie-algebra",
)
end
else
error("Each item in reduced_expression needs to be an Int or Vector{Int}")
end
end
# If one of the conditions is met, the algorithms works. Otherwise a warning is printed (and can be ignored).
#if !(is_longest_weyl_word(type, rank, operators)) && !(Set(operators) == [i for i=1:n])
# println("WARNING: operators may be incorrect input.")
#if !(is_longest_weyl_word(type, rank, reduced_expression)) && !(Set(reduced_expression) == [i for i=1:n])
# println("WARNING: reduced_expression may be incorrect input.")
#end
operators = sub_simple_refl(operators, lie_algebra.lie_algebra_gap)
sanitized_reduced_expression = Vector{Union{Int,Vector{Int}}}() # creates an empty array of the desired type
for item in reduced_expression
if isa(item, Int)
push!(sanitized_reduced_expression, item)
elseif isa(item, Vector{Int})
push!(sanitized_reduced_expression, item)
else
error("Wrong type")
end
end
operators = get_operators_simple_reflections(
lie_algebra, chevalley_basis, sanitized_reduced_expression
)
return operators
end

Expand Down
57 changes: 55 additions & 2 deletions experimental/BasisLieHighestWeight/src/WordCalculations.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function compute_betas(
function compute_betas_lustzig(
lie_algebra::LieAlgebraStructure, word::Vector{Int}
)::Vector{Vector{Int}}
"""
Expand Down Expand Up @@ -26,6 +26,42 @@ function compute_betas(
return julia_betas
end

function compute_betas_simple_reflections(
lie_algebra::LieAlgebraStructure, word::Vector{<:Union{Int,Vector{Int}}}
)::Vector{Vector{Int}}
"""
Calculate betas from type, rank and a longest-word from the weylgroup.
"""
# Construct Gap-Objects
root_system = GAP.Globals.RootSystem(lie_algebra.lie_algebra_gap)

simple_roots = GAP.Globals.SimpleSystem(root_system)
weyl_group = GAP.Globals.WeylGroup(root_system)
sparse_cartan_matrix = GAP.Globals.SparseCartanMatrix(weyl_group)

# Positive roots
root_system = GAP.Globals.RootSystem(lie_algebra.lie_algebra_gap)
positive_roots = Vector{Vector{Int}}(GAP.Globals.PositiveRoots(root_system))

# Calculate betas by adding roots for vectors
# Root-system Gap-Objects
betas = []
for root in word
if isa(root, Int)
push!(betas, positive_roots[root])
elseif isa(root, Vector{Int})
result = zeros(Int, length(first(positive_roots)))
for idx in root
result .+= positive_roots[idx]
end
push!(betas, result)
else
error("Invalid input, only accepts Vector of Int and Vector{Int}")
end
end
return betas
end

function roots_to_root_vectors(
lie_algebra::LieAlgebraStructure,
chevalley_basis::NTuple{3,Vector{GAP.Obj}},
Expand Down Expand Up @@ -95,7 +131,24 @@ function get_operators_lustzig(
\beta_2 = \alpha_1 + \alpha_2
\beta_3 = \alpha_2
"""
betas = compute_betas(lie_algebra, reduced_expression)
betas = compute_betas_lustzig(lie_algebra, reduced_expression)
operators = roots_to_root_vectors(lie_algebra, chevalley_basis, betas)
return operators
end

function get_operators_simple_reflections(
lie_algebra::LieAlgebraStructure,
chevalley_basis::NTuple{3,Vector{GAP.Obj}},
reduced_expression::Vector{Union{Int,Vector{Int}}},
)::Vector{GAP.Obj}
"""
Computes the operators given a Vector of either the index of a positive root, or
a vector that gets evaluated as its sum. F.e.
B3, [1, [1, 2]] -> [positive root 1, positive root 4]
"""
betas = compute_betas_simple_reflections(lie_algebra, reduced_expression)
operators = roots_to_root_vectors(lie_algebra, chevalley_basis, betas)

return operators
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
word = [1, 2, 1]
lie_algebra = BasisLieHighestWeight.LieAlgebraStructure(type, rank)

betas = BasisLieHighestWeight.compute_betas(lie_algebra, word)
betas = BasisLieHighestWeight.compute_betas_lustzig(lie_algebra, word)

# Expected beta values
expected_betas = [[2, -1], [1, 1], [-1, 2]]
Expand Down

0 comments on commit 4a2bad4

Please sign in to comment.