  The problem of an optimal mapping between Hilbert spaces $IN$ of
$\left|\psi\right\rangle$ and $OUT$ of $\left|\phi\right\rangle$ based on a set
of wavefunction measurements (within a phase) $\psi_l \to \phi_l$, $l=1\dots
M$, is formulated as an optimization problem maximizing the total fidelity
$\sum_{l=1}^{M} \omega^{(l)}
\left|\langle\phi_l|\mathcal{U}|\psi_l\rangle\right|^2$ subject to probability
preservation constraints on $\mathcal{U}$ (partial unitarity). Constructed
operator $\mathcal{U}$ can be considered as a $IN$ to $OUT$ quantum channel; it
is a partially unitary rectangular matrix of the dimension $\dim(OUT) \times
\dim(IN)$ transforming operators as $A^{OUT}=\mathcal{U} A^{IN}
\mathcal{U}^{\dagger}$. An iteration algorithm finding the global maximum of
this optimization problem is developed and it's application to a number of
problems is demonstrated. A software product implementing the algorithm is
available from the authors.
