scipy.special.zetac#
- scipy.special.zetac(x, out=None) = <ufunc 'zetac'>#
Riemann zeta function minus 1.
This function is defined as
\[\zeta(x) - 1 = \sum_{k=2}^{\infty} \frac{1}{k^x}\]where
x > 1. Forx < 1the analytic continuation is computed. For more information on the Riemann zeta function, see [dlmf].- Parameters:
- xarray_like of float
Values at which to compute zeta(x) - 1 (must be real).
- outndarray, optional
Optional output array for the function results
- Returns:
- scalar or ndarray
Values of zeta(x) - 1.
See also
Notes
Array API Standard Support
zetachas support for Python Array API Standard compatible backends in addition to NumPy. The following combinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
✅
PyTorch
✅
⛔
JAX
✅
⛔
Dask
✅
n/a
For the NumPy backend, this function supports all NumPy ufunc keyword arguments. Other backends may support
out, but none of the other ufunc kwargs.outis typically supported for CuPy and PyTorch, but not currently in cases where SciPy relies on a generic Array API implementation or, for PyTorch on CPU, falls back to the NumPy backend.outis never supported for JAX because JAX arrays are immutable.zetacdoes not currently supportoutfor the PyTorch backend.See Support for the array API standard for more information.
References
[dlmf]NIST Digital Library of Mathematical Functions https://dlmf.nist.gov/25
Examples
>>> import numpy as np >>> from scipy.special import zetac, zeta
Some special values:
>>> zetac(2), np.pi**2/6 - 1 (0.64493406684822641, 0.6449340668482264)
>>> zetac(-1), -1.0/12 - 1 (-1.0833333333333333, -1.0833333333333333)
Compare
zetac(x)tozeta(x) - 1for large x:>>> zetac(60), zeta(60) - 1 (8.673617380119933e-19, 0.0)