Use of dimer potentials to calculate the energy levels of alkali atoms in rare‐gas matrices