to let it dictate the next search direction. Instead, we leverage a window of the last $m$ residuals computed by the unrestarted CG to build an appropriately restarted subspace.

Consider the preconditioned CG algorithm in the left box of Figure \[fig:eigCG\]. We will exploit the equivalence of CG and Lanczos and the fact that the Lanczos vectors are the appropriately normalized CG residuals [@GolubVanLoan]. In the general case of an SPD preconditioner, $P\neq I$, the Lanczos method approximates eigenpairs of the symmetric matrix $\hat A = P^{-1/2}AP^{-1/2}$ from the Lanczos basis $P^{-1/2} R = P^{-1/2}[r_1/\rho_1,\ldots ,r_j/\rho_j]$, where $\rho_j = (r_j^Hz_j)^{1/2}$ and $z_j = P^{-1/2}r_j$. Let $\hat U = P^{-1/2}R Y$ and $\hat \Lambda$ be the Lanczos approximations to the eigenvectors and eigenvalues of $\hat A$, respectively. These are exactly the eigenpairs needed to deflate subsequent linear systems with $\hat A$ using (\[eq:initCG\]). The inconvenient $\hat U$ basis can be avoided because CG needs an initial guess $x_0 \approx x$ and not $\hat x_0 \approx P^{1/2}x$. Specifically, let $V = P^{-1}R = [z_1/\rho_1, \ldots ,z_j/\rho_j]$, let $\tilde x_0$ be some approximation to $x$, and $P^{1/2}\tilde x_0$ the corresponding initial guess for the split preconditioned system $\hat A$. If $\hat x_0$ is 