Integrate with Latte : error during the second calculation

asked 1 year ago

Pierre-L gravatar image

I need to calculate integrals of polynomials over polyhedra. I'm using the latte package in a jupyter notebook. Here is a small problematic example:

from sage.features.latte import Latte
R.<x,y>=PolynomialRing(QQ)
P=Polyhedron(vertices=((0, -1), (2, 1), (-1, 1), (-1, -1)))
poly=R('2*(1+x)')
P.integrate(poly,algorithm='latte')

The first execution of the cell gives the (probably) correct result: 26/3. But on the second run, there appears a long error message, first an error message from Python, then a error from latte that ends with :

starting to integrate 1 product of linear forms.
Valuation.cpp: the methods are different.
triangulateion    : 26/3
cone-decomposition: 26/3
prod linear form  : 32/3

(Sorry I can't attaching a screenshot with the full message). I specify that I tried to change the algorithm option by indicating 'cone-decomposition' or 'triangulation' without success. I also checked that the error also occurs if we run the script directly in sage. Thanks to anyone who can help me.

Preview: (hide)

Comments

Reproducible at SageCell: https://sagecell.sagemath.org/?q=bhmcly First clicks on [Evaluate] gives a correct result, but second and on produces an error.

Max Alekseyev gravatar imageMax Alekseyev ( 1 year ago )
1

Notice:

P.integrate(poly)

works fine in SageCell

achrzesz gravatar imageachrzesz ( 1 year ago )