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
Equality comparison gives incorrect result in divisor group of a curve #37966
Comments
I'm willing to try to submit a patch. I poked around in the code and it looks like divisors inherit from |
See discussion in linked PR for how this was solved. |
…m commutativity) Fixes sagemath#37966. ### 📝 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 and checked the documentation preview. URL: sagemath#37972 Reported by: Vincent Macri Reviewer(s): Travis Scrimshaw, Vincent Macri
…m commutativity) Fixes sagemath#37966. ### 📝 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 and checked the documentation preview. URL: sagemath#37972 Reported by: Vincent Macri Reviewer(s): Travis Scrimshaw, Vincent Macri
…m commutativity) Fixes sagemath#37966. ### 📝 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 and checked the documentation preview. URL: sagemath#37972 Reported by: Vincent Macri Reviewer(s): Travis Scrimshaw, Vincent Macri
Steps To Reproduce
Example code:
The same thing happens with
HyperellipticCurve
andCurve
.This example in particular violates commutativity of the divisor group, despite the divisor group being marked in Sage as part of the "Category of commutative additive groups".
Expected Behavior
Comparison in the divisor group should give the correct result or at the very least return a not implemented error.
Actual Behavior
Comparison in the divisor group gives an incorrect result.
Additional Information
__eq__
needs to be implemented for divisors. Something like this should work:but I'm not familiar enough with the internals of Sage to know where this should go.
Environment
I ran
make ptestlong
and all tests passed, so I doubt it's an issue with my environment.Checklist
The text was updated successfully, but these errors were encountered: