Theoretical Spectroscopy of Transition Metal and Rare Earth Ions