Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #33847: Bug in h_star_vector for polytopes with the normaliz bac…
…kend Dr. Ben Braun reported the following error. The h-star-vector records the coefficients of the polynomial in the numerator of the Ehrhart series of a lattice polytope. The method h_star_vector() for polytopes with the normaliz backend was implemented in #28413. The implementation seems to have an error, namely that it drops internal zeros from the vector. Example: {{{ sage: L = [[1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0], [1, 0, 0, ....: 1, 0, 0], [1, 0, 0, 0, 1, 0], [1, 0, 0, 1, 2, 3]] sage: P = Polyhedron(vertices=L,backend='normaliz') sage: P.ehrhart_series().numerator() 2*t^2 + 1 sage: P.h_star_vector() [1, 2] }}} Actually, the correct return should be `[1, 0, 2]`. This bug is caused by the line 1437 of `src/sage/geometry/polyhedron/backend_normaliz.py`, which forgets to pass `sparse=False` into `self.ehrhart_series().numerator().coefficients()`. We fix the bug by changing this line to `return self.ehrhart_series().numerator().list()`. URL: https://trac.sagemath.org/33847 Reported by: yzh Ticket author(s): Yuan Zhou Reviewer(s): Matthias Koeppe
- Loading branch information