jax.numpy.linalg.slogdet#

jax.numpy.linalg.slogdet(a, *, method=None)[source]#

Compute the sign and (natural) logarithm of the determinant of an array.

LAX-backend implementation of numpy.linalg.slogdet().

Original docstring below.

If an array has a very small or very large determinant, then a call to det may overflow or underflow. This routine is more robust against such issues, because it computes the logarithm of the determinant rather than the determinant itself.

Parameters
  • a ((..., M, M) array_like) – Input array, has to be a square 2-D array.

  • method (Optional[str]) –

Returns

  • sign ((…) array_like) – A number representing the sign of the determinant. For a real matrix, this is 1, 0, or -1. For a complex matrix, this is a complex number with absolute value 1 (i.e., it is on the unit circle), or else 0.

  • logdet ((…) array_like) – The natural log of the absolute value of the determinant.

  • If the determinant is zero, then sign will be 0 and logdet will be

  • -Inf. In all cases, the determinant is equal to sign * np.exp(logdet).