Given a non-symmetric, $n\times n$ real matrix $A$, I want to find real eigenvalues and eigenvectors.
It is very well known that $A$ is not guaranteed to have any real eigenvalues and eigenvectors. However at least I want to check if a real eigenvector exists, and want to find it if one exists.
Q1. I have tried the following approach and seems to work on a few toy examples.
- Run eigendecomposition on $A$ :
eigval, eigvec = np.linalg.eig(A) - Filter for real eigenvalues:
eigval_real = eigval[eigval.imag == 0] - Filter for real eigenvectors:
eigvec_real = eigvec[:, eigval.imag == 0]
What would be the biggest caveat for this approach? How could this method be improved?
Q2. Miscellaneous facts on non symmetric matrices. Answers or points to references on any subset of those questions are welcome.
- How can I check if $A$ has any real eigenvalue?
- On what condition will $A$ have at least one real eigenvalue?
- How can I efficiently compute only real eigenvectors and real eigenvalues of $A$, without having those useless imaginary ones?
- What would be the connection between $A$'s eigenvalues and the "symmetrized" matrix $A_{sym} = \frac{1}{2} (A + A^T)$?
Background: I am interested in finding eigenvectors of finite difference (FD) matrix. In a regularly-spaced grid, FD matrices (for example for Laplacian $\nabla^2 = \frac{\partial^2 }{\partial x^2} + \frac{\partial^2}{\partial y ^2}$) are symmetric, so its eigenvectors are real. However, when grid is not regular, FD matrices are rarely symmetric. I am dealing with such matrices.
I would compute the characteristic polynomial of $A$ and then I would try to determine whether or not it has real roots. If $\lambda$ is such a root, then there is necessarily a real vector $v$ such that $Av=\lambda v$. Therefore, your third step is a waste of energy.
In order to determine if a given real polynomial has real roots, perhaps that Sturm's theorem is the best approach.