First time here? Check out the FAQ!

Ask Your Question
1

Subfaces of a face in Polyhedra package?

asked 3 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

tmonteil gravatar image

updated 3 years ago

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.

Preview: (hide)
link

Comments

Thank you very much!

Polydarya gravatar imagePolydarya ( 3 years ago )

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: 3 years ago

Seen: 249 times

Last updated: May 11 '21