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

Status badges

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 Martin Rubey

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?

comment:2 Changed 9 years ago by Martin Rubey

Cc: Martin Rubey added

comment:3 Changed 9 years ago by Mike Hansen

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 Martin Rubey

Keywords: LazyPowerSeries added; lazy-power-series removed

comment:5 in reply to:  3 Changed 9 years ago by Martin Rubey

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 9 years ago by Mike Hansen

A fix is in #15673

comment:7 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:8 Changed 8 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:9 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:10 Changed 6 years ago by Jakob Kroeker

Stopgaps: incorrectAnswerMarker

comment:11 Changed 10 days ago by Martin Rubey

Cc: Travis Scrimshaw added
Milestone: sage-6.4sage-duplicate/invalid/wontfix
Status: newneeds_review

This is fixed in #32367 and it should be tested by the testsuite.

comment:12 Changed 10 days ago by Darij Grinberg

Thanks a lot, Tejasvi, Travis and Martin!

comment:13 Changed 10 days ago by Martin Rubey

Hi Darij! I am glad you like it! After #34552, you will like it even more :-)

comment:14 Changed 10 days ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review
Note: See TracTickets for help on using tickets.