I want the eigenvalues of the following generalized eigenvalue problem: $$ Av = \lambda M v $$ where
$A\in\mathbb{R}^{n\times n}$ is sparse, symmetric, and positive semi-definite
$M\in\mathbb{R}^{n\times n}$ is sparse, symmetric, and indefinite (i.e. neither positive nor negative definite)
I want the eigenvalues $\lambda$ with the smallest absolute value, i.e. $|\lambda|$ closest to zero.
My problem is that I am using scipy
and in particular scipy.sparse.linalg.eigsh
. (Note that I have to use Python, but not necessarily scipy
, if someone knows a better library.) In this case, eigsh
forces me to use the buckling
option, since $M$ is indefinite. However, the buckling
mode sorts based on eigenvalues transformed via:
$$ \widetilde{\lambda} = \frac{\lambda}{\lambda - \sigma} $$
where $\sigma$ is a user-defined constant. Unfortunately, I can't figure out how to get the eigenvalues with smallest magnitude from this.
If I choose $\sigma$ to be large, then ask eigsh
for the smallest magnitude (i.e. option SM
), it is too slow. Slightly better is using the option BE
, which returns values from both ends of the spectrum, with a small $\sigma$ close to zero. However, there's no reason to believe the smallest eigenvalues are equally distributed between positive and negative.
Does anyone have any advice for dealing with getting the smallest magnitude eigenvalues from a generalized symmetric eigenvalue problem where the mass matrix is indefinite?
(As a separate note, I have to add $\xi I$ to $A$, and then subtract $\xi$ from $\lambda$ at the end (for small $\xi$), so that it goes from positive semi-definite to positive definite, as required by buckling
mode. I am aware that this is not an exact correction for the generalized eigenproblem as it is for the simpler case, but I could not find a better alternative so far, and it doesn't seem to be a big issue. I've asked a related question here, specific to this aspect.)
EDIT (091018): I needed some preliminary results and it seems like the following works, but certainly may not be optimal in terms of speed. Simply solve $M^{-1}Av=\lambda v$ instead using eigs
. The trick to making it fast is using prefactorizations (i.e. sparse LUs) to make computing $M^{-1}A$ and $A^{-1}M$ fast. I'd love to know more about potentially better ways to do this!
normal mode
shift inversion to get the largest magnitude eigenvalues (e.g.LM
mode withsigma=0
)? Does this "inverse" system really have the reciprocal eigenvalues? $\endgroup$ – user3658307 Sep 10 '18 at 17:10