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

  • M ({(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.shape) * eps.

    Changed in version 1.14: Broadcasted against the stack of matrices


rank – Rank of M.

Return type

(..) array_like



MATLAB reference documention, “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.