-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Highly confusing behavior of RootSystem related objects (lattices and ambient space) #15325
Comments
comment:1
Nicolas can probably do a better job at explaining the math design choices, but hopefully this won't be too far off the mark. For C, this is "correct" and is due to the projection used, i.e. For A, my knowledge of E8 is somewhat limited. I'd expect the For B, this does not surprise me (too much), again because it's trying to do things in the root lattice and that is a sublattice of the weight lattice. In general, I don't think one cannot take something from the weight lattice and express it in the root lattice. |
<!-- ^ 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
<!-- ^ 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
I'm not sure to what extent the following behavior is deliberate or simply unavoidable, so maybe this bug report should be reclassified as bad documentation. Also, I'm not sure whether I should be filing several different bug reports (but I do believe the issues I raise are very closely related).
My main issue is that for mathematicians who are used to thinking of the weight lattice of a root system living inside of the root lattice, itself living inside some common euclidean ambient space (which, I think, is standard practice), Sage's behavior is mind-boggingly confusing, if not outright insane.
Exhibit A (shows that elements of the root lattice and its ambient space, while comparing for equality, behave very differently when it comes to scalar product):
Exhibit B (shows that Sage does not consider the root lattice as living inside the weight lattice):
Exhibit C (shows how confusing the embedding of the weight lattice in the ambient space is):
I'm not sure how all of this should be fixed, but certainly when x==y returns True then x and y should have a very similar behavior, and in particular x in y.parent() should also return True.
CC: @sagetrac-sage-combinat @nthiery
Component: combinatorics
Keywords: root-system
Issue created by migration from https://trac.sagemath.org/ticket/15325
The text was updated successfully, but these errors were encountered: