# Using algebraically smallest eigenvalues to find smallest in magnitude eigenvalues

I have a symmetric indefinite matrix, $H$. I also have a routine that can compute the algebraically smallest eigenvalues of a symmetric indefinite matrix. I would like to compute the eigenvalues with smallest magnitude using my existing code.

One way I can do this is to use my routine to compute the algebraically smallest eigenpairs of $H^2$. Then I can use Rayleigh quotients to figure the smallest magnitude eigenvalues of $H$. This works great but is very slow since $cond(H^2) = cond(H)^2$.

Is there a better way?

• What does "algebraically smallest" mean? – Dan Mar 29 '12 at 20:08
• from his way of currently solving it one can infer that it means "absolutely smallest" – Arnold Neumaier Mar 29 '12 at 20:13
• By algebraically smaller I mean closer to $-\infty$. I don't know the proper term. – dranxo Mar 29 '12 at 22:21
• What you say here is just termed ''smallest'' (in your case = most negative). You'd get this by running the Lanczos algorithm. But the smallest eigenvalue of H^2 gives you the eigenvalue closest to 0 (the absolutely smallest), not to -infty, so I inferred that you meant that. So what do you really mean? If the spectrum were 2,1,-2,-5, which eigenvalue should be returned? – Arnold Neumaier Mar 30 '12 at 7:43
• The current code will return -5. I would like a way to get 1. – dranxo Mar 30 '12 at 18:05

## 2 Answers

If you can afford a single factorization of $H$ you can find the absolute largest eigenvalue of $H^{-1}$ by the Lanczos algorithm, using the factorization to calculate matrix-vector products with $H^{-1}$. The inverse then gives the absolutely smallest eigenvalue of $H$.

• Yes, inverse iteration can do it. Problem is that the bare bones matrix library I'm using does not have a linear solver and it's nontrivial to code up a good one that can handle indefinite matrices. – dranxo Mar 29 '12 at 22:27

You can use Jacobi-Davidson to find the lowest eigenvalue(s). Also see this question for related issues.