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 = 2,8,1,12 \), then after the first step the final Slater determinant is \( 2,3,9,8 \). The second step will return \( 2,3,8,9 \) and a phase of -1, because an odd number of interchanges is required.