Let us a consider a $N$ qubit quantum system and an obervable $O$. In general one would be interested in computing something like $\langle O \rangle$ using a quantum computer. In a problem I am interested in, however, for the given Hermitian operator $O$ and a family of unitaries $\{ U_a \}_{a \in \mathbb{N}}$ I am interested in computing stuff like
$$ \langle 0 | U^\dagger_a O U_b | 0 \rangle \equiv \langle a | O | b \rangle. $$
This, I believe would be in general called a matrix element (please correct if me if wrong). Now, I am curious to as to how one goes to compute such a complex number on a circuit model.
I do think that we need to implement the followong:
• First we need some ancilla qubit. We start with one ancilla qubit in the state $|0\rangle$. Apply $H$ to this ancilla so it enters the superposition.
• Then we prepare the $N$‑qubit system register in the state $|b\rangle$ (i.e., the “input” state).
• Now controlled‑$U$ operation. I can use the ancilla to control $U$ on the system: If the ancilla is in $|1\rangle$, $U$ is applied on the system and if it’s in $|0\rangle$, nothing happens so that the joint state becomes
$(1/\sqrt{2})[|0\rangle \otimes |b\rangle + |1\rangle \otimes U|b\rangle]$.
• Then we need a basis rotation on the system. We apply an additional unitary transformation $U_a^\dagger$ on the system register that “rotates” the target state $|a\rangle$ into a standard basis state (so we map $|a\rangle \to |0…0\rangle$). That is, after this operation, the overlap $\langle a|…\rangle$ is translated into an amplitude for measuring $|0\ldots 0\rangle$ in the system.
• System measurement (postselection). Finally, we measure the system register in the computational basis, and postselect on the outcome corresponding to the rotated state (for example, $|0\ldots 0\rangle$ ). Postselection isolates the components of the system that are aligned with $|a\rangle$, so that the amplitudes associated with $|0\ldots 0\rangle$ now encode $\langle a|b\rangle$ and $\langle a|U|b \rangle$ from the two branches.
• We now apply a second $H$ gate on the ancilla. This one interferes the two ancilla branches: one branch where the system stayed at $|b\rangle$ and one where it evolved to $U|b\rangle$. The interference converts the relative phase and amplitude difference (i.e. the difference between $\langle a|b \rangle$ and $\langle a|U|b\rangle$) into a measurable difference in the ancilla’s state.
• Final measurement and data extraction is the last step then where we measure the ancilla in the computational basis to construct empirical statistics and average the results to accurately extract the desired matrix element.
To be honest I am not 100% sure this makes sense (even if the name "matrix element makes sense here) so I would appreciate some help.
