electromagnetism and electron configuration