Ask Your Question

Revision history [back]

The appropriate object would be a "lazy power series".

One can define a LazyPowerSeriesRing in Sage, but it does not seem very capable so far, and in particular cannot compute $1 / (1 - x)$.

From the list of tickets whose summary contains "lazy", the most relevant are:

Many seem stalled but #27347 seems promising.

Edit: With #27347 (now closed and hopefully making it into Sage 8.8.beta3), one can now do:

sage: from sage.rings.lazy_laurent_series_ring import LazyLaurentSeriesRing
sage: L = LazyLaurentSeriesRing(ZZ, 'x')
sage: x = L.gen()
sage: f = ~(1 - x)
sage: f
1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + ...
sage: f[800]
1

The appropriate object would be a "lazy power series".

One can define a LazyPowerSeriesRing in Sage, but it does not seem very capable so far, and in particular cannot compute $1 / (1 - x)$.

From the list of tickets whose summary contains "lazy", the most relevant are:

Many seem stalled but #27347 seems promising.

Edit: With #27347 (now closed and hopefully making it into Sage 8.8.beta3), one can now do:

sage: from sage.rings.lazy_laurent_series_ring import LazyLaurentSeriesRing
sage: L = LazyLaurentSeriesRing(ZZ, 'x')
sage: x = L.gen()
sage: f = ~(1 - x)
sage: f
1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + ...
sage: f[800]
1

A related interesting package is ore_algebra, see