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
/home/artal/sage/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx in 
sage.symbolic.expression.Expression.numerator 
(build/cythonized/sage/symbolic/expression.cpp:48252)()   9377             
sig_on()   9378             try:-> 9379                 ex = self._gobj.numer() 
  9380             finally:   9381                 sig_off()
ValueError: divide: arguments must be polynomials over the rationals


This error does not happen if I erase some terms of h; and some times it gives 
the error only if I did not restart the jupyter notebook. Any ideas? Enrique.


--
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 sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/2a0acf72-82e8-3ac7-a306-c820786d75c6%40gmail.com.

Reply via email to