scipy.special.erfi#

scipy.special.erfi(z, out=None) = <wrapped_ufunc 'erfi'>#

Imaginary error function.

The imaginary error function is defined as

\[\operatorname{erfi}(z) = -i \operatorname{erf}(i z)\]
Parameters:
zarray_like

Real or complex valued argument

outndarray, optional

Optional output array for the function results

Returns:
scalar or ndarray

Values of the imaginary error function

See also

erf, erfc, erfcx, dawsn, wofz

Notes

Added in version 0.12.0.

Array API Standard Support

erfi has 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 typically none of the other ufunc kwargs. out is 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. out is never supported for JAX because JAX arrays are immutable. erfi does not currently support out for the PyTorch backend.

See Array API coverage for more information.

References

[1]

Steven G. Johnson, Faddeeva W function implementation. http://ab-initio.mit.edu/Faddeeva

Examples

>>> import numpy as np
>>> from scipy import special
>>> import matplotlib.pyplot as plt
>>> x = np.linspace(-3, 3)
>>> plt.plot(x, special.erfi(x))
>>> plt.xlabel('$x$')
>>> plt.ylabel('$erfi(x)$')
>>> plt.show()
../../_images/scipy-special-erfi-1.png