First time here? Check out the FAQ!

Ask Your Question
1

Having trouble importing the lazy_laurent_series module

asked 5 years ago

tzeentch gravatar image

updated 5 years ago

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
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 5 years ago

Emmanuel Charpentier gravatar image

updated 5 years ago

WorksForMe(TM). On a Python 3-based 9.0.beta3 :

sage: from sage.rings.laurent_series_ring import *
sage: L.<z> = LazyLaurentSeriesRing(QQ)
sage: L.category()
Category of magmas and additive magmas
sage: 1/(1 - z)
1 + z + z^2 + z^3 + z^4 + z^5 + z^6 + ...
sage: 1/(1 - z) == 1/(1 - z)

NOTE : from the doc:

The definition of Laurent series rings is not initially imported into the global namespace. You need to import it explicitly to use it.

HTH,

Preview: (hide)
link

Comments

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
tzeentch gravatar imagetzeentch ( 5 years ago )
1

Your Sage is too old (8.1 is quite old by today's standards...). From the doc:

AUTHORS: Kwankyu Lee (2019-02-24): initial version

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 5 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 5 years ago

Seen: 325 times

Last updated: Nov 05 '19