I confirm the bug on 8.9.beta5. It is most probably a bug in Pynac. Note
that if you multiply by 2 it "works"
sage: (2*num).factor()
(16*r^6 - 32*r^4*x^2 + 16*r^2*x^4 + 32*r^4*y^2 + 32*r^2*x^2*y^2 +
16*r^2*y^4 + 80*r^2*x^2 + 16*x^4 + 16*r^2*y^2 + 32*x^2*y^2 + 16*y^4 -
16*x^2 - 16*y^2)*r^4/(r^6 + 6*r^4*x^2 + r^2*x^4 + 2*r^4*y^2 +
2*r^2*x^2*y^2 + r^2*y^4 - 2*r^2*x^2 + x^4 + 2*r^2*y^2 + 2*x^2*y^2 + y^4)^2
Le 24/07/2019 à 13:31, Enrique Artal a écrit :
> I have encountered a problem with factor in SR which can be avoided but it
> shows a problem. If I run this code:
>
> var('t',domain='complex')
> var('r,x,y',domain='real')
> h= r^6+r^4*t^2 + 4*r^4*t*conjugate(t) + r^4*conjugate(t)^2 +
> r^2*t^2*conjugate(t)^2 - r^2*t^2 - r^2*conjugate(t)^2 + t^2*conjugate(t)^2
> H=h(t=x+I*y).factor()
> num=1/2*(H.derivative(x)/H).derivative(x)+1/2*(H.derivative(y)/H).derivative(y)
> num.factor()
>
> I get the following error
>
> ---------------------------------------------------------------------------ValueError Traceback (most recent call last)<ipython-input-1-bfb20671ab22> in <module>() 6 H=h(t=x+I*y).factor() 7 num=Integer(1)/Integer(2)*(H.derivative(x)/H).derivative(x)+Integer(1)/Integer(2)*(H.derivative(y)/H).derivative(y)----> 8 num.factor()
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.factor (build/cythonized/sage/symbolic/expression.cpp:57759)() 11107 cdef GEx x 11108 cdef bint b> 11109 if dontfactor or not self.is_rational_expression(): 11110 m = self._maxima_() 11111 name =
m.name()
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.is_rational_expression (build/cythonized/sage/symbolic/expression.cpp:15368)() 2030 False 2031 """-> 2032 return all(part.is_polynomial(v) 2033 for part in (self.numerator(), self.denominator()) 2034 for v in part.variables())
> /home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx in genexpr (build/cythonized/sage/symbolic/expression.cpp:15110)() 2031 """ 2032 return all(part.is_polynomial(v)-> 2033 for part in (self.numerator(), self.denominator()) 2034 for v in part.variables()) 2035