Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

From Sage version 8.9+, on, the class CombinatorialPolyhedron can do just that.

Here is an example with your suggested Egyptian pyramid:

sage: ep = CombinatorialPolyhedron([[4,3,2,1],[4,3,0],[4,2,0],[3,1,0],[2,1,0]]); ep
A 3-dimensional combinatorial polyhedron with 5 facets
sage: fl_ep = ep.face_lattice(); fl_ep
Finite lattice containing 20 elements
sage: ep.f_vector()
(1, 5, 8, 5, 1)
sage: ep_poly = polytopes.regular_polygon(4).pyramid()
sage: fl_ep_poly = ep_poly.face_lattice()
sage: fl_ep_poly.is_isomorphic(fl_ep)
True

So far, there are a few things you can call on ep like edge graph, and ridges, and a fast iterator on the faces.