id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
7644 generic power series reversion William Stein Alex Ghitza "From this [http://groups.google.com/group/sage-support/browse_thread/thread/34fdf02add8100b6 sage-support] thread: Make the following work over any base ring:
{{{
sage: R. = QQ[[]]
sage: f = 1/(1-x) - 1; f
x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12
+ x^13 + x^14 + x^15 + x^16 + x^17 + x^18 + x^19 + O(x^20)
sage: g = f.reversion(); g
x - x^2 + x^3 - x^4 + x^5 - x^6 + x^7 - x^8 + x^9 - x^10 + x^11 - x^12
+ x^13 - x^14 + x^15 - x^16 + x^17 - x^18 + x^19 + O(x^20)
sage: f(g)
x + O(x^20)
}}}
Matt Bainbridge says about power series reversion, which uses pari in some cases, and maybe isn't there in others:
{{{
Its easy enough to code this in sage. This seems to work over any
field:
def ps_inverse(f):
if f.prec() is infinity:
raise ValueError, ""series must have finite precision for
reversion""
if f.valuation() != 1:
raise ValueError, ""series must have valuation one for
reversion""
t = parent(f).gen()
a = 1/f.coefficients()[0]
g = a*t
for i in range(2, f.prec()):
g -= ps_coefficient((f + O(t^(i+1)))(g),i)*a*t^i
g += O(t^f.prec())
return g
def ps_coefficient(f,i):
if i >= f.prec():
raise ValueError, ""that coefficient is undefined""
else:
return f.padded_list(f.prec())[i]
}}}
== Apply ==
1. [attachment:trac_7644_reversion_lagrange_6.patch]" enhancement closed major sage-4.6.2 algebra fixed lagrange, reversion Francis Clarke sage-4.6.2.alpha1 Niles Johnson Francis Clarke N/A