Ask Your Question

Having trouble importing the lazy_laurent_series module

asked 2019-11-05 00:56:54 +0200

tzeentch gravatar image

updated 2019-11-05 00:57:21 +0200

I am trying to import and use lazy Laurent series rings in sage, documented here: ( 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
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-05 08:51:46 +0200

Emmanuel Charpentier gravatar image

updated 2019-11-05 08:52:45 +0200

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.


edit flag offensive delete link more


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 ( 2019-11-06 17:06:40 +0200 )edit

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 ( 2019-11-06 19:37:42 +0200 )edit

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


Asked: 2019-11-05 00:56:54 +0200

Seen: 256 times

Last updated: Nov 05 '19