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
Implement the hypercenter and upper central series for finite dimensional Lie algebras #37693
Conversation
src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py
Outdated
Show resolved
Hide resolved
src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py
Outdated
Show resolved
Hide resolved
src/sage/categories/finite_dimensional_lie_algebras_with_basis.py
Outdated
Show resolved
Hide resolved
02b2233
to
2d446eb
Compare
I've added all of the suggested whitespace. |
try: | ||
amb_names = dict(zip(sorted_indices, ambient.variable_names())) | ||
names = [amb_names[i] for i in index_set] | ||
except ValueError: # ambient has not assigned variable names | ||
pass |
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'd suggest to rewrite it as try... except... else
, which makes it clearer which of the lines is expected to raise the exception
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 instead just examined the _names
attribute and avoided using try
-except
to control programming flow.
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.
Otherwise LGTM
2d446eb
to
d821fae
Compare
Documentation preview for this PR (built with commit 4fa759a; changes) is ready! 🎉 |
…for finite dimensional Lie algebras <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> We implement the upper central series and hypercenter of a finite dimensional Lie algebra. As part of the testing, we found improvements could be made to the generic example (needed so the example would work with these tests): We moved the `reduce()` method up to the category. Implemented methods expected for the subalgebras. Better input verification. Elements are now hashable. We had to work around the fact that `lift()` is serving multiple roles as to the UEA and to the ambient space for a Lie subalgebra. This functionality needs to be divided (I take full responsibility for this bad design) by renaming `lift` to something for the UEA map, but this is a significant change that should be done on a followup PR. We also fixed some bugs and improved efficiency with changing vectors into Lie algebra elements. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#37693 Reported by: Travis Scrimshaw Reviewer(s): Matthias Köppe, Travis Scrimshaw
We implement the upper central series and hypercenter of a finite dimensional Lie algebra.
As part of the testing, we found improvements could be made to the generic example (needed so the example would work with these tests): We moved the
reduce()
method up to the category. Implemented methods expected for the subalgebras. Better input verification. Elements are now hashable. We had to work around the fact thatlift()
is serving multiple roles as to the UEA and to the ambient space for a Lie subalgebra. This functionality needs to be divided (I take full responsibility for this bad design) by renaminglift
to something for the UEA map, but this is a significant change that should be done on a followup PR.We also fixed some bugs and improved efficiency with changing vectors into Lie algebra elements.
📝 Checklist
⌛ Dependencies