I have $n$-dimensional matrices $\mathrm{\hat{H}}(\vec{k})$ depending on vector parameter $\vec{k}$.

Now, eigenvalue routines return eigenvalues in no particular order (they are usually sorted), but I want to trace eigenvalues $E_i$ as smooth functions of $\vec{k}$. Because eigenvalues are not returned in any particular order, just tracing $E_i$ for some particular index $i\in\{1,..,n\}$ will return set of lines which are not smooth, as shown on the picture bellow

band structure

My idea to trace continuous lines was to use eigenvectors. Namely, for two close points $\vec{k}$ and $\vec{k}+d\vec{k}$ eigenvectors should be approximately orthonormal so that $v_i(\vec{k})\cdot v_j(\vec{k}+d\vec{k})\sim \delta_{p_i p_j}$ where $p_i, p_j\in \pi(\{1,...,n\})$, and $\pi$ is some permutation. Then I would use given permutation to reorder the eigenvalues and thus trace smooth lines.

I other words, I would trace continuity of eigenvectors.

However, I run into some problems with numerical routines. At a given small subset of points I use, few eigenvectors at nearby points are not almost orthonormal. My first suspicion was that those eigenvectors correspond to a degenerate eigenvalue, but that is not always true.

This also holds true if I reduce $d\vec{k}$ to be really small.

Is such thing allowed to happen. Or, is it possible to guarantee that numerical routines return continuous eigenvectors? Routine I use is numpy.linalg.eigh which is an interface for zheevd from LAPACK.

(Physicists amongst you will recognize that I am talking about the band structure)

  • 1
    $\begingroup$ Your matrix is Hermitian, right? $\endgroup$
    – k20
    Commented Sep 3, 2013 at 15:50
  • $\begingroup$ Of course. I forgot to mention that. $\endgroup$
    – tomic
    Commented Sep 3, 2013 at 15:55
  • $\begingroup$ Maybe the problem is that even when the eigenvalues are distinct, the eigenvectors can have arbitrary sign? $\endgroup$
    – k20
    Commented Sep 3, 2013 at 16:06
  • $\begingroup$ I don't think this should be the problem since in the end I just take absolute value of the matrix of eigenvector products. $\endgroup$
    – tomic
    Commented Sep 3, 2013 at 18:16
  • $\begingroup$ Would you be able to use numpy.linalg.svd to generate your eigenvectors. At least in Matlab, the underlying routine for svd always returns the eigenvalues and eigenvectors in decreasing order. $\endgroup$
    – horchler
    Commented Sep 3, 2013 at 21:54

2 Answers 2


At points where two lines merge, you have that two eigenvalues are the same and consequently that the eigenspace that corresponds to these two eigenvectors is two-dimensional. What this means is that at that point, the two eigenvectors are no longer unique (not just up to a sign) but can be any of the infinitely many possible orthogonal vectors that span this two-dimensional space.

Have you tried continuation methods that trace individual lines over different values of $k$?

  • $\begingroup$ It was the first thing I thought of. However, I was surprised that it also happened for eigenvalues which were non-degenerate. $\endgroup$
    – tomic
    Commented Sep 4, 2013 at 9:22
  • $\begingroup$ pretty sure that for hermitian matrices, this doesn't happen for eigenvalues that are non-degenerate $\endgroup$
    – k20
    Commented Sep 9, 2013 at 21:08
  • $\begingroup$ You may also be interested in this question: scicomp.stackexchange.com/questions/8432/… $\endgroup$ Commented Sep 10, 2013 at 12:00

I work in electromagnetics, so I have to compute photonic band structures. I used to try to make the bands smooth by trying to detect crossover points, but after many attempts and discussions with coworkers, we ultimately concluded there is no really good way or reason to do it.

But, if you still insist on doing what you want, you want to look at computing eigenvalue derivatives with respect to k. There is quite a bit of literature on this, mainly on perturbation theory of eigenvalue problems (classic book by Kato), and also work on perturbation analysis in the presence of eigenvalue degeracies (a much harder problem, literature by Roger C E Tan). I would try to do this for the nondegenerate case first, since that's still relatively easy.


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.