Environment-assisted two-state pure-state transformation (source code)

= Environment-assisted two-state pure-state transformation

There are a unitary $U$ and normalized environment states $|e_i\rangle$ satisfying
$$
U|\phi_i\rangle|0\rangle=|\psi_i\rangle|e_i\rangle,
\qquad i=0,1,
$$
exactly when
$$
|\langle\phi_0|\phi_1\rangle|
\leq|\langle\psi_0|\psi_1\rangle|.
$$
Necessity follows from preservation of inner products. For sufficiency, choose $\langle e_0|e_1\rangle$ to make the input and output inner products equal; equal two-vector Gram matrices define an isometry that extends to a unitary.