-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Corrects some inner products in root systems #38750
Conversation
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.
Thank you for the improvements here. It is good to not require the user to be so explicit. Here are some improvements based on your PR.
continue | ||
result += c*self_mc[t] | ||
return result | ||
raise TypeError(f"Don't know how to coerce {lambdacheck} into root or coroot space of {self}") |
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.
raise TypeError(f"Don't know how to coerce {lambdacheck} into root or coroot space of {self}") |
Co-authored-by: Travis Scrimshaw <clfrngrown@aol.com>
Co-authored-by: Travis Scrimshaw <clfrngrown@aol.com>
Co-authored-by: Travis Scrimshaw <clfrngrown@aol.com>
Co-authored-by: Travis Scrimshaw <clfrngrown@aol.com>
Co-authored-by: Travis Scrimshaw <clfrngrown@aol.com>
Co-authored-by: Travis Scrimshaw <clfrngrown@aol.com>
Documentation preview for this PR (built with commit e08bb52; changes) is ready! 🎉 |
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.
Sorry, I missed one doc-formatting thing. Once fixed, this will be a positive review.
Thank you. |
<!-- ^ 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". --> Goal of this PR: * Fix Exhibit A in sagemath#15325 * Exhibits B and C in the issue are ignored because they are not strictly speaking errors Status quo: * Some inner products for elements of root spaces or ambient spaces give wrong answers or raise exceptions Fix: * Adds a few lines of code to scalar product functions in ambient_space and root_space * TESTS were added to scalar product member functions to exhibit fixing this issue Notes: * I am unable to verify that the documentation builds because I cannot build the documentation (build problems with this version of Sage) A more thorough test of this functionality, which checks Exhibit A from the issue on more cases, is provided by the following code snippet: ``` for ct in [['G', 2], ['F', 4], ['E', 8], ['E', 7]] + [[x, 6] for x in ['A', 'B', 'C', 'D', 'E']]: rt = RootSystem(ct) print(ct) lat = rt.root_lattice() spc = rt.ambient_space() ell = lat.rank() C = rt.cartan_matrix() for i in range(1,ell+1): assert lat.simple_root(i) == spc.simple_root(i) assert lat.simple_coroot(i) == spc.simple_coroot(i) for j in range(1,ell+1): aprod = C[j-1,i-1] assert lat.simple_root(i).scalar(lat.simple_coroot(j)) == aprod assert spc.simple_root(i).scalar(spc.simple_coroot(j)) == aprod assert spc.simple_root(i).scalar(lat.simple_coroot(j)) == aprod assert lat.simple_root(i).scalar(spc.simple_coroot(j)) == aprod ``` ### 📝 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. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ 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#38750 Reported by: Skip G Reviewer(s): Skip G, Travis Scrimshaw
<!-- ^ 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". --> Goal of this PR: * Fix Exhibit A in sagemath#15325 * Exhibits B and C in the issue are ignored because they are not strictly speaking errors Status quo: * Some inner products for elements of root spaces or ambient spaces give wrong answers or raise exceptions Fix: * Adds a few lines of code to scalar product functions in ambient_space and root_space * TESTS were added to scalar product member functions to exhibit fixing this issue Notes: * I am unable to verify that the documentation builds because I cannot build the documentation (build problems with this version of Sage) A more thorough test of this functionality, which checks Exhibit A from the issue on more cases, is provided by the following code snippet: ``` for ct in [['G', 2], ['F', 4], ['E', 8], ['E', 7]] + [[x, 6] for x in ['A', 'B', 'C', 'D', 'E']]: rt = RootSystem(ct) print(ct) lat = rt.root_lattice() spc = rt.ambient_space() ell = lat.rank() C = rt.cartan_matrix() for i in range(1,ell+1): assert lat.simple_root(i) == spc.simple_root(i) assert lat.simple_coroot(i) == spc.simple_coroot(i) for j in range(1,ell+1): aprod = C[j-1,i-1] assert lat.simple_root(i).scalar(lat.simple_coroot(j)) == aprod assert spc.simple_root(i).scalar(spc.simple_coroot(j)) == aprod assert spc.simple_root(i).scalar(lat.simple_coroot(j)) == aprod assert lat.simple_root(i).scalar(spc.simple_coroot(j)) == aprod ``` ### 📝 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. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ 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#38750 Reported by: Skip G Reviewer(s): Skip G, Travis Scrimshaw
Goal of this PR:
Status quo:
Fix:
Notes:
A more thorough test of this functionality, which checks Exhibit A from the issue on more cases, is provided by the following code snippet:
📝 Checklist
⌛ Dependencies