Problem with factor and imag.
I'm new to SageMath, and I'm not sure what's going wrong.
Here are the commands I enter and results I get:
sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0
Why is Q
factoring to 0
?
Weird.
assume(z, 'complex')
seems to help.Also
Possible serious bug. Advice requested on
sage-devel
.