Solution (source code)

= Solution

With the incoming basis $\mathcal I_\pm$ and outgoing basis $\mathcal O_\pm$ as printed, expand any scattering solution as $\psi\sim a_+\mathcal I_++a_-\mathcal I_-+b_+\mathcal O_++b_-\mathcal O_-$. Linearity defines
$$
\boxed{\begin{pmatrix}b_+\\b_-\end{pmatrix}=S^P(k)\begin{pmatrix}a_+\\a_-\end{pmatrix}.}
$$
The column indexed by a channel records outgoing amplitudes for a unit incoming wave in that channel. The extra minus sign in $\mathcal O_-$ is a channel phase convention; it affects the sign of the free odd-channel amplitude but not flux probabilities. For a real potential and no absorbing or additional channels, probability-current conservation makes the flux-normalized matrix unitary.