-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental: Add BasisLieHighestWeight
#2936
Merged
micjoswig
merged 87 commits into
oscar-system:master
from
lgoettgens:gf/BasisLieHighestWeight
Nov 23, 2023
Merged
Changes from 86 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
6dec9fd
Code from BasisLieHighestWeight, Pull request oscar-system/Oscar.jl#2115
BenWilop b0e48d4
Removed part of fromGap, gens(ZZx) instaed of x
BenWilop 613f831
Simplified paramters with structures and recomputation
BenWilop 21909b3
TODOs
BenWilop cae54aa
Added test-files, removed TVec
BenWilop 856d74c
Removed nullSpace()
BenWilop cab59f4
VectorSpaceBases-test.jl
BenWilop f68e0be
NewMonomial-test.jl
BenWilop 9ca1a0c
compute_sub_weights
BenWilop 35e0407
Added GAPWrap instead of GAP.Globals where possible
BenWilop f9d7635
Custom print functions for the structures
BenWilop 15ff68c
tabs to indents
BenWilop 004d992
Doctest basis_lie_highest_weight
BenWilop aa9c0cd
Changed get_monomial_order_lt to accept name of monomial-order as def…
BenWilop d96e300
function body of special basis_lie_highest_weight functions
BenWilop 8a1b5b0
.
BenWilop b314bd1
DemazureOperators
BenWilop 75a1b56
demazure_operators_summary
BenWilop b1c2441
oplex_lt
BenWilop c89f9b8
Bugfix ZZ(0) in result instead of ZZ(1)
BenWilop 75f3445
Comments
BenWilop fc81361
Bugfix demazure_operator order of operators
BenWilop 860ee5a
Root Conversion with QQ
BenWilop 62ca83b
RootConversion-test and -data
BenWilop 5798828
Bugfix rootconverison A
BenWilop ef8b21b
Bugfix root-conversion D
BenWilop 708ad8f
Bugfix root-conversion F
BenWilop d37e31f
Bugfix root-conversion E8
BenWilop 40eb331
CalculateBetas, CalculateBetas-test
BenWilop 6a0caa7
root_to_root_vector
BenWilop bdff013
compute_operators_lustzig_nz
BenWilop 8debb93
Operators as Julia-vectors, find_root_in_chevalley_basis
BenWilop 14d5a9e
basis_lie_highest_weight_lustzig
BenWilop 0fe0f08
Docstring and adapted methods for lustzig, nz, fflv, string
BenWilop be7fc73
Print Birational-sequence with alpha_i
BenWilop 1e3e63d
Word-calculations only for lustzig
BenWilop b3c46da
Remove Documenter.jl as dep
lgoettgens 979fd34
Run JuliaFormatter
lgoettgens 78485c5
Fix root conversion
lgoettgens 5b440ee
Make tests green
lgoettgens d53c1b2
Make RootConversion tests faster
lgoettgens c3657b7
Use lowercase constructors
lgoettgens a617724
Refactor root conversion
lgoettgens 1d0bc6d
Remove workaround for old issues
lgoettgens c9db616
Move some stuff around
lgoettgens bc35796
Change dynkin type to symbol
lgoettgens 3024eb9
Fix doctests
lgoettgens 60acd9f
Add basic docs
lgoettgens 6b46f95
Excise uses of `gap_to_julia` and `julia_to_gap`
lgoettgens fc4e052
Enhance printing of output
lgoettgens 8a920f9
Remove `cache_size`
lgoettgens 2e60526
Remove lots of unused code
lgoettgens 3cc7027
Bugfix: Reverse operator list for FFLV
BenWilop 1894b79
User can input reduced expression through sum of roots instead of sea…
lgoettgens a76cb5c
Refactor polyhedral code
lgoettgens 7906b0e
Change `get_lattice_points_of_weightspace` to accept input in alpha_i
lgoettgens 2f7f5c6
Excise all uses of weights in eps_i basis
lgoettgens 5952ecb
Change monomial ordering inputs to symbols
lgoettgens da01078
`order` -> `ordering`
lgoettgens c17b4be
Refactor passing around lie_algebra
lgoettgens 0b28288
Move user facing functions to separate file
lgoettgens 5926d29
Adapt input to Ghislain's whishes
lgoettgens 5aef659
Make weighted orderings work
lgoettgens c6f7811
Add function to print operators
lgoettgens 027f96d
Replace all uses of `convert`
lgoettgens d17f03c
Refactor algorithm input and some Lie algebra stuff
lgoettgens 944dbf6
More random refactoring
lgoettgens 6695adf
More monomial ordering changes
lgoettgens f5dc7b0
Excise `SparseVectorSpaceBasis`
lgoettgens efa4451
Fix spelling [skip ci]
lgoettgens f1b2914
`isweighted` -> `_is_weighted`
lgoettgens 083ec19
Fix doctests
lgoettgens 123c942
Skip sorting of monomials
lgoettgens bd11db1
Merge branch 'master' into gf/BasisLieHighestWeight
lgoettgens ff01ab8
Fix printing
lgoettgens 19b2c3f
Merge remote-tracking branch 'origin/gf/BasisLieHighestWeight' into g…
lgoettgens b2b9373
Fix deprecation warning
lgoettgens 40800a8
Add docstrings to `UserFunctions.jl`
lgoettgens 4f827fb
Add tests against Xin's output
lgoettgens e79a64a
Remove unnecessary printings
lgoettgens eb5494f
Add exports
lgoettgens 62f83cf
Adjust printing to Ghislain's whishes
lgoettgens 8ce5c19
Apply suggestions from code review
lgoettgens 68539ae
Fix typo in printing
lgoettgens 1d85a83
Merge remote-tracking branch 'origin/gf/BasisLieHighestWeight' into g…
lgoettgens f6c3319
Fix visibility issue
lgoettgens 99f833a
Add all documented functions to docs
lgoettgens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
"introduction.md" | ||
] |
25 changes: 25 additions & 0 deletions
25
experimental/BasisLieHighestWeight/docs/src/introduction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
```@meta | ||
CurrentModule = Oscar | ||
DocTestSetup = quote | ||
using Oscar | ||
end | ||
``` | ||
|
||
# Introduction | ||
|
||
This subproject contains the code for the OSCAR book chapter by Ghislain Fourier and Xin Fang on the bases of highest weight modules. | ||
|
||
## Status | ||
|
||
This part of OSCAR is in an experimental state; please see [Adding new projects to experimental](@ref) for what this means. | ||
More documentation is to come in the future. | ||
|
||
## Contact | ||
|
||
Please direct questions about this part of OSCAR to the following people: | ||
* [Ghislain Fourier](https://www.art.rwth-aachen.de/cms/~rnko/) | ||
* [Lars Göttgens](https://lgoe.li/) | ||
|
||
You can ask questions in the [OSCAR Slack](https://www.oscar-system.org/community/#slack). | ||
|
||
Alternatively, you can [raise an issue on github](https://www.oscar-system.org/community/#how-to-report-issues). |
59 changes: 59 additions & 0 deletions
59
experimental/BasisLieHighestWeight/src/BasisLieHighestWeight.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
module BasisLieHighestWeight | ||
|
||
using ..Oscar | ||
using ..Oscar: GAPWrap, IntegerUnion, _is_weighted | ||
|
||
using AbstractAlgebra.PrettyPrinting | ||
|
||
import Oscar: dim, monomial_ordering, monomials | ||
|
||
import Base: length | ||
|
||
# TODO: Test if ZZx should be a graded_polynomial_ring with weights_w as weights | ||
|
||
# TODO (?) Maybe export and docstring: | ||
# get_dim_weightspace | ||
# orbit_weylgroup | ||
# get_lattice_points_of_weightspace | ||
# convert_lattice_points_to_monomials | ||
# convert_monomials_to_lattice_points | ||
# action_matrices_of_operators | ||
# weights_for_operators | ||
|
||
# TODO Use Oscar-Lie-Algebra type instead of LieAlgebra | ||
# TODO Data-Type for weights of Lie-Algebras? Two types, in alpha_i and w_i, conversion is defined in RootConversion | ||
# w_to_aplha | ||
# alpha_to_w | ||
|
||
# TODO GAPWrap-wrappers are missing | ||
|
||
include("LieAlgebras.jl") | ||
include("BirationalSequence.jl") | ||
include("MonomialBasis.jl") | ||
include("NewMonomial.jl") | ||
include("TensorModels.jl") | ||
include("MonomialOrder.jl") | ||
include("RootConversion.jl") | ||
include("WeylPolytope.jl") | ||
include("MainAlgorithm.jl") | ||
include("UserFunctions.jl") | ||
|
||
export basis_lie_highest_weight_operators | ||
export basis_lie_highest_weight | ||
export basis_lie_highest_weight_lusztig | ||
export basis_lie_highest_weight_nz | ||
export basis_lie_highest_weight_pbw | ||
export basis_lie_highest_weight_string | ||
|
||
end | ||
|
||
using .BasisLieHighestWeight | ||
|
||
export BasisLieHighestWeight | ||
|
||
export basis_lie_highest_weight_operators | ||
export basis_lie_highest_weight | ||
export basis_lie_highest_weight_lusztig | ||
export basis_lie_highest_weight_nz | ||
export basis_lie_highest_weight_pbw | ||
export basis_lie_highest_weight_string |
12 changes: 12 additions & 0 deletions
12
experimental/BasisLieHighestWeight/src/BirationalSequence.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
struct BirationalSequence | ||
operators::Vector{GAP.Obj} | ||
operators_vectors::Vector{Vector{Any}} | ||
weights_w::Vector{Vector{ZZRingElem}} | ||
weights_alpha::Vector{Vector{QQFieldElem}} | ||
end | ||
|
||
function Base.show(io::IO, birational_sequence::BirationalSequence) | ||
println(io, "BirationalSequence") | ||
println(io, "Operators: ", birational_sequence.operators) | ||
print(io, "Weights in alpha_i:", birational_sequence.weights_alpha) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
@attributes mutable struct LieAlgebraStructure | ||
lie_type::Symbol | ||
rank::Int | ||
lie_algebra_gap::GAP.Obj | ||
chevalley_basis::NTuple{3,Vector{GAP.Obj}} | ||
|
||
function LieAlgebraStructure(lie_type::Symbol, rank::Int) | ||
lie_algebra_gap = GAP.Globals.SimpleLieAlgebra( | ||
GAP.Obj(lie_type), rank, GAP.Globals.Rationals | ||
) | ||
chevalley_basis = NTuple{3,Vector{GAP.Obj}}(GAP.Globals.ChevalleyBasis(lie_algebra_gap)) | ||
return new(lie_type, rank, lie_algebra_gap, chevalley_basis) | ||
end | ||
end | ||
|
||
rank(L::LieAlgebraStructure) = L.rank | ||
|
||
@attr QQMatrix function cartan_matrix(L::LieAlgebraStructure) | ||
R = GAP.Globals.RootSystem(L.lie_algebra_gap) | ||
C = matrix(QQ, GAP.Globals.CartanMatrix(R)) | ||
return C | ||
end | ||
|
||
@attr QQMatrix function inv_cartan_matrix(L::LieAlgebraStructure) | ||
return inv(cartan_matrix(L)) | ||
end | ||
|
||
function Base.show(io::IO, L::LieAlgebraStructure) | ||
io = pretty(io) | ||
print(io, LowercaseOff(), "Lie algebra of type $(L.lie_type)$(L.rank)") | ||
end | ||
|
||
function lie_algebra(type::Symbol, rk::Int) | ||
return LieAlgebraStructure(type, rk) | ||
end | ||
|
||
function chevalley_basis_gap(L::LieAlgebraStructure) | ||
return L.chevalley_basis | ||
end | ||
|
||
function cartan_sub_basis(L::LieAlgebraStructure) | ||
return L.chevalley_basis[3] | ||
end | ||
|
||
function root_system_gap(L::LieAlgebraStructure) | ||
return GAP.Globals.RootSystem(L.lie_algebra_gap) | ||
end | ||
|
||
function num_positive_roots(L::LieAlgebraStructure) | ||
return length(GAP.Globals.PositiveRoots(root_system_gap(L))) | ||
end | ||
|
||
function matrices_of_operators_gap( | ||
L::LieAlgebraStructure, highest_weight::Vector{ZZRingElem}, operators::Vector{GAP.Obj} | ||
) | ||
""" | ||
used to create action_matrices_of_operators | ||
""" | ||
M = GAP.Globals.HighestWeightModule(L.lie_algebra_gap, GAP.Obj(Int.(highest_weight))) | ||
matrices_of_operators = [ | ||
sparse_matrix(transpose(matrix(QQ, GAP.Globals.MatrixOfAction(GAPWrap.Basis(M), o)))) # TODO: remove transpose? | ||
for o in operators | ||
] | ||
denominators = map(y -> denominator(y[2]), union(union(matrices_of_operators...)...)) | ||
common_denominator = lcm(denominators)# // 1 | ||
matrices_of_operators = | ||
(A -> change_base_ring(ZZ, common_denominator * A)).(matrices_of_operators) | ||
return matrices_of_operators | ||
end | ||
|
||
function weight(L::LieAlgebraStructure, operator::GAP.Obj) | ||
""" | ||
Calculates the weight in w_i for operator | ||
""" | ||
@req !iszero(operator) "Operators should be non-zero" | ||
basis = GAP.Globals.Basis(L.lie_algebra_gap) | ||
basis_ind = GAP.Globals.Position(basis, operator) | ||
denom = GAP.Globals.Coefficients(basis, operator)[basis_ind] | ||
return [ | ||
ZZ(GAP.Globals.Coefficients(basis, h * operator)[basis_ind]//denom) for | ||
h in cartan_sub_basis(L) | ||
] | ||
end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, there is an experimental
LieAlgebra
type, and now there is alsoLieAlgebraStructure
. This looks a bit weird to me. Please enlighten me about your goals.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LieAlgebraStructure
is only there to exist temporarily (as a thin wrapper around), asLieAlgebra
currently does not support everything that is needed here. As already noted in #2936 (comment), this is on the todo-list to merge. But as that involves more work of different people (e.g. @felix-roehrich), and is mostly unrelated to the stuff here, I would like to move that piece of work to a future PR.