Derivative of an eigenvalue dependent on a parameter

In numerical applications it is often the case that we have to differentiate a eigenvalue which is a function of some parameter. Let H(α) be a non-singular matrix dependent on a real parameter α. Let the eigenvalues be λi(α) and let the right and left eigenvectors be vi(α) and ui(α), respectively. Let us further assume that in expressions the eigenvectors are already normalized. Now suppose we want to calculate λi(α)α. The naive way to do this is via finite differences:

(1)λi(α)αλi(α+ϵ)λi(α)ϵ

but this requires doing two eigendecompositions. Instead, we can appeal to the definition of the ith eigenvalue:

(2)uiTHvi=λi

Differentiate both sides w.r.t α:

(3)α(uiTHvi)=uiTαHvi+uiTHαvi+uiTHviα=λi(uiTαvi+uiTviα)+uiTHαvi

Now using the orthogonality relations between the right and left eigenvectors, i.e. uiTvj=δij we can see that uiTαvi=uiTviα=0 because the derivatives are orthogonal to the vectors by normalization (the eigenvectors live on a d-dimensional unit hypersphere, where d is the dimension of H, and we can just throw away any changes that would bring us off the sphere). So the formula is

(4)λiα=α(uiTHvi)=uiTHαvi

If nothing else you can get the derivative of H by automatic differentiation.

Degenerate Eigenvalues

What if λi is degenerate with another eigenvalue λj for some range of the parameter α ? Then we are no longer guaranteed the orthogonality from before since we have a two dimensional subspace in which we are free rotate our eigenvectors. Suppose we reorthogonalize ui and uj inside the degenerate subspace. Reviewing the steps, we find that the derivative uiTα may rotate inside the degenerate subspace, acquiring components in the direction uj. Then we get

(5)α(uiTHvi)=λi(uiTαvi+uiTviα)+uiTHαvi=λi(g(α)ujTvi+g(α)uiTvj)+uiTHαvi

where g(α) and g(α) are functions that measure the magnitude of the derivative in the direction of uj and vj, respectively. Then what we need to do is clear: we need to construct uj and ui such that they are orthogonal to vi and vj, respectively.

Eigenvectors

To get the derivatives of the eigenvectors of a Hermitian matrix with distinct eigenvalue λi and normalized eigenvector ui, we differentiate

α(Huiλiui)=(HαλiαI)ui+(HλiI)uiα=0uiα=(HλiI)1(HαλiαI)ui

noting that the inverse is justified because the nullspace of HλiI is spanned by ui, which is the direction that is subtracted from Hα. Hence the action of (HλiI)1 is unambiguous. We may use the Moore-Penrose pseudo inverse to write:

(6)uiα=(HλiI)+Hαui