Ask Your Question
1

Subfaces of a face in Polyhedra package?

asked 2021-05-11 15:58:50 +0100

Polydarya gravatar image

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-05-11 16:38:22 +0100

tmonteil gravatar image

updated 2021-05-11 16:44:40 +0100

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())[2]                                                                                                                                                                        
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[0]                                                                                                                                                                                               
sage: g                                                                                                                                                                                                      
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices

Your problem is that :

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.

edit flag offensive delete link more

Comments

Thank you very much!

Polydarya gravatar imagePolydarya ( 2021-05-11 21:07:02 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-05-11 15:58:50 +0100

Seen: 214 times

Last updated: May 11 '21