Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Series Reversion

I have a rational polynomial y(x) = P(x)/Q(x) which I want to revert (I'm trying to find the inverse of y).

y(x) is a symbolic expression in SAGE. In order to use g = y.reversion() I have to convert the symbolic expression to a power series.

  • When I do y(x).power_series(QQ) SAGE returns

[sage]: TypeError: unable to convert 45*(256*sqrt(2))*e to a rational

  • When I try y(x).power_series(RR) it tells me

[sage]: TypeError: denominator must be a unit

Am I missing some algebra?

Series Reversion

I have a rational polynomial y(x) = P(x)/Q(x) which I want to revert (I'm trying to find the inverse of y).

y(x) is a symbolic expression in SAGE. Sage. In order to use g = y.reversion() I have to convert the symbolic expression to a power series.

  • When I do y(x).power_series(QQ) SAGE Sage returns

[sage]: TypeError: unable to convert 45*(256*sqrt(2))*e to a rationalrational

  • When I try y(x).power_series(RR) it tells me

  • [sage]: TypeError: denominator must be a unitunit
    

    Am I missing some algebra?

    Series Reversion

    I have a rational polynomial y(x) = P(x)/Q(x) which I want to revert (I'm trying to find the inverse of y).

    y(x) is a symbolic expression in Sage. SAGE. In order to use g = y.reversion() I have to convert the symbolic expression to a power series.

    y(x) looks like this

    x^2*f1((3/x-1)^n,(1/x-1)^n) / (const + f2((3/x-1)^n,(1/x-1)^n)))

    The numerator has higher degree than the denominator.

    • When I do y(x).power_series(QQ) Sage SAGE returns

    [sage]: TypeError: unable to convert 45*(256*sqrt(2))*e to a rational rational

    • When I try y(x).power_series(RR) it tells me

    [sage]: TypeError: denominator must be a unit unit

    Am I missing some algebra?

    Series Reversion

    I have a rational polynomial y(x) = P(x)/Q(x) which I want to revert (I'm trying to find the inverse of y).

    y(x) is a symbolic expression in SAGE. In order to use g = y.reversion() I have to convert the symbolic expression to a power series.

    y(x) looks like this

    x^2*f1((3/x-1)^n,(1/x-1)^n) x^2*f1((3/x-1)^m,(1/x-1)^m) / (const + f2((3/x-1)^n,(1/x-1)^n)))

    The numerator has higher degree than the denominator.

    • When I do y(x).power_series(QQ) SAGE returns

    [sage]: TypeError: unable to convert 45*(256*sqrt(2))*e to a rational

    • When I try y(x).power_series(RR) it tells me

    [sage]: TypeError: denominator must be a unit

    Am I missing some algebra?

    Series Reversion

    I have a rational polynomial y(x) = P(x)/Q(x) f(z) = P(z)/Q(z) which I want to revert (I'm trying to find the inverse of y).

    y(x) is a symbolic expression f).

    I'll pick a simple example, the function f(z) = (1/z-1)^4

    [sage:] z = var('z');
    [sage:] z = FractionField(PolynomialRing(QQ, 'z')).objgen();
    [sage:] f(z) = (1/z-1)^4;
    [sage:] g = f(z).taylor(x,2,4); #I expand f in SAGE. In order to use g = y.reversion() I have to convert the symbolic expression to a power series.

    y(x) looks like this

    x^2*f1((3/x-1)^m,(1/x-1)^m) / (const + f2((3/x-1)^n,(1/x-1)^n)))

    The numerator a Taylor series just to make sure it's a series [sage:] f.expand().reversion(); AttributeError: 'sage.symbolic.expression.Expression' object has higher degree than the denominator.

    • When I do y(x).power_series(QQ) SAGE returns

    [sage]: TypeError: unable to convert 45*(256*sqrt(2))*e to a rational

    • When I try y(x).power_series(RR) it tells me

    [sage]: no attribute 'reversion' [sage:] g1 = g.power_series(QQ); TypeError: denominator must be a unitunit [sage:] g.reversion(); AttributeError: 'sage.symbolic.expression.Expression' object has no attribute 'reversion'

    Am

    A power series P(z) is not a rational function P(z)/Q(z). That's why the TypeError: denominator must be a unit appears.

    Is it possible that SAGE cannot invert rational polynomials? In the SAGE help text the computation is passed to pari first, before using Lagrangian inversion.

    I missing some algebra?thought SAGE uses FLINT. Why is it not used for computing the inverse of rational polynomials?

    Series Reversion

    I have a rational polynomial f(z) = P(z)/Q(z) which I want to revert (I'm trying to find the inverse of f).

    I'll pick a simple example, the function f(z) = (1/z-1)^4

    [sage:] sage: z = var('z');
    [sage:] var('z')
    sage: z = FractionField(PolynomialRing(QQ, 'z')).objgen();
    [sage:] 'z')).objgen()
    sage: f(z) = (1/z-1)^4;
    [sage:] (1/z-1)^4
    sage: g = f(z).taylor(x,2,4); #I expand f in a Taylor series just to make sure it's a series
    [sage:] f.expand().reversion();
               sage: f.expand().reversion()
    AttributeError: 'sage.symbolic.expression.Expression' object has no
               no attribute 'reversion'
    [sage:] sage: g1 = g.power_series(QQ);
               g.power_series(QQ)
    TypeError: denominator must be a unit
    [sage:] g.reversion();
               sage: g.reversion()
    AttributeError: 'sage.symbolic.expression.Expression' object has no
               no attribute 'reversion'
    

    A power series P(z) is not a rational function P(z)/Q(z). That's why the TypeError: denominator must be a unit unit appears.

    Is it possible that SAGE Sage cannot invert rational polynomials? In the SAGE Sage help text the computation is passed to pari first, before using Lagrangian inversion.

    I thought SAGE Sage uses FLINT. Why is it not used for computing the inverse of rational polynomials?

    Series Reversion

    I have a rational polynomial f(z) = P(z)/Q(z) which I want to revert (I'm trying to find the inverse of f).

    I'll pick a simple example, the function f(z) = (1/z-1)^4

    sage: z = var('z')
    sage: z = FractionField(PolynomialRing(QQ, 'z')).objgen()
    sage: f(z) = (1/z-1)^4
    sage: g = f(z).taylor(x,2,4); #I expand f in a Taylor series just to make sure it's a series
    sage: f.expand().reversion()
    AttributeError: 'sage.symbolic.expression.Expression' object has no attribute 'reversion'
    sage: g1 = g.power_series(QQ)
    TypeError: denominator must be a unit
    sage: g.reversion()
    AttributeError: 'sage.symbolic.expression.Expression' object has no attribute 'reversion'
    

    A power series P(z) is not a rational function P(z)/Q(z). That's why the TypeError: denominator must be a unit appears.

    Is it possible that Sage cannot invert rational polynomials? In the Sage help text the computation is passed to pari first, before using Lagrangian inversion.

    I thought Sage uses FLINT. Why is it not used for computing the inverse of rational polynomials?


    EDIT (after answer by slelievre):

    My problem now is how to avoid using the Symbolic Ring. I'm trying to do the following:

    I want to invert an approximation formula for the Gamma-function. I am using Spouge's approximation. It has terms in the numerator and the denominator. Ithink I can compute them separetely per se, but what if I wanted to do a Pade approximation of the function

    sage: f = (z+13)^(z+1/2)*exp(z)
    
    sage: g = f.pade(5,5)
    

    (it's the term ahead of the sum term in Spouge's approximation)

    How do I get separate polynomials for the numerator and the denominator that are defined in the right algebraic structure?