Building a Hamiltonian matrix

Example: Suppose in the \( sd \) single-particle space that the initial Slater determinant is \( 1,3,9,12 \). If \( p,q,r,s = 3,8,1,12 \), then after the first step the final Slater determinant is \( 3,3,9,8 \), but after the second step the phase is 0 because the single-particle state 3 is occupied twice.

Lastly, the final step takes the ordered final Slater determinant and we search through the basis list to determine its index in the many-body basis, that is, \( \beta \).