Laurent Series Rings

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, "x")
sage: R.base_ring()
Rational Field
sage: S = LaurentSeriesRing(GF(17)['x'], 'y')
sage: S
Laurent Series Ring in y over
 Univariate Polynomial Ring in x over Finite Field of size 17
sage: S.base_ring()
Univariate Polynomial Ring in x over Finite Field of size 17
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, "x")
>>> R.base_ring()
Rational Field
>>> S = LaurentSeriesRing(GF(Integer(17))['x'], 'y')
>>> S
Laurent Series Ring in y over
 Univariate Polynomial Ring in x over Finite Field of size 17
>>> S.base_ring()
Univariate Polynomial Ring in x over Finite Field of size 17
class sage.rings.laurent_series_ring.LaurentSeriesRing(power_series)[source]

Bases: UniqueRepresentation, CommutativeRing

Univariate Laurent Series Ring.

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, 'x'); R
Laurent Series Ring in x over Rational Field
sage: x = R.0
sage: g = 1 - x + x^2 - x^4 + O(x^8); g
1 - x + x^2 - x^4 + O(x^8)
sage: g = 10*x^(-3) + 2006 - 19*x + x^2 - x^4 +O(x^8); g
10*x^-3 + 2006 - 19*x + x^2 - x^4 + O(x^8)
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, 'x'); R
Laurent Series Ring in x over Rational Field
>>> x = R.gen(0)
>>> g = Integer(1) - x + x**Integer(2) - x**Integer(4) + O(x**Integer(8)); g
1 - x + x^2 - x^4 + O(x^8)
>>> g = Integer(10)*x**(-Integer(3)) + Integer(2006) - Integer(19)*x + x**Integer(2) - x**Integer(4) +O(x**Integer(8)); g
10*x^-3 + 2006 - 19*x + x^2 - x^4 + O(x^8)

You can also use more mathematical notation when the base is a field:

sage: Frac(QQ[['x']])
Laurent Series Ring in x over Rational Field
sage: Frac(GF(5)['y'])
Fraction Field of Univariate Polynomial Ring in y over Finite Field of size 5
>>> from sage.all import *
>>> Frac(QQ[['x']])
Laurent Series Ring in x over Rational Field
>>> Frac(GF(Integer(5))['y'])
Fraction Field of Univariate Polynomial Ring in y over Finite Field of size 5

When the base ring is a domain, the fraction field is the Laurent series ring over the fraction field of the base ring:

sage: Frac(ZZ[['t']])
Laurent Series Ring in t over Rational Field
>>> from sage.all import *
>>> Frac(ZZ[['t']])
Laurent Series Ring in t over Rational Field

Laurent series rings are determined by their variable and the base ring, and are globally unique:

sage: # needs sage.rings.padics
sage: K = Qp(5, prec=5)
sage: L = Qp(5, prec=200)
sage: R.<x> = LaurentSeriesRing(K)
sage: S.<y> = LaurentSeriesRing(L)
sage: R is S
False
sage: T.<y> = LaurentSeriesRing(Qp(5, prec=200))
sage: S is T
True
sage: W.<y> = LaurentSeriesRing(Qp(5, prec=199))
sage: W is T
False

sage: K = LaurentSeriesRing(CC, 'q'); K                                         # needs sage.rings.real_mpfr
Laurent Series Ring in q over Complex Field with 53 bits of precision
sage: loads(K.dumps()) == K                                                     # needs sage.rings.real_mpfr
True
sage: P = QQ[['x']]
sage: F = Frac(P)
sage: TestSuite(F).run()
>>> from sage.all import *
>>> # needs sage.rings.padics
>>> K = Qp(Integer(5), prec=Integer(5))
>>> L = Qp(Integer(5), prec=Integer(200))
>>> R = LaurentSeriesRing(K, names=('x',)); (x,) = R._first_ngens(1)
>>> S = LaurentSeriesRing(L, names=('y',)); (y,) = S._first_ngens(1)
>>> R is S
False
>>> T = LaurentSeriesRing(Qp(Integer(5), prec=Integer(200)), names=('y',)); (y,) = T._first_ngens(1)
>>> S is T
True
>>> W = LaurentSeriesRing(Qp(Integer(5), prec=Integer(199)), names=('y',)); (y,) = W._first_ngens(1)
>>> W is T
False

>>> K = LaurentSeriesRing(CC, 'q'); K                                         # needs sage.rings.real_mpfr
Laurent Series Ring in q over Complex Field with 53 bits of precision
>>> loads(K.dumps()) == K                                                     # needs sage.rings.real_mpfr
True
>>> P = QQ[['x']]
>>> F = Frac(P)
>>> TestSuite(F).run()

When the base ring \(k\) is a field, the ring \(k((x))\) is a CDVF, that is a field equipped with a discrete valuation for which it is complete. The appropriate (sub)category is automatically set in this case:

sage: k = GF(11)
sage: R.<x> = k[[]]
sage: F = Frac(R)
sage: F.category()
Join of
 Category of complete discrete valuation fields and
 Category of commutative algebras over (finite enumerated fields and
 subquotients of monoids and quotients of semigroups) and
 Category of infinite sets
sage: TestSuite(F).run()
>>> from sage.all import *
>>> k = GF(Integer(11))
>>> R = k[['x']]; (x,) = R._first_ngens(1)
>>> F = Frac(R)
>>> F.category()
Join of
 Category of complete discrete valuation fields and
 Category of commutative algebras over (finite enumerated fields and
 subquotients of monoids and quotients of semigroups) and
 Category of infinite sets
>>> TestSuite(F).run()
Element[source]

alias of LaurentSeries

base_extend(R)[source]

Return the Laurent series ring over R in the same variable as self, assuming there is a canonical coerce map from the base ring of self to R.

EXAMPLES:

sage: K.<x> = LaurentSeriesRing(QQ, default_prec=4)
sage: K.base_extend(QQ['t'])
Laurent Series Ring in x over Univariate Polynomial Ring in t over Rational Field
>>> from sage.all import *
>>> K = LaurentSeriesRing(QQ, default_prec=Integer(4), names=('x',)); (x,) = K._first_ngens(1)
>>> K.base_extend(QQ['t'])
Laurent Series Ring in x over Univariate Polynomial Ring in t over Rational Field
change_ring(R)[source]

EXAMPLES:

sage: K.<x> = LaurentSeriesRing(QQ, default_prec=4)
sage: R = K.change_ring(ZZ); R
Laurent Series Ring in x over Integer Ring
sage: R.default_prec()
4
>>> from sage.all import *
>>> K = LaurentSeriesRing(QQ, default_prec=Integer(4), names=('x',)); (x,) = K._first_ngens(1)
>>> R = K.change_ring(ZZ); R
Laurent Series Ring in x over Integer Ring
>>> R.default_prec()
4
characteristic()[source]

EXAMPLES:

sage: R.<x> = LaurentSeriesRing(GF(17))
sage: R.characteristic()
17
>>> from sage.all import *
>>> R = LaurentSeriesRing(GF(Integer(17)), names=('x',)); (x,) = R._first_ngens(1)
>>> R.characteristic()
17
construction()[source]

Return the functorial construction of this Laurent power series ring.

The construction is given as the completion of the Laurent polynomials.

EXAMPLES:

sage: L.<t> = LaurentSeriesRing(ZZ, default_prec=42)
sage: phi, arg = L.construction()
sage: phi
Completion[t, prec=42]
sage: arg
Univariate Laurent Polynomial Ring in t over Integer Ring
sage: phi(arg) is L
True
>>> from sage.all import *
>>> L = LaurentSeriesRing(ZZ, default_prec=Integer(42), names=('t',)); (t,) = L._first_ngens(1)
>>> phi, arg = L.construction()
>>> phi
Completion[t, prec=42]
>>> arg
Univariate Laurent Polynomial Ring in t over Integer Ring
>>> phi(arg) is L
True

Because of this construction, pushout is automatically available:

sage: 1/2 * t
1/2*t
sage: parent(1/2 * t)
Laurent Series Ring in t over Rational Field

sage: QQbar.gen() * t                                                       # needs sage.rings.number_field
I*t
sage: parent(QQbar.gen() * t)                                               # needs sage.rings.number_field
Laurent Series Ring in t over Algebraic Field
>>> from sage.all import *
>>> Integer(1)/Integer(2) * t
1/2*t
>>> parent(Integer(1)/Integer(2) * t)
Laurent Series Ring in t over Rational Field

>>> QQbar.gen() * t                                                       # needs sage.rings.number_field
I*t
>>> parent(QQbar.gen() * t)                                               # needs sage.rings.number_field
Laurent Series Ring in t over Algebraic Field
default_prec()[source]

Get the precision to which exact elements are truncated when necessary (most frequently when inverting).

EXAMPLES:

sage: R.<x> = LaurentSeriesRing(QQ, default_prec=5)
sage: R.default_prec()
5
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, default_prec=Integer(5), names=('x',)); (x,) = R._first_ngens(1)
>>> R.default_prec()
5
fraction_field()[source]

Return the fraction field of this ring of Laurent series.

If the base ring is a field, then Laurent series are already a field. If the base ring is a domain, then the Laurent series over its fraction field is returned. Otherwise, raise a ValueError.

EXAMPLES:

sage: R = LaurentSeriesRing(ZZ, 't', 30).fraction_field()
sage: R
Laurent Series Ring in t over Rational Field
sage: R.default_prec()
30

sage: LaurentSeriesRing(Zmod(4), 't').fraction_field()
Traceback (most recent call last):
...
ValueError: must be an integral domain
>>> from sage.all import *
>>> R = LaurentSeriesRing(ZZ, 't', Integer(30)).fraction_field()
>>> R
Laurent Series Ring in t over Rational Field
>>> R.default_prec()
30

>>> LaurentSeriesRing(Zmod(Integer(4)), 't').fraction_field()
Traceback (most recent call last):
...
ValueError: must be an integral domain
gen(n=0)[source]

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, "x")
sage: R.gen()
x
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, "x")
>>> R.gen()
x
is_dense()[source]

EXAMPLES:

sage: K.<x> = LaurentSeriesRing(QQ, sparse=True)
sage: K.is_dense()
False
>>> from sage.all import *
>>> K = LaurentSeriesRing(QQ, sparse=True, names=('x',)); (x,) = K._first_ngens(1)
>>> K.is_dense()
False
is_exact()[source]

Laurent series rings are inexact.

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, "x")
sage: R.is_exact()
False
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, "x")
>>> R.is_exact()
False
is_field(proof=True)[source]

A Laurent series ring is a field if and only if the base ring is a field.

is_sparse()[source]

Return if self is a sparse implementation.

EXAMPLES:

sage: K.<x> = LaurentSeriesRing(QQ, sparse=True)
sage: K.is_sparse()
True
>>> from sage.all import *
>>> K = LaurentSeriesRing(QQ, sparse=True, names=('x',)); (x,) = K._first_ngens(1)
>>> K.is_sparse()
True
laurent_polynomial_ring()[source]

If this is the Laurent series ring \(R((t))\), return the Laurent polynomial ring \(R[t,1/t]\).

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, "x")
sage: R.laurent_polynomial_ring()
Univariate Laurent Polynomial Ring in x over Rational Field
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, "x")
>>> R.laurent_polynomial_ring()
Univariate Laurent Polynomial Ring in x over Rational Field
ngens()[source]

Laurent series rings are univariate.

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, "x")
sage: R.ngens()
1
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, "x")
>>> R.ngens()
1
polynomial_ring()[source]

If this is the Laurent series ring \(R((t))\), return the polynomial ring \(R[t]\).

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, "x")
sage: R.polynomial_ring()
Univariate Polynomial Ring in x over Rational Field
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, "x")
>>> R.polynomial_ring()
Univariate Polynomial Ring in x over Rational Field
power_series_ring()[source]

If this is the Laurent series ring \(R((t))\), return the power series ring \(R[[t]]\).

EXAMPLES:

sage: R = LaurentSeriesRing(QQ, "x")
sage: R.power_series_ring()
Power Series Ring in x over Rational Field
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, "x")
>>> R.power_series_ring()
Power Series Ring in x over Rational Field
random_element(algorithm='default')[source]

Return a random element of this Laurent series ring.

The optional algorithm parameter decides how elements are generated. Algorithms currently implemented:

  • 'default': Choose an integer shift using the standard distribution on the integers. Then choose a list of coefficients using the random_element function of the base ring, and construct a new element based on those coefficients, so that the i-th coefficient corresponds to the (i+shift)-th power of the uniformizer. The amount of coefficients is determined by the default_prec of the ring. Note that this method only creates non-exact elements.

EXAMPLES:

sage: S.<s> = LaurentSeriesRing(GF(3))
sage: S.random_element()  # random
s^-8 + s^-7 + s^-6 + s^-5 + s^-1 + s + s^3 + s^4
+ s^5 + 2*s^6 + s^7 + s^11 + O(s^12)
>>> from sage.all import *
>>> S = LaurentSeriesRing(GF(Integer(3)), names=('s',)); (s,) = S._first_ngens(1)
>>> S.random_element()  # random
s^-8 + s^-7 + s^-6 + s^-5 + s^-1 + s + s^3 + s^4
+ s^5 + 2*s^6 + s^7 + s^11 + O(s^12)
residue_field()[source]

Return the residue field of this Laurent series field if it is a complete discrete valuation field (i.e. if the base ring is a field, in which base it is also the residue field).

EXAMPLES:

sage: R.<x> = LaurentSeriesRing(GF(17))
sage: R.residue_field()
Finite Field of size 17

sage: R.<x> = LaurentSeriesRing(ZZ)
sage: R.residue_field()
Traceback (most recent call last):
...
TypeError: the base ring is not a field
>>> from sage.all import *
>>> R = LaurentSeriesRing(GF(Integer(17)), names=('x',)); (x,) = R._first_ngens(1)
>>> R.residue_field()
Finite Field of size 17

>>> R = LaurentSeriesRing(ZZ, names=('x',)); (x,) = R._first_ngens(1)
>>> R.residue_field()
Traceback (most recent call last):
...
TypeError: the base ring is not a field
uniformizer()[source]

Return a uniformizer of this Laurent series field if it is a discrete valuation field (i.e. if the base ring is actually a field). Otherwise, an error is raised.

EXAMPLES:

sage: R.<t> = LaurentSeriesRing(QQ)
sage: R.uniformizer()
t

sage: R.<t> = LaurentSeriesRing(ZZ)
sage: R.uniformizer()
Traceback (most recent call last):
...
TypeError: the base ring is not a field
>>> from sage.all import *
>>> R = LaurentSeriesRing(QQ, names=('t',)); (t,) = R._first_ngens(1)
>>> R.uniformizer()
t

>>> R = LaurentSeriesRing(ZZ, names=('t',)); (t,) = R._first_ngens(1)
>>> R.uniformizer()
Traceback (most recent call last):
...
TypeError: the base ring is not a field
sage.rings.laurent_series_ring.is_LaurentSeriesRing(x)[source]

Return True if this is a univariate Laurent series ring.

This is in keeping with the behavior of is_PolynomialRing versus is_MPolynomialRing.