  The Algebraic Bethe Ansatz (ABA) is a highly successful analytical method
used to exactly solve several physical models in both statistical mechanics and
condensed-matter physics. Here we bring the ABA into unitary form, for its
direct implementation on a quantum computer. This is achieved by distilling the
non-unitary $R$ matrices that make up the ABA into unitaries using the QR
decomposition. Our algorithm is deterministic and works for both real and
complex roots of the Bethe equations. We illustrate our method on the
spin-$\frac{1}{2}$ XX and XXZ models. We show that using this approach one can
efficiently prepare eigenstates of the XX model on a quantum computer with
quantum resources that match previous state-of-the-art approaches. We run
small-scale error-mitigated implementations on the IBM quantum computers,
including the preparation of the ground state for the XX and XXZ models on $4$
sites. Finally, we derive a new form of the Yang-Baxter equation using unitary
matrices, and also verify it on a quantum computer.
