Ask Your Question

Revision history [back]

There are two different implementations for LaurentPolynomialRing depending on whether there is one or more indeterminates:

sage: Q.<x> = LaurentPolynomialRing(QQ)
sage: type(Q)
<class 'sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing_univariate_with_category'>
sage: Q.<x,y> = LaurentPolynomialRing(QQ)
sage: type(Q)
<class 'sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing_mpair_with_category'>

Each implementation comes with its own methods.

A trick to benefit from the multivariate implementation of groebner_basis is to define Q as a multivariate Laurent Polynomial Ring, but with 1 indeterminate:

sage: Q.<x> = LaurentPolynomialRing(QQ, 1)
sage: type(Q)
<class 'sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing_mpair_with_category'>

Note the 1 at the end of the first command.

Then, you can do:

sage: I = Q.ideal([x - x^-1 + x^2])
sage: I.groebner_basis()
(x^3 + x^2 - 1,)