#7644: generic power series reversion
-----------------------------+----------------------------------------------
Reporter: was | Owner: AlexGhitza
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.6.1
Component: algebra | Keywords: lagrange, reversion
Author: Niles Johnson | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Comment(by fwclarke):
Replying to [comment:11 niles]:
> Yes, especially if there is work in progress to support converting more
rings to pari. I wrote a revised patch which first attempts to convert to
pari and do reversion there, and then tries the Lagrange inversion if
conversion to pari fails. I think that implementation means that this
patch can be independent of #4376 -- it will simply perform better when
that patch is included.
A good point (but it would be nice if #4376 could be reviewed; it's very
short).
> > I also think it is sensible to be able to revert infinite precision
series, either by specifying the desired precision or by using the
parent's default precision.
> Yes, upon further consideration I agree. I've made this and two other
improvements: 1. Given a power series with infinite precision and degree
`deg`, its reversion is computed with precision `deg + 1`.
I don't see the logic for this. I would suggest having a keyword
`precision` with default `None`, and replacing
{{{
if f.prec() is infinity:
out_prec = f.degree() + 1
f = f.add_bigoh(out_prec)
else:
out_prec = f.prec()
}}}
with
{{{
if f.prec() is infinity and precision is None:
precision = f.parent().default_prec()
if precision:
f = f.add_bigoh(precision)
}}}
Then one could do (to get some Catalan numbers):
{{{
sage: R.<x> = QQ[[]]
sage: (x - x^2).reversion()
x + x^2 + 2*x^3 + 5*x^4 + 14*x^5 + 42*x^6 + 132*x^7 + 429*x^8
+ 1430*x^9 + 4862*x^10 + 16796*x^11 + 58786*x^12 + 208012*x^13
+ 742900*x^14 + 2674440*x^15 + 9694845*x^16 + 35357670*x^17
+ 129644790*x^18 + 477638700*x^19 + O(x^20)
}}}
or
{{{
sage: (x - x^2).reversion(precision=8)
x + x^2 + 2*x^3 + 5*x^4 + 14*x^5 + 42*x^6 + 132*x^7 + O(x^8)
}}}
rather than
{{{
sage: (x - x^2).reversion()
x + x^2 + O(x^3)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7644#comment:14>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.