-
Notifications
You must be signed in to change notification settings - Fork 53
[Wording] Algorithm-independent definition of matrix_rank
#211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
Sorry, I did miss that point in the OP, I will update it for future reference. There are indeed other algorithms that are rank-revealing. The most important is QR with pivoting present in LAPACK, which is also sometimes used to solve In particular, see the relevant part of the As such, I believe that it would be better to make this definition independent of the algorithm used to compute it. |
I always took it that the number of singular values is determined by the matrix rank, so in a sense they are interchangeable and is not really tied to a specific algorithm. Though looking it at a different angle it does imply I shared the same concern when reviewing the relevant PRs, and I was convinced by the fact that several other libraries (Matlab, Julia, etc) also describe it in the same fashion. If this becomes universal in numerical linear algebra (which I am not an expert in) then there's little merit to not follow the convention. Just my two cents. |
@leofang Thanks for pointing that out. Given the universality of the definition (across MATLAB, Julia, NumPy, etc), I'd lean toward keeping the definition as is. |
During the consortium meeting on 2021-07-29, a decision was made to keep the definition of |
The current definition of
matrix_rank
is: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.
cc @rgommers @mruberry
The text was updated successfully, but these errors were encountered: