# Variational Quantum Eigensolver (VQE) - Question about finding the imaginary part of measurement

I've been reading this article in order to understand how to implement a VQE on a quantum computer.

Equation 38 involves the imaginary part of $$\langle\psi_0 |V_k^{j\dagger}(t)O_iU(t)|\psi_0\rangle$$ and they show the circuit (figure 3) for finding it. I don't understand how this circuit works and why it finds the imaginary part.

I would appreciate if someone could explain each part of the circuit or forward me to a source which explains this.

Also, why is the measurement of the ancilla qubit happening in the Y basis and why is the $$R_x(\pi/2)$$ gate making sure that the measurement is in the Y basis?

On the last part of your question: the operation $$R_x (\pi /2)$$ can be visualized on the Bloch sphere by a quarter clockwise turn around the x-axis. How does this help? If you start with Y-basis vectors (one pointing to the right and the other pointing to the left on the Bloch sphere) above operation transforms them to the Z-axis basis vectors (one pointing up and the other pointing down). So then the standard (Z-basis) measurement is able to distinguish the original Y-basis vectors.