Skip to content

Commit

Permalink
first commit of basisLieHighestWeight
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWilop committed Mar 24, 2023
1 parent 13cc38e commit e811583
Show file tree
Hide file tree
Showing 12 changed files with 1,400 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.12.0-DEV"
[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
AlgebraicSolving = "66b61cbe-0446-4d5d-9090-1ff510639f9d"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
GAP = "c863536a-3901-11e9-33e7-d5cd0df7b904"
Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
Expand All @@ -19,6 +20,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RandomExtensions = "fb686558-2515-59ef-acaa-46db3789a887"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Singular = "bcd08a7b-43d2-5ff7-b6d4-c458787f915c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
TOPCOM_jll = "36f60fef-b880-50dc-9289-4aaecee93cc3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Expand Down
1 change: 1 addition & 0 deletions experimental/Experimental.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ include("Schemes/BlowupMorphism.jl")
include("Schemes/ToricSchemes/include.jl")

include("ExteriorAlgebra/ExteriorAlgebra.jl")
include("basisLieHighestWeight/main.jl")
50 changes: 50 additions & 0 deletions experimental/basisLieHighestWeight/LieAlgebras.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ?

using Oscar
using SparseArrays

G = Oscar.GAP.Globals
forGap = Oscar.GAP.julia_to_gap
fromGap = Oscar.GAP.gap_to_julia


function lieAlgebra(t::String, n::Int)
"""
Creates the Lie-algebra as a GAP object that gets used for a lot other computations with GAP
"""
L = G.SimpleLieAlgebra(forGap(t), n, G.Rationals)
return L, G.ChevalleyBasis(L)
end


gapReshape(A) = sparse(hcat(A...))


function matricesForOperators(L, hw, ops)
"""
used to create tensorMatricesForOperators
"""
M = G.HighestWeightModule(L, forGap(hw))
mats = G.List(ops, o -> G.MatrixOfAction(G.Basis(M), o))
mats = gapReshape.(fromGap(mats))
d = lcm(denominator.(union(mats...)))
mats = (A->ZZ.(A*d)).(mats)
return mats
end


function weightsForOperators(L, cartan, ops)
"""
Calculates the weight wts[i] for each operator ops[i]
"""
cartan = fromGap(cartan, recursive=false)
ops = fromGap(ops, recursive=false)
asVec(v) = fromGap(G.ExtRepOfObj(v))
if any(iszero.(asVec.(ops)))
error("ops should be non-zero")
end
nzi(v) = findfirst(asVec(v) .!= 0)
return [
[asVec(h*v)[nzi(v)] / asVec(v)[nzi(v)] for h in cartan] for v in ops
]
end
50 changes: 50 additions & 0 deletions experimental/basisLieHighestWeight/LongestWord.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#using Gapjm

G = Oscar.GAP.Globals
forGap = Oscar.GAP.julia_to_gap
fromGap = Oscar.GAP.gap_to_julia

#function longest_weyl_word(t, n)
# """
# generates a reduced expression of the longest weylword of type (t,n) by choosing uniformly a random reflection that is not leftdescending
# the resulting longest words are not uniformly distributed
# """
# W = Gapjm.coxgroup(Symbol(t),n) # Weyl-group
# S = Gapjm.gens(W) # generators of W (simple reflections)
# m = length(S)
# p = W() # id
# word = [] # generated word
#
# # extend p with reflection that are not leftdescending until not possible (i.e. reached longest word)
# while true
# not_desc = [i for i=1:m if !(i in Gapjm.leftdescents(W,p))] # set of i s.t. length(S[i]*p) > length(p)
# if length(not_desc) >= 1
# i = rand(not_desc)
# push!(word, i)
# p = S[i]*p
# else
# break
# end
# end
# return word
#end

#function is_longest_weyl_word(t,n,word)
# """
# returns if word is a reduced expression of the longest weyl word of type (t,n)
# is_longest_weyl_word(t,n,longest_weyl_word(t, n)) is always true
# """
# W = Gapjm.coxgroup(Symbol(t),n) # Weyl-group
# p = W(word ...) # group element of word
# return p == longest(W) # is word longest word?
#end

function sub_simple_refl(word, L, n)
"""
substitute simple reflections (i,i+1), saved in dec by i, with E_{i,i+1}
"""
R = G.RootSystem(L)
CG = fromGap(G.CanonicalGenerators(R)[1], recursive = false)
ops = forGap([CG[i] for i in word], recursive = false)
return ops
end
Loading

0 comments on commit e811583

Please sign in to comment.