6

In HHL algorithm, for subroutine involving controlled rotation, after applying $R_y(\theta)$, where $\theta=2\sin^{-1}\left(\frac{C}{\lambda}\right)$ to the ancilla, the state changes to $\sqrt{1-\frac{C^2}{\lambda^2}}|0\rangle+\frac{C}{\lambda}|1\rangle.$

Question

If $\lambda=1$, then by $\sqrt{1-\frac{C^2}{\lambda^2}}|0\rangle+\frac{C}{\lambda}|1\rangle$ and choosing $C=1$, we get $\theta=\pi$. For $\lambda=2$, $\theta=\frac{\pi}{3}.$ So in general, for each $\lambda$, correspondingly there's a different $\theta$. Since we don't know eigenvalues a priori, how do we account $\theta $s for superpositon of eigenvalues?

With respect to the circuit here on page 5, I don't understand how the controlled rotation part works. Will this circuit work when I choose a hermitian matrix $A_{4\times 4}$ such that, one of it's eigenvalues, $\lambda_j=10\neq 2^i,i \in \mathbb{Z}$ ?

Omkar
  • 341
  • 2
  • 9

2 Answers2

5

You don't know the eigenvalues a priori, but you have performed phase estimation, and have (at least a good approximation to) your eigenvalues recorded on a register. If you control off that register, you can use it to decide the angle of the rotation for each eigenvector.

DaftWullie
  • 63,351
  • 4
  • 57
  • 142
1

The question of how the eigenvalue inversion subroutine is implemented in general is not solved yet in a satisfactory way, to my knowledge. I myself spent quite some time looking for the classical algorithm implemented in classical computers to try to make it reversible, but even that was lost time. What I am aware of is that Qiskit has its own implementation (although I don't know how general it is), and that there are some papers that propose/implement approximations of the inversion function. For instance, this paper implements an approximation of the eigenvalue inversion subroutine (the code in Quil can be found in the associated GitLab repository) that is exact in the case of eigenvalues that are powers of 2. The reason why it is exact for powers of 2 is because in that case the inversion can be written as a combination of bit swaps, so the eigenvalue inversion subroutine is a collection of controlled SWAP gates (a pictorial representation of the circuit is in Fig. 3 in this paper). It is however very unlikely that this algorithm can be improved further without a huge increase in qubit count, since the next step of the iteration (Fig. 4 in the last paper cited) has an output very nonlinear in the input.

Alex
  • 573
  • 4
  • 7