scipy.special.poch#
- scipy.special.poch(z, m, out=None) = <ufunc 'poch'>#
Pochhammer symbol.
The Pochhammer symbol (rising factorial) is defined as
\[(z)_m = \frac{\Gamma(z + m)}{\Gamma(z)}\]For positive integer m it reads
\[(z)_m = z (z + 1) ... (z + m - 1)\]See [DLMF] for more details.
- Parameters:
- z, marray_like
Real-valued arguments.
- outndarray, optional
Optional output array for the function results
- Returns:
- scalar or ndarray
The value of the function.
Notes
Array API Standard Support
pochhas 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.pochdoes 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/5.2#iii
Examples
>>> import scipy.special as sc
It is 1 when m is 0.
>>> sc.poch([1, 2, 3, 4], 0) array([1., 1., 1., 1.])
For z equal to 1 it reduces to the factorial function.
>>> sc.poch(1, 5) 120.0 >>> 1 * 2 * 3 * 4 * 5 120
It can be expressed in terms of the gamma function.
>>> z, m = 3.7, 2.1 >>> sc.poch(z, m) 20.529581933776953 >>> sc.gamma(z + m) / sc.gamma(z) 20.52958193377696