# Circuit that measures PVM

How can I construct a circuit that measures PVM $$\{|\psi\rangle\langle\psi|\},|\psi^\perp\rangle\langle\psi^\perp| \}$$ where $$|\psi\rangle=\cos\frac{\theta}{2}+e^{i\phi}\sin\frac{\theta}{2}|1\rangle$$ by using only computational basis measurement and Pauli-axis rotation.

Recall that

$$R_Y(\theta) = \begin{pmatrix} \cos\frac{\theta}{2} &-\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} &\cos\frac{\theta}{2} \end{pmatrix} \\ R_Z(\phi) = \begin{pmatrix} e^{-\frac{i\phi}{2}} & 0 \\ 0 & e^{\frac{i\phi}{2}} \end{pmatrix}.$$

Define

$$U(\theta, \phi) = R_Z(\phi) R_Y(\theta) \equiv\begin{pmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ e^{i\phi}\sin\frac{\theta}{2} & e^{i\phi}\cos\frac{\theta}{2} \end{pmatrix}$$

where $$\equiv$$ denotes equivalence up to unobservable global phase. We see that $$U|0\rangle = |\psi\rangle$$ and $$U|1\rangle = |\psi^\perp\rangle$$. Therefore

$$|\psi\rangle\langle\psi| = U|0\rangle\langle 0|U^\dagger \\ |\psi^\perp\rangle\langle\psi^\perp| = U|1\rangle\langle 1|U^\dagger.$$

We conclude that to reproduce output statistics of the PVM $$\{|\psi\rangle\langle\psi|\},|\psi^\perp\rangle\langle\psi^\perp| \}$$ we should apply $$U^\dagger$$ followed by a measurement in the computational basis. If we also want to obtain the appropriate post-measurement state we then need to apply $$U$$.