Solution (source code)

= Solution

Write the unknown pure <photon polarization> <qubit> as
$$
|\psi\rangle=\alpha|H\rangle+\beta|V\rangle,\qquad |\alpha|^2+|\beta|^2=1.
$$
The <polarizing beam splitter> sends the $H$ component down the lower path and the $V$ component up the upper path. After rotating the upper <photon polarization> to $H$, both paths have the same internal <quantum state> and can interfere at BS2. Absorb fixed apparatus phases into a calibrated zero for the tunable <quantum phase>. With the preceding reflection convention, the <quantum state> before BS2 is $(\alpha|\ell\rangle+i\beta e^{i\theta}|u\rangle)|H\rangle$, so the two output amplitudes are
$$
a_1=\frac{i}{\sqrt2}(\alpha+\beta e^{i\theta}),\qquad a_0=\frac1{\sqrt2}(\alpha-\beta e^{i\theta}).
$$
Consequently
$$
\boxed{P_1(\theta)=\frac12+\operatorname{Re}(\gamma e^{i\theta}),\qquad \gamma=\alpha^*\beta,\qquad P_0=1-P_1.}
$$
Repeated counts while scanning $\theta$ determine the complex <quantum coherence> $\gamma$. The <interference visibility> is $2|\gamma|$, and the fringe position determines the relative <quantum phase> $\arg\beta-\arg\alpha$ whenever both components are nonzero.

A fringe alone is not enough to determine an arbitrary <photon polarization> <quantum state>: it fixes $|\alpha\beta|$ but not which of $|\alpha|^2$ and $|\beta|^2$ is larger. Indeed, $|H\rangle$ and $|V\rangle$ both give the flat fringe $P_1=1/2$. For a general <pure quantum state>, the two possible population differences are
$$
|\alpha|^2-|\beta|^2=\pm\sqrt{1-4|\gamma|^2}.
$$
Resolve this ambiguity by temporarily detecting the two paths before BS2. Their relative counts give $h=|\alpha|^2$ and $1-h=|\beta|^2$ using the same <polarizing beam splitter> and detectors. Taking $\alpha=\sqrt h$ as a global-phase choice, the reconstructed <quantum state> for $h>0$ is
$$
\boxed{|\psi\rangle=\sqrt h\,|H\rangle+\frac{\gamma}{\sqrt h}|V\rangle.}
$$
If $h=0$, it is $|V\rangle$ up to a <global phase>. This completes <interferometric polarization tomography>. The counts are obtained from many identically prepared <photons>; they do not identify an arbitrary <quantum state> from one <photon>.