Deriving all allowed term symbols for a given electron configuration

Let’s assume, we are interested in deriving all allowed term symbols for any electron configuration. Normally, this involves drawing a lot of arrows and coping with possible combinations. The following description is rather terse. Throughout the following text, all electrons in the last unoccupied shell share the same quantum number n:

1. Build all combinations of electron spin and angular momentum quantum number and discard all of them that disagree with Pauli’s principle, so all electrons’ state differ in at least one quantum number. (The boring part.)
2. Calculate the total spin and angular momentum for each of the combinations by summing over the electron’s quantum numbers. (The tedious task.)
3. Fill a table with all relevant values for the total spin (columns) and the total angular momentum (rows) by counting the combinations from step 1 that yielded the specific values from the table headers as calculated in step 2. (The least interesting part.)
4. Search for term symbols within the table. (Hey – that’s funny.)

As you may have noticed, I rather dislike the first three steps. This makes me being less attentive, thus introducing some errors. Therefore, I dislike these steps even more. However, a small python script solves my problem:

All you have to do is to adjust the two ‘configuration’ lines. l takes the quantum number l for the only partial filled orbital and e holds the number of electrons within this orbital. Please keep in mind, that no error checking is performed. Some sample output for nitrogen with the electron configuration 1s2 2s2 2p3 (l=1, e=3):

Of course, U and D are symbols for spin up and spin down. For the sake of completeness, I add the description how to get the term symbols from the last table. First, there is a state spanning from -2 to 2 for M_l and from -0.5 to 0.5 for M_s. Thus, L=2 and S=1/2. With J=|L-S|…|L+S|={3/2, 5/2}, we get [latex]^2D_{3/2}[/latex] and [latex]^2D_{5/2}[/latex]. After removing these states from the table, we get a new one:

Again, we find S=1/2. This time, M_l has the range -1 to 1, so L=1. With J={1/2, 3/2}, we get [latex]^2P_{1/2}[/latex] and [latex]^2P_{3/2}[/latex]. The new table looks like

Only one term symbol is left. One tip: it’s [latex]^4S_{3/2}[/latex] – the ground state of nitrogen.