# When diagonalising the overlap matrix, what happens if the square root of the diagonal matrix does not exist?

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!

• The overlap matrix is positive definite (en.wikipedia.org/wiki/Definiteness_of_a_matrix). This means all its eigenvalues, the elements of the diagonal matrix you give above, are positive. Thus what you describe can not happen in real arithmetic, though there may be issues on computers where you are using floating point. When I have more time I'll write a proper answer Aug 1 '19 at 15:23
• The proof can be found here Aug 2 '19 at 8:07
• @JanJensen FYI the .dk books.google link appears not to work outside Denmark Aug 2 '19 at 19:00
• @MichaelBanck ah, ok. The book is "Simple Theorems, Proofs, and Derivations in Quantum Chemistry" by Istvan Mayer and the proof appears on page 63 Aug 7 '19 at 10:10
• It works in .uk Aug 15 '19 at 10:39

The matrix $$\mathbf{s}$$ in your question are the eigenvalues of the overlap matrix $$\mathbf{S}$$, further the matrix $$\mathbf{U}$$ are a matrix of the eigenvector of the overlap matrix. Now looking at the equation that gives you concern:
$$\mathbf{X} = \mathbf{U}\mathbf{s}^{-1/2}\mathbf{U}^\dagger$$
Since $$\mathbf{s}$$ is a diagonal matrix then taking the power of $$\mathbf{s}$$ is just taking the power of every element:
$$\mathbf{s}^{-1/2}=\begin{bmatrix}s_1&0&...&0\\0&s_2&...&...\\...&...&...&0\\0&...&0&s_n\end{bmatrix}^{-1/2}=\begin{bmatrix}s_1^{-1/2}&0&...&0\\0&s_2^{-1/2}&...&...\\...&...&...&0\\0&...&0&s_n^{-1/2}\end{bmatrix}$$
The only way as you noted this can cause trouble is if any of the elements of $$\mathbf{s}$$ are negative. Now here we have to remember that $$\mathbf{s}$$ are the eigenvalues of the overlap matrix, it is therefore guareenteed that all of the elements will be equal to or greater than zero! For the proof of this see my answer to one of your other questions, Basis sets - negative contraction coefficients?