[Wording] Algorithm-independent definition of `matrix_rank`
See original GitHub issueThe current definition of matrix_rank
is:
Computes the rank (i.e., number of non-zero singular values) of a matrix
This is strongly biased towards the SVD view of the rank, which goes against point 4 of the design principles.
Edit Note that there are other algorithms that are rank-revealing. The most important is QR with pivoting present in LAPACK, which is also sometimes used to solve lstsq. See L351-395 of LAPACK’s implementation. LU with full pivoting strategies may also be made into a rank-revealing algorithm (see this paper with +150 citations) although no large library implements them to the best of my knowledge.
A more implementation agnostic definition would be “the number of independent columns”. This gets closer into the intuition of what the rank of a linear map really is: The dimension of the image of the map.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top GitHub Comments
The rtol parameter is based on the singular values, so it’s implicit in the current specification that it would be computed that way. If there are alternate algorithms that wouldn’t be based on that, we might want to reconsider the inclusion of that parameter.
During the consortium meeting on 2021-07-29, a decision was made to keep the definition of
matrix_rank
as is, following conventions set forth in PyData ecosystem and elsewhere (MATLAB, Julia) where the matrix rank is defined in terms of the number of singular values.