I have been trying to understand Variational Quantum Eigensolver (VQE), particularly from the non-linear binary programming perspective. But after reading a few resources I'm still confused about where exactly the algorithm promise a speed-up over classical one. The key steps where quantum properties provide advantages seem to be:
- Ansatz preparation $|\psi(\theta)\rangle = U(\theta)|\psi_0\rangle$, where classically this would involve applying matrices of size $2^N$.
- Computing the expectation $\langle \psi(\theta)|H|\psi(\theta)\rangle$.
Is this essentially correct?
I think I can accept step 1. but for step 2. how does quantum computer computes $\langle \psi(\theta)|H|\psi(\theta)\rangle$ quickly in practice?
I read from several places, e.g. Why exactly are variational algorithms considered promising? that this is done by making repeated measurements to find the approximated distribution of bitstrings in $|\psi(\theta)\rangle$, then compute the expectation value of $H$ classically. The important point seems to be that if $H$ is bounded by some $C$, then the number of samples required to estimate $\langle \psi(\theta)|H|\psi(\theta)\rangle$ to $\epsilon > 0$ precision seems to be $O(C^2/\epsilon^2)$, which grows polynomially with problem size if $C$ does (see e.g. 4.3.3 remark in https://qiskit.org/textbook/ch-applications/qaoa.html#:~:text=QAOA%20(Quantum%20Approximate%20Optimization%20Algorithm,(%20%CE%B2%20%2C%20%CE%B3%20)%20%E2%9F%A9%20). On the other hand, even to simulate the sampling process classically we need to store distribution $|\psi(\theta)\rangle$ which requires $2^N$ space and also another $2^N$ loop to simulate sampling process (dividing $[0,1]$ into $2^N$ subintervals and do a uniform distribution or something?).
But if we are only going to measure $|\psi(\theta)\rangle$ w.r.t. $Z$-basis then compute the expectation value of $H$ classically, then why many resources such as https://arxiv.org/pdf/2111.05176.pdf seems to suggest the importance of having $H$ in a form that is `directly measurable on quantum computer' (see page 7)? This apparently restricts $H$ to the form $H = \sum w_a P_a$ where $P_a \in \{I, X, Y, Z\}^{\otimes N}$, instead of $H$ being any bounded functions $\{0,1\}^N\rightarrow \mathbb{R}$ which should be allowed if we are just going to compute the expectation value classically.