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
fix LazyPowerSeriesRing in other variable than x #27931
Comments
Branch: u/dkrenn/lazy-power-series-in-z |
Commit: |
Author: Daniel Krenn |
comment:3
Did also some small cleanup. |
comment:4
I think we should actually go a bit further and make thing proper. Set the class-level attribute So there is a reason for storing |
comment:5
Replying to @tscrim:
Yes, I agree. Tried that yesterday while working on this ticket, and then gave up after an hour or so... (There were a lot of strange error messages, infinite recursion loops etc. That all not in
Really?....my feeling was that storing zero in each element seems somehow a waste. What if we store it in the parent and call it by While I am not entirely sure this makes that much of a difference, it does seem to be called with some frequency, thus it might have some non-trivial effect. There is no real harm in having this (hidden) attribute IMO. Getting this zero should clearly be done via the parent as it is not something that depends on the particular element. |
comment:6
Replying to @dkrenn:
I see the problem: It is using the old-style parent still. This is something that should be fixed, but that would be much more invasive than should be on this ticket.
This is just one pointer, so it is such a small thing in terms of memory for something that is used with some frequency by the element. So I think there is a benefit to doing this here. However, my suspicion is that this is not going to matter too much in terms of "real-world" computations. If you do put it in the parent with simple attribute indirections, then that is a good compromise. I don't have too strong of an opinion on this matter. |
comment:7
Replying to @tscrim:
So somehow I am not very successful today... In
and don't see why. (I got a problem when using |
comment:8
Because @@ -268,7 +269,7 @@ class LazyPowerSeriesRing(Algebra):
sage: L.zero()
0
"""
- return self.term(self.base_ring().zero(), 0)
+ return self.term(self.parent()._zero_base_ring, 0)
def identity_element(self):
""" So change this to |
comment:10
Replying to @tscrim:
Of course, I was inpatent and overlooked this. Thank you. Fixed now. |
Reviewer: Travis Scrimshaw |
comment:11
Let it be so. |
Changed branch from u/dkrenn/lazy-power-series-in-z to |
gives an error.
Component: basic arithmetic
Author: Daniel Krenn
Branch/Commit:
bf30d1f
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/27931
The text was updated successfully, but these errors were encountered: