Given an $n\times n$ matrix $Q$ (with e.g. $n\approx10^4$) I am only interested in the 3rd smallest eigenvalue of $Q,$ and not the entire spectrum (assume all eigenvalues are real, e.g. a Hermitian matrix). So one direct way would be to solve the Eigensystem, order the eigenvalues and pick the 3rd one:
{eigv, U} = Eigensystem[Q];
order = Ordering[eigv];
eigv = eigv[[order]];
res = eigv[[3]];
(Main question): But is there a way to go about this in a more targeted and efficient way considering that we know which eigenvalue we are looking for?
In the above I order the eigenvalues, but if we don't, does
Eigensystem
arrange them in a specific order already?
Addendum:
The matrix can has only nonnegative eigenvalues (M-matrix), and its first eigenvalue, $\lambda_0,$ is typically $0.$ Therefore, the idea is to find the 3rd smallest eigenvalue $\lambda$ in magnitude, knowing that the real parts of all $\lambda$ are nonnegative. These properties are e.g. satisfied for Laplacian matrices of graphs, in this case graphs with $10^4$ nodes.
Eigensystem[Q, 3, Method -> {"Arnoldi", "Criteria" -> "RealPart"}]
could be one choice. $\endgroup$eigbig
) usingEigenvalues[mat,1]
, then find the three largest in magnitude ofmat-eigbig*identity
and addeigbig
to them. Can useEigensystem
for this second step to get the corresponding eigenvectors. $\endgroup$