= Solution
{c}
Read the source network as a <Hadamard test>: a <Hadamard gate> on the first <qubit>, a <controlled unitary gate> with the first <qubit> as control, and another <Hadamard gate> on that control. Starting from $|0\rangle|\phi\rangle$, the successive <quantum states> are
$$
\begin{aligned}
|\Psi_1\rangle&=\frac{|0\rangle+|1\rangle}{\sqrt2}|\phi\rangle,\\
|\Psi_2\rangle&=\frac{|0\rangle|\phi\rangle+|1\rangle U|\phi\rangle}{\sqrt2},\\
|\Psi_3\rangle&=\frac12\left[|0\rangle(I+U)|\phi\rangle+|1\rangle(I-U)|\phi\rangle\right].
\end{aligned}
$$
Apply <5/b> to the last line. Since $U^\dagger U=I$ by <unitarity>,
$$
\begin{aligned}
P_0&=\tfrac14\langle\phi|(I+U^\dagger)(I+U)|\phi\rangle
=\tfrac12\left[1+\operatorname{Re}\langle\phi|U|\phi\rangle\right],\\
P_1&=\tfrac14\langle\phi|(I-U^\dagger)(I-U)|\phi\rangle
=\tfrac12\left[1-\operatorname{Re}\langle\phi|U|\phi\rangle\right].
\end{aligned}
$$
For the <Pauli Z gate> observable on the first <qubit>, the two <eigenvalues> are $+1$ and $-1$. Thus
$$
\boxed{\langle Z\rangle=P_0-P_1=\operatorname{Re}\langle\phi|U|\phi\rangle.}
$$
As a check, $U=I$ returns outcome zero certainly, while $U=-I$ returns one certainly. The <controlled unitary gate> makes this relative <phase> measurable even though multiplying an isolated system's <quantum state> by $-1$ is only a <global phase>.
Back to article page