# Is there a problem in Voronoi cell computation ?

Dear community,

I was wondering if there is a problem in my following computation of voronoi cell ?

Here is the code I am using :

from sage.modules.free_module_integer import IntegerLattice
l  = [7, 0, -1, -2, -1, -2, 7, -2, 0, 0, -2, 0, 7, -2, 0, -1, -2, -1, 7, 0, -1, -1, 0, -2, 7]
M = matrix(5, 5, l)
print (IntegerLattice(M).voronoi_cell().volume() == M.det() )


If I am not mistaken, the last print should be true which is not the case. Am I doing something wrong here ?

edit retag close merge delete

Indeed:

sage: IntegerLattice(M).voronoi_cell().volume()
138219104/10715
sage: IntegerLattice(M.LLL()).voronoi_cell().volume()
138219104/10715
sage: n(138219104/10715)
12899.5897340177
sage: M.det()
12858


The diamond cutting algorithm is very verbose (54 steps in this case). Maybe it can help to debug?

sage: from sage.modules.diamond_cutting import calculate_voronoi_cell
sage: c = calculate_voronoi_cell(M, verbose=True)
.... very verbose ....
sage: c
A 5-dimensional polyhedron in QQ^5 defined as the convex hull of 630 vertices

( 2023-12-14 21:55:58 +0200 )edit

I created an issue for this bug: https://github.com/sagemath/sage/issu...

( 2024-01-18 11:08:49 +0200 )edit