  The Einstein-de Haas (EdH) effect, where the spin angular momentum of
electrons is transferred to the mechanical angular momentum of atoms, was
established experimentally in 1915. While a semi-classical explanation of the
effect exists, modern electronic structure methods have not yet been applied to
modelling the phenomenon. In this paper we investigate its microscopic origins
by means of a non-collinear tight-binding model of an $\textrm{O}_2$ dimer,
which includes the effects of spin-orbit coupling, coupling to an external
magnetic field, and vector Stoner exchange. By varying an external magnetic
field in the presence of spin-orbit coupling, a torque can be generated on the
dimer, validating the presence of the EdH effect. Avoided energy level
crossings and the rate of change of magnetic field determine the evolution of
the spin. We find also that the torque exerted on the nuclei by the electrons
in a time-varying $B$ field is not only due to the EdH effect. Other
contributions arise from field-induced changes in the electronic orbital
angular momentum and from the direct action of the Faraday electric field
associated with the time-varying magnetic field.
