# Normaliz cone from precomputed data has lattice messed up

Reported by: Owned by: gh-kliem critical sage-9.3 geometry normaliz, polytope jipilab, gh-LaisRast, mkoeppe David Roe, Jonathan Kliem Matthias Koeppe N/A bcc7ea6 bcc7ea670128b6e8334b3be01f16c8f9fe05b866

sage: p = Polyhedron(vertices=[(-3,-3), (3,0), (3,3), (0,3)], backend='normaliz')
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.

### comment:1 Changed 21 months ago by gh-kliem

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.

### comment:2 Changed 21 months ago by gh-kliem

• Report Upstream changed from Not yet reported upstream; Will do shortly. to N/A

### comment:3 Changed 21 months ago by gh-kliem

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).

### comment:4 Changed 21 months ago by gh-kliem

• Authors set to David Roe, Jonathan Kliem
• Branch set to public/30891
• Status changed from new to needs_review

New commits:

 ​cddb6db use saturation to obtain the correct lattice

### comment:5 Changed 21 months ago by gh-kliem

• Description modified (diff)

### comment:6 Changed 21 months ago by gh-kliem

• Description modified (diff)

### comment:7 Changed 21 months ago by gh-kliem

• Branch changed from public/30891 to public/30891-reb
• Commit changed from cddb6db5d7eff137df3ad95dd17ac5823e68abaa to bcc7ea670128b6e8334b3be01f16c8f9fe05b866

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

New commits:

 ​c7ed9b5 Merge branch 'public/30891' of git://trac.sagemath.org/sage into public/30891-reb ​bcc7ea6 added optional flags

### comment:8 Changed 21 months ago by mkoeppe

• Reviewers set to Matthias Koeppe
• Status changed from needs_review to positive_review

Thank you.

### comment:10 Changed 20 months ago by vbraun

• Branch changed from public/30891-reb to bcc7ea670128b6e8334b3be01f16c8f9fe05b866
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.