Opened 6 years ago
Last modified 3 years ago
#15249 new defect
In lazy power series rings, 0 + a and 0 - a return 0
Reported by: | darij | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | algebra | Keywords: | LazyPowerSeries, species |
Cc: | mhansen, mantepse | Merged in: | |
Authors: | Reviewers: | ||
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 (10)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
- Cc mantepse added
comment:3 follow-up: ↓ 5 Changed 6 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 6 years ago by
- Keywords LazyPowerSeries added; lazy-power-series removed
comment:5 in reply to: ↑ 3 Changed 6 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:6 Changed 6 years ago by
A fix is in #15673
comment:7 Changed 6 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:8 Changed 5 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:9 Changed 5 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:10 Changed 3 years ago by
- Stopgaps set to incorrectAnswerMarker
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?