-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Inverse function for gale_transform
#29065
Comments
New commits:
|
Commit: |
Branch: public/29065 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
Small remarks:
- The vectors are scalled automatically such that they add up to zero.
+ The vectors are scaled automatically such that they add up to zero. - # The vectors of our gale transform shall add up to one.
+ # The vectors of our gale transform shall add up to zero.
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
Here are some comments:
def gale_transform_to_polyhedron(vectors, base_ring=None, backend=None):
r"""
- Return the polytope from a (linear) gale transform.
+ Return the polytope associated to the list of vectors forming a Gale transform.
This function is the inverse of
:meth:`~sage.geometry.polyhedron.base.Polyhedron_base.gale_transform`
- up to projective isomorphism.
+ up to projective transformation.
This needs to be more clear. Is it: The I think that the following sentence should be changed to reflect what the function does internally (if it is not the case, you mention in the comments in the code that you do it, this should be mentioned here too!). + The function is much faster and gives nicer representation if this
+ is already the case. + INPUT:
+
- - ``vectors`` -- the vectors of the gale transform
+ - ``vectors`` -- the ordered vectors of the Gale transform Please use the suggested format when using default values for optional parameters:
gale transform -> Gale transform (but not in names of functions...) straight forward -> straightforward |
comment:8
This comment is totally cryptic to me. Should I change the format? To what? There is tons of different styles for this all over the place. The coding conventions suggest the following:
Why is the order of the vectors of importance? Replying to @jplab:
|
Changed branch from public/29065 to public/29065-reb |
comment:10
Replying to @kliem:
I like the above convention, yes.
Essentially, to make things clear and smooth, it is practical to talk about a "labeled" set of vector, where the set of labels has a total order a.k.a. essentially numbered from 1 to k. In practice, when one uses Gale duality, to go from primal to dual notions and vice-versa, it is important to have a precise ground set in order to do the translations: complementation should be well-defined, and as soon as you get into the oriented matroid business, it is important to get the signs right... This is why it is a soothing measure to mention here in the first line of the documentation that we do care that this is an (ordered) list of vectors. This will make our life easier when explaining/doing things. |
comment:11
About this, we should also add a reference to another book. I suggest the Triangulations book of De Loera, Rambau, Santos. Definition 2.5.1 and Definition 4.1.35. Essentially, this function is not necessarily to get a polytope, right? Or does it really check for the polytopality property? I see the possibility here to split into two functions... |
comment:18
Tiny things: + sage: gale_transform_to_polytope(
+ ....: [(1,1), (-1,-1), (1,0),
+ ....: (-1,0), (1,-1), (-2,1)],
+ ....: backend='cdd', base_ring=RDF)
+ A 3-dimensional polyhedron in RDF^3 defined as the convex hull of 6 vertices I know that cdd is the only backend handling RDF, but perhaps it would be good to still check the backend like the example just before... Question: is this test equivalent to the fact that it is not the correct polytope: + if not P.n_vertices() == len(vertices):
+ raise ValueError("the gale transform does not correspond to a polytope") It would be good to give a reference for that line in the code in a comment. I want to make sure to catch this error if and only if the thing go wrong (so that other types of errors are not hidden by that failing/passing like it happened a lot in polyhedron stuff...). In - We assume the centroid of the (input) vectors to be the origin.
- We stack ``Matrix(vectors)`` by a row of ones.
- The right kernel of this is the dual point configuration.
+ If the centroid of the (input) vectors is not the origin, we do an appropriate transformation to make it so.
+ We add a row of ones on top of ``Matrix(vectors)``.
+ The right kernel of this larger matrix is the dual configuration space, and a basis of this space provides the dual point configuration. Then paragraph 3 and 4 of the algorithm are a bit hard to parse... Perhaps rework them a bit? |
Changed branch from public/29065-reb to public/29065-reb2 |
Last 10 new commits:
|
comment:21
You will hate me for this, but "centroid" is the wrong term. What you mean is "center" (the centroid method is not implemented yet, see https://ask.sagemath.org/question/8092/compute-the-centroid-of-a-polytope/ ... which is also to be implemented ...Sighhhhhh). One small thing: - convex if and only if every hyperplane contains at least two vectors of
+ convex and if and only if every hyperplane contains at least two vectors of Otherwise, looks very good! |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:23
:-) |
comment:24
I'm working on #27728 which depends on this ticket, and I might have some more feedback about the functions. Let's wait for that and the bots. |
comment:25
Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date. |
comment:26
Ok, looks good. If there are more modifications on this function, they can be addressed in #27728. |
Changed branch from public/29065-reb2 to |
One can obtain a gale diagram from a polyhedron. Some interesting examples of polyhedra are obtained by the reverse approach.
We implement a method that converts a gale diagram to a
Polyhedron
.This is a preparation for adding polytopes to the library obtained from the Gale diagram (e.g. #27728).
CC: @jplab @LaisRast @yuan-zhou
Component: geometry
Keywords: polytopes, gale transform
Author: Jonathan Kliem
Branch/Commit:
b6898dd
Reviewer: Jean-Philippe Labbé
Issue created by migration from https://trac.sagemath.org/ticket/29065
The text was updated successfully, but these errors were encountered: