A non-linear quantum state transformation is presented. The transformation,
which operates on pairs of spin-1/2, can be used to distinguish optimally
between two non-orthogonal states. Similar transformations applied locally on
each component of an entangled pair of spin-1/2 can be used to transform a
mixed nonlocal state into a quasi-pure maximally entangled singlet state. In
both cases the transformation makes use of the basic building block of the
quantum computer, namely the quantum-XOR gate.Comment: 12 pages, LaTeX, amssym, epsfig (2 figures included