I was looking at the code required for a simple RHF computation when I came across the section for the diagonalisation of the Fock Matrix.
Based on what I know, the diagonal matrix $\mathbf{s}$ is evaluated as
$$\mathbf{s} = \mathbf{U}^\dagger\mathbf{S}\mathbf{U},$$ where $\mathbf{S}$ is the overlap matrix.
The matrix $\mathbf{X}$ is then evaluated as
$$\mathbf{X} = \mathbf{U}\mathbf{s}^{-1/2}\mathbf{U}^\dagger$$
and the diagonalised Fock operator $\mathbf{F'}$ as
$$\mathbf{F'} = \mathbf{X}^\dagger\mathbf{F}\mathbf{X}.$$
But what happens if the matrix $\mathbf{s}$ has terms that are negative? What happens then? Do we simply take the magnitude and carry on?
Thanks!