Ideals in Laurent polynomial rings - Polynomials

Skip to content
Back to top
View this page
Edit this page

# Ideals in Laurent polynomial rings

For \(R\) a commutative ring, ideals in the Laurent polynomial ring \(R[x_1^{\pm 1}, x_2^{\pm 1}, \ldots, x_n^{\pm 1}]\) are implemented as ideals in the ordinary polynomial ring \(R[x_1, \ldots, x_n]\) which are saturated with respect to the ideal \((x_1 \cdots x_n)\).

AUTHORS:

- Kiran S. Kedlaya (2020): initial implementation

class sage.rings.polynomial.laurent_polynomial_ideal.LaurentPolynomialIdeal(ring, gens, coerce=True, hint=None)

  Bases: `Ideal_generic`

  Create an ideal in a Laurent polynomial ring.

  To compute structural properties of an ideal in the Laurent polynomial ring \(R[x_1^{\pm},\ldots,x_n^{\pm}]\), we form the corresponding ideal in the associated ordinary polynomial ring \(R[x_1,\ldots,x_n]\) which is saturated with respect to the ideal \((x_1 \cdots x_n)\). Since computing the saturation can be expensive, we employ some strategies to reduce the need for it.

  - We only create the polynomial ideal as needed.

  - For some operations, we try some superficial tests first. E.g., for comparisons, we first look directly at generators.

  - The attribute `hint` is a lower bound on the associated polynomial ideal. Hints are automatically forwarded by certain creation operations (such as sums and base extensions), and can be manually forwarded in other cases.

  INPUT:

  - `ring` – the ring the ideal is defined in

  - `gens` – list of generators for the ideal

  - `coerce` – whether or not to coerce elements into `ring`

  - `hint` – an ideal in the associated polynomial ring (optional; see above)

  EXAMPLES:

  Sage

      sage: R.<x,y> = LaurentPolynomialRing(IntegerRing(), 2, order='lex')
      sage: R.ideal([x, y])
      Ideal (x, y) of Multivariate Laurent Polynomial Ring in x, y
      over Integer Ring
      sage: R.<x0,x1> = LaurentPolynomialRing(GF(3), 2)
      sage: R.ideal([x0^2, x1^-3])
      Ideal (x0^2, x1^-3) of Multivariate Laurent Polynomial Ring in x0, x1
      over Finite Field of size 3

      sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
      sage: I = P.ideal([~x + ~y - 1])
      sage: print(I)
      Ideal (-1 + y^-1 + x^-1) of
       Multivariate Laurent Polynomial Ring in x, y over Rational Field
      sage: I.is_zero()
      False
      sage: (x^(-2) + x^(-1)*y^(-1) - x^(-1)) in I
      True

      sage: P.<x,y,z> = LaurentPolynomialRing(QQ, 3)
      sage: I1 = P.ideal([x*y*z + x*y + 2*y^2, x + z])
      sage: I2 = P.ideal([x*y*z + x*y + 2*y^2 + x + z, x + z])
      sage: I1 == I2
      True
      sage: I3 = P.ideal([x*y*z + x*y + 2*y^2 + x + z, x + z, y])
      sage: I1 < I3
      True
      sage: I1.minimal_associated_primes()
      (Ideal (-1/2*z^2 + y - 1/2*z, x + z) of Multivariate
        Laurent Polynomial Ring in x, y, z over Rational Field,)

      sage: K.<z> = CyclotomicField(4)                                            # needs sage.rings.number_field
      sage: J = I1.base_extend(K)                                                 # needs sage.rings.number_field
      sage: J.base_ring()                                                         # needs sage.rings.number_field
      Cyclotomic Field of order 4 and degree 2

  Python

      >>> from sage.all import *
      >>> R = LaurentPolynomialRing(IntegerRing(), Integer(2), order='lex', names=('x', 'y',)); (x, y,) = R._first_ngens(2)
      >>> R.ideal([x, y])
      Ideal (x, y) of Multivariate Laurent Polynomial Ring in x, y
      over Integer Ring
      >>> R = LaurentPolynomialRing(GF(Integer(3)), Integer(2), names=('x0', 'x1',)); (x0, x1,) = R._first_ngens(2)
      >>> R.ideal([x0**Integer(2), x1**-Integer(3)])
      Ideal (x0^2, x1^-3) of Multivariate Laurent Polynomial Ring in x0, x1
      over Finite Field of size 3

      >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
      >>> I = P.ideal([~x + ~y - Integer(1)])
      >>> print(I)
      Ideal (-1 + y^-1 + x^-1) of
       Multivariate Laurent Polynomial Ring in x, y over Rational Field
      >>> I.is_zero()
      False
      >>> (x**(-Integer(2)) + x**(-Integer(1))*y**(-Integer(1)) - x**(-Integer(1))) in I
      True

      >>> P = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
      >>> I1 = P.ideal([x*y*z + x*y + Integer(2)*y**Integer(2), x + z])
      >>> I2 = P.ideal([x*y*z + x*y + Integer(2)*y**Integer(2) + x + z, x + z])
      >>> I1 == I2
      True
      >>> I3 = P.ideal([x*y*z + x*y + Integer(2)*y**Integer(2) + x + z, x + z, y])
      >>> I1 < I3
      True
      >>> I1.minimal_associated_primes()
      (Ideal (-1/2*z^2 + y - 1/2*z, x + z) of Multivariate
        Laurent Polynomial Ring in x, y, z over Rational Field,)

      >>> K = CyclotomicField(Integer(4), names=('z',)); (z,) = K._first_ngens(1)# needs sage.rings.number_field
      >>> J = I1.base_extend(K)                                                 # needs sage.rings.number_field
      >>> J.base_ring()                                                         # needs sage.rings.number_field
      Cyclotomic Field of order 4 and degree 2

  apply_coeff_map(f, new_base_ring=None, forward_hint=True)

    Apply a function to coefficients.

    This operation forwards hints by default.

    EXAMPLES:

    Sage

        sage: K.<z> = CyclotomicField(3)
        sage: P.<x,y> = LaurentPolynomialRing(K, 2)
        sage: I = P.ideal([x + z, y - z])
        sage: h = K.hom([z^2])
        sage: I.apply_coeff_map(h)
        Ideal (x - z - 1, y + z + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Cyclotomic Field of order 3 and degree 2
        sage: K1.<z1> = CyclotomicField(12)
        sage: h1 = K.hom([z1^4])
        sage: I.apply_coeff_map(h1, new_base_ring=K1)
        Ideal (x + z1^2 - 1, y - z1^2 + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Cyclotomic Field of order 12 and degree 4

    Python

        >>> from sage.all import *
        >>> K = CyclotomicField(Integer(3), names=('z',)); (z,) = K._first_ngens(1)
        >>> P = LaurentPolynomialRing(K, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x + z, y - z])
        >>> h = K.hom([z**Integer(2)])
        >>> I.apply_coeff_map(h)
        Ideal (x - z - 1, y + z + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Cyclotomic Field of order 3 and degree 2
        >>> K1 = CyclotomicField(Integer(12), names=('z1',)); (z1,) = K1._first_ngens(1)
        >>> h1 = K.hom([z1**Integer(4)])
        >>> I.apply_coeff_map(h1, new_base_ring=K1)
        Ideal (x + z1^2 - 1, y - z1^2 + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Cyclotomic Field of order 12 and degree 4

  apply_map(f, new_ring=None, new_base_ring=None, apply_to_hint=None)

    Return the new ideal obtained by applying `f` to each generator.

    By default, this does not forward hints. To do so, set `apply_to_hint` to specify a function to apply to generators of `hint`.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([x + 1, y - 1])
        sage: I.apply_map(lambda z: z + 2)
        Ideal (x + 3, y + 1) of Multivariate Laurent Polynomial Ring in x, y
         over Rational Field
        sage: K.<i> = CyclotomicField(4)                                            # needs sage.rings.number_field
        sage: I.apply_map(lambda z: z + 2, new_base_ring=K)                         # needs sage.rings.number_field
        Ideal (x + 3, y + 1) of Multivariate Laurent Polynomial Ring in x, y
         over Cyclotomic Field of order 4 and degree 2

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x + Integer(1), y - Integer(1)])
        >>> I.apply_map(lambda z: z + Integer(2))
        Ideal (x + 3, y + 1) of Multivariate Laurent Polynomial Ring in x, y
         over Rational Field
        >>> K = CyclotomicField(Integer(4), names=('i',)); (i,) = K._first_ngens(1)# needs sage.rings.number_field
        >>> I.apply_map(lambda z: z + Integer(2), new_base_ring=K)                         # needs sage.rings.number_field
        Ideal (x + 3, y + 1) of Multivariate Laurent Polynomial Ring in x, y
         over Cyclotomic Field of order 4 and degree 2

  associated_primes()

    Return associated primes of this ideal.

    These are computed from the polynomial ideal, but it is not necessary to saturate. Instead, we omit primes containing any polynomial generator.

    EXAMPLES:

    Sage

        sage: P.<x,y,z> = LaurentPolynomialRing(QQ, 3)
        sage: p = z^2 + 1; q = z^3 + 2
        sage: I = P.ideal((p*q^2, y - z^2))
        sage: tuple(sorted(I.associated_primes(), key=str))
        (Ideal (y + 1, z^2 + 1) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field,
         Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field)

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
        >>> p = z**Integer(2) + Integer(1); q = z**Integer(3) + Integer(2)
        >>> I = P.ideal((p*q**Integer(2), y - z**Integer(2)))
        >>> tuple(sorted(I.associated_primes(), key=str))
        (Ideal (y + 1, z^2 + 1) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field,
         Ideal (z^2 - y, y*z + 2, y^2 + 2*z) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field)

  base_extend(F)

    Form the base extension of `self` to the base ring `F`.

    This operation forwards hints.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([x + y])
        sage: K.<z> = CyclotomicField(3)                                            # needs sage.rings.number_field
        sage: I.base_extend(K)                                                      # needs sage.rings.number_field
        Ideal (x + y) of Multivariate Laurent Polynomial Ring in x, y
         over Cyclotomic Field of order 3 and degree 2

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x + y])
        >>> K = CyclotomicField(Integer(3), names=('z',)); (z,) = K._first_ngens(1)# needs sage.rings.number_field
        >>> I.base_extend(K)                                                      # needs sage.rings.number_field
        Ideal (x + y) of Multivariate Laurent Polynomial Ring in x, y
         over Cyclotomic Field of order 3 and degree 2

  change_ring(R, hint=None)

    Coerce an ideal into a new ring.

    This operation does not forward hints, but a new hint can be specified manually.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([x + y])
        sage: Q.<x,y,z> = LaurentPolynomialRing(QQ, 3)
        sage: I.change_ring(Q)
        Ideal (x + y) of Multivariate Laurent Polynomial Ring in x, y, z
         over Rational Field

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x + y])
        >>> Q = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = Q._first_ngens(3)
        >>> I.change_ring(Q)
        Ideal (x + y) of Multivariate Laurent Polynomial Ring in x, y, z
         over Rational Field

  dimension()

    Return the dimension of this ideal.

    EXAMPLES:

    Sage

        sage: P.<x,y,z> = LaurentPolynomialRing(QQ, 3)
        sage: I = P.ideal(((x+1)^2, (y+1)^3, ((x+1)*z)^4 + (y+1)^3 + 10*(x+1)^2))
        sage: I.dimension()
        1

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
        >>> I = P.ideal(((x+Integer(1))**Integer(2), (y+Integer(1))**Integer(3), ((x+Integer(1))*z)**Integer(4) + (y+Integer(1))**Integer(3) + Integer(10)*(x+Integer(1))**Integer(2)))
        >>> I.dimension()
        1

  gens_reduced()

    Return a reduced system of generators.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ)
        sage: J = P.ideal([x^2 - y^-2, x * y^3 + 2 * y^2+ y])
        sage: J.gens_reduced()
        (x + 6*y + 5, 3*y^2 + 4*y + 1)

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> J = P.ideal([x**Integer(2) - y**-Integer(2), x * y**Integer(3) + Integer(2) * y**Integer(2)+ y])
        >>> J.gens_reduced()
        (x + 6*y + 5, 3*y^2 + 4*y + 1)

  groebner_basis(saturate=True)

    Return the reduced Groebner basis for the specified term order.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([x + y])
        sage: J = P.ideal([y + 1])
        sage: (I + J).groebner_basis()
        (x - 1, y + 1)

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x + y])
        >>> J = P.ideal([y + Integer(1)])
        >>> (I + J).groebner_basis()
        (x - 1, y + 1)

  hint()

    Return the hint of this ideal.

    The hint is an ideal of the associated polynomial ring, which is assumed to be contained in the associated ideal. It is used internally to speed up computation of the associated ideal in some cases; normally the end user will have no need to work with it directly.

    EXAMPLES:

    Sage

        sage: P.<x,y,z> = LaurentPolynomialRing(QQ, 3)
        sage: I = P.ideal([x^2*y + 3*x*y^2])
        sage: I.hint()
        Ideal (0) of Multivariate Polynomial Ring in x, y, z over Rational Field

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
        >>> I = P.ideal([x**Integer(2)*y + Integer(3)*x*y**Integer(2)])
        >>> I.hint()
        Ideal (0) of Multivariate Polynomial Ring in x, y, z over Rational Field

  is_binomial(groebner_basis=False)

    Determine whether every generator of `self` is a binomial.

    If `groebner_basis` is `True`, this becomes intrinsic (for a choice of term order).

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([x + y])
        sage: I.is_binomial()
        True

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x + y])
        >>> I.is_binomial()
        True

  is_one()

    Determine whether or not `self` is the unit ideal.

    This requires saturation of the polynomial ideal.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([~x + ~y - 1, x + y])
        sage: I.is_one()
        True

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([~x + ~y - Integer(1), x + y])
        >>> I.is_one()
        True

  minimal_associated_primes(saturate=False)

    Return minimal associated primes of this ideal.

    These are computed from the polynomial ideal, but it is not necessary to saturate. Instead, we omit primes containing any polynomial generator.

    EXAMPLES:

    Sage

        sage: P.<x,y,z> = LaurentPolynomialRing(QQ, 3)
        sage: p = z^2 + 1; q = z^3 + 2
        sage: I = P.ideal((p*q^2, y - z^2))
        sage: tuple(sorted(I.minimal_associated_primes(), key=str))
        (Ideal (z^2 + 1, -z^2 + y) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field,
         Ideal (z^3 + 2, -z^2 + y) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field)

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
        >>> p = z**Integer(2) + Integer(1); q = z**Integer(3) + Integer(2)
        >>> I = P.ideal((p*q**Integer(2), y - z**Integer(2)))
        >>> tuple(sorted(I.minimal_associated_primes(), key=str))
        (Ideal (z^2 + 1, -z^2 + y) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field,
         Ideal (z^3 + 2, -z^2 + y) of
          Multivariate Laurent Polynomial Ring in x, y, z over Rational Field)

  normalize_gens()

    Redefine the ideal with a normalized set of generators.

    For two ideals returned by this function, equality testing can be done by comparing generators.

    This operation forwards hints.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([~x+y])
        sage: J = P.ideal([y+1])
        sage: I + J
        Ideal (y + x^-1, y + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Rational Field
        sage: (I + J).normalize_gens()
        Ideal (x - 1, y + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Rational Field

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([~x+y])
        >>> J = P.ideal([y+Integer(1)])
        >>> I + J
        Ideal (y + x^-1, y + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Rational Field
        >>> (I + J).normalize_gens()
        Ideal (x - 1, y + 1) of Multivariate Laurent Polynomial Ring
         in x, y over Rational Field

  polynomial_ideal(saturate=True)

    Return the associated polynomial ideal.

    By default, the ideal is saturated with respect to the product of the polynomial ring generators; this is necessary for testing equality and inclusion. As saturation can be quite time-consuming, it can be disabled by setting `saturate=False`; however, the result will then depend not just on the original ideal but also on the choice of generators.

    EXAMPLES:

    Sage

        sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
        sage: I = P.ideal([x^2*y + 3*x*y^2])
        sage: I.polynomial_ideal()
        Ideal (x + 3*y) of Multivariate Polynomial Ring in x, y over Rational Field
        sage: P.<t> = LaurentPolynomialRing(QQ)
        sage: J = P.ideal(t^2 - t^-1)
        sage: J.polynomial_ideal()
        Principal ideal (t^3 - 1) of Univariate Polynomial Ring in t over Rational Field
        sage: J = P.ideal([t^2 - t^-1, t + t^-1])
        sage: J.polynomial_ideal()
        Principal ideal (1) of Univariate Polynomial Ring in t over Rational Field
        sage: J = P.ideal([t^2 - t^-1, t - t^-1])
        sage: J.polynomial_ideal()
        Principal ideal (t - 1) of Univariate Polynomial Ring in t over Rational Field

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x**Integer(2)*y + Integer(3)*x*y**Integer(2)])
        >>> I.polynomial_ideal()
        Ideal (x + 3*y) of Multivariate Polynomial Ring in x, y over Rational Field
        >>> P = LaurentPolynomialRing(QQ, names=('t',)); (t,) = P._first_ngens(1)
        >>> J = P.ideal(t**Integer(2) - t**-Integer(1))
        >>> J.polynomial_ideal()
        Principal ideal (t^3 - 1) of Univariate Polynomial Ring in t over Rational Field
        >>> J = P.ideal([t**Integer(2) - t**-Integer(1), t + t**-Integer(1)])
        >>> J.polynomial_ideal()
        Principal ideal (1) of Univariate Polynomial Ring in t over Rational Field
        >>> J = P.ideal([t**Integer(2) - t**-Integer(1), t - t**-Integer(1)])
        >>> J.polynomial_ideal()
        Principal ideal (t - 1) of Univariate Polynomial Ring in t over Rational Field

  radical()

    Return the radical of this ideal.

    EXAMPLES:

    Sage

        sage: P.<x,y,z> = LaurentPolynomialRing(QQ, 3)
        sage: I = P.ideal(((x+1)^2, (y+1)^3, ((x+1)*z)^4 + (y+1)^3 + 10*(x+1)^2))
        sage: I.radical()
        Ideal (y + 1, x + 1) of Multivariate Laurent Polynomial Ring in x, y, z
         over Rational Field

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
        >>> I = P.ideal(((x+Integer(1))**Integer(2), (y+Integer(1))**Integer(3), ((x+Integer(1))*z)**Integer(4) + (y+Integer(1))**Integer(3) + Integer(10)*(x+Integer(1))**Integer(2)))
        >>> I.radical()
        Ideal (y + 1, x + 1) of Multivariate Laurent Polynomial Ring in x, y, z
         over Rational Field

  set_hint(hint)

    Set the hint of this ideal.

    The hint is an ideal of the associated polynomial ring, which is assumed to be contained in the associated ideal. It is used internally to speed up computation of the associated ideal in some cases; normally the end user will have no need to work with it directly.

    EXAMPLES:

    Sage

        sage: P.<x,y,z> = LaurentPolynomialRing(QQ, 3)
        sage: I = P.ideal([x^2*y + 3*x*y^2])
        sage: I.hint()
        Ideal (0) of Multivariate Polynomial Ring in x, y, z over Rational Field
        sage: I.set_hint(P.polynomial_ring().ideal([x + 3*y]))
        sage: I.hint()
        Ideal (x + 3*y) of Multivariate Polynomial Ring in x, y, z over Rational Field

    Python

        >>> from sage.all import *
        >>> P = LaurentPolynomialRing(QQ, Integer(3), names=('x', 'y', 'z',)); (x, y, z,) = P._first_ngens(3)
        >>> I = P.ideal([x**Integer(2)*y + Integer(3)*x*y**Integer(2)])
        >>> I.hint()
        Ideal (0) of Multivariate Polynomial Ring in x, y, z over Rational Field
        >>> I.set_hint(P.polynomial_ring().ideal([x + Integer(3)*y]))
        >>> I.hint()
        Ideal (x + 3*y) of Multivariate Polynomial Ring in x, y, z over Rational Field

  toric_coordinate_change(M, forward_hint=True)

    Compute the toric change of coordinates defined by the integer matrix `M`.

    This operation forwards hints by default.

    EXAMPLES:

    Sage

        sage: K.<z> = CyclotomicField(3)
        sage: P.<x,y> = LaurentPolynomialRing(K, 2)
        sage: I = P.ideal([x + 1, y - 1])
        sage: M = Matrix([[2,1], [1,-3]])
        sage: I.toric_coordinate_change(M)
        Ideal (x^2*y + 1, -1 + x*y^-3) of Multivariate Laurent Polynomial Ring
         in x, y over Cyclotomic Field of order 3 and degree 2

    Python

        >>> from sage.all import *
        >>> K = CyclotomicField(Integer(3), names=('z',)); (z,) = K._first_ngens(1)
        >>> P = LaurentPolynomialRing(K, Integer(2), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
        >>> I = P.ideal([x + Integer(1), y - Integer(1)])
        >>> M = Matrix([[Integer(2),Integer(1)], [Integer(1),-Integer(3)]])
        >>> I.toric_coordinate_change(M)
        Ideal (x^2*y + 1, -1 + x*y^-3) of Multivariate Laurent Polynomial Ring
         in x, y over Cyclotomic Field of order 3 and degree 2