Module: sage.rings.multi_polynomial_ideal
Author Log:
sage: x,y,z = QQ['x,y,z'].gens() sage: I = ideal(x^5 + y^4 + z^3 - 1, x^3 + y^3 + z^2 - 1) sage: B = I.groebner_basis() sage: len(B) 8 sage: [f in I for f in I.gens()] [True, True]
sage: f = I.gens()[0] sage: I.reduce(f) 0
sage: g = I.gens()[1] sage: I.reduce(g) 0
sage: I.reduce(g+x^2) x^2
We compute a Groebner basis for cyclic 6, which is a standard benchmark and test ideal.
sage: x,y,z,t,u,v = QQ['x,y,z,t,u,v'].gens() sage: I = ideal(x + y + z + t + u + v, x*y + y*z + z*t + t*u + u*v + v*x, x*y*z + y*z*t + z*t*u + t*u*v + u*v*x + v*x*y, x*y*z*t + y*z*t*u + z*t*u*v + t*u*v*x + u*v*x*y + v*x*y*z, x*y*z*t*u + y*z*t*u*v + z*t*u*v*x + t*u*v*x*y + u*v*x*y*z + v*x*y*z*t, x*y*z*t*u*v - 1) sage: B = I.groebner_basis() sage: len(B) 17
Module-level Functions
x) |
Class: MPolynomialIdeal
self, ring, gens, [coerce=True]) |
Create an ideal in a multivariate polynomial ring.
sage: R = PolynomialRing(IntegerRing(), 2, ['x','y']); x,y = R.gens() sage: R.ideal([x, y]) Ideal (y, x) of Polynomial Ring in x, y over Integer Ring sage: R = PolynomialRing(GF(3), 2); x = R.gens() sage: R.ideal([x[0]**2, x[1]**3]) Ideal (x1^3, x0^2) of Polynomial Ring in x0, x1 over Finite Field of size 3
Functions: groebner_fan
self, [is_groebner_basis=False], [symmetry=None], [verbose=False]) |
Return the Groebner fan of this ideal.
The base ring must be
or a finite field
of with
.
INPUT: is_groebner_basis -- bool (default False). if True, then I.gens() must be a Groebner basis with respect to the standard degree lexicographic term order. symmetry -- default: None; if not None, describes symmetries of the ideal verbose -- default: False; if True, printout useful info during computations
Class: MPolynomialIdeal_macaulay2_repr
sage: x,y,z,w = PolynomialRing(ZZ, 4, 'xyzw', macaulay2=True).gens() # optional sage: I = ideal(x*y-z^2, y^2-w^2) # optional sage: I # optional Ideal (-1*w^2 + y^2, -1*z^2 + x*y) of Polynomial Ring in x, y, z, w over Integer Ring
self, ring, gens, [coerce=True]) |
Functions: groebner_basis
self) |
Return the Groebner basis for this ideal.
ALGORITHM: Computed using Macaulay2.
sage: x,y,z,w = PolynomialRing(ZZ, 4, 'xyzw', macaulay2=True).gens() # optional sage: I = ideal(x*y-z^2, y^2-w^2) # optional sage: I.groebner_basis() # optional [-1*w^2 + y^2, -1*z^2 + x*y, -1*y*z^2 + x*w^2]
Special Functions: _macaulay2_
self, [macaulay2=None]) |
Return Macaulay2 ideal corresponding to this ideal.
Class: MPolynomialIdeal_singular_repr
self, ring, gens, [coerce=True]) |
Functions: associated_primes,
complete_primary_decomposition,
dimension,
genus,
groebner_basis,
intersection,
minimal_associated_primes,
plot,
primary_decomposition,
radical,
reduce
self, [algorithm=sy]) |
sage: R, (x,y,z) = PolynomialRing(Q, 3, 'xyz').objgens() sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: I.associated_primes() [Ideal (1 + z^2, 1 + y) of Polynomial Ring in x, y, z over Rational Field, Ideal (2 + z^3, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field]
self, [algorithm=sy]) |
INPUT: algorithm -- string: 'sy' -- (default) use the shimoyama-yokoyama algorithm 'gtz' -- use the gianni-trager-zacharias algorithm OUTPUT: list -- a list of primary ideals and their associated primes [(primary ideal, associated prime), ...]
ALGORITHM: Uses Singular.
sage: R, (x,y,z) = PolynomialRing(Q, 3, 'xyz').objgens() sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: pd = I.complete_primary_decomposition(); pd [(Ideal (1 + z^2, 1 + y) of Polynomial Ring in x, y, z over Rational Field, Ideal (1 + z^2, 1 + y) of Polynomial Ring in x, y, z over Rational Field), (Ideal (-1*z^2 + y, 4 + 4*z^3 + z^6) of Polynomial Ring in x, y, z over Rational Field, Ideal (2 + z^3, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field)]
sage: I.complete_primary_decomposition(algorithm = 'gtz') [(Ideal (1 + z^2, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field, Ideal (1 + z^2, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field), (Ideal (-1*z^2 + y, 4 + 4*z^3 + z^6) of Polynomial Ring in x, y, z over Rational Field, Ideal (2 + z^3, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field)]
self) |
The dimension of the ring modulo this ideal.
self) |
Return the genus of the projective curve defined by this ideal, which must be 1 dimensional.
self) |
Return a Groebner basis of this ideal.
ALGORITHM: Uses Singular.
We compute a Groebner basis of "cyclic 4" relative to lexicographic ordering.
sage: R = PolynomialRing(RationalField(), 4, ['a','b','c','d'], 'lex') sage: a,b,c,d = R.gens() sage: I = R.ideal([a+b+c+d, a*b+a*d+b*c+c*d, a*b*c + a*b*d + a*c*d + b*c*d, a*b*c*d-1]) sage: I Ideal (-1 + a*b*c*d, d + c + b + a, c*d + b*c + a*d + a*b, b*c*d + a*c*d + a*b*d + a*b*c) of Polynomial Ring in a, b, c, d over Rational Field sage: I.groebner_basis() [1 - d^4 - c^2*d^2 + c^2*d^6, -1*d - c + c^2*d^3 + c^3*d^2, -1*d + d^5 - b + b*d^4, -1*d^2 - d^6 + c*d + c^2*d^4 - b*d^5 + b*c, d^2 + 2*b*d + b^2, d + c + b + a]
oteSome Groebner basis calculations crash on 64-bit opterons with SAGE's singular build, but work fine with an official binary. If you download and install a Singular binary from the Singular website it will not have this problem (you can use it with SAGE by putting it in local/bin/).
self, other) |
Return the intersection of the two ideals.
sage: R, (x,y) = PolynomialRing(Q, 2, 'xy').objgens() sage: I = x*R sage: J = y*R sage: I.intersection(J) Ideal (x*y) of Polynomial Ring in x, y over Rational Field
The following simple example illustrates that the product need not equal the intersection.
sage: I = (x^2, y)*R sage: J = (y^2, x)*R sage: K = I.intersection(J); K Ideal (y^2, x*y, x^2) of Polynomial Ring in x, y over Rational Field sage: IJ = I*J; IJ Ideal (y^3, x*y, x^2*y^2, x^3) of Polynomial Ring in x, y over Rational Field sage: IJ == K False
self) |
OUTPUT: list - a list of prime ideals
sage: R, (x,y,z) = PolynomialRing(Q, 3, 'xyz').objgens() sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: I.minimal_associated_primes () [Ideal (2 + z^3, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field, Ideal (1 + z^2, -1*z^2 + y) of Polynomial Ring in x, y, z over Rational Field]
ALGORITHM: Uses Singular.
self) |
If you somehow manage to install surf, perhaps you can use this function to implicitly plot the real zero locus of this ideal (if principal).
INPUT: self -- must be a principal ideal in 2 or 3 vars over QQ.
Implicit plotting in 2-d:
sage: R, (x,y) = MPolynomialRing(QQ,2).objgens() sage: I = R.ideal([y^3 - x^2]) sage: I.plot() # cusp (optional surf) sage: I = R.ideal([y^2 - x^2 - 1]) sage: I.plot() # hyperbola (optional surf) sage: I = R.ideal([y^2 + x^2*(1/4) - 1]) sage: I.plot() # ellipse (optional surf) sage: I = R.ideal([y^2-(x^2-1)*(x-2)]) sage: I.plot() # elliptic curve (optional surf)
Implicit plotting in 3-d:
sage: R, (x,y,z) = MPolynomialRing(QQ,3).objgens() sage: I = R.ideal([y^2 + x^2*(1/4) - z]) sage: I.plot() # a cone (optional surf) sage: I = R.ideal([y^2 + z^2*(1/4) - x]) sage: I.plot() # same code, from a different angle (optional surf) sage: I = R.ideal([x^2*y^2+x^2*z^2+y^2*z^2-16*x*y*z]) sage: I.plot() # Steiner surface (optional surf)
Author: David Joyner (2006-02-12)
self, [algorithm=sy]) |
sage: R, (x,y,z) = PolynomialRing(Q, 3, 'xyz').objgens() sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: I.primary_decomposition() # this fails on some 64-bit machines sometimes during automated testing; I don't know why! [Ideal (1 + z^2, 1 + y) of Polynomial Ring in x, y, z over Rational Field, Ideal (-1*z^2 + y, 4 + 4*z^3 + z^6) of Polynomial Ring in x, y, z over Rational Field]
self) |
The radical of this ideal.
This is an obviously not radical ideal:
sage: R, (x,y,z) = PolynomialRing(QQ, 3, 'xyz').objgens() sage: I = (x^2, y^3, (x*z)^4 + y^3 + 10*x^2)*R sage: I.radical() Ideal (y, x) of Polynomial Ring in x, y, z over Rational Field
That the radical is correct is clear from the Groebner basis.
sage: I.groebner_basis() [y^3, x^2]
This is the example from the singular manual:
sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y-z^2)*R sage: I.radical() Ideal (-1*z^2 + y, 2 + 2*z^2 + z^3 + z^5) of Polynomial Ring in x, y, z over Rational Field
Note: (From Singular manual) A combination of the algorithms of Krick/Logar and Kemper is used. Works also in positive characteristic (Kempers algorithm).
sage: R,(x,y,z) = PolynomialRing(GF(37), 3, 'xyz').objgens() sage: p = z^2 + 1; q = z^3 + 2 sage: I = (p*q^2, y - z^2)*R sage: I.radical() Ideal (36*z^2 + y, 2 + 2*z^2 + z^3 + z^5) of Polynomial Ring in x, y, z over Finite Field of size 37
self, f) |
Reduce an element modulo a standard basis for this ideal. This returns 0 if and only if the element is in this ideal.
sage: R, (x,y) = PolynomialRing(Q, 2, 'xy').objgens() sage: I = (x^3 + y, y)*R sage: I.reduce(y) 0 sage: I.reduce(x^3) 0 sage: I.reduce(x - y) x
sage: I = (y^2 - (x^3 + x))*R sage: I.reduce(x^3) y^2 - x sage: I.reduce(x^6) y^4 - 2*x*y^2 + x^2 sage: (y^2 - x)^2 y^4 - 2*x*y^2 + x^2
Special Functions: _cmp_,
_contains_,
_singular_
self, f) |
sage: R, (x,y) = PolynomialRing(Q, 2, 'xy').objgens() sage: I = (x^3 + y, y)*R sage: x in I False sage: y in I True sage: x^3 + 2*y in I True
self, [singular=None]) |
Return Singular ideal corresponding to this ideal.
sage: R, (x,y) = PolynomialRing(Q, 2, 'xy').objgens() sage: I = R.ideal([x^3 + y, y]) sage: S = I._singular_() sage: S y, x^3+y
See About this document... for information on suggesting changes.