Ring of Laurent Polynomials (base class)¶
If
AUTHORS:
David Roe (2008-2-23): created
David Loeffler (2009-07-10): cleaned up docstrings
- class sage.rings.polynomial.laurent_polynomial_ring_base.LaurentPolynomialRing_generic(R)[source]¶
Bases:
Parent
Laurent polynomial ring (base class).
EXAMPLES:
Since Issue #11900, it is in the category of commutative rings:
sage: R.<x1,x2> = LaurentPolynomialRing(QQ) sage: R.category() Join of Category of unique factorization domains and Category of algebras with basis over (number fields and quotient fields and metric spaces) and Category of commutative algebras over (number fields and quotient fields and metric spaces) and Category of infinite sets sage: TestSuite(R).run()
- change_ring(base_ring=None, names=None, sparse=False, order=None)[source]¶
EXAMPLES:
sage: R = LaurentPolynomialRing(QQ, 2, 'x') sage: R.change_ring(ZZ) Multivariate Laurent Polynomial Ring in x0, x1 over Integer Ring
Check that the distinction between a univariate ring and a multivariate ring with one generator is preserved:
sage: P.<x> = LaurentPolynomialRing(QQ, 1) sage: P Multivariate Laurent Polynomial Ring in x over Rational Field sage: K.<i> = CyclotomicField(4) # needs sage.rings.number_field sage: P.change_ring(K) # needs sage.rings.number_field Multivariate Laurent Polynomial Ring in x over Cyclotomic Field of order 4 and degree 2
- characteristic()[source]¶
Return the characteristic of the base ring.
EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').characteristic() 0 sage: LaurentPolynomialRing(GF(3), 2, 'x').characteristic() 3
- completion(p=None, prec=20, extras=None)[source]¶
Return the completion of
self
.Currently only implemented for the ring of formal Laurent series. The
prec
variable controls the precision used in the Laurent series ring. Ifprec
is , then this returns aLazyLaurentSeriesRing
.EXAMPLES:
sage: P.<x> = LaurentPolynomialRing(QQ); P Univariate Laurent Polynomial Ring in x over Rational Field sage: PP = P.completion(x); PP Laurent Series Ring in x over Rational Field sage: f = 1 - 1/x sage: PP(f) -x^-1 + 1 sage: g = 1 / PP(f); g -x - x^2 - x^3 - x^4 - x^5 - x^6 - x^7 - x^8 - x^9 - x^10 - x^11 - x^12 - x^13 - x^14 - x^15 - x^16 - x^17 - x^18 - x^19 - x^20 + O(x^21) sage: 1 / g -x^-1 + 1 + O(x^19) sage: # needs sage.combinat sage: PP = P.completion(x, prec=oo); PP Lazy Laurent Series Ring in x over Rational Field sage: g = 1 / PP(f); g -x - x^2 - x^3 + O(x^4) sage: 1 / g == f True
- construction()[source]¶
Return the construction of
self
.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x,y').construction() (LaurentPolynomialFunctor, Univariate Laurent Polynomial Ring in x over Rational Field)
- fraction_field()[source]¶
The fraction field is the same as the fraction field of the polynomial ring.
EXAMPLES:
sage: L.<x> = LaurentPolynomialRing(QQ) sage: L.fraction_field() Fraction Field of Univariate Polynomial Ring in x over Rational Field sage: (x^-1 + 2) / (x - 1) (2*x + 1)/(x^2 - x)
- gen(i=0)[source]¶
Return the
-th generator ofself
.If
is not specified, then the first generator will be returned.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').gen() x0 sage: LaurentPolynomialRing(QQ, 2, 'x').gen(0) x0 sage: LaurentPolynomialRing(QQ, 2, 'x').gen(1) x1
- gens()[source]¶
Return the tuple of generators of
self
.EXAMPLES:
sage: LaurentPolynomialRing(ZZ, 2, 'x').gens() (x0, x1) sage: LaurentPolynomialRing(QQ, 1, 'x').gens() (x,)
- ideal(*args, **kwds)[source]¶
EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').ideal([1]) Ideal (1) of Multivariate Laurent Polynomial Ring in x0, x1 over Rational Field
- is_exact()[source]¶
Return
True
if the base ring is exact.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').is_exact() True sage: LaurentPolynomialRing(RDF, 2, 'x').is_exact() False
- is_integral_domain(proof=True)[source]¶
Return
True
ifself
is an integral domain.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').is_integral_domain() True
The following used to fail; see Issue #7530:
sage: L = LaurentPolynomialRing(ZZ, 'X') sage: L['Y'] Univariate Polynomial Ring in Y over Univariate Laurent Polynomial Ring in X over Integer Ring
- is_noetherian()[source]¶
Return
True
ifself
is Noetherian.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').is_noetherian() True
- krull_dimension()[source]¶
EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').krull_dimension() Traceback (most recent call last): ... NotImplementedError
- ngens()[source]¶
Return the number of generators of
self
.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').ngens() 2 sage: LaurentPolynomialRing(QQ, 1, 'x').ngens() 1
- polynomial_ring()[source]¶
Return the polynomial ring associated with
self
.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').polynomial_ring() Multivariate Polynomial Ring in x0, x1 over Rational Field sage: LaurentPolynomialRing(QQ, 1, 'x').polynomial_ring() Multivariate Polynomial Ring in x over Rational Field
- random_element(min_valuation=-2, max_degree=2, *args, **kwds)[source]¶
Return a random polynomial with degree at most
max_degree
and lowest valuation at leastmin_valuation
.Uses the random sampling from the base polynomial ring then divides out by a monomial to ensure correct
max_degree
andmin_valuation
.INPUT:
min_valuation
– integer (default: ); the minimal allowed valuation of the polynomialmax_degree
– integer (default: ); the maximal allowed degree of the polynomial*args
,**kwds
– passed to the random element generator of the base polynomial ring and base ring itself
EXAMPLES:
sage: L.<x> = LaurentPolynomialRing(QQ) sage: f = L.random_element() sage: f.degree() <= 2 True sage: f.valuation() >= -2 True sage: f.parent() is L True
sage: L = LaurentPolynomialRing(ZZ, 2, 'x') sage: f = L.random_element(10, 20) sage: f.degree() <= 20 True sage: f.valuation() >= 10 True sage: f.parent() is L True
sage: L = LaurentPolynomialRing(GF(13), 3, 'x') sage: f = L.random_element(-10, -1) sage: f.degree() <= -1 True sage: f.valuation() >= -10 True sage: f.parent() is L True
sage: L.<x, y> = LaurentPolynomialRing(RR) sage: f = L.random_element() sage: f.degree() <= 2 True sage: f.valuation() >= -2 True sage: f.parent() is L True
sage: L = LaurentPolynomialRing(QQbar, 5, 'x') sage: f = L.random_element(-1, 1) sage: f = L.random_element(-1, 1) sage: f.degree() <= 1 True sage: f.valuation() >= -1 True sage: f.parent() is L True
- remove_var(var)[source]¶
EXAMPLES:
sage: R = LaurentPolynomialRing(QQ,'x,y,z') sage: R.remove_var('x') Multivariate Laurent Polynomial Ring in y, z over Rational Field sage: R.remove_var('x').remove_var('y') Univariate Laurent Polynomial Ring in z over Rational Field
- term_order()[source]¶
Return the term order of
self
.EXAMPLES:
sage: LaurentPolynomialRing(QQ, 2, 'x').term_order() Degree reverse lexicographic term order
- variable_names_recursive(depth=+Infinity)[source]¶
Return the list of variable names of this ring and its base rings, as if it were a single multi-variate Laurent polynomial.
INPUT:
depth
– integer orInfinity
OUTPUT: a tuple of strings
EXAMPLES:
sage: T = LaurentPolynomialRing(QQ, 'x') sage: S = LaurentPolynomialRing(T, 'y') sage: R = LaurentPolynomialRing(S, 'z') sage: R.variable_names_recursive() ('x', 'y', 'z') sage: R.variable_names_recursive(2) ('y', 'z')