-
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
Add Coxeter Groups and Root Systems #2689
Conversation
Note that we have root lattices in the sense of quadratic forms coming from Hecke:
Perhaps they can be of use to you.
|
Thanks, I'll have a look. |
Thank you for this, I'll leave some comments later. There are many other people which are working on things in algebraic Lie theory which may have an interest in this, e.g. @lgoettgens and @voggesbe. We don't need to have this perfectly in sync but it would be good if eventually we can share types for things like root systems between Lie algebras, Coxeter/Weyl groups and other applications, so it's good to stay in touch about these things |
One further comment: on the long run, I want to work with infinite Coxeter groups, too, and also work on code for Kac-Moody groups and algebras. For these (but also already for Lie algebras and algebraic groups) it may be useful to also have a notion of "root datum" (like Magma also has, see https://magma.maths.usyd.edu.au/magma/handbook/text/1143). I am merely saying this to set a vision for the future; this is not a request for you to change anything here right now. |
@felix-roehrich has his office two doors down from mine. And we talk regularly about this, and how it could connect to the other Lie algebra stuff in Oscar. |
end | ||
mat[rk - 1, rk] = -2 | ||
elseif fam == :E | ||
@req rk in 6:8 "type En requires rank to be one of 6, 7, 8" |
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.
Just as a side remark (not a change request): Actually there is also
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.
If you have a reference to common generalized Cartan matrices, I will implement them. For now I have implemented the classical case, but when offering generalized Cartan matrices, there should be some rules on what is offered by the helper.
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.
The standard reference for Cartan matrices (generalized) should be Kac's book Infinite Dimensional Lie Algebras I would say.
# | ||
############################################################################### | ||
|
||
struct WeylGroup <: CoxeterGroup |
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.
you probably will want this to be attribute storing on the long run...
struct WeylGroup <: CoxeterGroup | |
@attributes mutable struct WeylGroup <: CoxeterGroup |
I think it would be useful to have a comment (or better: docstring) that briefly explains in how far you consider "Weyl group" as a special case of Coxeter group (i.e., what makes it different from "other" kinds of of Coxeter groups)
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.
WeylGroup
is the implemtation of CoxGrpMin
in https://github.com/ulthiel/CoxeterGroups.jl. Since this PR is quite large already, in a follow up PR I want to add CoxGrpRec
renamed to CoxeterGroupGeneric
(?) and offer a generic Coxeter group constructor from a Coxeter matrix. In my opinion there should then be references for specials cases like Weyl Groups (with specialized algorithms). In ulthiel/CoxeterGroups.jl#1 CoxeterGroups{T}
was suggested. I am open for suggestions also from @ulthiel.
Also note that an abstract type is necessary to break cyclic dependency between root systems and Weyl groups.
(Maybe I also misunderstood your comment.)
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.
Whenever I read "Weyl group" I think "finite Coxeter group". Maybe I am too much used to the algebraic groups setting. Kac uses Weyl group more generally as well. I don't know what's best. But note that CoxGrpMin refers to an algorithm (namely using minimal roots). I somehow like(d) to make this clear. But again, I don't know what's best.
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.
2 days later I really think there should be separate types for the separate algorithms for computing in (some classes of) Coxeter groups and the types should also be called like that, as originally in CoxeterGroups.jl. So, I would prefer CoxGrpMin to WeylGroup. Also, there is CoxGrpSym in CoxeterGroups.jl which is extremely useful for type-A computations. This should go in here as well. There may be CoxGrpPerm for a permutation group algorithm etc. The generic function coxeter_group(...) should select the type that's most appropriate for the given type. @fingolfin, what do you think?
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.
I will look at this next week.
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.
Could this be looked at before merging?
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.
To me Weyl group applies to infinite groups as well, in Kac Moody theory at least we consistently use that.
Having different types for different algorithms makes some sense, but there are also many drawbacks. But I don't think it's necessary to hold up this PR about it, as this is purely for the experimental branch.
If we want to make progress on this, I don't think discussions on PRs are the way forward. It just doesn't work that well. We need to sit together in a room with enough time (possible organize a little workshop) and hash it out... but in the end, actual code trumps all. If something is implemented and works, great; if it doesn't work, we can iterate on it.
I.e., "use case drive design" -- which is why I said in a PR comment elsewhere that I don't want to hold up this PR right now as I just don't have time to work on it or one code using it, and if it works for you guys right now, great. I already know I will need changes for my use cases (e.g. infinite root systems should not store explicit vectors of positive roots; and I need a RootDatum
type; etc.) but all of that can (and IMHO: should) be added later.
@felix-roehrich @lgoettgens are you also in contact with @ulthiel about this? |
I am thankful for your comments but please wait until I mark the PR as ready for review. Most of the comments you just made are already outdated from my recent work and this will just create more work for both of us. I will mark your recent comments as resolved once I push my changes. |
13d2e6c
to
fbe4767
Compare
fbe4767
to
322eaa3
Compare
Tests and sanity checks still missing. I will add those if no more (big) changes are requested/necessary. |
I'll hope to find some time the next days to review this. And it would be great if @fingolfin could have a look as well. |
Codecov Report
@@ Coverage Diff @@
## master #2689 +/- ##
==========================================
- Coverage 80.38% 80.08% -0.31%
==========================================
Files 469 471 +2
Lines 66383 66856 +473
==========================================
+ Hits 53363 53541 +178
- Misses 13020 13315 +295
|
I'll test it. But before I forget: please make sure that the following people are mentioned as contributors (as well): Cameron Braunstein (@CameronBraunstein), Joel Gibson (University of Sydney, @joelgibson), Tom Schmit (@schto223). As with JuLie, if this gets merged then I'll archive CoxeterGroups.jl. On the type design/hierarchy the experts should comment (@fingolfin). I still don't know what's the way to go. (It would be good to have Coxeter groups finally, though, in any way.) |
I unfortunately didn't get to this yet. And as I am on holidays until the 8th, I'll only manage to review this the week after. |
Both PR #2572 and PR #2689 add root systems. How shall we resolve this? @felix-roehrich @voggesbe @lgoettgens ? |
According to @felix-roehrich there should be no conflict in merging both after review. Afterwards, we can try to unify these. My dream would be to make the GAP-backed root systems a concrete subtype of the abstract root system type of this PR. |
I don't quite share that -- it sounds as if we would have multiple root system implementations that overlap in functionality but are still different. That's something I'd rather avoid. But perhaps I misunderstand? |
Let's get #2572 merged first. Afterwards, I can work with @felix-roehrich on making them compatible / merging them /... let's see how it evolves. And after all, this is still in experimental. |
If I didn't miss anything #2572 only uses GAP only to get basic root system information (like number of roots, Cartan matrix). So this can easily be replaced with the implementation in this PR. |
18e8e93
to
cd56668
Compare
@felix-roehrich and I talked about this yesterday and pushed some changes
This is now only missing a fix for the |
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.
This is now good to go from my POV. Further functionalities, tests, and docs will be added by @felix-roehrich in a future PR.
Can somebody with merge rights (maybe @thofma) enable auto-squash-merge on this?
@fingolfin please let us know if you have any urgent changes to be made in this PR. If not, please merge this and you can write comments afterward that get addressed in a follow-up. |
I made several comments/questions above on types and naming. There was no reply. |
Ah, sorry, I somehow missed them while looking through this PR. I'll give an answer here. We decided to (for the moment at least; this can of course be renamed after a discussion) keep the name WeylGroup for the following reasons:
Other subtypes of CoxeterGroup will get implemented by @felix-roehrich add a later point in time. All of this is of course not set in stone and can be changed in a future PR. @felix-roehrich if I forgot something, please add. @fingolfin already approved this in a very similar state. Could you please give your opinion to this? |
Alright, good, it seems you thought about this, that's all I wanted. I want to protest though against calling my idea a "weird combination" :-D (joking)! |
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.
Fine by me.
I left a few comments on type stability, outdated docstrings etc.
As I understood @lgoettgens on Friday he'd prefer to apply the corresponding fixes post-merge. Fine by me, too.
@doc raw""" | ||
chevalley_basis(L::AbstractLieAlgebra{C}) -> NTuple{3,Vector{AbstractLieAlgebraElem{C}}} | ||
|
||
Return the Chevalley basis of the Lie algebra `L` in three vectors, stating first the positive root vectors, |
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.
You say "the" Chevalley basis, "the" Cartan subalgebra. These are not in general unique things, so what is meant? IMHO this should either be changed to "a" in both cases, or somewhere should be an explanation in how far something "unique" is returned that warrants the use "the"
to the order of the roots in the root system. | ||
""" | ||
function chevalley_basis(L::AbstractLieAlgebra) | ||
@req has_root_system(L) "No root system known." |
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.
Wouldn't root_system(L)
below already throw a similar error? Removing this check here then would have the advantage that this method would start working once someone implements runtime computation of root systems...
lie_algebra(R::Field, dynkin::Tuple{Char,Int}; cached::Bool) -> AbstractLieAlgebra{elem_type(R)} | ||
|
||
Construct the simple Lie algebra over the ring `R` with Dynkin type given by `dynkin`. |
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.
Docstring doesn't match changed signature
lie_algebra(R::Field, dynkin::Tuple{Char,Int}; cached::Bool) -> AbstractLieAlgebra{elem_type(R)} | |
Construct the simple Lie algebra over the ring `R` with Dynkin type given by `dynkin`. | |
lie_algebra(R::Field, S::Symbol, n::Int; cached::Bool) -> AbstractLieAlgebra{elem_type(R)} | |
Construct the simple Lie algebra over the ring `R` with Dynkin type given by `S` and `n`. |
@@ -0,0 +1,144 @@ | |||
############################################################################### | |||
# |
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.
# |
positive_roots::Any #::Vector{RootSpaceElem} (cyclic reference) | ||
weyl_group::Any #::WeylGroup (cyclic reference) |
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.
Couldn't this at least be, say,
positive_roots::Any #::Vector{RootSpaceElem} (cyclic reference) | |
weyl_group::Any #::WeylGroup (cyclic reference) | |
positive_roots::Vector #::Vector{RootSpaceElem} (cyclic reference) | |
weyl_group::CoxeterGroup #::WeylGroup (cyclic reference) |
The entries could be made concrete via type parameters. If it ever matters (right now I guess it doesn't).
end | ||
|
||
function num_positive_roots(R::RootSystem) | ||
return length(R.positive_roots) |
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.
This suffers from type instability, can be solved via
return length(R.positive_roots) | |
return length(positive_roots(R)) |
Same for most other places accessing R.positive_roots
instead of positive_roots(R)
end | ||
|
||
function positive_root(R::RootSystem, i::Int) | ||
return R.positive_roots[i]::RootSpaceElem |
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.
Better:
return R.positive_roots[i]::RootSpaceElem | |
return positive_roots(R)[i] |
# | ||
############################################################################### | ||
|
||
struct WeylGroup <: CoxeterGroup |
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.
To me Weyl group applies to infinite groups as well, in Kac Moody theory at least we consistently use that.
Having different types for different algorithms makes some sense, but there are also many drawbacks. But I don't think it's necessary to hold up this PR about it, as this is purely for the experimental branch.
If we want to make progress on this, I don't think discussions on PRs are the way forward. It just doesn't work that well. We need to sit together in a room with enough time (possible organize a little workshop) and hash it out... but in the end, actual code trumps all. If something is implemented and works, great; if it doesn't work, we can iterate on it.
I.e., "use case drive design" -- which is why I said in a PR comment elsewhere that I don't want to hold up this PR right now as I just don't have time to work on it or one code using it, and if it works for you guys right now, great. I already know I will need changes for my use cases (e.g. infinite root systems should not store explicit vectors of positive roots; and I need a RootDatum
type; etc.) but all of that can (and IMHO: should) be added later.
I am currently working on implementing https://github.com/ulthiel/CoxeterGroups.jl (see #2217). To have compatibility with root systems and since many efficient algorithms for Weyl groups rely on geometric properties, I have also written a first draft for root systems in OSCAR.
Currently this is still under heavy development, especially distributing logic between root systems and Weyl groups.
At the moment Cartan matrices are implemented as ZZMatrix, but it might make sense to implement it as a sparse matrix instead.
Documentation and tests are also missing.
For simplicity everything lives in experimental/LieAlgebras but everything from Coxeter groups that does not depend on root systems should probably moved to the Groups folder at some point.