jax.numpy.linalg.matrix_rank(M, tol=None)[source]

Return matrix rank of array using SVD method

LAX-backend implementation of matrix_rank().

Original docstring below.

Rank of the array is the number of singular values of the array that are greater than tol.

Changed in version 1.14: Can now operate on stacks of matrices

  • A ({(M,), (..., M, N)} array_like) – Input vector or stack of matrices.

  • tol ((...) array_like, float, optional) –

    Threshold below which SVD values are considered zero. If tol is None, and S is an array with singular values for M, and eps is the epsilon value for datatype of S, then tol is set to S.max() * max(M, N) * eps.

    Changed in version 1.14: Broadcasted against the stack of matrices

  • hermitian (bool, optional) –

    If True, A is assumed to be Hermitian (symmetric if real-valued), enabling a more efficient method for finding singular values. Defaults to False.

    New in version 1.14.


rank – Rank of A.

Return type

(…) array_like



MATLAB reference documentation, “Rank” https://www.mathworks.com/help/techdoc/ref/rank.html


W. H. Press, S. A. Teukolsky, W. T. Vetterling and B. P. Flannery, “Numerical Recipes (3rd edition)”, Cambridge University Press, 2007, page 795.