How can I compute the partial derivatives of the dominant eigenvalue and eigenvectors of a real symmetric matrix $\mathbf{A}$?


In particular, given


$ \mathbf{v}^\* = \arg\max\_{\mathbf{v}} \mathbf{v}^{\top}\mathbf{A}\mathbf{v},\quad \text{subject to } ~ \|\mathbf{v}\|\_2 = 1,
$


how can I find $\partial v\_{i}^\*/\partial A\_{jk}$?


I know the power method is the usual way to compute the dominant eigenvalue and eigenvector. Is their any similar algorithm for computing the gradient? 


Unlike [another question](https://mathoverflow.net/questions/147388/derivative-of-the-dominant-eigenvalue), I am interested in an efficient computational solution rather than an analytical one.



Gradients of the Dominant Eigenvalue and Eigenvector
See (68) [here](http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3274/pdf/imm3274.pdf): if $\lambda$ is a simple eigenvalue, $Av=\lambda v$ and $v$ is normalized to be orthogonal,
$$
\frac{\partial v}{\partial A\_{jk}} = (\lambda I - A)^+ E^{jk} v,
$$
where $E^{jk}$ is the matrix with $1$ in position $jk$ and $0$ everywhere else. That plus symbol is a Moore-Penrose pseudoinverse.


The formula is easy to compute explicitly because it only requires the eigenvector itself and the pseudoinverse. Moreover, If the eigenvector is simple then you know that $\lambda I-A$ has rank $n-1$, so you don't have a (potentially difficult) rank decision to make.


Also, [related answer](https://mathoverflow.net/a/98786/1898) with a technique that can produce those formulas.


