An expression can be simplified adding assumptions *a posteriori* using the 
refine() function:

  In [33]: refine(sqrt(x ** 2), Q.real(x))
  Out[33]: │x│

but this doesn't seem to work in the complex case when the re() and im() 
functions are involved:

  In [37]: refine(im(x), Q.real(x))  # I expect 0
  Out[37]: im(x)
  
  In [38]: refine(re(x), Q.real(x))  # I expect x
  Out[38]: re(x)

  In [39]: refine(re(x), Q.imaginary(x))
  Out[39]: re(x)
  
  In [40]: refine(im(x), Q.imaginary(x))
  Out[40]: im(x)

Is this a bug or am I missing something? 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy/-/Knpy95uKwY8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to