I am trying to understand an algorithm for computing the overlap between two single qubit states, $\left |\psi\right>$ and $\left |\phi\right>$: $$ \left| \left< \psi | \phi \right> \right|^2. $$ The overlap is given by the expectation value of the SWAP operator, but a more efficient method is presented in Learning the quantum algorithm for state overlap. The circuit for the "Bell-Basis algorithm (BBA)" (see Fig 6A in the aforementioned paper) is:
The text (bottom left on page 7) says:
Figure 6(A) shows the BBA for one-qubit states ρ and σ. This circuit employs one CNOT gate followed by one Hadamard gate, with both qubits being measured. It is straightforward to show that this corresponds to a Bell basis measurement. The post-processing is a bit more complicated, with c = (1, 1, 1, −1), which corresponds to summing the probabilities for the 00, 01, and 10 outcomes and subtracting probability of the 11 outcome. The above post-processing is equivalent to measuring the expectation value of a controlled-Z operator
Note:
- by "post-processing" they mean the overlap between $\left |\psi\right>$ and $\left |\phi\right> = \sum_i c_i \,p_i$, where the $p_i$ are probabilities (Eqn 6 in the paper)
- the probabilities are obtained by running the circuit many times, with the same input states.
Can someone please explain how this works?
AFAIK, the expectation value of an operator $A$ on some state $\left |\psi\right>$ is: $$ \left<A\right>_\psi = \left<\psi | A | \psi \right> = \sum_i \lambda_i \left<\psi | \omega_i \right> \left< \omega_i | \psi \right> $$ where the $\lambda_i, \omega_i$ are the eigenvalues and eigenvectors of $A$. The controlled-Z operator has eigenvalues (1, 1, 1, -1) and eigenvectors 00, 01, 10, 11, so I can almost understand how the algorithm works (i.e. the eigenvalues match the $c = (1,1,1,-1)$ in the text quoted above), but I don't understand:
- how the probabilities $p_i$ relate to the terms $\left<\psi | \omega_i \right> \left< \omega_i | \psi \right>$ i.e. how does the measurement in Z relate to $\left| \left< \psi | \omega_i \right> \right|^2$
- how it works when applied to two different input states$\left |\psi\right>$ and $\left |\phi\right>$ (the above has the same state $\left.|\psi\right>$ on both sides), which is the value of interest ($\left| \left< \psi | \phi \right> \right|^2$).