Energy calculations and level populations