Le 04/12/2018 à 15:36, Dima Pasechnik a écrit :
On Tue, Dec 4, 2018 at 1:47 PM Daniel Krenn <[email protected]> wrote:

For integrating a polynomial over a polyhedron LattE is used but if the
dimension is not full, then it is not implemented, see

     sage: x, y = polygens(QQ, 'x, y')
     sage: P = Polyhedron(vertices=[[0,0],[1,1]])
     sage: P.integrate(x*y)    # optional - latte_int
     Traceback (most recent call last):
     ...
     NotImplementedError: The polytope must be full-dimensional.

from

http://doc.sagemath.org/html/en/reference/discrete_geometry/sage/geometry/polyhedron/base.html#sage.geometry.polyhedron.base.Polyhedron_base.integrate

I wonder if there is a (simple) way to come around this?

[I might not be that familiar with integration over polyhedra, but
shouldn't that basically be a somehow "nice" transformation where some
Jacobi-determinant comes into play?

you need an orthonormal transformation, thus potentially square roots,
if you just want to move over to
P.affine_hull() and integrate there.

Of course not. There is a well defined *rational* Lebesgue measure on
the affine hull H of your polyhedron. Just consider the Lebesgue measure
so that the lattice Z^d \cap H has covolume 1. With this normalization,
any integral is rational.

This is what you obtain for the volume (ie integration of the
constant function 1) with the option measure='induced'.

But the restriction to full-dimensional isn't really hard to overcome
with a generalisation of the method
in LattE, and I see how to do this, I think.
If anyone cares I could implement this.

If you do anything please respect the convention naming from the
volume function.

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to