-
Notifications
You must be signed in to change notification settings - Fork 112
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
Fix several things around root systems #3048
Fix several things around root systems #3048
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #3048 +/- ##
==========================================
- Coverage 80.43% 80.42% -0.01%
==========================================
Files 506 506
Lines 70074 70105 +31
==========================================
+ Hits 56365 56385 +20
- Misses 13709 13720 +11
|
@felix-roehrich please review the changes here, even though it has already been merged. I can react to your comments in a future PR. |
end | ||
|
||
function simple_roots(R::RootSystem) | ||
return [positive_root(R, i) for i in 1:num_simple_roots(R)] |
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.
return [positive_root(R, i) for i in 1:num_simple_roots(R)] | |
return positive_roots(R)[1:rank(R)] |
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 current solution is more efficient than your suggestion. Your suggestion first creates a vector of all positive roots and then copies the first rk
many to a new vector. As there are many more positive than simple roots, this is mostly useless work.
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.
No, the implementation is just an accessor with a type assertion. The suggestion instead prevents creating a new underlying array each time.
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.
Oh yeah, you are correct.
word = deepcopy(x.word) | ||
for _ in 2:n | ||
for s in Iterators.reverse(x.word) | ||
_lmul!(x.parent.refl, word, s) | ||
end | ||
end | ||
|
||
return WeylGroupElem(x.parent, word) |
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.
word = deepcopy(x.word) | |
for _ in 2:n | |
for s in Iterators.reverse(x.word) | |
_lmul!(x.parent.refl, word, s) | |
end | |
end | |
return WeylGroupElem(x.parent, word) | |
px = deepcopy(x) | |
for _ in 2:n | |
for s in Iterators.reverse(x.word) | |
lmul!(px, Int(s)) # make lmul! more general to make casting unnecessary | |
end | |
end | |
return px |
While writing a jupyter notebook for an exercise class, I found several things that weren't working or just weren't there. This is the first batch of fixes and additions from that.