Skip to content
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

In lazy power series rings, 0 + a and 0 - a return 0 #15249

Closed
darijgr opened this issue Oct 1, 2013 · 10 comments
Closed

In lazy power series rings, 0 + a and 0 - a return 0 #15249

darijgr opened this issue Oct 1, 2013 · 10 comments

Comments

@darijgr
Copy link
Contributor

darijgr commented Oct 1, 2013

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.

CC: @mwhansen @mantepse @tscrim

Component: algebra

Keywords: LazyPowerSeries, species

Stopgaps: incorrectAnswerMarker

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/15249

@darijgr darijgr added this to the sage-6.1 milestone Oct 1, 2013
@mantepse
Copy link
Collaborator

mantepse commented Jan 9, 2014

comment:1

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?

@mwhansen
Copy link
Contributor

comment:3

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.

@mantepse
Copy link
Collaborator

Changed keywords from lazy-power-series, species to LazyPowerSeries, species

@mantepse
Copy link
Collaborator

comment:5

Replying to @mwhansen:

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

@mwhansen
Copy link
Contributor

comment:6

A fix is in #15673

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@sagetrac-jakobkroeker
Copy link
Mannequin

sagetrac-jakobkroeker mannequin commented Jul 9, 2016

Stopgaps: incorrectAnswerMarker

@mantepse
Copy link
Collaborator

comment:11

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

@mantepse mantepse removed this from the sage-6.4 milestone Sep 21, 2022
@darijgr
Copy link
Contributor Author

darijgr commented Sep 21, 2022

comment:12

Thanks a lot, Tejasvi, Travis and Martin!

@mantepse
Copy link
Collaborator

comment:13

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

@tscrim
Copy link
Collaborator

tscrim commented Sep 22, 2022

Reviewer: Travis Scrimshaw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants