  We present a method to determine the model Hamiltonians to treat rare-earth
multiplets in solids from the results of the quasiparticle self-consistent
\textit{GW} (QSGW) method. We apply the method to trivalent Eu compounds
EuCl$_3$, EuN, and Eu-doped GaN after examining free rare-earth ions. We solve
the model Hamiltonian by the exact diagonalization. Our results justify
applying the Dieke diagram to ions in solid, while its limitation is clarified.
In particular, we show that the crystal fields cause sizable breaking of the
Russell-Saunders coupling.
