Interface to Frobby for fast computations on monomial ideals. - Interpreter Interfaces

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

# Interface to Frobby for fast computations on monomial ideals.

The software package Frobby provides a number of computations on monomial ideals. The current main feature is the socle of a monomial ideal, which is largely equivalent to computing the maximal standard monomials, the Alexander dual or the irreducible decomposition.

Operations on monomial ideals are much faster than algorithms designed for ideals in general, which is what makes a specialized library for these operations on monomial ideals useful.

AUTHORS:

- Bjarke Hammersholt Roune (2008-04-25): Wrote the Frobby C++ program and the initial version of the Python interface.

Note

The official source for Frobby is <https://www.broune.com/frobby>, which also has documentation and papers describing the algorithms used.

class sage.interfaces.frobby.Frobby

  Bases: `object`

  alexander_dual(monomial_ideal)

    This function computes the Alexander dual of the passed-in monomial ideal. This ideal is the one corresponding to the simplicial complex whose faces are the complements of the nonfaces of the simplicial complex corresponding to the input ideal.

    INPUT:

    - `monomial_ideal` – the monomial ideal to decompose

    OUTPUT: the monomial corresponding to the Alexander dual

    EXAMPLES:

    This is a simple example of computing irreducible decomposition.

    Sage

        sage: # optional - frobby
        sage: (a, b, c, d) = QQ['a,b,c,d'].gens()
        sage: id = ideal(a * b, b * c, c * d, d * a)
        sage: alexander_dual = frobby.alexander_dual(id)
        sage: true_alexander_dual = ideal(b * d, a * c)
        sage: alexander_dual == true_alexander_dual # use sets to ignore order
        True

    Python

        >>> from sage.all import *
        >>> # optional - frobby
        >>> (a, b, c, d) = QQ['a,b,c,d'].gens()
        >>> id = ideal(a * b, b * c, c * d, d * a)
        >>> alexander_dual = frobby.alexander_dual(id)
        >>> true_alexander_dual = ideal(b * d, a * c)
        >>> alexander_dual == true_alexander_dual # use sets to ignore order
        True

    We see how it is much faster to compute this with frobby than the built-in procedure for simplicial complexes:

    Sage

        sage: # optional - frobby
        sage: t=simplicial_complexes.PoincareHomologyThreeSphere()
        sage: R=PolynomialRing(QQ,16,'x')
        sage: I=R.ideal([prod([R.gen(i-1) for i in a]) for a in t.facets()])
        sage: len(frobby.alexander_dual(I).gens())
        643

    [Python]

        >>> from sage.all import *
        >>> # optional - frobby
        >>> t=simplicial_complexes.PoincareHomologyThreeSphere()
        >>> R=PolynomialRing(QQ,Integer(16),'x')
        >>> I=R.ideal([prod([R.gen(i-Integer(1)) for i in a]) for a in t.facets()])
        >>> len(frobby.alexander_dual(I).gens())
        643

  associated_primes(monomial_ideal)

    This function computes the associated primes of the passed-in monomial ideal.

    INPUT:

    - `monomial_ideal` – the monomial ideal to decompose

    OUTPUT:

    A list of the associated primes of the monomial ideal. These ideals are constructed in the same ring as monomial_ideal is.

    EXAMPLES:

    Sage

        sage: R.<d,b,c>=QQ[] # optional - frobby
        sage: I=[d*b*c,b^2*c,b^10,d^10]*R # optional - frobby
        sage: frobby.associated_primes(I)   # optional - frobby
        [Ideal (d, b) of Multivariate Polynomial Ring in d, b, c over Rational Field,
        Ideal (d, b, c) of Multivariate Polynomial Ring in d, b, c over Rational Field]

    Python

        >>> from sage.all import *
        >>> R = QQ['d, b, c']; (d, b, c,) = R._first_ngens(3)# optional - frobby
        >>> I=[d*b*c,b**Integer(2)*c,b**Integer(10),d**Integer(10)]*R # optional - frobby
        >>> frobby.associated_primes(I)   # optional - frobby
        [Ideal (d, b) of Multivariate Polynomial Ring in d, b, c over Rational Field,
        Ideal (d, b, c) of Multivariate Polynomial Ring in d, b, c over Rational Field]

  dimension(monomial_ideal)

    This function computes the dimension of the passed-in monomial ideal.

    INPUT:

    - `monomial_ideal` – the monomial ideal to decompose

    OUTPUT: the dimension of the zero set of the ideal

    EXAMPLES:

    Sage

        sage: R.<d,b,c>=QQ[] # optional - frobby
        sage: I=[d*b*c,b^2*c,b^10,d^10]*R # optional - frobby
        sage: frobby.dimension(I)   # optional - frobby
        1

    Python

        >>> from sage.all import *
        >>> R = QQ['d, b, c']; (d, b, c,) = R._first_ngens(3)# optional - frobby
        >>> I=[d*b*c,b**Integer(2)*c,b**Integer(10),d**Integer(10)]*R # optional - frobby
        >>> frobby.dimension(I)   # optional - frobby
        1

  hilbert(monomial_ideal)

    Compute the multigraded Hilbert-Poincaré series of the input ideal. Use the -univariate option to get the univariate series.

    The Hilbert-Poincaré series of a monomial ideal is the sum of all monomials not in the ideal. This sum can be written as a (finite) rational function with \((x_1-1)(x_2-1)...(x_n-1)\) in the denominator, assuming the variables of the ring are \(x_1,x2,...,x_n\). This action computes the polynomial in the numerator of this fraction.

    INPUT:

    - `monomial_ideal` – a monomial ideal

    OUTPUT:

    A polynomial in the same ring as the ideal.

    EXAMPLES:

    Sage

        sage: R.<d,b,c>=QQ[] # optional - frobby
        sage: I=[d*b*c,b^2*c,b^10,d^10]*R # optional - frobby
        sage: frobby.hilbert(I) # optional - frobby
        d^10*b^10*c + d^10*b^10 + d^10*b*c + b^10*c + d^10 + b^10 + d*b^2*c + d*b*c + b^2*c + 1

    Python

        >>> from sage.all import *
        >>> R = QQ['d, b, c']; (d, b, c,) = R._first_ngens(3)# optional - frobby
        >>> I=[d*b*c,b**Integer(2)*c,b**Integer(10),d**Integer(10)]*R # optional - frobby
        >>> frobby.hilbert(I) # optional - frobby
        d^10*b^10*c + d^10*b^10 + d^10*b*c + b^10*c + d^10 + b^10 + d*b^2*c + d*b*c + b^2*c + 1

  irreducible_decomposition(monomial_ideal)

    This function computes the irreducible decomposition of the passed-in monomial ideal. I.e. it computes the unique minimal list of irreducible monomial ideals whose intersection equals monomial_ideal.

    INPUT:

    - `monomial_ideal` – the monomial ideal to decompose

    OUTPUT:

    A list of the unique irredundant irreducible components of monomial_ideal. These ideals are constructed in the same ring as monomial_ideal is.

    EXAMPLES:

    This is a simple example of computing irreducible decomposition.

    Sage

        sage: # optional - frobby
        sage: (x, y, z) = QQ['x,y,z'].gens()
        sage: id = ideal(x ** 2, y ** 2, x * z, y * z)
        sage: decom = frobby.irreducible_decomposition(id)
        sage: true_decom = [ideal(x, y), ideal(x ** 2, y ** 2, z)]
        sage: set(decom) == set(true_decom) # use sets to ignore order
        True

    Python

        >>> from sage.all import *
        >>> # optional - frobby
        >>> (x, y, z) = QQ['x,y,z'].gens()
        >>> id = ideal(x ** Integer(2), y ** Integer(2), x * z, y * z)
        >>> decom = frobby.irreducible_decomposition(id)
        >>> true_decom = [ideal(x, y), ideal(x ** Integer(2), y ** Integer(2), z)]
        >>> set(decom) == set(true_decom) # use sets to ignore order
        True

    We now try the special case of the zero ideal in different rings.

    We should also try PolynomialRing(QQ, names=[]), but it has a bug which makes that impossible (see Issue #3028).

    Sage

        sage: # optional - frobby
        sage: rings = [ZZ['x'], CC['x,y']]
        sage: allOK = True
        sage: for ring in rings:
        ....:     id0 = ring.ideal(0)
        ....:     decom0 = frobby.irreducible_decomposition(id0)
        ....:     allOK = allOK and decom0 == [id0]
        sage: allOK
        True

    [Python]

        >>> from sage.all import *
        >>> # optional - frobby
        >>> rings = [ZZ['x'], CC['x,y']]
        >>> allOK = True
        >>> for ring in rings:
        ...     id0 = ring.ideal(Integer(0))
        ...     decom0 = frobby.irreducible_decomposition(id0)
        ...     allOK = allOK and decom0 == [id0]
        >>> allOK
        True

    Finally, we try the ideal that is all of the ring in different rings.

    Sage

        sage: # optional - frobby
        sage: rings = [ZZ['x'], CC['x,y']]
        sage: allOK = True
        sage: for ring in rings:
        ....:     id1 = ring.ideal(1)
        ....:     decom1 = frobby.irreducible_decomposition(id1)
        ....:     allOK = allOK and decom1 == [id1]
        sage: allOK
        True

    Python

        >>> from sage.all import *
        >>> # optional - frobby
        >>> rings = [ZZ['x'], CC['x,y']]
        >>> allOK = True
        >>> for ring in rings:
        ...     id1 = ring.ideal(Integer(1))
        ...     decom1 = frobby.irreducible_decomposition(id1)
        ...     allOK = allOK and decom1 == [id1]
        >>> allOK
        True