I stumbled upon an issue with computing eigenvalues of a matrix which I discovered while debugging some code which uses reconstructing the matrix from its eigenvalues/eigenvectors.

First of all, here is the (anti-hermitian) matrix in question:


You will notice, that the elements of mat differ in magnitude by six orders of magnitude. We compute eigenvalues and eigenvectors

{eigVals, eigVecs} = Eigensystem[mat];

and inspect what they look like:

Chop[eigVals, 10^-7]//Column

Now, we make a sanity check:

Chop[eigVecs.mat.ConjugateTranspose[eigVecs], 10^-7]//MatrixForm

and observe that there are off-diagonal elements which can get close to 100 in magnitude. This should definitely not be the case. It also appears that the eigenvectors are not orthonormalized properly, although they should according to the documentation of Eigensystem where it says:

For approximate numerical matrices m, the eigenvectors are normalized.

Chop[eigVecs.eigVecs\[ConjugateTranspose], 10^-7] // MatrixForm

reveals that there are off-diagonal elements ~0.25.

I am aware that the huge difference in scales does not render this an easy task, though I need to understand what is going wrong here and find a workaround. Can anyone give me some insight/fix/explanation?

  • $\begingroup$ Did you try to take the MatrixLog of your matrix (which I obviously cannot access), and to diagonalize it? The set of normalized eigenvectors of MatrixLog[mat] should coincide with those of mat. $\endgroup$
    – user46676
    Commented Feb 21, 2017 at 16:41
  • $\begingroup$ @marmot No, haven't tried that but I will. Thanks for the suggestion. But why can't you access the matrix? mat should be accessible via the Uncompress line at the beginning of the question. $\endgroup$
    – Lukas
    Commented Feb 21, 2017 at 16:45
  • $\begingroup$ Sorry, didn't know what Uncompress does. The MatrixLog tricks appears to work. $\endgroup$
    – user46676
    Commented Feb 21, 2017 at 16:58
  • 3
    $\begingroup$ Lukas, I suspect that you may be suffering from loss of precision in your numerical calculations. Consider for instance setting the precision of your mat higher and repeating your calculations: {eigVals, eigVecs} = Eigensystem[SetPrecision[mat, 30]]; Chop[eigVecs.ConjugateTranspose[eigVecs] == IdentityMatrix[Length[mat]] returns True. $\endgroup$
    – MarcoB
    Commented Feb 21, 2017 at 18:00
  • $\begingroup$ @MarcoB Thanks for this suggestion. In fact, the original problem comes from a Matlab simulation and I believe there is nothing like SetPrecision there. But glad to see it is such a simple fix in Mathematica. $\endgroup$
    – Lukas
    Commented Feb 21, 2017 at 20:34

1 Answer 1


A possible workaround is based on MatrixLog

mat = Uncompress[

lmat = MatrixLog[mat];
ev = Orthogonalize[Eigenvectors[lmat]];
Chop[ev.mat.ConjugateTranspose[ev], 10^-7] // MatrixForm
Chop[ev.ConjugateTranspose[ev]] // MatrixForm

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.