Solution (source code)

= Solution
{c}

The two output ports are orthogonal <single-photon states>. Conservation of total <probability> at a lossless <beam splitter> gives $2c^2=1$. With $c$ real and positive,
$$
\boxed{c=1/\sqrt2.}
$$
In the ordered input basis $(0,1')$ and output basis $(0',1)$, the <beam splitter scattering matrix> is
$$
S=\frac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}.
$$
For the usual reciprocal lossless <beam splitter>, reversing propagation uses $S^{-1}=S^\dagger=S$. Consequently,
$$
\boxed{|1\rangle\longmapsto\frac{|0\rangle-|1'\rangle}{\sqrt2},\qquad
|0'\rangle\longmapsto\frac{|0\rangle+|1'\rangle}{\sqrt2}.}
$$
The <relative phase> in the first rule is essential to the repeated-path calculation. Overall port phases may be changed consistently; they cannot be changed on one pass alone while retaining the original scattering rules. In the following, take unit mirror reflection amplitudes by incorporating fixed reflection phases into the propagation-mode convention, and keep any unremoved propagation phase explicitly if needed.