Skip to content
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

Merged
merged 8 commits into from
Nov 24, 2023

Conversation

lgoettgens
Copy link
Member

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.

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Merging #3048 (421cd00) into master (a179656) will decrease coverage by 0.01%.
Report is 4 commits behind head on master.
The diff coverage is 31.42%.

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     
Files Coverage Δ
experimental/LieAlgebras/src/LieAlgebras.jl 100.00% <ø> (ø)
experimental/LieAlgebras/src/WeylGroup.jl 74.85% <91.66%> (+6.92%) ⬆️
experimental/LieAlgebras/src/RootSystem.jl 41.02% <0.00%> (-3.63%) ⬇️

@simonbrandhorst simonbrandhorst merged commit c195b4b into oscar-system:master Nov 24, 2023
18 of 22 checks passed
@lgoettgens lgoettgens deleted the lg/root-system-fixes branch November 25, 2023 13:08
@lgoettgens
Copy link
Member Author

lgoettgens commented Nov 25, 2023

@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)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return [positive_root(R, i) for i in 1:num_simple_roots(R)]
return positive_roots(R)[1:rank(R)]

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Member Author

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.

Comment on lines +152 to +159
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

thofma pushed a commit that referenced this pull request Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic: LieAlgebras
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants