Opened 12 years ago
Last modified 10 days ago
#10084 needs_review defect
Lazy power series are created with incorrect order
Reported by: | Harald Schilly | Owned by: | Sage Combinat CC user |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | combinatorics | Keywords: | LazyPowerSeries |
Cc: | axel.bacher@…, Mike Hansen, Martin Rubey | Merged in: | |
Authors: | Mike Hansen | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: | todo |
Description
Reported by the "Report a Problem" Form:
When typing the following:
S = LazyPowerSeriesRing(ZZ) one = S(0) + S(1) one.order
I get a "Infinite series order" message. When asking for
one.coefficients(3)
I get "[0, 0, 0]".
Looking into the code sage/combinat/species/series.py, the _add_ method calls the _new method to create the sum series. Trying:
zero = S(0) test_series = zero._new(lambda ao: Stream(const=1), lambda: 0) test_series.order test_series.coefficients(3)
I again get "Infinite series order" and "[0, 0, 0]".
As I understand it, the _new() method calls the init() method of LazyPowerSeries in the line:
new_fps = self.__class__(parent, stream=None, order=unk, aorder=self.aorder, aorder_changed=True, is_initialized=False)
If the value self.aorder is inf, this puts new_fps.aorder to inf, which (in the init() code), also puts new_fps.order to inf, which makes Sage think that the series has infinite order.
Changing the argument aorder=self.aorder to aorder=unk in the above line solved the problem. The sum of S(0) and S(1) should have order zero, and its first three coefficients should be [1, 0, 0].
The series test_series should also have order zero, and its coefficients should be [1, 1, 1].
Attachments (1)
Change History (12)
comment:1 Changed 12 years ago by
Cc: | Mike Hansen added |
---|---|
Component: | symbolics → combinatorics |
Owner: | changed from Burcin Erocal to Sage Combinat CC user |
Changed 10 years ago by
Attachment: | trac_10084-lazy_power_series_order-mh.patch added |
---|
comment:2 Changed 10 years ago by
Authors: | → Mike Hansen |
---|---|
Status: | new → needs_review |
comment:3 Changed 10 years ago by
Status: | needs_review → needs_work |
---|
comment:4 Changed 9 years ago by
Milestone: | sage-5.11 → sage-5.12 |
---|
comment:5 Changed 9 years ago by
Cc: | Martin Rubey added |
---|---|
Keywords: | LazyPowerSeries added |
comment:6 Changed 9 years ago by
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 7 years ago by
Stopgaps: | → todo |
---|
comment:11 Changed 10 days ago by
Milestone: | sage-6.4 → sage-duplicate/invalid/wontfix |
---|---|
Status: | needs_work → needs_review |
This is no longer relevant, since #32367.
A fix is in #15673