These are chat archives for symengine/symengine

4th
Jul 2014
Ondřej Čertík
@certik
Jul 04 2014 03:46
@asmeurer thanks for the comments on the complex stuff. I replied there (https://github.com/sympy/csympy/issues/233#issuecomment-48006574). It's been like 10 years since I did this the last, so I had to spent few hours reviewing the stuff.
@asmeurer I came to the conclusion, that you choose the branch cut for arg(z) arbitrary. Usually it's for the negative x-axis (i.e. angle alpha=pi), but it can be any angle, and in fact, it can be any curve. Do you agree? Then once you define arg(z), then you define everything else using it, e.g. log(z) = log(|z|) + i*arg(z), and you don't choose any branch cuts anymore.
More specifically, you could in principle choose different branch cuts for all the functions, e.g. one for arg(z), another incompatible one for log(z), yet another one for asin(z). But then you can't use the usual formulas that relate these functions. So the only other way is to choose a branch cut for arg(z) and derive everything else using it. Let me know if this is your understanding as well.
Ondřej Čertík
@certik
Jul 04 2014 03:51
Furthermore, the branch cut for arg(z) is arbitrary. Then one derives formulas for arg(e^z), arg(a*b) = arg(a) + arb(b) + 2*pi*k, where k = floor(...) and so on. These formulas depend on the particular branch cut that was chosen. Then to derive all the other functions, it's just algebra and applying these relations. No more worries about branch cuts etc.
Aaron Meurer
@asmeurer
Jul 04 2014 05:17
FYI, the SymPy polar_lift, exp_polar, periodic_argument, and Symbol(‘x’, polar=True) are helpful here
they let you compute things on the Riemann surface of the logarithm, instead of the complex plane
by the way, I wrote a blog post about some similar stuff a while back https://asmeurersympy.wordpress.com/2013/03/03/when-does-xlogy-ylogx/
I hope everything I wrote there is correct
Ondřej Čertík
@certik
Jul 04 2014 05:53
Looks correct. I think I need a list of the basic identities, written for general complex arguments. For example, also (x*y)^z = x^z*y^z *correction etc. SymPy seems to be doing the right thing overall.
Ondřej Čertík
@certik
Jul 04 2014 05:59
Btw, this site has all the correct formulas for complex numbers: http://functions.wolfram.com/ElementaryFunctions/Power/16/ShowAll.html
i.e. it lists the exact correction