Comment #5 on issue 1242 by [email protected]: Simplifying of complex exponentials
http://code.google.com/p/sympy/issues/detail?id=1242

In current master:

In [1]: c = cos(x)._eval_rewrite_as_exp(x)

In [2]: t = tan(x)._eval_rewrite_as_exp(x)

In [3]: simplify(c*t)

In [1]: c = cos(x)._eval_rewrite_as_exp(x)

In [2]: t = tan(x)._eval_rewrite_as_exp(x)

In [3]: simplify(c*t)
Out[3]: (I - I*exp(2*I*x))*exp(-I*x)/2

In [5]: simplify(c*t).expand()
Out[5]: -I*exp(I*x)/2 + I*exp(-I*x)/2

It is correct, but .expand() usage is needed.

But (3 hours ago and now) I have tested in my fork, where
`simplify(c*t)` yield `-I*exp(I*x)/2 + I*exp(-I*x)/2` straightly, without expand()

Also, I do not the precise politics of `simplify` what to do simpler (Out[3] or Out[5]).

In any case, the tests have to be presented in sympy about it.

So, formally, issue is not fixed now (no test).


Additionally:

(it is out of this issue, but may be another new),
to avoid many similar problems with comlexes - it is a question,
I will cite myself:

"Complex numbers:

I observe that there are two ways to operate with them.

Pure symbolical way (with assumption option): I can operate symbolical with complex variable with the help of standard operations (multiplicity, abs, conjugate and so on):

Another way with the aim of I symbol: I can observe real and imaginary parts, and with the aim of I behaviour operations are maintaining:
E.g. for
1 + cos(x) + I + sin(x)*I

if I multiply this by I, than sympy scan every sub-expression in Add class and every sub-expression is multiplied by I.

I wonder that there is no class of complex number as like as Rational(p/q), which tracking real and imaginary part. In this way, this operation would be separated: 1 + cos(x) moved to imaginary field of class and 1 + sin(x) to real field of class.

The reason is not only for complex number, but for one way to operate with para complex numbers (where I**2 = 1) or dual numbers (I**2==0 ), and for extension for other dimensions (quaternions, Clifford algebra and so on)."

But I am not sure is it a poper time for rising it right now.


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
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-issues?hl=en.

Reply via email to