-
-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make indices of V_representation of faces of polyhedron accessible through a new method #27071
Comments
comment:1
As a point of comparison to consider:
This output is unified for lattice polytopes, cones, fans, and their components:
Also
so faces are polytopes as well and all the methods of "standalone polytopes" are available for them as well. |
comment:2
Replying to @novoselt:
Oh! Great, yes this is pretty much what I had in mind. I should probably use the same name of methods, to make this uniform too. Further, to get the face as a polyhedron, the method
|
Commit: |
New commits:
|
Author: Jean-Philippe Labbé |
This comment has been minimized.
This comment has been minimized.
Branch: u/jipilab/27071 |
comment:4
Replying to @jplab:
I found it more convenient to have faces being "honest polytopes" - do you have any reasons for NOT doing it? (This is not the goal of this ticket, of course.) A couple of questions: do we have any general guidelines for More to the point - the ticket was about getting access to "ambient indices" via a method and perhaps making sage: Polyhedron(vertices=[[0,0,0],[1,0,0],[0,1,0]]).face_lattice().level_sets()
- [[<>], [<0>, <1>, <2>], [<0,1>, <0,2>, <1,2>], [<0,1,2>]]
+ [[A -1-dimensional face of a Polyhedron in ZZ^3],
+ [A 0-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 1 vertex,
+ A 0-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 1 vertex,
+ A 0-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 1 vertex],
+ [A 1-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 2 vertices,
+ A 1-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 2 vertices,
+ A 1-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 2 vertices],
+ [A 2-dimensional face of a Polyhedron in ZZ^3 defined as the convex hull of 3 vertices]] could be more desirable than the new one where different faces have the same repr. To be clear - I am not saying that your changes are bad, they are after all very much in line with my choices for lattice polytopes, just want to make sure that all things and opinions are considered. Perhaps it is useful to combine verbose description with indices. And to keep it shorter I would vote for "2-d" instead of "2-dimensional". (Faces of lattice polytopes mention 3 different dimensions so space saving was particularly visible there.) |
comment:5
Replying to @novoselt:
Well, the structure was already in place. Conceptually, I like to have an actual object for faces of a polytope. For example, they are the elements of the face lattice. Having them know "where they are from" is quite practical, one can ask for neighbors, etc. So all these methods are then in the class of PolyhedronFaces... Having to do
Good question. I followed the one for In this case, I would stick to the local convention on
Yes, you are right. While I was changing the doctests, I was thinking that the information becomes somewhat lost (indices of the vertices) on the one hand, but also somehow still good on the other (dimension, ambient dim, and number of vertices). What is better? Hm. For example, when dealing with larger polytopes, does printing a list with 50 vertex indices instructive? Or rather "A 4-dimensional face of a Polyhedron in There is no way to know anything from just a list of indices... At least, that's how I react everytime I see such a list. But yes, sometimes, I am quite happy to see the list of indices, but then I can not fetch them in any practical way (hence this ticket!). So in the end, having them stuck in the I agree, this is a big change and this should be discussed. I should perhaps ask on sage-devel. One compromise is: Change the doctests back so that they show the actual list of indices (via the new implemented method) and not just the
Sure, I appreciate your feedback! Yes, I wanted to model it from your suggestion, while also keeping it uniform with the
|
comment:6
Replying to @jplab:
Do faces have their own internal indices, i.e. are there edges randomly-but-consistently numbered 3 and 4? If yes, it could be useful to include this number in the output so one can see the difference between two edges in the output. |
comment:7
Replying to @novoselt:
The indices are fixed, they are the indices in the V-representation. I will change the doctests back to show the indices. Concerning the naming convention, I would stick to https://groups.google.com/forum/#!topic/sage-devel/wgo18WKZTpQ |
comment:9
Ok, I would say that it is ready for review now. |
comment:10
Failing test in quick tutorial. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
... ready to get reviewed. Hopefully all tests pass now. |
comment:13
Replying to @jplab:
That's not what I meant, sorry for not being clear. My question was: is there edge !#3? Or a 5-dimensional face !#42? If that is the case, it may be useful to have this number in the repr. It does not have to be canonical in any sense, but when you have say a list of edges belonging to some higher-dimensional face, it may be nice to see that they are !#3, !#5, !#8, and !#23, rather than just that there are four edges, all looking exactly the same. And in any case that's just a suggestion, I don't insist ;-) |
comment:14
Replying to @novoselt:
Oh, I see now! Okay! Hmm, the ordering is decided at the level of posets, through the face lattice. I do not know how much the ordering would be canonical. Especially now with the transition to python3, I would not try to introduce in there... Only vertices receive a consistent numbering through the V-representation. The other faces do not... |
comment:15
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually) |
Reviewer: Jonathan Kliem |
comment:16
Looks fine to me. |
Changed branch from u/jipilab/27071 to |
Currently, we can get faces of polyhedron objects like this:
It is sometimes useful to get a straight access to the printed indices given by the
_repr_
. Wishing something like:And it would be nice to improve the
_repr_
of faces to have a more complete description:... but for that one, better suggestions are welcome. The annoying thing with <0,1,2,3> is that it can be a square, and it can be a simplex, there is no way to know the dimension (which the face knows anyway) from the representation string.
To get the above, it was necessary to also implement
n_vertices
,n_rays
, andn_lines
for faces.CC: @mo271 @videlec
Component: geometry
Keywords: polytopes, faces
Author: Jean-Philippe Labbé
Branch/Commit:
553a2b1
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/27071
The text was updated successfully, but these errors were encountered: