Wed 31 July 2019
| tags: blog Hartree-Fock
In the following we will look at how to do Hartree-Fock calculations more efficiently by means
of integral direct algorithms, in which the 4 index integrals are recalculated when needed and not saved on disk.
This sounds odd since these integrals don't change, but one hand the disk I/O slows down the
HF calculation and on the other hand even for relatively small systems like benzene
in a def2-QZVPP basis we end up with terabytes of required storage. Integral direct
implementation remove reduce the I/O bottleneck and are better scalable.
In a conventional algorithm the AO integrals \((\mu\nu|\kappa\lambda)\) are calculated once and then read in during
each SCF iterations. Although these integrals don't change during the SCF procedure, this kind of algorithm might
not be optimal since the constant I/O as well as the integral storage can be a bottleneck.[1]
However, in HF/KS-DFT calculations we actually don't need these integrals. We just need to contract them with the density matrix
to obtain the Fock matrix. The storage requirements for the Fock matrix are \(N^2\) instead of \(N^4\) for the 4 index AO integrals.
Therefore, we defintely can expect savings if we avoid the storage of the AO integrals.
Thus, in direct SCF methods these integrals are re-calculated in each SCF iteration.[1-2]
This requires an efficient pre-screening. We should avoid to calculate small integrals let's say \(10^{-10}\) .
With means of simple mathematical relations there is a tool to achieve this. We recall that the two-electron integrals
\begin{equation}
g_{abcd} = \int \int \frac{\Omega_{ab}(1)\Omega_{cd}(2)}{r_{12}} d\pmb{r}_2 d\pmb{r}_2
\end{equation}
are elements of a positive definite matrix with diagonal elements \(g_{abab}\ge 0\) . Thus the conditions for an inner product are satisfied
and we can use the Cauchy-Schwartz inequality
\begin{equation}
\|g_{abcd}\| \le \sqrt{g_{abab}}\sqrt{g_{cdcd} } = Q_{ab} Q_{cd}
\end{equation}
to get an strict upper bound to the integral! Additionally in case of direct SCF we can exploit that
the density matrix is available prior to the integral evaluation and we can use this information for additional screening.
The screening is performed on the level of shells. This reduces memory requirements and ensures rotational invariance.
\begin{equation}
D_{MN} = \max_{\mu \in M, \nu \in N} | D_{\mu\nu} | \quad\quad Q_{MN} = \max_{\mu \in M, \nu \in N} | Q_{\mu\nu} |
\end{equation}
The integral \((\mu\nu|\kappa\lambda)\) is only needed to be evaluated if
\begin{equation}
Q_{MN} Q_{KL} D_{\max} \ge \tau
\end{equation}
where
\begin{equation}
D_{\max} = \max\{4|D_{MN}| ,4 |D_{KL}|, |D_{NL}|, |D_{NK}|, |D_{ML}|, |D_{MK}| \} \quad.
\end{equation}
Furthermore we can use an incremental Fock-build and then use the difference in the density matrix between iterations for screening:
\begin{equation}
\Delta D_{\mu\nu}^{(i)} = D_{\mu\nu}^{(i)} - D_{\mu\nu}^{(i-1)}
\end{equation}
In this way in each iteration more and more integrals are screened away and the SCF iterations become faster and faster.
For the evaluation of the Fock-matrix (RHF) let's recall that
\begin{equation}
F_{\mu\nu} = h_{\mu\nu} + \sum_{\kappa\lambda} D_{\kappa\lambda} \left[ 2 (\mu\nu|\kappa\lambda) - (\mu\kappa|\nu\lambda) \right]
\end{equation}
Exploiting permutational symmetry the contributions to the Fock-matrix can be written as
\begin{align*}
F_{\mu\nu} & = F_{\mu\nu} + 4 D_{\kappa\lambda} (\mu\nu|\kappa\lambda) \\
F_{\kappa\lambda} & = F_{\kappa\lambda} + 4 D_{\mu\nu} (\mu\nu|\kappa\lambda)
\end{align*}
for the Coulomb contributions and
\begin{align*}
F_{\mu\kappa} & = F_{\mu\kappa} - D_{\nu\lambda} (\mu\nu|\kappa\lambda) \\
F_{\mu\lambda} & = F_{\mu\lambda} - D_{\nu\kappa} (\mu\nu|\kappa\lambda) \\
F_{\nu\kappa} & = F_{\nu\kappa} - D_{\mu\lambda} (\mu\nu|\kappa\lambda) \\
F_{\nu\lambda} & = F_{\nu\lambda} - D_{\mu\kappa} (\mu\nu|\kappa\lambda)
\end{align*}
for the Exchange contributions. Thus, if we calculate a shell quadruple we can calculates its
contributions to the Fock matrix according to the given recipe. This completely removes the
necessity to store the integrals on disk. Note that same programs provide semi integral direct
algorithms, in which the most time consuming integrals are stored and read in, in each SCF iteration.
References
J. Almlöf, K. Faegri Jr., and K. Korsell. Principles for a Direct SCF Approach to LICAO-MO ab-initio Calculations. Journal of Computational Chemistry, 385–399, 1982.
M. Häser and R. Ahlrichs. Improvements on the Direct SCF Method. Journalof Computational Chemistry, 104–111, 1989.