I have an operator $H$. I express $H$ as a matrix in the orthonormalized $\{ |e > \}$ basis. Then I diagonalize it to obtain eigenvalues, let's say for example $H$ is $6 \times 6$ and the eigenvalues are $1, 5, 7, 9, 3, 8$. Now I express $H$ as a matrix in a different orthonormalized $\{ |f > \}$ basis obtained through unitary transformation of the $\{ |e > \}$ basis. Now I diagonalize this matrix. In principle, I should get same result $1, 5, 7, 9, 3, 8$. But when I run the code, only four eigenvalues are matching - let's say I get $1, 5, 7, 9, -4, 15$. Notice that the last two eigenvalues don't match, but peculiarly their sum is same as before, i.e., $3 + 8 = -4 + 15 = 11$. I am using ${numpy.linalg.eig}$ . Please enlighten me.

  • 5
    $\begingroup$ Can you show the code? $\endgroup$
    – mmikkelsen
    Feb 18, 2023 at 19:50
  • 2
    $\begingroup$ The sum being the same makes sense because the trace of the matrix should be invariant to unitary transformations. However the product of the eigenvalues, which is the determinant of the matrix, should also be invariant, but isn't for the values you have shown. So something clearer went wrong either with the diagonalization process or more likely the conversion you used between bases. $\endgroup$
    – Tyberius
    Feb 19, 2023 at 1:11
  • 4
    $\begingroup$ Isolate a minimal example that demonstrates the bug (possibly with a simpler operator) and show us the code. I suspect a human error, since this shouldn't happen (unless in very special cases with highly non-normal matrices that make the eigenvalue problem ill-conditioned, but in my experience when a physicist says "operator" usually they mean "symmetric matrix"). $\endgroup$ Feb 19, 2023 at 14:30
  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Mar 1, 2023 at 8:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.