-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Bug in reduction of exterior algebra elements modulo ideal #37108
Comments
FYSA @tscrim |
Strictly speaking, your example doesn’t necessarily show a bug: it is only required to lift to some element (which goes to 0 under the natural quotient map). That being said, yes, it should reduce everything to 0, which uniquely lifts to 0. Some additional useful information for here would be the GB for the ideal. It might also be an issue in the quotient with not using a GB. |
It seems like it is using a computed GB. The computed GB is not reduced, but after manually reducing the GB, it still has this same discrepancy.
Could you say more about this? Do you mean something like the Groebner strategy is trying to do the reduction with an empty GB? |
I am not surprised. A reduced GB is not necessary to do the reduction and make it unique.
I was thinking it was possible the quotient wasn't constructing the GB before doing the reduction, but that is not the case. Your comment about needed to do the reduction twice I think is on the money for the bug and the fix. We need to reduce as many times until we no longer change the element. This should be easy to fix: def reduce():
if not f:
return f
# Make a copy to mutate
f = type(f)(f._parent, copy(f._monomial_coefficients))
was_reduced = True
while was_reduced:
was_reduced = False
for g in self.groebner_basis:
was_reduced = self.reduce_single(f, g)
if was_reduced:
break
return f We could potentially speed this part up by keeping better track of the degree of the GB leading terms, but that is a more invasive change and optimization that can be done later. We are likely making the same mistake in the reduced GB computation code. |
I am trying to go through and verify the
Is this some sort of Cython issue? Here's the source code for
Can you help me to understand the line |
I also have the same question with |
Those are When performing a reduction of an arbitrary element |
Ah that makes sense, thanks!
Ah duh - thanks for breaking it down for me. |
No problem. Thanks for pushing the fix. |
…xterior algebra <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> This adds a loop to continue doing reduction modulo a Grobner basis for an element modulo an ideal in the exterior algebra. This guarantees a unique representative for each element, and that representative will be $0$ if the element is in the ideal. This fixes sagemath#37108. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [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 - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> None. <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37146 Reported by: trevorkarn Reviewer(s): Travis Scrimshaw
…xterior algebra <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> This adds a loop to continue doing reduction modulo a Grobner basis for an element modulo an ideal in the exterior algebra. This guarantees a unique representative for each element, and that representative will be $0$ if the element is in the ideal. This fixes sagemath#37108. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [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 - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> None. <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37146 Reported by: trevorkarn Reviewer(s): Travis Scrimshaw
…xterior algebra <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> This adds a loop to continue doing reduction modulo a Grobner basis for an element modulo an ideal in the exterior algebra. This guarantees a unique representative for each element, and that representative will be $0$ if the element is in the ideal. This fixes sagemath#37108. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [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 - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> None. <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37146 Reported by: trevorkarn Reviewer(s): Travis Scrimshaw
…xterior algebra <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> This adds a loop to continue doing reduction modulo a Grobner basis for an element modulo an ideal in the exterior algebra. This guarantees a unique representative for each element, and that representative will be $0$ if the element is in the ideal. This fixes sagemath#37108. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [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 - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> None. <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37146 Reported by: trevorkarn Reviewer(s): Travis Scrimshaw
Steps To Reproduce
In Sage 10.2 and 10.2.rc4, reduction of elements of exterior algebra modulo an ideal does not give a reduced form.
Expected Behavior
There should be no nonzero degree-4 elements in the previous example.
Actual Behavior
One needs to do the reduction step manually twice in order to reduce elements modulo the ideal.
Additional Information
A guess at the bug is that it could be caused by a loop terminating early during the Groebner basis reduction step.
Environment
Checklist
The text was updated successfully, but these errors were encountered: