Theoretical study of the electronic spectrum of magnesium-porphyrin