Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use the normaliz backend (requires Normaliz 3.5.4) and its python interface pynormaliz (requires PyNormaliz 1.16).

You can install them by typing:

sage -i normaliz
sage -i pynormaliz

in a terminal once this ticket has been merged. Then you can type in sage:

sage: C = polytopes.hypercube(3, backend="normaliz")
sage: C.hilbert_series().numerator().coefficients()
[1, 3, 6, 7, 6, 3, 1]

Note that this requires the latest features of this ticket.

click to hide/show revision 2
No.2 Revision

You can use the normaliz backend (requires Normaliz 3.5.4) and its python interface pynormaliz (requires PyNormaliz 1.16).

You can install them by typing:

sage -i normaliz
sage -i pynormaliz

Then, in a terminal once this ticket has been merged. Then with Sage 8.9 or more recent, you can type in sage:get the h^*-vector by typing:

sage: C = polytopes.hypercube(3, backend="normaliz")
sage: C.hilbert_series().numerator().coefficients()
C.ehrhart_series().numerator().coefficients()
[1, 3, 6, 7, 6, 3, 23, 23, 1]

Note that this requires This hypercube is the latest features of ±1 cube, so its volume is 8*factorial(3)=48, which is 1+23+23+1.

Eventually, once this ticket. is merged, it will be possible to call it directly on the polytope like so:

sage: C.h_star_vector()
[1, 23, 23, 1]