-
-
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
lattice_polytope.facet_normal bug with polytopes of less that full dimension #9188
Comments
comment:2
I missed two doctests that were failing; Some of the old doctests actually did give the wrong facet normals :-) Also, I improved my new doctest to also check the |
Reviewer: Andrey Novoseltsev |
comment:3
This is very embarrassing... Will look over and take care of propagated errors. |
comment:4
I forgot one more transposition of a matrix %-) This version should be correct now. Added another doctest. |
Attachment: trac_9188_fix_facet_normal.patch.gz Updated patch |
comment:5
Yeap, the first version was definitely wrong... |
Apply on top of the original patch. |
comment:6
Attachment: trac_9188_fix_facet_normal_reviewer.patch.gz OK, my patch looks big, but the only real change to the original is taking the absolute value of the dual scaling factor, so that normals remain inner. In addition I (hopefully) made doctests more clear, since they do appear in the documentation. Polytopes are now created using coordinates of points with all the necessary transpositions after that. I also made doctest lines shorter for better looks of the documentation. I have changed "parallel" to "orthogonal to integer kernel" in the description of normals (and now I do remember that I didn't like this "parallel" when I wrote it...). If you are fine with all these changes, I will switch it to positive review. Thank you for catching this bug! |
comment:7
Good idea to make sure that the scaling factor is positive. I also like your work on the doctests. Looks good to me! Note to release manager: apply both patches in order! |
Merged: sage-4.5.2.alpha0 |
In general,
lattice_polytope._embedding_matrix
is not orthogonal. Butfacet_normal()
implicitly makes this assumption by embedding the normals (which live in the dual vector space) by the transpose of the_embedding_matrix
.Here is an example of the incorrect result:
If
lp.facet_normal(0)
would define a facet then its equation would be satisfied at 3 out of 4 vertices.The attached patch fixes this issue. A scale factor for the dual embedding is introduced to keep the facet normal coordinates integral. Moreover, a suitable doctest is added.
NOTE: This bug impacts the toric variety code under development in #8986, #8987:
CC: @novoselt
Component: geometry
Author: Volker Braun
Reviewer: Andrey Novoseltsev
Merged: sage-4.5.2.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/9188
The text was updated successfully, but these errors were encountered: