-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Polytope volume function engines produce different results #16045
Comments
Stopgaps: wrongAnswerMarker |
comment:1
what is a rational polytope? defined over rationals? At least I could not get from documentation that using engine="lrs" |
comment:2
This is actually very useful to have this. (I was actually looking for such a function just now). It should perhaps be better documented with an optional parameter to switch this on and off and let |
comment:3
I agree, a keyword parameter that controls the measure used for lower-dim faces would be useful.
|
comment:4
A few questions:
|
comment:6
Replying to @mo271:
It is a troolean (at least for rational polytopes) as mentioned in comment:3 of Marcelo.
No.
A |
comment:8
So how about the following solve the problem: We introduce a parameter "measure" with the following options:
I suppose it would be wisest to catch measure="ambient" if the polytope is not full-dimensional and return "0" for all the engines (Even if the engines only can compute the induced volume of the polytope) Should it could work like:
Maybe it would be ok to choose a differnt engine for the last command automatically. What do you think? |
comment:9
Replying to @mo271:
Note that "latte_renormalized" only make sense for polyhedron defined over Q. I guess it would be better
+1. I also do not like the behavior of the last command. The default choice of the engine should take into account the
|
comment:10
minor remark: ticket #20887 also touches the polyhedron volume function |
comment:11
+1 on |
Branch: u/moritz/16045 |
Author: Moritz Firsching |
Commit: |
comment:13
I am building on #20887 and introduced a Here is a test (make sure ou have latte_int, topcom and lrs installed)
The options are explained as
What could I write for I have not yet added doctests. Comments welcome! New commits:
|
comment:14
(I think this is describe in the latte manual) Given the polytope P in Zd it spans an affine space E. The ambient measure is the only scaling of the Lebesgue measure so that the lattice |
comment:15
If you merge commits from #20887 here you should set it as a dependency. |
comment:16
Note that it's also defined for rational polytopes; and more generally for any (possibly irrational) translation of those. |
Dependencies: #20887 |
comment:19
I noticed that "lrs" is in fact not computing the Lebesgue measure of the affine hull. Form the lrs web-page: If the option is applied to a V-representation of a polytope that is not full dimensional, the volume of a projected polytope is computed. The projection used is to the lexicographically smallest coordinate subspace, see Avis, Fukuda, Picozzi (2002). In fact, this shows already in one of the old doctests:
The result with the induced measure should be So this should not be used to compute the volume of facets, as mentioned in comment:2 ! In any case I still think it would be useful to have the option for this measure, except that at the moment, none of the engines is able to actually compute appropriate induced volumes. Perhaps it would be useful to open a ticket to ask for a function, that does compute the induced measure?! A naive implementation could choose an affine basis of vertices and then some isometry. |
comment:20
It would be nice to have an explanation of these subtleties in the doc of the function (as shown by Moritz). Consequently, the issue described in the ticket would be resolved so as to address the reason why it returns different results. IMHO, I guess it is okay to have one method returning different results depending on the value of the parameters. So +1 to have an optional parameter which specifies the measure (and hence the engine in some cases) as Vincent mentionned. Finally, add a TODO that would ask for the lebesgue measure which would be addressed in a separate ticket and explain what What do you think? |
comment:21
One thing that would be useful to have, would be a function, that takes a non full-dimensional poytope and returns a full-dimensional one that is affinely equivalent to the original one. Note that the usual
The length of the affine hull is not
Here the simplex is not regular after using Consider this new
Using this gets the desired results:
It is actually useful to plot the permutahedron nicely:
(There is an inherent problem, that considering a rational polytope as full-dimensional polytope in its affine hull might lead to non-rational polyopes: basically you want to work in a field with square roots.) In any case I propose to introduce an improved version of the What do you think? |
comment:22
Replying to @mo271:
I agree that it would be useful and essentially straightforward (ignoring details about base ring). You can open a new ticket and move the discussion there. |
comment:23
Replying to @videlec:
I opened #22804 and already added some code. This could eventually become a depency here (#16045) and we can end up with a '.volume' method that is more useful... |
comment:34
Use # abs tol marker in the comment. See Special Markup to Influence Doctests in the documentation. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:36
Thanks, Sébastian! |
Changed keywords from polytope, volume, lrs_volume to polytope, volume, lrs_volume, days88 |
comment:38
There is a hidden failed test (probably got caught by chance by the bot):
Question: I have "normaliz" in my optional installed packages but not "pynormaliz", is the above naming correct then? I am aware that this is not the topic of this ticket but since the tests failed here, it is probably best to treat this here. |
comment:40
Replying to @jplab:
The only way that sage accesses normaliz is via pynormaliz, so this is correct. |
comment:41
I disagree. This should not be treated here, but a new ticket should be opened. If we proceed as you propose (and everybody else does the same), this random pynormaliz bug will be treated in every ticket that is around. In fact it already seems to be fixed here: see also: and |
comment:42
My bad, I confused both and only installed normaliz. Oh well... |
Changed branch from u/moritz/16045 to u/jipilab/16045 |
comment:44
All right, good to know, thanks for looking it up! Should we add a dependancy in such cases, or perhaps just wait...? I corrected two indentations. This looks good to me now, tests pass on my machine with pynormaliz (!). I extended the description of the ticket a bit, if you believe it should contain some more information you can add it, otherwise, I'd it is ready to go. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:45
Thanks for the review, JP! I don't think we should put a dependency for the pynormaliz-set-thing. |
Changed branch from u/jipilab/16045 to |
The volume currently does not distinguish between ambient and induced volume. This should be changed.
Different engine yield very different results, and example:
The lrs engine for polytope volume calculates volume respective to the dimension of the polytope,
while the auto engine calculates volume respective to the dimension of the ambient space.
Example:
(Note: The lrs allows calculation of volumes of facets without reducing the dimension of the ambient space, but it uses non-isometrical projections!)
The suggested resolution adds a parameter
measure
that essentially behaves as follows:Depends on #20887
Depends on #22804
CC: @sagetrac-jakobkroeker @mkoeppe @videlec @jplab @mforets @mo271 @seblabbe
Component: geometry
Keywords: polytope, volume, lrs_volume, days88
Stopgaps: wrongAnswerMarker
Author: Moritz Firsching
Branch/Commit:
f5d47cf
Reviewer: Jean-Philippe Labbé
Issue created by migration from https://trac.sagemath.org/ticket/16045
The text was updated successfully, but these errors were encountered: