Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No complex arguments in scipy.special.zeta or scipy.special.zetac #9182

Closed
sohambhattacharyya opened this issue Aug 27, 2018 · 5 comments
Closed

Comments

@sohambhattacharyya
Copy link

sohambhattacharyya commented Aug 27, 2018

This is a feature request. Complex numbers are not supported by the scipy.special.zeta and scipy.special.zetac functions.

Reproducing code example:

zeta(2+1j)

Error message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-29-07480cb9365e> in <module>()
----> 1 zeta(2+1j)

/usr/local/lib/python3.6/dist-packages/scipy/special/basic.py in zeta(x, q, out)
   2461     if q is None:
   2462         q = 1
-> 2463     return _zeta(x, q, out)
   2464 

TypeError: ufunc '_zeta' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Scipy/Numpy/Python version information:

0.19.1 1.14.5 sys.version_info(major=3, minor=6, micro=3, releaselevel='final', serial=0)
@akahard2dj
Copy link
Contributor

akahard2dj commented Aug 28, 2018

Looking at the documentation of scipy.special.zeta, the input parameter x must be real.

Parameters:   x : array_like of floatInput data, must be real

@sohambhattacharyya
Copy link
Author

Hmm I see. It's supposed to take complex arguments though. It's doable manually. Didn't try on the cephes/zeta.c file.

@person142
Copy link
Member

@sohambhattacharyya an important question here is what application you have in mind when requesting complex arguments. The "standard" application for complex arguments of the Riemann zeta function is of course investigating the zeros along the critical strip, and this is not at all a procedure for which SciPy is suitable. Our special functions typically only accept double precision arguments, and properly investigating zeros requires using arbitrary precision. Arbitrary precision arguments are, at least for now, out of scope for SciPy.

@sohambhattacharyya
Copy link
Author

Hmm I see. Thanks a lot for the info.

@rgommers
Copy link
Member

Okay looks like that's a no to the feature request for the time being. So closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants