Quantum Chemistry

Hartree-Fock SCF — exercises

Recognize a problem as a fixed-point iteration — an operator that depends on its own eigenvector — and solve by iterative refinement: linearize with a guess, solve, use the result to rebuild the operator, iterate. Diagnose convergence, oscillation, and the use of damping or DIIS-style acceleration.

1 worked example · 7 practice problems · 2 check problems

Worked example: scalar fixed-point iteration

Problem. The SCF iteration in Hartree-Fock has the structure "Fock matrix depends on density, density depends on Fock-matrix eigenvectors." That coupled structure is the matrix version of a scalar fixed-point problem. To build intuition for what convergence looks like, solve the scalar fixed-point starting from . Run 5 iterations by hand. Identify the fixed point analytically.

Diagnosis. A fixed point of is any satisfying . Fixed-point iteration converges to when and you start close enough. The HF SCF loop is exactly this — with replaced by a Fock matrix, replaced by "build new Fock matrix from the current one's eigenvectors."

Predict before reading on: solve algebraically before iterating. Square both sides; you get a quadratic. The positive root is the fixed point.

Analytical fixed point. , so (taking the positive root, since the iteration involves a positive square root).

Iteration trace.

kcomputationerror
00.000(initial)2.0
11.4140.59
21.8480.15
31.9620.038
41.9900.0096
51.9980.0024

Convergence rate. Each iteration reduces the error by a factor of roughly 4 — the iteration is linearly convergent with rate . This matches the formal theory: linear-rate fixed-point iteration converges as .

Predict before reading on: how does the rate compare to the worst-case rate of gradient descent? What does it look like when ?

If , the iteration diverges away from the fixed point even if you start arbitrarily close. The HF SCF can do this — oscillate or blow up — which is what motivates damping (linear extrapolation of the new density with the old) and DIIS (Direct Inversion in Iterative Subspace, which uses a history of past iterates).

Verification.

import numpy as np

x = 0.0
for k in range(6):
    print(f"iter {k}: x = {x:.6f}")
    x = np.sqrt(2 + x)
# Converges to x = 2.0

Articulate: state in one sentence the structural analogy between scalar fixed-point iteration and Hartree-Fock SCF.


Practice problems

Seven problems. The unifying move is the same — iterate until self-consistent — across very different surface contexts. Some are abstract (scalar fixed points, power iteration); some are physical (SCF, mean-field Ising); the last is a transfer to a non-quantum-chemistry self-consistency.

P.1 scalar fixed-point convergence analysis

Consider the fixed-point iteration , starting from .

(a) Identify the fixed point analytically.

(b) Compute the rate and predict the convergence behavior.

(c) Run 3 iterations and verify your prediction.

Find the analogue: same iteration structure as the worked example, different . Compute and use the linear-rate formula. Then verify against actual iterations.

show answer

(a) Fixed point: .

(b) . At : . Quadratic convergence — the iteration is Newton's method for , and the rate is even better than linear: error squares each step.

(c) . Each error squares: . Quadratic ✓

This is the Babylonian (or Heron's) method for computing square roots, in use for ~4000 years. It's just Newton's method on , and the property is what makes Newton converge quadratically.

P.2 cosine fixed-point (Dottie number)

Iterate starting from any . What does it converge to? Why is this called the "Dottie number" and what does it look like graphically?

Find the analogue: same fixed-point iteration, different . Solve graphically (intersection of and ) and characterize the convergence rate.

show answer

Converges to — the Dottie number, the unique real solution of .

It's called the Dottie number because the iteration converges from any starting point — try it on your calculator: hit cos repeatedly. Whatever you started with (in radians), you end up at 0.7391.

Graphically: the curve intersects the line exactly once, at . The slope of cosine there is , so and the iteration converges linearly. The negative sign means it oscillates around the fixed point as it converges — successive iterates alternate above and below.

No closed form exists for the Dottie number — it's transcendental. Like many fixed points, you can only compute it by iterating.

P.3 power iteration for dominant eigenvector

Run power iteration on the matrix starting from . Normalize after each step. Where does it converge? Compute the Rayleigh quotient at convergence to find the dominant eigenvalue.

Find the analogue: power iteration is fixed-point iteration on the normalized matrix-vector product map: . The fixed point is the dominant eigenvector. The SCF iteration is power iteration on the Fock-matrix-density loop, with extra structure.

show answer
import numpy as np
A = np.diag([3.0, 1.0, -2.0])
v = np.array([1.0, 1.0, 1.0])
for _ in range(20):
    v = A @ v
    v = v / np.linalg.norm(v)
print(v)                        # ≈ (1, 0, 0)
print(v @ A @ v)                # ≈ 3.0

Converges to , the eigenvector of the largest-magnitude eigenvalue 3.

Key subtlety: the eigenvalue has larger magnitude than 1 but smaller than 3. Power iteration finds the largest-magnitude eigenvalue, not the largest signed one. Successive iterates alternate sign if the dominant eigenvalue is negative.

Convergence rate: where is the dominant eigenvalue and the next-largest in magnitude. Here , so error shrinks by 2/3 per step — slow. If the spectrum were , convergence would be much faster.

The HF SCF inherits this same slow-when-eigenvalues-cluster behavior. When orbital energies are nearly degenerate near the HOMO/LUMO gap, vanilla SCF converges slowly or oscillates — which is what motivates DIIS and level shifting.

P.4 oscillation and damping

Consider the iteration , starting from .

(a) What's the fixed point?

(b) Run 5 iterations. What happens?

(c) Apply linear damping: with . Run 5 iterations and observe.

Find the analogue: damping (a.k.a. linear mixing) is the standard fix for SCF oscillation: instead of taking the full new density, take a weighted average of the old and new. Same trick applied here to a scalar diverging iteration.

show answer

(a) .

(b) , so — the iteration diverges. Trace: . Alternating sign, growing magnitude.

(c) Damped iteration: . Effective , magnitude < 1, so now the iteration converges. Fixed point unchanged at .

Trace: . Converges nicely to 1/3.

The general formula: if the bare iteration has effective derivative with , the damped iteration with mixing has effective derivative . Choose small enough to push this into , then make it as large as possible for fastest convergence.

In SCF practice, is a typical safe value for difficult systems. DIIS does this adaptively, using past iterates to project out the slowly-converging direction altogether.

P.5 mean-field Ising self-consistency

The mean-field Ising model has self-consistent magnetization where is the dimensionless coupling.

(a) At , iterate from . What does it converge to?

(b) At , iterate from . What does it converge to?

(c) The transition happens at (the mean-field ). Show this by examining the slope of at .

Find the analogue: same fixed-point iteration as the worked example, but the function depends on a physical parameter . The qualitative behavior changes at a critical value — exactly the same way HFB pairing has a critical below which is the only fixed point.

show answer

(a) : iterate from . Converges to . Non-trivial fixed point — the system is in the symmetry-broken (ferromagnetic) phase.

(b) : converges to . Disordered (paramagnetic) phase.

(c) . At : . The trivial fixed point is stable iff , i.e., . At the stability transitions: above this threshold, the trivial fixed point becomes unstable and a non-trivial fixed point emerges. This is a bifurcation, the fixed-point version of a phase transition.

The HFB gap equation has the same structure (P.1 of the HFB exercise set derived ). Both phase transitions are special cases of "loss of stability of the trivial fixed point" — fixed-point iteration with an external parameter, crossing the rate threshold at the critical value.

P.6 SCF convergence diagnostics

Below are dE-per-iteration logs from two SCF runs:

Run A:
  iter 0    E = -2.7116    dE = -2.71e+00
  iter 1    E = -2.8151    dE = -1.04e-01
  iter 2    E = -2.8162    dE = -1.10e-03
  iter 3    E = -2.81625   dE = -1.48e-05
  iter 4    E = -2.81625   dE = -2.22e-07
  iter 5    E = -2.81625   dE = -3.39e-09

Run B:
  iter 0    E = -3.2       dE = -3.2e+00
  iter 1    E = -3.1       dE = +0.1e+00
  iter 2    E = -3.3       dE = -0.2e+00
  iter 3    E = -3.1       dE = +0.2e+00
  iter 4    E = -3.3       dE = -0.2e+00

(a) Which run is converging, and at what rate? Estimate the linear convergence factor .

(b) What's happening in Run B? Propose two interventions.

Find the analogue: Run A's pattern matches the worked example's: linear convergence, error shrinking by a constant factor per iteration. Run B's alternating-sign pattern is the same diagnostic as P.4: with a negative , producing the divergent oscillation.

show answer

(a) Run A is converging. Linear rate from successive ratios:

Roughly . Each iteration reduces the energy error by ~80x — fast linear convergence, consistent with a well-conditioned SCF (large HOMO-LUMO gap).

(b) Run B is oscillating. The energy alternates between -3.1 and -3.3 — the iteration has crossed into territory, like the worked-example divergence but stuck in a 2-cycle rather than blowing up. Likely cause: small HOMO-LUMO gap or near-degeneracy at the Fermi level.

Interventions: (i) Linear damping: replace the new density with (or similar). Costs per iteration, easy to implement, sometimes works on its own. (ii) Level shifting: add a large positive shift to the unoccupied-orbital block of the Fock matrix to artificially open the HOMO-LUMO gap. After convergence, the orbitals are unchanged but the gap is now controlled by the user. (iii) DIIS (Pulay's Direct Inversion of the Iterative Subspace): build a history of error vectors and find the linear combination that minimizes their norm. Standard tool in production quantum-chemistry codes.

P.7 cross-domain self-consistency (Wien's displacement law)

Wien's displacement law states that the wavelength at which a blackbody's spectrum peaks satisfies for some constant . Deriving reduces to solving the transcendental equation .

(a) Show that this is equivalent to the fixed-point equation .

(b) Iterate from and find to 4 decimal places.

(c) Why is this a fixed-point iteration, and what does it have to do with HF SCF?

Find the analogue: transcendental equations from physics frequently reduce to fixed-point iterations. Wien's constant, Kepler's equation, the Saha equation in stellar atmospheres — all the same pattern as HF SCF, with the operator being scalar or low-dimensional rather than matrix-valued.

show answer

(a) . ✓

(b) Iterate from : . Converges to .

From this, Wien's constant: m·K. Matches the tabulated value.

(c) It's a fixed-point iteration because with has , so and iteration converges. The connection to HF SCF: both are problems of the form "find such that " where represents some self-referential physical law. In SCF, is "build new Fock matrix from current density." In Wien's law, is "where does the derivative of vanish?" Same algorithm, same convergence analysis, vastly different domains.

The pattern is so common that the term "self-consistent" appears in: SCF (Hartree-Fock), DFT (Kohn-Sham), GW (many-body perturbation theory), CCSD (coupled-cluster, technically not fixed-point but iterative), Vlasov-Poisson (plasma physics), mean-field neural-network theory, fixed-point combinators in functional programming. The shared mathematical structure is the Banach fixed-point theorem and its variants.


Check problems

Check 1 derivation

Prove the local convergence theorem for fixed-point iteration:

If is continuously differentiable and is a fixed point with , then there is a neighborhood of such that the iteration starting from any point in that neighborhood converges to , with linear rate .

Specifically:

(a) Use the mean value theorem to derive for some .

(b) Use continuity of to argue that as .

(c) Conclude the rate result.

show solution sketch

(a) By the mean value theorem applied to on the interval between and :

for some between and .

But and (fixed-point property), so

(b) Pick a neighborhood small enough that for all , where is some number with . This is possible because is continuous and .

If , then (it's between and ), so .

Therefore: .

(c) By induction, , which goes to 0 as since .

Moreover, for all , and by continuity this ratio approaches as . So the asymptotic rate is exactly . ∎

This proof generalizes to multi-dimensional fixed-point iterations on with the Jacobian replacing and "all eigenvalues of inside the unit disk" replacing . This is what governs HF SCF convergence: the SCF iteration is locally a multidimensional fixed-point iteration on the density matrix, and its convergence rate is set by the largest-magnitude eigenvalue of the corresponding Jacobian — which depends on the orbital structure (HOMO-LUMO gap especially).

Check 2 articulation

In 150-250 words, articulate the relationship between three quantities in Hartree-Fock SCF:

  • The energy difference between consecutive iterations, .
  • The density-matrix change between iterations, .
  • The HOMO-LUMO gap of the converged solution.

Explain why "small " is not a sufficient convergence criterion in practice, why density-based criteria are more reliable, and how the gap controls the asymptotic convergence rate. Connect your explanation to the fixed-point theory from C1.

show solution sketch

SCF energy is variational in the density matrix: has a local minimum at the converged density , so there. Near convergence, is second-order in — the energy can be tiny while the density is still substantially off. This is a real problem: hartree might correspond to , which still produces wrong orbital coefficients for downstream uses (gradients, transition densities, embedding). Production codes always check both: and .

The HOMO-LUMO gap controls the asymptotic rate. The SCF iteration is, near convergence, a linear fixed-point iteration on the density: where is the SCF Jacobian. The eigenvalues of depend on inverse orbital-energy differences: where indexes occupied orbitals and indexes virtuals. The smallest difference — the HOMO-LUMO gap — produces the largest-magnitude Jacobian eigenvalue and the slowest converging component. Systems with large gaps (closed-shell organic molecules) converge in 5-10 iterations; systems with small gaps (transition metals, near-degenerate states) need 50+ or fail to converge without DIIS.

This is exactly the C1 result applied to the matrix case. The convergence rate generalizes to "spectral radius of the SCF Jacobian," and the SCF Jacobian's spectrum is what links convergence behavior to the system's electronic structure.