  Trajectory-based methods that propagate classical nuclei on multiple quantum
electronic states are often used to simulate nonadiabatic processes in the
condensed phase. A long-standing problem of these methods is their lack of
detailed balance, meaning that they do not conserve the equilibrium
distribution. In this article, we investigate ideas for how to restore detailed
balance in mixed quantum--classical systems by tailoring the previously
proposed spin-mapping approach to thermal equilibrium. We find that adapting
the spin magnitude can recover the correct long-time populations but is
insufficient to conserve the full equilibrium distribution. The latter can
however be achieved by a more flexible mapping of the spin onto an ellipsoid,
which is constructed to fulfill detailed balance for arbitrary potentials. This
ellipsoid approach solves the problem of negative populations that has plagued
previous mapping approaches and can therefore be applied also to strongly
asymmetric and anharmonic systems. Because it conserves the thermal
distribution, the method can also exploit efficient sampling schemes used in
standard molecular dynamics, which drastically reduces the number of
trajectories needed for convergence. The dynamics does however still have
mean-field character, as is observed most clearly by evaluating reaction rates
in the golden-rule limit. This implies that although the ellipsoid mapping
provides a rigorous framework, further work is required to find an accurate
classical-trajectory approximation that captures more properties of the true
quantum dynamics.
