You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do not know if this is known or reported before. Feel free to close if so.
I see lots of exceptions from polyutils.py calling integrate command. Below is just one typical example
from sympy import *
x=symbols('x')
integrand="(-36-2*6**(1/2)*x**2)/(9*3**(1/2)+3*2**(1/2)*x**2-x**4)"
integrate( sympify(integrand), x)
gives
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/sympy/polys/polyutils.py", line 211, in _parallel_dict_from_expr_if_gens
monom[indices[base]] = exp
~~~~~~~^^^^^^
KeyError: 1/(2*_t**4 - 2*sqrt(2)*_t**2 + 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.11/site-packages/sympy/integrals/integrals.py", line 1567, in integrate
return integral.doit(**doit_flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/integrals.py", line 612, in doit
antideriv = self._eval_integral(
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/integrals.py", line 955, in _eval_integral
result, i = risch_integrate(f, x, separate_integral=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/risch.py", line 1835, in risch_integrate
ans = integrate(fa.as_expr()/fd.as_expr(), DE.x, risch=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/integrals.py", line 1567, in integrate
return integral.doit(**doit_flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/integrals.py", line 612, in doit
antideriv = self._eval_integral(
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/integrals.py", line 1041, in _eval_integral
parts.append(coeff * ratint(g, x))
^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/rationaltools.py", line 83, in ratint
L = ratint_logpart(r, Q, x, t)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/integrals/rationaltools.py", line 231, in ratint_logpart
res = Poly(res, t, composite=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/polys/polytools.py", line 182, in __new__
return cls._from_expr(rep, opt)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/polys/polytools.py", line 311, in _from_expr
rep, opt = _dict_from_expr(rep, opt)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/polys/polyutils.py", line 368, in _dict_from_expr
rep, gens = _dict_from_expr_if_gens(expr, opt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/polys/polyutils.py", line 307, in _dict_from_expr_if_gens
(poly,), gens = _parallel_dict_from_expr_if_gens((expr,), opt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/sympy/polys/polyutils.py", line 216, in _parallel_dict_from_expr_if_gens
raise PolynomialError("%s contains an element of "
sympy.polys.polyerrors.PolynomialError: 1/(2*_t**4 - 2*sqrt(2)*_t**2 + 1) contains an element of the set of generators.
>>>
Here is another example
from sympy import *
x=symbols('x')
integrand="(3-2*2**(1/2)+x**2)**2*(-3+2*2**(1/2)+x**2)/(577-408*2**(1/2)-8* (-41+29*2**(1/2))*x**2-2*(-39+28*2**(1/2))*x**4-8*(2**(1/2)-1)*x**6+x**8)"
integrate( sympify(integrand), x)
gives
File "/usr/lib/python3.11/site-packages/sympy/polys/polyutils.py", line 216, in _parallel_dict_from_expr_if_gens
raise PolynomialError("%s contains an element of "
sympy.polys.polyerrors.PolynomialError: 1/(-4893319121142556020618924174780472498117708482611714912381696*_t**4 + 3460099133069698398004476359279702930052248019321310378430976*sqrt(2)*_t**4 - 159769239484575670917838951113184628965915778476312975023968*_t**2 + 112973912664560957914881642683593608324699445462537847255936*sqrt(2)*_t**2 - 1304135764168161431882534016166025912200366086490350062499 + 922163242431207071074983301530248435746125497723607601750*sqrt(2)) contains an element of the set of generators.
And another example
from sympy import *
x=symbols('x')
integrand="(-3+2*2**(1/2)+x**2)/(17-12*2**(1/2)+(2-4*2**(1/2))*x**2+x**4)"
integrate( sympify(integrand), x)
Gives
File "/usr/lib/python3.11/site-packages/sympy/polys/polyutils.py", line 216, in _parallel_dict_from_expr_if_gens
raise PolynomialError("%s contains an element of "
sympy.polys.polyerrors.PolynomialError: 1/(-2304*_t**4 + 1024*sqrt(2)*_t**4 - 32*_t**2 + 64*sqrt(2)*_t**2 - 1) contains an element of the set of generators.
The resultant should not have denominators like this. Maybe resultant is broken in the EX domain. Probably because EX uses cancel and cancel cannot handle sqrt(2) and sqrt(3) without extension=True. For EX probably a division free resultant algorithm should be used like actually computing the determinant of the Sylvester matrix or something.
I do not know if this is known or reported before. Feel free to close if so.
I see lots of exceptions from
polyutils.py
calling integrate command. Below is just one typical examplegives
Here is another example
gives
And another example
Gives
Version info
The text was updated successfully, but these errors were encountered: