HorneSci

Incremental Fock builds in quantum chemistry

How a Hartree–Fock solver can reuse the previous Fock matrix, where that reuse breaks down, and how to compare it with a full build.

A NASA Ames simulation shows charge concentration and depletion around a latanoprost molecule

One molecule, many calculations

A flexible molecule can settle into many shapes. A conformer search changes the coordinates, evaluates the new geometry, and uses the resulting forces to pick the next move. The NASA Ames visualization shows latanoprost this way: the CREST workflow computes energy, charge density and atomic forces along the trajectory, and the colors mark where charge is concentrated or depleted as the molecule changes shape.

Inside each of those evaluations, many electronic structure calculations run a second loop. A Hartree–Fock solver starts from an estimate of the electron density, builds a Fock matrix from it, solves for new orbitals, and repeats until density and energy converge. Through that loop the nuclear coordinates and basis functions do not change. Almlöf, Faegri and Korsell described the direct form of this loop, which recomputes integrals on every iteration instead of storing them. Anything the iterations share is a candidate for reuse.

FixedGeometry · basis · H1Density P2Build G(ΔP)3Update F4Solve orbitalsRepeat until density and energy converge
Illustrative. One Hartree–Fock iteration. Geometry, basis and the one-electron term H stay fixed through the loop; the incremental build changes only how the G step is computed.

Build from the change in density

For a fixed basis and geometry, write the Fock matrix as F(P) = H + G(P). P is the density matrix, H is the fixed one-electron term, and G is the linear map that combines the Coulomb and exchange contributions. Because G is linear, G(P + ΔP) = G(P) + G(ΔP), so F(P + ΔP) = F(P) + G(ΔP). In exact arithmetic that is the matrix a full rebuild gives. Häser and Ahlrichs described this incremental form for direct SCF.

The saving depends on how ΔP looks. Suppose that late in a calculation the density changes mostly among a few pairs of basis functions. Contributions built from small changes fall below a chosen threshold and can be screened out, so the solver builds only the rest. The Q-Chem manual describes the same pattern: the number of integrals that need recomputing falls as the calculation converges, and incremental builds apply only to direct SCF. Psi4 documents density-based screening and an incremental Fock build option, INCFOCK, for some integral algorithms, and leaves it off by default. PySCF documents direct SCF with a cutoff threshold and uses direct SCF by default.

Each Fock matrix is now a running sum of increments, so screening and rounding errors can accumulate across iterations and change the path to convergence. Check the final solution against a full build.

ΔPG(ΔP)GChanged densityBuiltScreened outF(P + ΔP) = F(P) + G(ΔP)
Illustrative. A toy density change ΔP with two nonzero blocks, and the Fock increment G(ΔP) built only where contributions pass the threshold. Which cells are built depends on the integrals and the chosen tolerance.

What changes when the atoms move

Between two geometries in a conformer search, the atom-centered basis functions move. The one-electron term and the two-electron integrals move with them, so a density update alone cannot reconstruct the new Fock matrix. A previous density or set of orbitals can still seed a nearby calculation if the code can transfer it into the new basis. Measure that as a separate source of reuse.

HIntegralsFockDensitySame geometry, next iterationReusedReusedReused + G(ΔP)ΔPNew geometryRebuiltRebuiltRebuiltGuess only
Illustrative. At a fixed geometry the iteration reuses H and the integrals and adds a density change. After the atoms move, those terms are rebuilt and only a transferred guess carries over.

Run the comparison at a fixed geometry

Start with the same molecule, basis, initial guess, convergence criteria and integral algorithm. Run the ordinary solver, then run it with incremental builds enabled. Record time in Coulomb and exchange construction, total time to convergence, and iteration count. Check the total energy and the final density, and compare forces if the workflow uses them. Repeat on easy and difficult geometries. A per-iteration gain counts only if the calculation still converges to the intended solution and the whole job finishes sooner.

Sources