-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
slow inv(::Eigen)
method
#38335
Comments
Isn't that only valid if the original matrix is hermitian? |
It shouldn't be. Vectors is an orthogonal matrix |
No, @simeonschaub is right. We should probably add a field to |
Please note, that the initial formula Example:
|
Would it make sense to (optionally) extend the output gathered in For non-unitary vectors, the user could decide, if |
For the records: In the general (non-symmetric) case.
|
For the timing, some measured values:
|
Anyone working with a diagonalization of a very non-normal matrix should know that the eigenvectors are potentially a badly conditioned matrix, and that anything they might want to do with the I thought the getting the left eigenvectors requires extra computation (they are equivalent to (I'm not sure it's essential to provide a faster |
From the measured figures you can see, that for n = 1000, the extra evaluation of left eigenvectors takes 336 ms The same timing argument is valid in the hermitian/symmetric case.
Calculating condition numbers for the eigenvalues is an option of Calculating condition numbers for the right eigenvectors is an option of
I agree, if you don't need the eigen decomposition. But once you have it, it can save you time (28ms vs. 48 ms in the symmetric case). Having a flag, which indicates the eigenvectors are unitary would also allow to implement other kinds of matrix functions from |
If you already have the eigendecomposition of a Hermitian matrix and you are interested in saving time, you should generally avoid computing the matrix inverse in the first place. Anything you might want to do with the matrix inverse you can do directly with the eigenvectors and eigenvalues. That being said, it makes sense to me to store an |
Yes, of course. That questions the existence of
From the existing type information, we can derive from For the purpose of the spectral theorem (not only the inverse), it would be useful to know if the eigenvector matrix is unitary. This can be assumed for the output of the The condition numbers for the eigenvalues, which can be delivered by |
No reason not to define it, since it is well-defined and easy to compute (assuming the diagonalization itself is well conditioned). But I'm not sure if it's worth optimizing too much.
The key point here is opting in. Left eigenvectors and condition numbers can be very useful, but I don't think we should compute them by default. It's not clear to me what the opt-in interface would look like. |
Additional fields and corresponding type parameters in |
inv
of anEigen
seems to be no faster (maybe a bit slower) thaninv
of the original matrix. The code isShould that be
instead?
The text was updated successfully, but these errors were encountered: