Closed amilsted closed 5 years ago
That is certainly a bug. From your description, I assume it has to do with how I combine the real and imaginary part of the Schur vectors in the real schur decomposition. I'll take a look at this asap.
Ok this seems to be because of how ?trevc
in lapack works:
Each eigenvector is normalized so that the element of largest magnitude has magnitude 1; here the magnitude of a complex number (x,y) is taken to be |x| + |y|.
I will add an explicit normalization step
Strange that nobody noticed/complained so far.
Check out v0.3.2 :-)
Or not
I should have awaited tests; clearly I broke something.
Unless you care very much about the info.residuals
being correct, you should be fine. I forgot to update those. Will fix tonight.
Proper fix in v0.3.3
Hi Jutho!
I'm not sure if this is a bug, but I noticed that eigsolve() does not always return normalized eigenvectors. Are the eigenvalues supposed to be normalized? I couldn't see anything about this in my cursory glance at the docs.
Anyway, I am giving eigsolve() a real, nonsymmetric sparse matrix (Julia's built-in sparse type) and the eigenvectors have norm 1 or sqrt(2). If I make the element type of the matrix complex (without changing the values), all eigenvectors have norm 1.
For more detail, I was just diagonalizing the Ising spin chain (as one does...) via T*H, where T is a translation by one site and H is the Hamiltonian. The translation-invariant states (with real eigenvalues) had norm 1, the others had norm sqrt(2).
Ash
PS: Thanks for all the cool code you're putting out at the moment. Much appreciated! 🥇