You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Branch cuts of sqrt() and log() are not handled properly.
If that implies that sqrt() and log() have more than this issue in the complex plane I don't know.
Moreover, if that implies that other elementary functions are having similar problems with branch cuts I have not tested.
In [2]: N(sqrt(-1.+I*1e-10))
Out[2]: 5.0e-11 + 1.0*I
In [3]: N(sqrt(-1.-I*1e-10))
Out[3]: 5.0e-11 - 1.0*I
Ok. sqrt-branch seems to lie on neg. Re-axis and is selected properly
2nd, same thing symbolically
In [5]: eps=symbols('eps')
In [6]: limit(sqrt(-1+I*eps),eps,0,'+')
Out[6]: I
In [7]: limit(sqrt(-1+I*eps),eps,0,'-')
Out[7]: I
In [8]: limit(sqrt(-1-I*eps),eps,0,'+')
Out[8]: I
In [9]: limit(sqrt(-1-I*eps),eps,0,'-')
Out[9]: I
Symbolic sqrt() returns 'I' irrespective of approach to branch cut. Wrong.
In [10]: log(-1I*1e-10)
Out[10]: 5.0e-21 - 3.14159265348979*I
In [11]: log(-1+I*1e-10)
Out[11]: 5.0e-21 + 3.14159265348979*I
Ok. log-branch seems to lie on neg. Re-axis and is selected properly
2nd, same thing symbolically
In [12]: limit(log(-1+I*eps),eps,0,'+')
Out[12]: I*pi
In [13]: limit(log(-1+I*eps),eps,0,'-')
Out[13]: I*pi
In [14]: limit(log(-1-I*eps),eps,0,'+')
Out[14]: I*pi
In [15]: limit(log(-1-I*eps),eps,0,'-')
Out[15]: I*pi
Symbolic log() returns 'I*pi' irrespective of approach to branch cut. Wrong.
Branch cuts of sqrt() and log() are not handled properly.
If that implies that sqrt() and log() have more than this issue in the complex plane I don't know.
Moreover, if that implies that other elementary functions are having similar problems with branch cuts I have not tested.
Exmpl. 1-------------------sqrt()---------------------------
1st, numerically
Ok. sqrt-branch seems to lie on neg. Re-axis and is selected properly
2nd, same thing symbolically
Symbolic sqrt() returns 'I' irrespective of approach to branch cut. Wrong.
Exmpl. 2-------------log()--------------
1st, numerically
Ok. log-branch seems to lie on neg. Re-axis and is selected properly
2nd, same thing symbolically
Symbolic log() returns 'I*pi' irrespective of approach to branch cut. Wrong.
Original issue for #7216: http://code.google.com/p/sympy/issues/detail?id=4117
Original author: https://code.google.com/u/112689286102358441542/
The text was updated successfully, but these errors were encountered: