Ask Your Question

masseygirl's profile - activity

2019-11-06 10:06:40 -0600 commented answer Having trouble importing the lazy_laurent_series module

It's unfortunately still not working, even after importing the package you mention. I'm running SageMath version 8.1.

sage: from sage.rings.laurent_series_ring import *
sage: L.<z> = LazyLaurentSeriesRing(QQ);
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-6587116685f3> in <module>()
----> 1 L = LazyLaurentSeriesRing(QQ, names=('z',)); (z,) = L._first_ngens(1);

NameError: name 'LazyLaurentSeriesRing' is not defined
2019-11-05 17:05:04 -0600 received badge  Supporter (source)
2019-11-04 17:56:54 -0600 asked a question Having trouble importing the lazy_laurent_series module

I am trying to import and use lazy Laurent series rings in sage, documented here: (http://doc.sagemath.org/html/en/refer...). I have the latest version of sage installed, and yet when I attempt to import/install the package it is nowhere to be found.

 from sage.rings.lazy_laurent_series_ring import LazyLaurentSeriesRing
    ---------------------------------------------------------------------------
    ImportError                               Traceback (most recent call last)
    <ipython-input-1-db0f55e1138b> in <module>()
    ----> 1 from sage.rings.lazy_laurent_series_ring import LazyLaurentSeriesRing

    ImportError: No module named lazy_laurent_series_ring

I then tried to download it, perhaps I am not downloading the correct package? Where is it hiding?

sage -i lazy_laurent_series
Error: package 'lazy_laurent_series' not found
Note: if it is an old-style package, use -p instead of -i to install it
2018-11-01 08:37:40 -0600 received badge  Nice Question (source)
2017-12-06 17:09:09 -0600 asked a question How to truncate a power series in two variables?

I would like to truncate power-series by setting $y$ to 0, in order to express $y = x^3 - xy^2$ as a power series in $x$ by recursively plugging in the equation for $y$, then truncating.

R.<x, y> = PowerSeriesRing(QQ, default_prec = 20)
f = x^3 + x*y^2
j = f(x, f(x, f(x, f(x, f(x,y))))).expand()
j + O(y)
---------------------------------------------------------------------------
ArithmeticError                           Traceback (most recent call last)
<ipython-input-20-fe9380f2a091> in <module>()
----> 1 j + O(y)

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/big_oh.py in O(*x, **kwds)
    154     elif hasattr(x, 'O'):
    155         return x.O(**kwds)
--> 156     raise ArithmeticError("O(%s) not defined" % (x,))

ArithmeticError: O(y) not defined

I have found that other variants, such asj + O(x, y)^{31}, j.truncate(31), and j + R.O(31) also do not work.

2017-12-06 01:27:53 -0600 received badge  Student (source)
2017-12-05 18:59:43 -0600 asked a question How can I recurse a power series in two variables?

I would like very much to express, for example,

R.<x, y> = PowerSeriesRing(QQ, default_prec = 20)
g(x, g(x, g(x, x)))

Or,

f(x, f(x, f(x, f(x, f(x, f(x, f(x, f(x, f(x, f(x, f(x, f(x, (f(x, (f(x, f(x,y))))))))))))))))).expand()

In a more elegant way, for a specified number of self-compositions in one variable. I have only been able to find the sage function of composition for one variable polynomials, not for nesting two variable power series.

2017-11-22 23:38:05 -0600 asked a question How can I compose 2 power series in one variable with their compositional inverse get a power series in two variables?

I would like to compose a power series $\ell$ defined in $x$ to get a power series $\ell^{-1}(\ell(x) + \ell(y))$ as a power series $f(x, y)$ in two variables, $x$ and $y$. In the code below I call l := $\ell$, and e := $\ell^{-1}$.

PREC = 20    
R.<x, y> = PowerSeriesRing( QQ, default_prec=PREC )
f = exp( 1/3 * log( 1-x^3 ) )
print f
w = 1/f
l = w.integral(x)
e = l.reverse() 
g = e(l(x) + l(y)) ??

I find immediately the following issue, let alone the issue of composing:

e = l.reverse()
AttributeError: 'MPowerSeriesRing_generic_with_category.element_class' object has no attribute 'reverse'

Once I have this two variable power series $f(x, y)$, I would like to output $f(x, (f(x, ..., f(x,x)))$, composed with itself $n$-times for a natural number $n$.

2017-11-22 17:25:29 -0600 commented answer How can I take a fractional power and a power series inverse?
2017-11-22 14:36:44 -0600 asked a question How can I take a fractional power and a power series inverse?

I am attempting to take the power series inverse of the Taylor series expansion of $(x^4-x)^{1/3}$ around the point 0.

When I attempt to define g=(x^4-x)^{1/3} :

sage: R.<x> = LaurentPolynomialRing(QQ);
sage: g = (x^4-x)^{1/3}
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-21-675538f6f472> in <module>()
----> 1 g = (x**Integer(4)-x)**{Integer(1)/Integer(3)}

sage/rings/polynomial/laurent_polynomial.pyx in sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_univariate.__pow__ (/usr/lib/sagemath//src/build/cythonized/sage/rings/polynomial/laurent_polynomial.c:10802)()

TypeError: int() argument must be a string or a number, not 'set'

Now, when I define $g$ as follows, I am unable to take the power series inverse:

sage: var('x')
x
sage: g = (1-x)**(1/3)
sage: G = g.taylor(x, 0, 10)
sage: 1/G
-4782969/(55913*x^10 + 64515*x^9 + 75735*x^8 + 90882*x^7 + 112266*x^6 + 144342*x^5 + 196830*x^4 + 295245*x^3 + 531441*x^2 + 1594323*x - 4782969)
sage: 1/G + O(x^10)

---------------------------------------------------------------------------
ArithmeticError                           Traceback (most recent call last)
<ipython-input-12-9fe94787aacb> in <module>()
----> 1 Integer(1)/G + O(x**Integer(10))

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/big_oh.py in O(*x, **kwds)
    154     elif hasattr(x, 'O'):
    155         return x.O(**kwds)
--> 156     raise ArithmeticError("O(%s) not defined" % (x,))

ArithmeticError: O(x^10) not defined
sage: G.inverse()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-34018a4209b6> in <module>()

How can I have the best of both worlds? In the end, I would like to have an element in the Laurent Series Ring, for the next stage is to take the formal integral of the result, and the composition inverse of this formal integral.

2017-11-21 17:04:45 -0600 commented answer How do I code a Laurent Series with variable coefficients?

Thank you very much, your edit was a lifesaver, and now everything works!

2017-11-21 17:04:30 -0600 received badge  Scholar (source)
2017-11-21 17:04:27 -0600 received badge  Editor (source)
2017-11-20 01:41:50 -0600 commented answer How do I code a Laurent Series with variable coefficients?

I am attempting to expand as a power series a quotient with variable coefficients. With this formalism, I am still unable to expand the polynomial quotient I receive (for my more complicated quotient, still in a and t) by adding + O(t^5).

2017-11-19 15:08:50 -0600 asked a question How do I code a Laurent Series with variable coefficients?

Edit: Adding more context.

I am attempting the following procedure:

  1. Begin with a polynomial $Z(u)$ with variable coefficients, of the form $1 + au + bu^2 + cu^3 + pbu^4 + p^2au^5 + p^3u^6$.
  2. Examine the coefficients of $Z'(u)/Z(u)$ as a power series in $u$.

It is this quest which leads me to attempt to construct a LaurentSeriesRing with variable coefficients. However, I keep encountering TypeErrors, I am wondering if a kind soul could help me in my quest. I will use here a very simple polynomial f to get the point across.

I am attempting to construct a LaurentSeriesRing with variable coefficients. However, I keep encountering TypeErrors, I am wondering if a kind soul could help me in my quest. I will use here a very simple polynomial f to get the point across.

sage: R.<t> = LaurentSeriesRing(QQ, 't')
sage: var('a')
a
sage: f = 1 + a*t
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-31-06d3f2f41e45> in <module>()
----> 1 f = Integer(1) + a*t

sage/structure/element.pyx in sage.structure.element.Element.__mul__ (/usr/lib/sagemath//src/build/cythonized/sage/structure/element.c:12443)()

sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op (/usr/lib/sagemath//src/build/cythonized/sage/structure/coerce.c:10496)()

TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and 'Laurent Series Ring in t over Rational Field'

I also tried:

sage: R.<u> = QQ[]
sage: var('a')
a
sage: f = 1 + a*u
sage: ff = derivative(f, u)
sage: R.<u> = LaurentSeriesRing(QQ); R
sage: f/ff + O(u^5)
----------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-28-c4846de7ced8> in <module>()
----> 1 f/ff + O(u**Integer(5))

sage/structure/element.pyx in sage.structure.element.Element.__add__ (/usr/lib/sagemath//src/build/cythonized/sage/structure/element.c:11198)()

sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op (/usr/lib/sagemath//src/build/cythonized/sage/structure/coerce.c:10496)()

TypeError: unsupported operand parent(s) for '+': 'Symbolic Ring' and 'Laurent Series Ring in u over Rational Field'