# Subfaces of a face in Polyhedra package?

I'm using polyhedra package and I need the operation that, for a given face, provides the list of all its subfaces (as faces in the bigger polyhedron). If I'm doing something like face.as_polyhedron().faces(n), the faces stop being recognised as belonging to the bigger polyhedron. What is the correct way to do that?

edit retag close merge delete

Sort by » oldest newest most voted

This is probably a hack since it touches a hidden attribute, but you can try the following:

Setting:

sage: A = polytopes.associahedron(['A',3])
sage: f = list(A.face_generator())
sage: f
A 2-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 5 vertices

sage: G = f.as_polyhedron().faces(1) ; G
(A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices)
sage: g = G
sage: g
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices


sage: g.polyhedron()
A 2-dimensional polyhedron in QQ^3 defined as the convex hull of 5 vertices
sage: g.polyhedron() == f.as_polyhedron()
True
sage: g.polyhedron() == A
False


What you can try:

sage: g._polyhedron = A


Then you have:

sage: g.polyhedron()
Generalized associahedron of type ['A', 3] with 14 vertices
sage: g.polyhedron() == A
True


Then, you should play with it to see whether there are side effects. I did not check the source code for that, use at you own risk.

more