Macaulay2 » Documentation
Packages » CellularResolutions :: cellComplex(Ring,Polyhedron)
next | previous | forward | backward | up | index | toc

cellComplex(Ring,Polyhedron) -- creates cell complex from given polyhedron

Synopsis

Description

Given a polyhedron, this command returns the cell complex whose cells correspond to the faces of the polyhedron. The faces have the default label 1.

i1 : R = QQ;
i2 : P = convexHull matrix {{1,1,-1,-1},{1,-1,1,-1}};
i3 : faces P

o3 = HashTable{0 => {({0, 1, 2, 3}, {})}                                    }
               1 => {({0, 2}, {}), ({1, 3}, {}), ({0, 1}, {}), ({2, 3}, {})}
               2 => {({0}, {}), ({2}, {}), ({1}, {}), ({3}, {})}
               3 => {}

o3 : HashTable
i4 : C = cellComplex(R,P);
i5 : cells C

o5 = HashTable{0 => {Cell of dimension 0 with label 1, Cell of dimension 0 with label 1, Cell of dimension 0 with label 1, Cell of dimension 0 with label 1}}
               1 => {Cell of dimension 1 with label 1, Cell of dimension 1 with label 1, Cell of dimension 1 with label 1, Cell of dimension 1 with label 1}
               2 => {Cell of dimension 2 with label 1}

o5 : HashTable

The labels on the vertices can be controlled via the optional parameter Labels This parameter expects a hash table whose keys are vectors corresponding to the vertices of the polyhedron with desired labels as corresponding values.

i6 : S = QQ[x,y,z,w];
i7 : v = vertices P;

              2       4
o7 : Matrix QQ  <-- QQ
i8 : H = hashTable {v_0 => x*y, v_1 => y*z, v_2 => x*w, v_3 => y*z};
i9 : labeledC = cellComplex(S, P, Labels => H);
i10 : for i to dim labeledC list cells(i,labeledC)/cellLabel

o10 = {{x*y, y*z, y*z, x*w}, {x*y*z, x*y*z*w, x*y*w, y*z}, {x*y*z*w}}

o10 : List

See also

Ways to use this method: