jax.numpy.linalg.cond¶

jax.numpy.linalg.cond(x, p=None)[source]¶

Compute the condition number of a matrix.

LAX-backend implementation of cond().

Original docstring below.

This function is capable of returning the condition number using one of seven different norms, depending on the value of p (see Parameters below).

Parameters
  • x ((.., M, N) array_like) – The matrix whose condition number is sought.

  • p ({None, 1, -1, 2, -2, inf, -inf, 'fro'}, optional) –

    Order of the norm:

    p

    norm for matrices

    None

    2-norm, computed directly using the SVD

    ’fro’

    Frobenius norm

    inf

    max(sum(abs(x), axis=1))

    -inf

    min(sum(abs(x), axis=1))

    1

    max(sum(abs(x), axis=0))

    -1

    min(sum(abs(x), axis=0))

    2

    2-norm (largest sing. value)

    -2

    smallest singular value

    inf means the numpy.inf object, and the Frobenius norm is the root-of-sum-of-squares norm.

Returns

c – The condition number of the matrix. May be infinite.

Return type

{float, inf}

References

1

G. Strang, Linear Algebra and Its Applications, Orlando, FL, Academic Press, Inc., 1980, pg. 285.