Package sage :: Package rings :: Package polynomial :: Module multi_polynomial_ideal :: Class MPolynomialIdeal
[hide private]
[frames] | no frames]

Class MPolynomialIdeal

source code

              MPolynomialIdeal_singular_repr --+
                                               |
             MPolynomialIdeal_macaulay2_repr --+
                                               |
                 MPolynomialIdeal_magma_repr --+
                                               |
                      object --+               |
                               |               |
structure.sage_object.SageObject --+           |
                                   |           |
           structure.element.Element --+       |
                                       |       |
         structure.element.MonoidElement --+   |
                                           |   |
                         ideal.Ideal_generic --+
                                               |
                                              MPolynomialIdeal
Known Subclasses:
pbori.BooleanPolynomialIdeal

Instance Methods [hide private]
 
__init__(self, ring, gens, coerce=True)
Create an ideal in a multivariate polynomial ring.
source code
 
groebner_fan(self, is_groebner_basis=False, symmetry=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a..., verbose=False)
Return the Groebner fan of this ideal.
source code
 
groebner_basis(self, algorithm=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a..., *args, **kwds)
Return the reduced Groebner basis of this ideal.
source code
 
change_ring(self, P)
Return the ideal \var{I} in \var{P} spanned by the generators $g_1, ..., g_n$ of self as returned by \code{self.gens()}.
source code
 
reduce(self, f)
Reduce an element modulo the reduced Groebner basis for this ideal.
source code
 
homogenize(self, var='h')
Return homogeneous ideal spanned by the homogeneous polynomials generated by homogenizing the generators of this ideal.
source code
 
is_homogeneous(self)
Return \code{True} if this ideal is spanned by homogeneous polynomials, i.e.
source code
 
_libsingular_normal_basis(self)
Returns the normal basis for a given groebner basis.
source code
 
normal_basis(self, algorithm='libsingular')
Returns a vector space basis (consisting of monomials) of the quotient ring by the ideal, resp.
source code

Inherited from MPolynomialIdeal_singular_repr: __cmp__, _contains_, _singular_, associated_primes, basis_is_groebner, complete_primary_decomposition, dimension, elimination_ideal, genus, hilbert_polynomial, hilbert_series, integral_closure, intersection, minimal_associated_primes, plot, primary_decomposition, quotient, radical, reduced_basis, syzygy_module, transformed_basis, triangular_decomposition, variety, vector_space_dimension

Inherited from MPolynomialIdeal_macaulay2_repr: _macaulay2_

Inherited from MPolynomialIdeal_magma_repr: _magma_

Inherited from ideal.Ideal_generic: __add__, __contains__, __mul__, __nonzero__, __radd__, __repr__, __rmul__, _latex_, base_ring, category, gens, gens_reduced, is_maximal, is_prime, is_principal, is_trivial, ring

Inherited from ideal.Ideal_generic (private): _repr_short

Inherited from structure.element.MonoidElement: __new__, __pow__, __rpow__, _mul_, multiplicative_order, order

Inherited from structure.element.Element: __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, _repr_, _richcmp_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, is_zero, n, parent, subs, substitute

Inherited from structure.sage_object.SageObject: _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_init_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_init_, db, dump, dumps, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ring, gens, coerce=True)
(Constructor)

source code 

Create an ideal in a multivariate polynomial ring.

INPUT:
    ring -- the ring the ideal is defined in
    gens -- a list of generators for the ideal
    coerce -- coerce elements to the ring \var{ring}?

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

Overrides: ideal.Ideal_generic.__init__

groebner_fan(self, is_groebner_basis=False, symmetry=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a..., verbose=False)

source code 

Return the Groebner fan of this ideal.

The base ring must be $\Q$ or a finite field $\F_p$ of with
$p <= 32749$.

EXAMPLES:
    sage: P.<x,y> = PolynomialRing(QQ)
    sage: i = ideal(x^2 - y^2 + 1)
    sage: g = i.groebner_fan()
    sage: g.reduced_groebner_bases()
    [[x^2 - y^2 + 1], [-x^2 + y^2 - 1]]

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

groebner_basis(self, algorithm=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a..., *args, **kwds)

source code 

Return the reduced Groebner basis of this ideal. A Groeber basis
$g_1,...,g_n$ for an ideal $I$ is a basis such that $<LT(g_i)>
= LT(I)$, i.e. the leading term ideal of $I$ is spanned by the
leading terms of $g_1,...,g_n$. Groebner bases are the key
concept in computational ideal theory in multivariate
polynomial rings which allows a variety of problems to be
solved. Additionally, a \emph{reduced} Groebner basis $G$ is a
unique representation for the ideal $<G>$ with respect to the
chosen monomial ordering.

INPUT:
    algorithm -- determines the algorithm to use, see below
                 for available algorithms.
    *args -- additional parameters passed to the respective
             implementations
    **kwds -- additional keyword parameters passed to the
              respective implementations

ALGORITHMS:
    \begin{description}
    \item[None] autoselect (default)
    \item['singular:groebner'] \Singular's \code{groebner} command
    \item['singular:std'] \Singular's \code{std} command
    \item['singular:stdhilb'] \Singular's \code{stdhib} command
    \item['singular:stdfglm'] \Singular's \code{stdfglm} command
    \item['singular:slimgb'] \Singular's \code{slimgb} command
    \item['libsingular:std'] lib\Singular's \code{std} command 
    \item['libsingular:slimgb'] lib\Singular's \code{slimgb} command
    \item['toy:buchberger'] \SAGE's toy/educational buchberger without strategy
    \item['toy:buchberger2'] \SAGE's toy/educational buchberger with strategy
    \item['macaulay2:gb'] Macaulay2's \code{gb} command (if available)
    \item['magma:GroebnerBasis'] \MAGMA's \code{Groebnerbasis} command (if available)
    \end{description}

NOTE: The \Singular and lib\Singular versions of the
respective algorithms are identically, but the former calls an
external \Singular process while the later calls a C function,
i.e. the calling overhead is smaller.

EXAMPLES:
    Consider Katsura-3 over QQ with lexicographical term
    ordering. We compute the reduced Groebner basis using every
    available implementation and check their equality.

    sage: P.<a,b,c> = PolynomialRing(QQ,3, order='lex')
    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis()
    [c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c, b + 30*c^3 - 79/7*c^2 + 3/7*c, a - 60*c^3 + 158/7*c^2 + 8/7*c - 1]

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('singular:groebner')
    [c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c, b + 30*c^3 - 79/7*c^2 + 3/7*c, a - 60*c^3 + 158/7*c^2 + 8/7*c - 1]

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('singular:std')
    [c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c, b + 30*c^3 - 79/7*c^2 + 3/7*c, a - 60*c^3 + 158/7*c^2 + 8/7*c - 1]

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('singular:stdhilb')
    [c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c, b + 30*c^3 - 79/7*c^2 + 3/7*c, a - 60*c^3 + 158/7*c^2 + 8/7*c - 1]

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('singular:stdfglm')
    [c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c, b + 30*c^3 - 79/7*c^2 + 3/7*c, a - 60*c^3 + 158/7*c^2 + 8/7*c - 1]

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('singular:slimgb')
    [c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c, b + 30*c^3 - 79/7*c^2 + 3/7*c, a - 60*c^3 + 158/7*c^2 + 8/7*c - 1]

Note that toy:buchberger does not return the reduced Groebner basis,

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('toy:buchberger')
    [a + 2*b + 2*c - 1, b^2 + 4/3*b*c - 1/3*b + c^2 - 1/3*c,
    a*b + b*c - 1/2*b, b + 30*c^3 - 79/7*c^2 + 3/7*c,
    a^2 - a + 2*b^2 + 2*c^2, b*c - 1/10*b + 6/5*c^2 - 2/5*c,
    c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c]

but that toy:buchberger2 does.

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('toy:buchberger2')
    [b + 30*c^3 - 79/7*c^2 + 3/7*c, c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c, a - 60*c^3 + 158/7*c^2 + 8/7*c - 1]

    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('macaulay2:gb') # optional requires Macaulay2
    [84*c^4 - 40*c^3 + c^2 + c, 7*b + 210*c^3 - 79*c^2 + 3*c, 7*a - 420*c^3 + 158*c^2 + 8*c - 7]
    
    sage: I = sage.rings.ideal.Katsura(P,3) # regenerate to prevent caching
    sage: I.groebner_basis('magma:GroebnerBasis') # optional requires MAGMA
    [a - 60*c^3 + 158/7*c^2 + 8/7*c - 1, b + 30*c^3 - 79/7*c^2 + 3/7*c, c^4 - 10/21*c^3 + 1/84*c^2 + 1/84*c]

    If Macaulay2 is installed, Groebner bases over $\ZZ$ can be computed.

    sage: P.<a,b,c> = PolynomialRing(ZZ,3)
    sage: I = P * (a + 2*b + 2*c - 1, a^2 - a + 2*b^2 + 2*c^2, 2*a*b + 2*b*c - b)
    sage: I.groebner_basis() #optional requires Macaulay2 
    [a + 2*b + 2*c - 1, 10*b*c + 12*c^2 - b - 4*c, 2*b^2 - 4*b*c - 6*c^2 + 2*c, 
     42*c^3 + b^2 + 2*b*c - 14*c^2 + b, 2*b*c^2 - 6*c^3 + b^2 + 5*b*c + 8*c^2 - b - 2*c,
     b^3 + b*c^2 + 12*c^3 + b^2 + b*c - 4*c^2]

    \SAGE also supports local orderings:

    sage: P.<x,y,z> = PolynomialRing(QQ,3,order='negdegrevlex')
    sage: I = P * (  x*y*z + z^5, 2*x^2 + y^3 + z^7, 3*z^5 +y ^5 )
    sage: I.groebner_basis()
    [x^2 + 1/2*y^3, x*y*z + z^5, y^5 + 3*z^5, y^4*z - 2*x*z^5, z^6]

ALGORITHM: Uses \Singular, \MAGMA (if available), Macaulay2 (if
available), or toy implementation.

change_ring(self, P)

source code 

Return the ideal \var{I} in \var{P} spanned by the generators
$g_1, ..., g_n$ of self as returned by \code{self.gens()}.

INPUT:
    P -- a multivariate polynomial ring

EXAMPLE:
   sage: P.<x,y,z> = PolynomialRing(QQ,3,order='lex')
   sage: I = sage.rings.ideal.Cyclic(P)
   sage: I
   Ideal (x + y + z, x*y + x*z + y*z, x*y*z - 1) of
   Multivariate Polynomial Ring in x, y, z over Rational Field

   sage: I.groebner_basis()
   [z^3 - 1, y^2 + y*z + z^2, x + y + z]

   sage: Q.<x,y,z> = P.change_ring(order='degrevlex'); Q
   Multivariate Polynomial Ring in x, y, z over Rational Field
   sage: Q.term_order()
   Degree reverse lexicographic term order

   sage: J = I.change_ring(Q); J
   Ideal (x + y + z, x*y + x*z + y*z, x*y*z - 1) of
   Multivariate Polynomial Ring in x, y, z over Rational Field

   sage: J.groebner_basis()
   [x + y + z, y^2 + y*z + z^2, z^3 - 1]

reduce(self, f)

source code 

Reduce an element modulo the reduced Groebner basis for this
ideal. This returns 0 if and only if the element is in this
ideal. In any case, this reduction is unique up to monomial
orders.

EXAMPLES:
    sage: R.<x,y> = PolynomialRing(QQ, 2)
    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

NOTE: Requires computation of a Groebner basis, which can be a
very expensive operation.

Overrides: ideal.Ideal_generic.reduce

homogenize(self, var='h')

source code 

Return homogeneous ideal spanned by the homogeneous
polynomials generated by homogenizing the generators of this
ideal.

INPUT:
    h -- variable name or variable in cover ring (default: 'h')

EXAMPLE:
    sage: P.<x,y,z> = PolynomialRing(GF(2))
    sage: I = Ideal([x^2*y + z + 1, x + y^2 + 1]); I
    Ideal (x^2*y + z + 1, y^2 + x + 1) of Multivariate
    Polynomial Ring in x, y, z over Finite Field of size 2

    sage: I.homogenize()
    Ideal (x^2*y + z*h^2 + h^3, y^2 + x*h + h^2) of
    Multivariate Polynomial Ring in x, y, z, h over Finite
    Field of size 2

    sage: I.homogenize(y)
    Ideal (x^2*y + y^3 + y^2*z, x*y) of Multivariate
    Polynomial Ring in x, y, z over Finite Field of size 2


   sage: I = Ideal([x^2*y + z^3 + y^2*x, x + y^2 + 1])
   sage: I.homogenize()
   Ideal (x^2*y + x*y^2 + z^3, y^2 + x*h + h^2) of
   Multivariate Polynomial Ring in x, y, z, h over Finite
   Field of size 2

is_homogeneous(self)

source code 

Return \code{True} if this ideal is spanned by homogeneous
polynomials, i.e. if it is a homogeneous ideal.

EXAMPLE:
    sage: P.<x,y,z> = PolynomialRing(QQ,3)
    sage: I = sage.rings.ideal.Katsura(P)
    sage: I
    Ideal (x + 2*y + 2*z - 1, x^2 + 2*y^2 + 2*z^2 - x, 2*x*y +
    2*y*z - y) of Multivariate Polynomial Ring in x, y, z over
    Rational Field

    sage: I.is_homogeneous()
    False

    sage: J = I.homogenize()
    sage: J
    Ideal (x + 2*y + 2*z - h, x^2 + 2*y^2 + 2*z^2 - x*h, 2*x*y
    + 2*y*z - y*h) of Multivariate Polynomial Ring in x, y, z,
    h over Rational Field

    sage: J.is_homogeneous()
    True

_libsingular_normal_basis(self)

source code 

Returns the normal basis for a given groebner basis. It will use 
the Groebner Basis as computed by
self._groebner_basis_using_libsingular().

EXAMPLES:
    sage: R.<x,y,z> = PolynomialRing(QQ)
    sage: I = R.ideal(x^2-2*x*z+5, x*y^2+y*z+1, 3*y^2-8*x*z)
    sage: I.normal_basis()
    [z^2, y*z, x*z, z, x*y, y, x, 1]
    

normal_basis(self, algorithm='libsingular')

source code 

Returns a vector space basis (consisting of monomials) of the quotient
ring by the ideal, resp. of a free module by the module, in case it is
finite dimensional and if the input is a standard basis with respect
to the ring ordering.

INPUT: 
    algorithm - defaults to use libsingular, if it is anything else
                we will use the kbase() command

EXAMPLES:
    sage: R.<x,y,z> = PolynomialRing(QQ)
    sage: I = R.ideal(x^2+y^2+z^2-4, x^2+2*y^2-5, x*z-1)
    sage: I.normal_basis()
    [y*z^2, z^2, y*z, z, x*y, y, x, 1]
    sage: I.normal_basis(algorithm='singular')
    [y*z^2, z^2, y*z, z, x*y, y, x, 1]