where I is the identity matrix and γ is a xed parameter set to 0.1 by default. is improves the convergence to the desired spin state, but also separates degenerate states with di erent spins, a situation that can potentially occurs with Rydberg states. In the Davidson algorithm, this requires the additional computation of S 2 U, for which the cost is expected to be the same as the cost of H U (see Algorithm 2). e cost of computing H U and S 2 U is mostly due to the search of the connected pairs of determinants, namely the determinants I| and |J for which I| Ĥ|J and I| Ŝ2 |J are not zero due to Slater-Condon's rules. We have modi ed the function computing H U so that it also computes S 2 U at the same time.