Skip to content
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

Normaliz cone from precomputed data has lattice messed up #30891

Closed
kliem opened this issue Nov 11, 2020 · 15 comments
Closed

Normaliz cone from precomputed data has lattice messed up #30891

kliem opened this issue Nov 11, 2020 · 15 comments

Comments

@kliem
Copy link
Contributor

kliem commented Nov 11, 2020

sage: p = Polyhedron(vertices=[(-3,-3), (3,0), (3,3), (0,3)], backend='normaliz')
sage: q = loads(p.dumps)
sage: p
sage: p.ehrhart_series()                                                                                                                                                            
(13*t^2 + 22*t + 1)/(-t^3 + 3*t^2 - 3*t + 1)
sage: p.volume()                                                                                                                                                                    
18
sage: q.ehrhart_series()                                                                                                                                                            
(t^2 + 2*t + 1)/(-t^3 + 3*t^2 - 3*t + 1)
sage: q.volume()                                                                                                                                                                    
2

The problem is that we should take the saturation instead of the basis of the row space. In the example above the quotient of the ambient lattice with the computed basis was not torsion-free.

CC: @jplab @LaisRast @mkoeppe

Component: geometry

Keywords: normaliz, polytope

Author: David Roe, Jonathan Kliem

Branch/Commit: bcc7ea6

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/30891

@kliem kliem added this to the sage-9.3 milestone Nov 11, 2020
@kliem
Copy link
Contributor Author

kliem commented Nov 11, 2020

comment:1

Normaliz data for p:

# ----8<---- Equivalent Normaliz input file ----8<----
amb_space 2
cone 0
subspace 0
vertices 4
 -3 -3 1
 3 0 1
 3 3 1
 0 3 1
# ----8<-------------------8<-------------------8<----
# Calling PyNormaliz.NmzCone(cone=[], subspace=[], vertices=[[-3, -3, 1], [3, 0, 1], [3, 3, 1], [0, 3, 1]])

Normaliz data for q:

# ----8<---- Equivalent Normaliz input file ----8<----
amb_space 2
dehomogenization 1
 0 0 1
extreme_rays 4
 -3 -3 1
 0 3 1
 3 0 1
 3 3 1
generated_lattice 3
 3 0 0
 0 3 0
 0 0 1
maximal_subspace 0
support_hyperplanes 4
 -1 0 3
 -1 2 3
 0 -1 3
 2 -1 3
# ----8<-------------------8<-------------------8<----
# Calling PyNormaliz.NmzCone(dehomogenization=[[0, 0, 1]], extreme_rays=[[-3, -3, 1], [0, 3, 1], [3, 0, 1], [3, 3, 1]], generated_lattice=[[3, 0, 0], [0, 3, 0], [0, 0, 1]], maximal_subspace=[], support_hyperplanes=[[-1, 0, 3], [-1, 2, 3], [0, -1, 3], [2, -1, 3]])

The volume is probably a usage error, I did not consider the case where a "cube" in the generated lattice has volume not equal to 1.

Ok, the other issue probably as well.

This raises a simple question in sage: Given rational vectors. How do I calculate integer vectors that generate the induced lattice? Actually the given vectors or integer, but for the mathematical question, I consider them to be rational.

@kliem
Copy link
Contributor Author

kliem commented Nov 11, 2020

Changed upstream from Not yet reported upstream; Will do shortly. to none

@kliem
Copy link
Contributor Author

kliem commented Nov 11, 2020

comment:3

I guess the solution to the second part also solves the first part, because in case of the volume the generated lattice is always the entire lattice (otherwise the "ambient" volume is zero anyway).

@kliem
Copy link
Contributor Author

kliem commented Nov 12, 2020

Author: David Roe, Jonathan Kliem

@kliem
Copy link
Contributor Author

kliem commented Nov 12, 2020

Branch: public/30891

@kliem
Copy link
Contributor Author

kliem commented Nov 12, 2020

Commit: cddb6db

@kliem
Copy link
Contributor Author

kliem commented Nov 12, 2020

New commits:

cddb6dbuse saturation to obtain the correct lattice

@kliem

This comment has been minimized.

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor Author

kliem commented Dec 1, 2020

Changed branch from public/30891 to public/30891-reb

@kliem
Copy link
Contributor Author

kliem commented Dec 1, 2020

Changed commit from cddb6db to bcc7ea6

@kliem
Copy link
Contributor Author

kliem commented Dec 1, 2020

comment:7

Forgot the optional flags. I don't know, when I will ever remember (and get it right on the first try).


New commits:

c7ed9b5Merge branch 'public/30891' of git://trac.sagemath.org/sage into public/30891-reb
bcc7ea6added optional flags

@mkoeppe
Copy link
Member

mkoeppe commented Dec 1, 2020

Reviewer: Matthias Koeppe

@kliem
Copy link
Contributor Author

kliem commented Dec 1, 2020

comment:9

Thank you.

@vbraun
Copy link
Member

vbraun commented Dec 6, 2020

Changed branch from public/30891-reb to bcc7ea6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants