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/989be80f-5124-4d8c-92cf-7354412dc817%40googlegroups.com.