In Macaulay2, every
simplicial complex is equipped with a polynomial ring, and the Stanley-Reisner ideal is contained in this ring.
i1 : loadPackage "SimplicialComplexes";
|
The 3-dimensional sphere has a unique minimal nonface which corresponds to the interior.
i2 : R = ZZ[a..e];
|
i3 : sphere = simplicialComplex {b*c*d*e,a*c*d*e,a*b*d*e,a*b*c*e,a*b*c*d}
o3 = | bcde acde abde abce abcd |
o3 : SimplicialComplex
|
i4 : monomialIdeal sphere
o4 = monomialIdeal(a*b*c*d*e)
o4 : MonomialIdeal of R
|
The simplicial complex from example 1.8 in Miller-Sturmfels, Combinatorial Commutative Algebra, consists of a triangle (on vertices
a,b,c), two edges connecting
c to
d and
b to
d, and an isolated vertex
e.
i5 : D = simplicialComplex {e, c*d, b*d, a*b*c}
o5 = | e cd bd abc |
o5 : SimplicialComplex
|
i6 : monomialIdeal D
o6 = monomialIdeal (a*d, b*c*d, a*e, b*e, c*e, d*e)
o6 : MonomialIdeal of R
|
There are six minimal nonfaces of
D.
This routine is identical to
ideal(SimplicialComplex), except for the
type of the output.
Note that no computatation is performed by this routine; all the computation was done while constructing the simplicial complex.