  Scanning probe microscopy and spectroscopy, and more recently in combination
with electron spin resonance, have allowed the direct observation of electron
dynamics on the single-atom limit. The interpretation of data is strongly
depending on model Hamiltonians. However, fitting effective spin Hamiltonians
to experimental data lacks the ability to explore a vast number of potential
systems of interest. By using plane-wave density functional theory (DFT) as
starting point, we build a multiplet Hamiltonian making use of
maximally-localized Wannier functions. The Hamiltonian contains spin-orbit and
electron-electron interactions needed to obtain the relevant spin dynamics. The
resulting reduced Hamiltonian is solved by exact diagonalization. We compare
three prototypical cases of 3d transition metals Mn (total spin $S=5/2$), Fe
($S=2$) and Co ($S=3/2$) on MgO with experimental data and find that our
calculations can accurately predict the spin orientation and anisotropy of the
magnetic adatom. Our method does not rely on experimental input and permits us
to explore and predict the fundamental magnetic properties of adatoms on
surfaces.

Mesoscale and Nanoscale Physics