Solution (source code)

= Solution

For two <nonorthogonal vectors>[nonorthogonal] input states $|\alpha\rangle,|\beta\rangle$, preservation of <inner products> by $G$ gives
$$
\langle\alpha|\beta\rangle
=\langle\alpha|\beta\rangle
\langle\widetilde P_U(\alpha)|\widetilde P_U(\beta)\rangle.
$$
Hence the two output-program states agree up to <quantum phase>[phase]. Any two <quantum state>[qubit states] can be joined through a state <nonorthogonal vectors>[nonorthogonal] to both, so after absorbing phases
$|\widetilde P_U\rangle$ is independent of the input.