1 | initial version |
I can replicate the observed bug in Ubuntu 22.04.2 LTS (jammy) with
But specifying algorithm=latte
as in @FrédéricC's comment gives the correct integral.
sage: from sage.features.latte import Latte
sage: Latte().is_present()
FeatureTestResult('latte_int', True)
sage: P = polytopes.cube()
sage: x, y, z = polygens(QQ, names='x, y, z')
sage: f = x^2 * y^2 * z^2
sage: P.integrate(f)
0
sage: P.integrate(f, algorithm='latte')
8/27
The first example in the documentation of P.integrate
,
accessed with P.integrate?
, or found at
reads:
sage: P = polytopes.cube()
sage: x, y, z = polygens(QQ, 'x, y, z')
sage: P.integrate(x^2*y^2*z^2) # optional - latte_int
8/27
That example should probably be fixed to use algorithm=latte
.
Without algorithm=latte
, Sage should either detect
whether LattE is available, and if so use it, or raise
a "not implemented" error rather than returning a wrong result.
I'm curious why the bug is observed with conda-installed Sage and LattE, but not in other setups.
2 | No.2 Revision |
I can replicate the observed bug in Ubuntu 22.04.2 LTS (jammy) with
But specifying algorithm=latte
as in @FrédéricC's comment gives the correct integral.
sage: from sage.features.latte import Latte
sage: Latte().is_present()
FeatureTestResult('latte_int', True)
sage: P = polytopes.cube()
sage: x, y, z = polygens(QQ, names='x, y, z')
sage: f = x^2 * y^2 * z^2
sage: P.integrate(f)
0
sage: P.integrate(f, algorithm='latte')
8/27
The first example in the documentation of P.integrate
,
accessed with P.integrate?
, or found at
reads:
sage: P = polytopes.cube()
sage: x, y, z = polygens(QQ, 'x, y, z')
sage: P.integrate(x^2*y^2*z^2) # optional - latte_int
8/27
That example should probably be fixed to use algorithm=latte
.
Without algorithm=latte
, I think Sage should either detect
checks whether LattE is available, and if so use it, or raise
uses it. But apparently that detection fails in the conda setup.
In any case, at some point a "not implemented" error should be raised rather than returning a wrong result.
I'm curious curious