jax.scipy.linalg.funm

Contents

jax.scipy.linalg.funm#

jax.scipy.linalg.funm(A, func, disp=True)[source]#

Evaluate a matrix function specified by a callable.

LAX-backend implementation of scipy.linalg._matfuncs.funm().

The array returned by jax.scipy.linalg.funm() may differ in dtype from the array returned by py:func:scipy.linalg.funm. Specifically, in cases where all imaginary parts of the array values are close to zero, the SciPy function may return a real-valued array, whereas the JAX implementation will return a complex-valued array.

Additionally, unlike the SciPy implementation, when disp=True no warning will be printed if the error in the array output is estimated to be large.

Original docstring below.

Returns the value of matrix-valued function f at A. The function f is an extension of the scalar-valued function func to matrices.

Parameters:
  • A ((N, N) array_like) – Matrix at which to evaluate the function

  • func (callable) – Callable object that evaluates a scalar function f. Must be vectorized (eg. using vectorize).

  • disp (bool, optional) – Print warning if error in the result is estimated large instead of returning estimated error. (Default: True)

Return type:

Array | tuple[Array, Array]

Returns:

  • funm ((N, N) ndarray) – Value of the matrix function specified by func evaluated at A

  • errest (float) – (if disp == False)

    1-norm of the estimated error, ||err||_1 / ||A||_1

References