Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 3 years ago

Max Alekseyev gravatar image

Thanks for the pointer from FrédéricC, it appears that Sage expects that the definition of polyhedron over ZZ is strict with all vertices being integral upfront. The behavior I expected can be achieved by first defining a polyhedron over QQ, computing its integral hull, and then changing base ring to ZZ like

P = Polyhedron( ieqs=[(-1, 1, -1, 0, -4), (2, -1, 1, 0, 4), (0, 1, 1, 2, -2), (2, -1, -1, -2, 2), (0, 0, -1, 1, 1), (1, 0, 1, -1, -1), (0, 1, 0, 0, 1), (1, -1, 0, 0, -1)], base_ring=QQ, backend='normaliz' )
Q = P.integral_hull().change_ring(ZZ)
click to hide/show revision 2
No.2 Revision

Thanks for to the pointer from FrédéricC, it appears that Sage expects that the definition of polyhedron over ZZ is strict with all vertices being integral upfront. The behavior I expected can be achieved by first defining a polyhedron over QQ, computing its integral hull, and then changing base ring to ZZ like

P = Polyhedron( ieqs=[(-1, 1, -1, 0, -4), (2, -1, 1, 0, 4), (0, 1, 1, 2, -2), (2, -1, -1, -2, 2), (0, 0, -1, 1, 1), (1, 0, 1, -1, -1), (0, 1, 0, 0, 1), (1, -1, 0, 0, -1)], base_ring=QQ, backend='normaliz' )
Q = P.integral_hull().change_ring(ZZ)

The error message in the case of non-integral vertices could have been more informative, nevertheless.