Opened 9 years ago
Last modified 10 days ago
#15249 positive_review defect
In lazy power series rings, 0 + a and 0 - a return 0
Reported by: | Darij Grinberg | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | algebra | Keywords: | LazyPowerSeries, species |
Cc: | Mike Hansen, Martin Rubey, Travis Scrimshaw | Merged in: | |
Authors: | Reviewers: | Travis Scrimshaw | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: | incorrectAnswerMarker |
Description
sage: L = LazyPowerSeriesRing(QQ) sage: x = L.gen() sage: L.zero().coefficients(4) [0, 0, 0, 0] sage: x.coefficients(4) [0, 1, 0, 0]
Correct so far...
sage: (L.zero() + x).coefficients(4) [0, 0, 0, 0] sage: (L.zero() - x).coefficients(4) [0, 0, 0, 0]
But x - L.zero()
and x + L.zero()
return correct results.
See also #15248 for another lazy power series bug.
Change History (14)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Cc: | Martin Rubey added |
---|
comment:3 follow-up: 5 Changed 9 years ago by
I've done some work on species recently which fixes this as a side effect. This is related to #10084. I'll post the branch asap.
comment:4 Changed 9 years ago by
Keywords: | LazyPowerSeries added; lazy-power-series removed |
---|
comment:5 Changed 9 years ago by
Replying to mhansen:
I've done some work on species recently which fixes this as a side effect. This is related to #10084. I'll post the branch asap.
Great! I'm all set to dig into the species code too. For a start, I looked through the tickets that are related to the lazy power series code and changed the keyword to LazyPowerSeries?...
Did you see #10931? I guess the patch won't apply anymore, but the philosophy should :-)
Best, Martin
comment:7 Changed 9 years ago by
Milestone: | sage-6.1 → sage-6.2 |
---|
comment:8 Changed 8 years ago by
Milestone: | sage-6.2 → sage-6.3 |
---|
comment:9 Changed 8 years ago by
Milestone: | sage-6.3 → sage-6.4 |
---|
comment:10 Changed 6 years ago by
Stopgaps: | → incorrectAnswerMarker |
---|
comment:11 Changed 10 days ago by
Cc: | Travis Scrimshaw added |
---|---|
Milestone: | sage-6.4 → sage-duplicate/invalid/wontfix |
Status: | new → needs_review |
This is fixed in #32367 and it should be tested by the testsuite.
comment:13 Changed 10 days ago by
Hi Darij! I am glad you like it! After #34552, you will like it even more :-)
comment:14 Changed 10 days ago by
Reviewers: | → Travis Scrimshaw |
---|---|
Status: | needs_review → positive_review |
One problem is in series_order.py. There, a very simple lattice (in fact, a total order) should be implemented: NonNegativeIntegers? together with the two special values unknown and infinity. unknown is the minimal element, infinity the maximal element.
Comparing unknown with another element works, comparing infinity with another element works, but comparing an integer with unknown does not work, because the comparison invoked is from Integer.
How should I create such a lattice really?