= Solution
Use basis order $000,001,010,011,100,101,110,111$, with the ancilla first, and put $x=e^{i\phi_1}$, $y=e^{i\phi_2}$. Initially the ancilla is at the north pole of the <Bloch sphere>. The other two <qubits> lie on its equator at azimuths $\phi_1,\phi_2$, with <Bloch vectors> $(\cos\phi_j,\sin\phi_j,0)$.
The four dotted cuts, in left-to-right order, have the explicit normalized vectors
$$
\boxed{v_0=\frac12(1,y,x,xy,0,0,0,0)^{\mathsf T},}
$$
$$
\boxed{v_1=\frac1{2\sqrt2}(1,y,x,xy,1,y,x,xy)^{\mathsf T},}
$$
$$
\boxed{v_2=\frac1{2\sqrt2}(1,y,x,xy,1,x,y,xy)^{\mathsf T},}
$$
$$
\boxed{v_3=\frac14(2,x+y,x+y,2xy,0,y-x,x-y,0)^{\mathsf T}.}
$$
The first <Hadamard gate> copies the lower-register amplitudes into two control branches; the <Fredkin gate> exchanges them only in the second branch; the final <Hadamard gate> adds and subtracts these branches.
Summing the squared magnitudes of the first four entries of $v_3$ gives
$$
P_0=\frac{8+2|x+y|^2}{16}=\frac34+\frac14\cos(\phi_1-\phi_2).
$$
Meanwhile $\langle\phi_2|\phi_1\rangle=(1+e^{i(\phi_1-\phi_2)})/2$, so
$$
\boxed{P_0=\frac{1+|\langle\phi_2|\phi_1\rangle|^2}{2}.}
$$
Identical input <qubits> give $P_0=1$; orthogonal equatorial inputs give $P_0=1/2$. The factor one half is an ancilla-interference effect, not a direct <projective measurement> of the lower <qubits> individually.
Back to article page