# How expensive are Hartree Fock calculations?

Hartree Fock is a very simple mean field approach for finding the ground state energies of - for example - molecules. But how expensive is it from a computational view? So after calculating all one - and two-particle integrals, which is $O(n^4)$, how expensive is it to do HF then? How large molecules could one in general do with that?

• There are lot of graphs about that scaling time, look at the gaussian manual, there is an example for hydrocarbons. – santimirandarp Apr 21 '18 at 17:46
• If I'm understanding right, you asking about the complexity after solving for the integrals which while formally is O(N^4) can usually be done O(N^3) or even O(N^2) in practice. Once you have evaluated the integrals, the only other step to the algorithm is to iteratively form the Fock Matrix and diagonalize so solve for the new coefficients. Matrix diagonalization is O(N^3) so with the integrals solved, this is the most expensive part. – Tyberius Apr 21 '18 at 18:55
• @santimirandarp Where exactly is this located? I can't find it. – pentavalentcarbon Apr 22 '18 at 20:30

In any case, as you say, its formal cost is $n^4$ ($n=$ number of basis functions): the number of two-electron integrals is $n^4$, and all these integral are necessary to build the Fock matrix, so the overall cost is also $n^4$. However, this is not the end of the story; as a system grows larger and larger in spatial extension many of the required integrals become vanishingly small and can be neglected, and other approximations become possible, at the cost of introducing a small and adjustable error. As long as the error introduced is (much) smaller than the intrinsic error of the Hartree-Fock method, it doesn't really matter. Some keyword often used in this context are 'linear-scaling' and 'density-fitted' methods.
In this study the largest calculation they report on is for alpha-cyclodextrin, a polysaccharide with formula $\ce{C36H60O30}$ (126 atoms, 516 electrons); using the aug-cc-pVDZ basis set (2058 basis functions) the authors report that a density-fitted Hartree-Fock calculation took about 4 minutes on a beefy workstation with 20 cores (two Intel Xeon E5-2690 @ 2.8 GHz).