Macaulay2 » Documentation
Packages » SimplicialComplexes :: faces(ZZ,SimplicialComplex)
next | previous | forward | backward | up | index | toc

faces(ZZ,SimplicialComplex) -- get the $i$-faces of an abstract simplicial complex

Synopsis

Description

In this package, an abstract simplicial complex $\Delta$ is identified with a squarefree monomial ideal in a polynomial ring. The vertices of $\Delta$ correspond to a subset of the variables in the polynomial ring, and each face is identified as the product of the variables corresponding to the vertices of that face. This method function returns a List whose entries are the monomials corresponding to the $i$-faces of $\Delta$.

The faces of the simplex correspond to all subsets of the underlying vertex set.

i1 : S = QQ[x_0..x_3];
i2 : Δ = simplexComplex(3, S)

o2 = simplicialComplex | x_0x_1x_2x_3 |

o2 : SimplicialComplex
i3 : netList for i from -1 to dim Δ list {i,faces(i, Δ)}

     +--+------------------------------------+
o3 = |-1|{1}                                 |
     +--+------------------------------------+
     |0 |{x , x , x , x }                    |
     |  |  0   1   2   3                     |
     +--+------------------------------------+
     |1 |{x x , x x , x x , x x , x x , x x }|
     |  |  0 1   0 2   0 3   1 2   1 3   2 3 |
     +--+------------------------------------+
     |2 |{x x x , x x x , x x x , x x x }    |
     |  |  0 1 2   0 1 3   0 2 3   1 2 3     |
     +--+------------------------------------+
     |3 |{x x x x }                          |
     |  |  0 1 2 3                           |
     +--+------------------------------------+
i4 : assert all(-1..dim Δ, i ->  faces(i, Δ) === first entries sub(matrix{rsort subsets(vertices Δ, i+1)/product}, S))

The faces of the dunce hat are a proper subset of the $7$-simplex.

i5 : R = ZZ[a..h];
i6 : Γ = dunceHatComplex R;
i7 : matrix {facets Γ}

o7 = | fgh agh dfh cdh bch abh cfg bcg abg def aef acf bde bce ace acd abd |

             1      17
o7 : Matrix R  <-- R
i8 : netList for i from -1 to dim Γ list {i,faces(i, Γ)}

     +--+------------------------------------------------------------------------------------------------------------------------+
o8 = |-1|{1}                                                                                                                     |
     +--+------------------------------------------------------------------------------------------------------------------------+
     |0 |{a, b, c, d, e, f, g, h}                                                                                                |
     +--+------------------------------------------------------------------------------------------------------------------------+
     |1 |{a*b, a*c, a*d, a*e, a*f, a*g, a*h, b*c, b*d, b*e, b*g, b*h, c*d, c*e, c*f, c*g, c*h, d*e, d*f, d*h, e*f, f*g, f*h, g*h}|
     +--+------------------------------------------------------------------------------------------------------------------------+
     |2 |{a*b*d, a*b*g, a*b*h, a*c*d, a*c*e, a*c*f, a*e*f, a*g*h, b*c*e, b*c*g, b*c*h, b*d*e, c*d*h, c*f*g, d*e*f, d*f*h, f*g*h} |
     +--+------------------------------------------------------------------------------------------------------------------------+
i9 : monomialIdeal Γ

o9 = monomialIdeal (a*b*c, b*c*d, a*b*e, a*d*e, c*d*e, b*f, a*d*f, c*d*f,
     ------------------------------------------------------------------------
     c*e*f, a*c*g, d*g, e*g, a*f*g, a*c*h, a*d*h, b*d*h, e*h, a*f*h, c*f*h,
     ------------------------------------------------------------------------
     b*g*h, c*g*h)

o9 : MonomialIdeal of R

There are two "trivial" simplicial complexes: the irrelevant complex has the empty set as a facet whereas the void complex has no faces.

i10 : irrelevant = simplicialComplex monomialIdeal gens S

o10 = simplicialComplex | 1 |

o10 : SimplicialComplex
i11 : dim irrelevant

o11 = -1
i12 : faces (-1, irrelevant)

o12 = {1}

o12 : List
i13 : assert(faces(-1, irrelevant) === {1_S})
i14 : void = simplicialComplex monomialIdeal 1_S

o14 = simplicialComplex 0

o14 : SimplicialComplex
i15 : faces(-1, void)

o15 = {}

o15 : List
i16 : assert all(-2..7, i -> faces(i, void) == {})

To avoid repeated computation, the values of this method are saved the cache table of the abstract simplicial complex $\Delta$.

i17 : peek Δ.cache

o17 = CacheTable{dim => 3                          }
                 faces => MutableHashTable{...6...}
i18 : peek Δ.cache.faces

o18 = MutableHashTable{-1 => {1}                                }
                       0 => {x , x , x , x }
                              0   1   2   3
                       1 => {x x , x x , x x , x x , x x , x x }
                              0 1   0 2   0 3   1 2   1 3   2 3
                       2 => {x x x , x x x , x x x , x x x }
                              0 1 2   0 1 3   0 2 3   1 2 3
                       3 => {x x x x }
                              0 1 2 3
                       ring => QQ[x ..x ]
                                   0   3

See also

Ways to use this method: