Quantum spectral filtering (source code)

= Quantum spectral filtering
{title2=$h(A)$}

Let a <Hermitian operator> $A$ have dyadic <eigenvalues> $\lambda_j=c_j/2^t$ in $[0,1)$ for known $t$, with controlled access to the <unitary operator> $U=e^{2\pi iA}$. This interval ensures that different <eigenvalues> have different <eigenphases>; exact representability alone would not exclude phase aliasing, as $0$ and $1$ both give phase zero. Let a real <function> $h$ obey $|h(\lambda_j)|\leq1$, and assume the required <quantum variable rotations> are available. Coherent <exact quantum phase estimation>, a <quantum variable rotation> and <uncomputation> implement
$$
|u_j\rangle|0\rangle\longmapsto|u_j\rangle\left(\sqrt{1-h(\lambda_j)^2}|0\rangle+h(\lambda_j)|1\rangle\right).
$$
<Postselection> on flag one gives $h(A)|b\rangle$ normalized, with <probability> $\|h(A)|b\rangle\|^2$, provided this vector is nonzero. Erasing the <eigenvalue> label by <uncomputation> is essential to preserve coherence between different <eigenvectors>. On this dyadic spectrum, $U^{2^t}=I$ gives $U^{-1}=U^{2^t-1}$, so reversing the phase-estimation gates is possible using forward controlled-$U$ calls. The choice $h(\lambda)=\lambda$ multiplies by $A$; a scaled reciprocal gives the different filter used in the <HHL algorithm>.