-
-
Notifications
You must be signed in to change notification settings - Fork 552
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
a lazy solver for functional equations #37033
a lazy solver for functional equations #37033
Conversation
…; moving towards full coverage.
… of cache may contain variable, add failing test
….com/mantepse/sage into lazy_series/integration_experimental
…reams which are different
…s, use 'is' for equality when finding input streams in Stream_uninitialized
….com/mantepse/sage into lazy_series/integration_experimental
Co-authored-by: Travis Scrimshaw <[email protected]>
I have one other question, concerning equality of parents: should I be using "==" or "is"? For example, in for i0, i in enumerate(indices):
c = s._cache[i]
if self._coefficient_ring == self._base_ring:
if c.parent() == self._PF:
c = retract(subs(c, var, val))
if c.parent() is not self._base_ring:
good = m - i0 - 1
elif c.parent() == self._U:
c = c.map_coefficients(lambda e: subs(e, var, val))
try:
c = c.map_coefficients(lambda e: retract(e), self._base_ring)
except TypeError:
good = m - i0 - 1
s._cache[i] = c I actually think that I did it backwards here. I understand that computations could in principle return an element with parent that is not identical to the one I'm expecting. Do we have a |
…tion of polynomial ring (which shouldn't be necessary in a better designed InfinitePolynomialRing)
sagemathgh-37916: structure/coerce actions We modify `ModuleAction` to prefer coercion of the base ring over creating an action. More precisely, before this branch, we have ``` sage: G = PolynomialRing(QQ, "x") sage: S = PolynomialRing(MatrixSpace(QQ, 2), "x") sage: G.gen() * S.gen() [x 0] [0 x]*x ``` instead of ``` [1 0] [0 1]*x^2 ``` and ``` sage: G = PolynomialRing(QQ, "x") sage: S = PolynomialRing(InfinitePolynomialRing(QQ, "a"), "x") sage: G.gen() * S.an_element() x*x ``` instead of ``` x^2 ``` which is at least surprising. In the end, this is needed to make sagemath#37033 work. Authors: @tscrim and @mantepse. URL: sagemath#37916 Reported by: Martin Rubey Reviewer(s): Travis Scrimshaw
sagemathgh-37916: structure/coerce actions We modify `ModuleAction` to prefer coercion of the base ring over creating an action. More precisely, before this branch, we have ``` sage: G = PolynomialRing(QQ, "x") sage: S = PolynomialRing(MatrixSpace(QQ, 2), "x") sage: G.gen() * S.gen() [x 0] [0 x]*x ``` instead of ``` [1 0] [0 1]*x^2 ``` and ``` sage: G = PolynomialRing(QQ, "x") sage: S = PolynomialRing(InfinitePolynomialRing(QQ, "a"), "x") sage: G.gen() * S.an_element() x*x ``` instead of ``` x^2 ``` which is at least surprising. In the end, this is needed to make sagemath#37033 work. Authors: @tscrim and @mantepse. URL: sagemath#37916 Reported by: Martin Rubey Reviewer(s): Travis Scrimshaw
sagemathgh-37916: structure/coerce actions We modify `ModuleAction` to prefer coercion of the base ring over creating an action. More precisely, before this branch, we have ``` sage: G = PolynomialRing(QQ, "x") sage: S = PolynomialRing(MatrixSpace(QQ, 2), "x") sage: G.gen() * S.gen() [x 0] [0 x]*x ``` instead of ``` [1 0] [0 1]*x^2 ``` and ``` sage: G = PolynomialRing(QQ, "x") sage: S = PolynomialRing(InfinitePolynomialRing(QQ, "a"), "x") sage: G.gen() * S.an_element() x*x ``` instead of ``` x^2 ``` which is at least surprising. In the end, this is needed to make sagemath#37033 work. Authors: @tscrim and @mantepse. URL: sagemath#37916 Reported by: Martin Rubey Reviewer(s): Travis Scrimshaw
Permutation (sub)groups are good examples, but I think their group algebras might not fall under this. Hom spaces between equal-but-not-identical parents also have the same behavior IIRC. I'm not sure how many rings fall under this though. I would probably just be consistent with using |
OK, I can do that. Meanwhile, I discovered another oddity. There is a bug in
This doesn't follow the specification. However, if I change this, I seem to get coercion errors. I have to double check, though. Update: sorry, I think it actually does, because |
I'm afraid I found the problem. Consider, as an example, the lazy power series ring I admit I do not fully understand why this happens only rarely, and if so, it is unconsequential most of the time. Mostly, it seems to happen with exact series, where we do not make sure that their data ( However, at least sometimes it is sheer luck that everything works out. For example, in I am not sure how to proceed. Do you think it makes sense to have another meeting? |
Superseeded by #38108 |
sagemathgh-38108: Implicit function solver for lazy series This pull request provides a method `define_implicitly` for lazy rings that allows to produce lazy power series solutions for systems of functional equations, in relatively great generality, superseding sagemath#37033. We use a special action to make sure that coercion between `CoefficientRing` and its base ring works as desired. However, it is a local change, if the current approach eventually shows its shortcomings. (Alternative approach previously considered: Using a special functor to control the pushout behaviors. The action approach was chosen as a way to prevent potential conflicts with other construction functors that may appear in the future.) Dependencies: sagemath#38729 URL: sagemath#38108 Reported by: Martin Rubey Reviewer(s): Martin Rubey, Travis Scrimshaw
sagemathgh-38108: Implicit function solver for lazy series This pull request provides a method `define_implicitly` for lazy rings that allows to produce lazy power series solutions for systems of functional equations, in relatively great generality, superseding sagemath#37033. We use a special action to make sure that coercion between `CoefficientRing` and its base ring works as desired. However, it is a local change, if the current approach eventually shows its shortcomings. (Alternative approach previously considered: Using a special functor to control the pushout behaviors. The action approach was chosen as a way to prevent potential conflicts with other construction functors that may appear in the future.) Dependencies: sagemath#38729 URL: sagemath#38108 Reported by: Martin Rubey Reviewer(s): Martin Rubey, Travis Scrimshaw
We enable sage to solve systems of functional equations of lazy power series, generalizing the existing possibility of defining series recursively. For example:
Dependencies: #37451, #37687, #37736, #37766, #37761, #37916