-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
quo_rem gives wrong answers for LaurentPolynomial_mpair #31257
Comments
comment:1
I would go for |
This comment has been minimized.
This comment has been minimized.
comment:2
Replying to @slel:
Integers and polynomials seem to adopt the other option:
|
Branch: public/31257 |
Author: Dave Morris |
comment:4
The PR fixes two bugs. A Laurent polynomial is stored as a pair: a polynomial, and a tuple of offsets for the exponents. The
This is mathematically wrong, because the remainder should be The other bug is less serious. It was caused by the non-uniqueness of the representation of a Laurent polynomial. For example, A question, because I am not a cython expert (or python expert). The
Is it true that this will normalize a copy of New commits:
|
Commit: |
comment:5
LGTM In my understanding you are right: this should leave |
Reviewer: Salvatore Stella |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
|
comment:7
The code is now more in line with what happens in other places in the same file. Talking of which, the univariate version of quo_rem does not normalize self before performing computations. Is this normalization required to get consistent answers? |
comment:8
In the univariate case, Laurent polynomials are always stored in normalized form: "A Laurent series is a pair But multivariate Laurent polynomials are not automatically normalized when they are created (or at other times). |
comment:9
Then I am fine with the fix. |
comment:10
Thanks for the review! For some reason, my explanation about the commit in comment:6 did not get uploaded, so I will paraphrase it now, for the record: My original commit did change |
Changed branch from public/31257 to |
The method
quo_rem
ofLaurentPolynomial_mpair
gives wrong answers:As remarked on sage-devel it is not clear which should be the preferred answer in this case: both
(0, 1/x)
and(1/(x*y), 0)
are correct becausey
is a unit.CC: @DaveWitteMorris
Component: algebra
Keywords: Laurent polynomials
Author: Dave Morris
Branch/Commit:
0b0db6d
Reviewer: Salvatore Stella
Issue created by migration from https://trac.sagemath.org/ticket/31257
The text was updated successfully, but these errors were encountered: