Skip to main content
Sandbox Physics

FR13-A · Electrons determine their own field

Build a Self-Consistent Hydrogen Molecule

How can an electron density agree with the field it creates? Start with a trial density, calculate its mean field, and solve for new orbitals. Repeat until the density changes negligibly and agrees with the field. This finds a self-consistent Hartree–Fock state; its energy still depends on the allowed orbitals.

Pull the two nuclei apart and follow the density as a Hartree–Fock calculation settles. Replay its actual iterations and see how the total energy and self-consistency residual change.

Interactive modelBuild a Self-Consistent Hydrogen Molecule
Total RHF energy−1.12-1.12
Self-consistency residual (hartree)5.94×10−105.94\times10^{-10}
Iteration3131
Electron number22

Calculated in your browser · STO-3G

One density, one self-consistency test

Total energyResidual

Current AO density matrix

P=(0.6030.6030.6030.603)P=\begin{pmatrix}0.603&0.603\\0.603&0.603\end{pmatrix}

A changing density changes the Fock operator. The residual measures whether the two agree.

Units, density and calculation detailsTr⁡(PS)=2\operatorname{Tr}(PS)=2

All total energies include nuclear repulsion. FCI solves the same finite Hamiltonian as HF. The saved calculation includes its geometry, method, density matrices and numerical diagnostics.

The logarithmic plot displays residuals below the following level at that floor; the numerical readout retains the calculated value. 10−1510^{-15}

Learn how the calculation works, from orbitals to a broken bond

Physics tutorial

Build a Self-Consistent Hydrogen Molecule

BackgroundIn Hartree–Fock theory, electrons move in a mean field built from the occupied orbitals. Changing an orbital changes that field, so a single diagonalization is usually only the beginning.

Why it mattersWatching the actual density and residual explains what a converged calculation has achieved.

Start with the essentials

Focus question
How can an electron density agree with the field it creates?
One-sentence intuition
Self-consistency means the occupied orbitals agree with the mean field generated by their own density.

Core mathematical model

Solve in a nonorthogonal atomic basis

FC=SCε,Pμν=2∑i∈occCμiCνiFC=SC\varepsilon,\qquad P_{\mu\nu}=2\sum_{i\in\mathrm{occ}}C_{\mu i}C_{\nu i}

The overlap matrix accounts for atomic orbitals that overlap in space. Two electrons occupy each restricted spatial orbital.

Check whether density and field agree

r=12∥FPS−SPF∥F,N=Tr⁡(PS)=2r=\tfrac12\lVert FPS-SPF\rVert_{\mathrm F},\qquad N=\operatorname{Tr}(PS)=2

The residual is the root-mean-square matrix commutator for this two-orbital basis. It vanishes at self-consistency. The overlap-weighted trace counts electrons.

Common difficulties

Convergence and accuracy

Typical misconceptionA tiny residual means the molecular energy is exact.

Better mental modelThe residual checks self-consistency inside the chosen Hartree–Fock model. Missing configurations and basis functions still limit the answer.

Run the experiment

  1. 01

    Predict before stretching

    Choose Near the energy minimum, then Correlation grows. Say what you expect the density and the energy difference to do before changing the preset.

    What to observe: The molecular density separates into two lobes, and the restricted description loses accuracy as the bond stretches.
  2. 02

    Replay a numerical decision

    Press Replay iterations, then move the iteration slider. Compare an uneven initial guess with a nearly symmetric guess.

    What to observe: Different guesses take different paths. The converged restricted density agrees when the same solution is reached.
  3. 03

    Save a reproducible comparison

    Use Save calculation at two separations. Compare the saved basis, geometry, density matrices and total energies.

    What to observe: Every record identifies the finite electronic model. Comparing it with a larger basis tests a separate source of error.

Related experiments and articles

Molecular electrons and breaking bonds · Reading path

Orbitals, self-consistency, correlation and dissociation

Articles on this path that use this experiment, followed by the other experiments they suggest.

  1. ArticleChoosing an orbital for one hydrogen electron
  2. ArticleTurning a molecule into a small matrix problem
  3. ArticleMaking the density and its field agree
FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy