Eqs. ( ) and ( ) are not affected anymore by singularities, and they do not require any conditions but the existence of A 1 . Moreover, the need of calculation of first-and second-order cofactors of Z is not a big computational issue, because of the generally small dimension of this matrix with respect to the dimension of S. Defining det(C) = 1 when rank(C) = 0, note that if rank(C) = 2 only one second-order cofactor for Z exists, and it is 1, while K i jkl term disappears when rank(C) < 2. Finally, eqs. (60) and (61) reduce to just the T terms when rank(C) = 0, as expected. Some more simplifications can be done when making explicit the spin partitioning of S, and by the use of the Cholesky representation of the electron repulsion integrals, see Supporting Information (SI).