On Wed, Dec 9, 2009 at 10:50 AM, Matt Bainbridge
<bainbridge.m...@gmail.com> wrote:
> Its easy enough to code this in sage.  This seems to work over any
> field:

Thanks.  This is now http://trac.sagemath.org/sage_trac/ticket/7644

>
>
> 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]
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to