Hartree–Fock Notebook
This notebook solves a genuine self-consistent-field problem without hiding the integral engine or the convergence tests. Two opposite-spin electrons occupy one spatial orbital expanded in normalized, one-centre -type Gaussian functions. Every overlap, kinetic, nuclear-attraction, and electron-repulsion integral is analytic. The only external dependency is NumPy.
For the published eight-function basis, the retained program obtains
after 16 undamped fixed-point iterations. The final density has electron count
and the generalized Fock residual is approximately . Yet the energy remains
above a high-precision Hartree–Fock-limit reference. Algebraic convergence of the self-consistency loop is therefore not the same claim as convergence of the one-electron basis.
Run the investigation. The program and retained results below support the stated experiment. Follow Running an Experiment for environment and output-directory guidance. The recorded evidence applies to its stated parameters and environment.
Canonical Scope
Section titled “Canonical Scope”Hartree–Fock Approximation owns the determinant variational derivation, direct and exchange operators, spin variants, occupied-projector formulation, stability questions, and general Roothaan–Hall equations. Hartree–Fock for Atoms owns the atomic specialization, radial equations, closed and open shells, atomic exchange, asymptotic behavior, and interpretation of atomic orbitals. Helium Atom owns the physical helium spectrum and precision hierarchy.
This page owns the reproducible computational experiment:
- construct all matrix elements from declared Gaussian exponents;
- solve a nonorthogonal generalized eigenproblem;
- build a closed-shell density and its Fock matrix;
- iterate them to self-consistency without an accelerator;
- expose a complete two-function matrix example;
- separate SCF, basis, and method errors;
- validate density, integral, eigenpair, and energy identities;
- compare with retained Hartree–Fock and correlated references;
- and state what an occupied orbital energy does and does not mean.
The implementation is intentionally small enough to audit line by line. It is not a production quantum-chemistry package, a general molecular integral engine, or a benchmark for advanced SCF accelerators.
Reproducibility Contract
Section titled “Reproducibility Contract”| Item | Notebook choice |
|---|---|
| system | neutral helium, nuclear charge , two electrons |
| Hamiltonian | nonrelativistic Coulomb Hamiltonian, infinite-mass point nucleus |
| state | closed-shell ground-state model |
| ansatz | one doubly occupied spatial orbital, restricted Hartree–Fock |
| representation | nested uncontracted one-centre normalized Gaussians |
| integrals | analytic overlap, kinetic, nuclear-attraction, and two-electron integrals |
| eigensolver | symmetric orthogonalization followed by a Hermitian eigensolve |
| SCF map | undamped density fixed-point iteration from a core-Hamiltonian guess |
| stopping rule | density RMS below and energy change below |
| arithmetic | IEEE 754 binary64 through NumPy |
| randomness | none |
| artifacts | Python program, two CSV files, two JSON files, SVG figure |
The code reports more digits than the physical model justifies so that deterministic reruns and algebraic identities can be tested. Those digits must not be mistaken for accuracy relative to exact helium.
Physical Model
Section titled “Physical Model”In Hartree atomic units,
The clamped-nucleus electronic Hamiltonian is
There is no nuclear-repulsion constant because this is a one-nucleus atom. The energy zero is a bare nucleus and two electrons at rest at infinite separation.
Restricted closed-shell state
Section titled “Restricted closed-shell state”The normalized spatial orbital is occupied by one -spin electron and one -spin electron. The determinant may be written
Equivalently, its spatial part is the symmetric product and its spin part is the singlet. The opposite-spin pair has no exchange integral between distinct spin-orbitals, but the closed-shell Fock expression still contains exchange bookkeeping. That bookkeeping cancels self-interaction and leaves one Coulomb field acting on either occupied electron.
For one normalized spatial orbital, define
where
Then
while the occupied canonical orbital satisfies
These equations already warn that the total energy is not twice the orbital energy.
Why helium is a useful SCF demonstrator
Section titled “Why helium is a useful SCF demonstrator”Helium is simple but not trivial:
- there is only one occupied spatial orbital, so spin and occupation bookkeeping stay transparent;
- electron repulsion makes the optimal orbital depend on its own density;
- a finite nonorthogonal basis produces a genuine generalized eigenproblem;
- the SCF loop is nonlinear even though each diagonalization is linear;
- an accurate Hartree–Fock limit and a much more accurate correlated energy are available for comparison;
- and the distinction between orbital relaxation and electron correlation is unusually clean.
Helium does not test multiple occupied orbitals, same-spin exchange between different orbitals, near-degeneracy, symmetry breaking, open shells, or multiple SCF stationary points. Those omissions matter when generalizing the lessons.
Finite One-Electron Basis
Section titled “Finite One-Electron Basis”The spatial orbital is expanded as
Each basis function is a normalized primitive Gaussian centred on the nucleus:
The exponent has dimensions when dimensions are restored. A large describes a tight function near the nucleus; a small exponent describes a diffuse function.
Published nested sequence
Section titled “Published nested sequence”The complete retained set is the even-tempered sequence
but functions are inserted in the order
This ordering starts with two valence-scale functions and then adds diffuse and successively tighter flexibility. Every -function space is contained in the next one, so an exactly minimized variational energy cannot increase with .
The ordering is pedagogical, not an optimized basis design. A production basis would normally use carefully optimized and often contracted functions, polarization functions for nonspherical environments, and diffuse functions selected for the target property.
Gaussian strengths and limitations
Section titled “Gaussian strengths and limitations”Products of Gaussians are analytically convenient. Even the four-index electron-repulsion integrals reduce here to a closed expression. A single Gaussian nevertheless has zero radial derivative at the nucleus:
The exact Coulombic orbital has a nuclear cusp. A linear combination of finitely many centred Gaussians therefore cannot satisfy the cusp condition exactly. Tight functions imitate the cusp over a finite region but do not change the analytic behavior at .
This is one reason a modest Gaussian expansion can give a good total energy while pointwise or contact properties converge more slowly.
Analytic Integral Engine
Section titled “Analytic Integral Engine”All basis functions share the same centre. Define
The notebook uses chemists’ two-electron notation
All functions are real.
Overlap
Section titled “Overlap”The overlap matrix is
Individual primitives are normalized, so , but different primitives are not orthogonal.
Kinetic energy
Section titled “Kinetic energy”For Gaussians at the same centre,
The matrix is symmetric, as required for a Hermitian one-electron operator.
Nuclear attraction
Section titled “Nuclear attraction”With a point nucleus at the common centre,
The core Hamiltonian matrix is
Electron repulsion
Section titled “Electron repulsion”The four-index integral is
The implementation constructs the full tensor because . It checks the permutation symmetries
A production integral engine would exploit these symmetries, screen small integrals, and avoid materializing a dense tensor when the system is large.
The Nonorthogonal Eigenproblem
Section titled “The Nonorthogonal Eigenproblem”Normalization of the molecular-orbital coefficient vector is metric normalization:
Stationarity of the finite-basis Hartree–Fock energy gives the Roothaan equation
Solving would be wrong unless . The primitive Gaussians here overlap strongly, so that mistake is numerically visible even in the two-function example.
Symmetric orthogonalization
Section titled “Symmetric orthogonalization”Diagonalize the positive-definite overlap matrix:
where is diagonal with positive eigenvalues. Define
Then
The generalized problem becomes the ordinary symmetric problem
and the original coefficients are recovered through
The code symmetrizes the transformed Fock matrix before diagonalization to remove tiny floating-point antisymmetric components.
Conditioning
Section titled “Conditioning”If two basis functions become nearly linearly dependent, the smallest overlap eigenvalue approaches zero and amplifies roundoff. The notebook records
For the final eight-function basis,
This is not severe in binary64 arithmetic, but it is large enough to make conditioning part of the evidence. The code refuses an overlap eigenvalue at or below instead of silently dividing by it.
Density and Fock Construction
Section titled “Density and Fock Construction”For one doubly occupied real spatial orbital, the closed-shell density matrix is
The factor of two is the occupation. With the integral ordering defined above, the Fock matrix is
The first term in brackets is Coulomb and the second is closed-shell exchange. Index permutations that look harmless on paper can change the exchange contraction in code; the explicit convention is therefore part of the reproducibility contract.
Total electronic energy
Section titled “Total electronic energy”Once and its self-consistent are known,
The factor prevents double counting the two-electron field already present in each orbital equation. In matrix notation for real symmetric matrices,
There is no separate nuclear-repulsion term for helium.
Metric density identities
Section titled “Metric density identities”The nonorthogonal-basis density must satisfy
and, for a rank-one closed-shell projector,
Checking would incorrectly assume an orthonormal basis. The metric-aware identity is the appropriate idempotency test.
At self-consistency, the occupied subspace is invariant under its own Fock operator. A useful atomic-orbital residual is
The notebook reports , the Frobenius norm. A small energy change alone does not guarantee a small orbital-gradient residual.
Self-Consistency Loop
Section titled “Self-Consistency Loop”The Fock matrix depends on the density, while the density is built from Fock eigenvectors:
A self-consistent density is a fixed point .
Initial guess
Section titled “Initial guess”The program begins by solving the core-Hamiltonian problem
The lowest vector supplies . This guess includes nuclear attraction and kinetic energy but no electron repulsion.
Iteration implemented
Section titled “Iteration implemented”For :
- Build .
- Solve .
- Occupy the lowest spatial orbital and construct .
- Rebuild for self-consistent energy and residual diagnostics.
- Stop only when both density and energy criteria pass.
The density criterion is
The energy criterion is
After convergence, the program performs one final Fock build and generalized eigensolve before reporting eigenpair diagnostics.
Why no damping or DIIS
Section titled “Why no damping or DIIS”The helium map converges smoothly from the core guess, so undamped fixed-point iteration exposes the raw nonlinear map. It is not a recommendation for general calculations. Larger systems can oscillate, converge slowly, or approach an unintended stationary point.
Density damping replaces the new density by
Pulay’s direct inversion in the iterative subspace uses a history of residuals to extrapolate a better Fock matrix or density. Level shifting, occupation control, augmented-Hessian methods, and trust-region approaches address other failure modes. An accelerator changes the solver path, not the Hartree–Fock stationary equations.
Minimal Two-Function Example
Section titled “Minimal Two-Function Example”The minimal demonstrator uses
This is not a standard named basis set. It is an auditable two-dimensional space chosen to make overlap, Fock construction, and self-consistency visible.
One-electron matrices
Section titled “One-electron matrices”The retained overlap matrix is
The kinetic and nuclear-attraction matrices are
and
Thus
Converged density and Fock matrices
Section titled “Converged density and Fock matrices”The occupied coefficient vector is
Its overall minus sign is arbitrary. Replacing by leaves the orbital ray, density, Fock matrix, and all observables unchanged.
The converged density is
and the Fock matrix built from it is
These values satisfy
with
Minimal energy ledger
Section titled “Minimal energy ledger”For the converged occupied orbital,
Therefore,
The last equality is a direct double-counting check. Using as the total energy would count the Coulomb interaction twice.
Convergence Results
Section titled “Convergence Results”Two independent convergence questions. (a) In the fixed eight-function basis, the density change and commutator residual decrease during undamped SCF iteration. (b) Fully converged energies in nested basis spaces approach a separate high-precision Hartree–Fock reference from above. A tiny SCF residual does not remove the finite-basis error.
Algebraic SCF history
Section titled “Algebraic SCF history”Selected rows from the eight-function run are:
| iteration | density RMS | commutator norm | |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 4 | |||
| 8 | |||
| 12 | |||
| 16 |
The displayed energy has reached its binary64 plateau before the density criterion passes. Energy changes at the last iterations fluctuate at the scale of a few units in the last printed digit. Continuing to demand smaller energy changes would measure floating-point noise rather than physical accuracy.
The final rebuild and eigensolve give
Nested-basis history
Section titled “Nested-basis history”Every row below is separately converged in the SCF sense.
| newly available exponent | ||||
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 |
The energy decreases monotonically because the spaces are nested and each SCF solution is the lowest closed-shell solution found in this simple problem. In a more complicated system, a numerical SCF sequence can switch between stationary solutions, break symmetry, or converge to a saddle. A monotone basis table should not be assumed without checking state identity and stability.
Final component ledger
Section titled “Final component ledger”For :
| component | value in |
|---|---|
| kinetic energy | |
| electron–nucleus energy | |
| electron–electron energy | |
| total electronic energy | |
| occupied orbital energy |
The component sum is
to floating-point precision.
Because the exponents were not variationally optimized as continuous parameters, the exact Coulomb virial identity need not hold in this fixed basis. The virial defect is
This is a useful diagnostic, but it is not an SCF stopping criterion.
Three Different Error Questions
Section titled “Three Different Error Questions”The phrase “the Hartree–Fock calculation converged” is incomplete. At least three limits must be separated.
SCF iteration error
Section titled “SCF iteration error”At fixed basis and fixed occupations, this asks whether
Density changes, commutator norms, orbital-gradient residuals, and energy changes diagnose this error. The final run has reduced it far below the basis error.
One-electron basis error
Section titled “One-electron basis error”This asks whether the finite orbital space is flexible enough within the Hartree–Fock model. Using the retained high-precision reference
the eight-function basis error is
This value is approximately times larger than the final generalized eigenpair residual when both are compared as raw numerical magnitudes in atomic units. Solver precision is not basis completeness.
Hartree–Fock model error
Section titled “Hartree–Fock model error”The nonrelativistic clamped-nucleus ground-state reference used here is
The Hartree–Fock correlation-energy magnitude for this Hamiltonian is
The finite-basis-to-exact gap is slightly larger:
Calling the entire finite-basis gap “correlation energy” would include the remaining orbital-basis error.
Relation to the effective-charge notebook
Section titled “Relation to the effective-charge notebook”The one-parameter exponential calculation gives
It is already a closed-shell single-determinant trial state. The present eight-Gaussian Hartree–Fock result lowers that energy by
That improvement comes from greater flexibility in the occupied orbital, not from electron correlation. Both states use one doubly occupied spatial orbital.
Orbital-Energy Interpretation
Section titled “Orbital-Energy Interpretation”The final occupied canonical energy is
It is the Lagrange multiplier associated with normalization of the occupied orbital and the eigenvalue of the self-consistent Fock operator in the finite basis. It is not the energy “owned” by one electron.
Why the total is not the orbital sum
Section titled “Why the total is not the orbital sum”For helium,
so summing over the two occupied spin-orbitals gives
The actual determinant energy is
Therefore,
The Coulomb contribution appears in both one-electron Fock eigenvalues and must be counted only once in the total energy.
Koopmans-style statement
Section titled “Koopmans-style statement”In a fixed-orbital Hartree–Fock picture, removing an electron from an occupied canonical orbital suggests
For this run the value is about . This is not a validated helium ionization energy:
- the cationic orbital is not allowed to relax;
- the basis is incomplete;
- correlation differs between neutral helium and He;
- finite nuclear mass, relativistic, radiative, and nuclear effects are not included;
- and the program does not perform a matched-basis energy difference.
A proper SCF calculation would solve both charge states with declared models and compare total energies. An experimental ionization threshold requires still more corrections.
Orbitals are representation-dependent
Section titled “Orbitals are representation-dependent”Canonical orbitals diagonalize the occupied–occupied and virtual–virtual Fock blocks, but unitary rotations within an occupied subspace leave the determinant and density unchanged. Helium has only one occupied spatial orbital, so this particular freedom is only an overall phase. In larger systems, orbital shapes and individual orbital energies should not be treated as unique observables.
Validation Ledger
Section titled “Validation Ledger”The run is accepted only when all retained checks pass.
| Check | Identity or threshold | final result |
|---|---|---|
| overlap normalization | error | |
| electron count | error | |
| metric idempotency | norm | |
| ERI symmetry | required permutations agree | max error |
| Fock commutator | ||
| generalized eigenpair | ||
| energy identity | error | |
| orbital identity | error | |
| double counting | error | |
| basis ordering | largest change | |
| HF upper bound | passed | |
| exact upper bound | passed |
No one check substitutes for all the others. A transposed exchange contraction can preserve matrix symmetry while producing the wrong energy. A density can have the correct trace while failing idempotency. A converged generalized eigenpair can solve the wrong Fock matrix exactly.
What is not independently validated
Section titled “What is not independently validated”The notebook does not independently rederive the literature benchmark values. They are retained comparison data with source DOIs in the metadata. It also does not:
- compare each analytic integral against numerical quadrature;
- test displaced or higher-angular-momentum Gaussians;
- prove that no other SCF stationary point exists;
- perform a Hartree–Fock stability analysis;
- optimize the Gaussian exponents;
- or validate properties other than energies and algebraic invariants.
Those are meaningful extensions rather than hidden claims.
Numerical Failure Modes
Section titled “Numerical Failure Modes”Energy convergence without density convergence
Section titled “Energy convergence without density convergence”Near a stationary point, the energy can change quadratically while orbital or density errors change linearly. A tiny can therefore coexist with a material density residual. This run requires both criteria and records the commutator independently.
Density convergence to the wrong state
Section titled “Density convergence to the wrong state”SCF equations can have multiple stationary solutions. A small residual proves self-consistency, not global minimality or physical relevance. Occupation, symmetry, spin contamination, stability, and continuity along a parameter scan must be checked in larger calculations.
Linear dependence
Section titled “Linear dependence”Diffuse or redundant functions can make nearly singular. Blindly applying then magnifies noise. Inspect overlap eigenvalues, remove redundant directions according to a declared threshold, and verify that observables are stable to that threshold.
Incorrect exchange indices
Section titled “Incorrect exchange indices”The Coulomb and exchange contractions differ only by an index permutation:
An implementation should state its integral convention and test an energy identity that depends on exchange, not merely inspect plausible-looking matrix entries.
Reusing a stale Fock matrix
Section titled “Reusing a stale Fock matrix”If the energy is evaluated using but , the reported quantity is not the stationary energy functional of either density. The program rebuilds a self-Fock from every output density before computing the recorded energy.
Comparing unmatched Hamiltonians
Section titled “Comparing unmatched Hamiltonians”A finite-nuclear-mass energy, a relativistic energy, an experimental ionization threshold, and the clamped-nucleus nonrelativistic electronic energy are different quantities. More digits do not make them directly comparable.
Downloadable Program and Data
Section titled “Downloadable Program and Data”- Download the Python program
- Download the nested-basis convergence CSV
- Download the final SCF history CSV
- Download the two-function matrices JSON
- Download the run metadata JSON
Run the downloaded program from the folder where you saved it:
python hartree-fock-helium.py --output-dir resultsThe program requires Python with NumPy. It has no network access, random sampling, hidden input files, or platform-specific numerical data.
Artifact roles
Section titled “Artifact roles”| Artifact | Role |
|---|---|
| Python program | canonical executable implementation and validation logic |
| basis CSV | energies, components, residuals, conditioning, and benchmark gaps for |
| SCF CSV | iteration-by-iteration energy, density change, and commutator for |
| matrices JSON | complete auditable matrices and identities for |
| metadata JSON | model, tolerances, environment, reference provenance, and pass/fail ledger |
| SVG figure | visual comparison of algebraic and representation convergence |
The JSON matrix artifact is deliberately separate from prose-rounded values. Use it when checking matrix products numerically.
Reproducibility Metadata
Section titled “Reproducibility Metadata”The retained run records:
| Field | Recorded value |
|---|---|
| Python | 3.12.13 |
| NumPy | 2.3.5 |
| platform | Windows 11, x86-64 |
| floating-point type | NumPy float64 |
| density tolerance | |
| energy tolerance | |
| random seed | none |
| program license | MIT |
| Hartree–Fock reference DOI | 10.2477/jccjie.2024-0032 |
| exact nonrelativistic reference DOI | 10.1002/qua.10344 |
The four generated data files were reproduced twice with identical SHA-256 hashes in the retained environment. Deterministic equality on one platform is strong evidence about the workflow, but cross-platform BLAS or eigensolver differences can change the last few floating-point digits without changing the scientific conclusion.
Common Mistakes
Section titled “Common Mistakes”Calling an SCF tolerance an energy error bar
Section titled “Calling an SCF tolerance an energy error bar”The threshold controls termination of an iterative solver. It does not bound basis error, model error, or property error.
Solving an ordinary eigenproblem
Section titled “Solving an ordinary eigenproblem”Primitive Gaussian coefficients satisfy . Ignoring changes both normalization and the stationary equation.
Omitting the occupation factor
Section titled “Omitting the occupation factor”For one doubly occupied spatial orbital,
Dropping the factor of two gives the wrong electron count and Fock field.
Doubling orbital energies
Section titled “Doubling orbital energies”double counts the Coulomb interaction. The total energy requires the density-functional expression or the equivalent identity.
Calling all of the exact-energy gap correlation
Section titled “Calling all of the exact-energy gap correlation”Only the complete-basis Hartree–Fock-to-exact difference defines the usual Hartree–Fock correlation energy for a specified Hamiltonian. A finite-basis gap also contains basis error.
Assuming Gaussian coefficients are probabilities
Section titled “Assuming Gaussian coefficients are probabilities”The primitives are nonorthogonal. Individual values are not basis-independent occupation probabilities, and their sum need not be one. Normalization uses .
Interpreting the coefficient sign
Section titled “Interpreting the coefficient sign”The overall sign of an eigenvector is arbitrary. A sign flip of all occupied coefficients changes no density or observable.
Trusting monotone energy alone
Section titled “Trusting monotone energy alone”Monotone values can still come from incorrect integrals or a consistently wrong functional. Independent algebraic identities and benchmark comparisons remain necessary.
Treating a Gaussian benchmark as a production basis
Section titled “Treating a Gaussian benchmark as a production basis”The exponent list is an instructional nested sequence. It has no standard basis-set name, contraction error analysis, polarization hierarchy, or property-specific optimization.
Treating minus the orbital energy as an exact ionization energy
Section titled “Treating minus the orbital energy as an exact ionization energy”Koopmans’ relation freezes orbitals and remains inside Hartree–Fock. Relaxation, correlation, basis error, and physical corrections all matter for comparison with a measured threshold.
Extensions
Section titled “Extensions”Optimize Gaussian exponents
Section titled “Optimize Gaussian exponents”Treat the exponents as nonlinear variational parameters while preserving positivity and avoiding near-linear dependence. This should lower the finite-basis energy, but every optimization must rerun SCF to convergence. The outer and inner tolerances should be reported separately.
Numerical radial Hartree–Fock
Section titled “Numerical radial Hartree–Fock”Replace the Gaussian expansion by a radial grid, finite elements, B-splines, or a complete exponential-type basis. Compare energy, density, cusp behavior, and radial moments, not only the total energy.
Matched-basis delta SCF
Section titled “Matched-basis delta SCF”Solve He and He with compatible basis and Hamiltonian choices, then form
Compare this relaxed Hartree–Fock value with the frozen-orbital estimate .
More occupied orbitals
Section titled “More occupied orbitals”Be or Ne introduces multiple occupied spatial orbitals and makes same-spin exchange among distinct orbitals explicit. It also introduces more possibilities for slow convergence, occupation changes, and orbital rotations.
Molecular centres
Section titled “Molecular centres”Moving basis functions to more than one nucleus requires nuclear-repulsion energy and geometry conventions. For molecular Gaussian Hartree–Fock it also requires the Gaussian product theorem, Boys functions, and more general electron-repulsion integrals. Molecular Orbital Computation isolates the preceding LCAO bridge in a one-electron, two-centre Slater-basis problem, where overlap and nuclear repulsion are already unavoidable but self-consistency and electron-repulsion integrals are absent.
Post-Hartree–Fock correlation
Section titled “Post-Hartree–Fock correlation”Configuration interaction, many-body perturbation theory, coupled-cluster methods, and explicitly correlated approaches enlarge the many-electron trial space beyond one determinant. Basis convergence and correlation convergence remain separate questions there as well.
Exercises
Section titled “Exercises”Exercise 1: Normalize a primitive Gaussian
Section titled “Exercise 1: Normalize a primitive Gaussian”Show that
is normalized in three dimensions.
Solution
The squared norm is
Use the three-dimensional Gaussian integral
Then
Setting this equal to one gives
and taking the positive square root yields the stated normalization.
Exercise 2: Derive the overlap formula
Section titled “Exercise 2: Derive the overlap formula”Starting from two normalized same-centre primitives with exponents and , derive . Verify that .
Solution
The product is
With ,
For , and
Exercise 3: Prove symmetric orthogonalization
Section titled “Exercise 3: Prove symmetric orthogonalization”Let with orthogonal and positive diagonal . Show that obeys , and derive the transformed Fock equation.
Solution
Because and are symmetric,
Using the declared decomposition,
Write in
Premultiplying by gives
Thus the transformed problem is an ordinary symmetric eigenproblem.
Exercise 4: Check the metric density identities
Section titled “Exercise 4: Check the metric density identities”For and , prove
and
Solution
Use cyclicity of the trace:
For idempotency,
The factor of two reflects double occupation. For an orthonormal spin-orbital projector with unit occupations, the corresponding idempotency convention would differ.
Exercise 5: Audit the minimal coefficient vector
Section titled “Exercise 5: Audit the minimal coefficient vector”Using the rounded two-function values, estimate and explain why is not the normalization test.
Solution
With
and ,
By contrast,
The missing cross term is large because the basis functions overlap strongly. Coefficient squares can be interpreted as ordinary component weights only after transforming to an orthonormal basis, and even then those weights remain representation-dependent.
Exercise 6: Derive the double-counting identity
Section titled “Exercise 6: Derive the double-counting identity”For a two-electron closed shell, use
and
to express the total energy in terms of and . Evaluate the identity for the minimal demonstrator.
Solution
Twice the orbital energy is
Subtract one Coulomb integral:
Using the retained values,
where the last displayed digit differs from the full-precision stored result because the inputs were rounded in the page. The JSON artifact verifies the identity to approximately .
Exercise 7: Separate the error budget
Section titled “Exercise 7: Separate the error budget”Using
compute the finite-basis error, Hartree–Fock correlation-energy magnitude, and total finite-basis-to-exact gap. Check the additive relation.
Solution
The basis error is
The Hartree–Fock correlation-energy magnitude is
The total gap is
Indeed,
The calculation shows why the finite-basis-to-exact gap cannot be labeled pure correlation energy.
Exercise 8: Explain the Gaussian cusp failure
Section titled “Exercise 8: Explain the Gaussian cusp failure”Show that any finite linear combination
has . Contrast this with the electron–nucleus cusp condition for a Coulombic orbital.
Solution
Differentiate term by term:
Every term contains a factor of , so
For a Coulombic nucleus, the spherical-average electron–nucleus cusp condition has the form
for a one-electron orbital, with the corresponding many-electron statement applied to the wavefunction as one electron approaches the nucleus. For and , the exact derivative is nonzero. Therefore no finite same-centre Gaussian sum satisfies the cusp exactly.
Increasing the number of tight Gaussians can approximate the orbital and its energy well away from the exact pointwise cusp, but it does not change this analytic fact.
Exercise 9: Design a safer stopping rule
Section titled “Exercise 9: Design a safer stopping rule”Suppose an SCF run reaches while its commutator norm remains . Should it be accepted? Propose a stopping and diagnosis policy.
Solution
It should not be accepted as a self-consistent solution. Near a stationary point, an energy can be insensitive to an orbital displacement even when the orbital gradient remains significant. A commutator norm of is incompatible with a tightly converged occupied subspace.
A practical policy is to require all of:
The thresholds should be chosen relative to the desired observable accuracy and reported with the result. If energy appears converged but stalls:
- inspect occupations and overlap conditioning;
- verify that energy and residual use the same output density;
- try damping or DIIS while retaining the residual test;
- test a different initial guess;
- perform stability analysis where available;
- and distinguish solver failure from a basis or symmetry problem.
An accelerator can reduce the residual, but it cannot turn an incorrect Fock construction into the correct equations.
Key Takeaways
Section titled “Key Takeaways”- Hartree–Fock is nonlinear because the one-electron operator depends on the occupied density that solves it.
- A nonorthogonal basis requires , metric normalization, and metric-aware density identities.
- Fock eigenvalues contain two-electron fields; their occupied sum is not the total electronic energy.
- SCF residuals, basis convergence, and correlation error answer different questions.
- A flexible single orbital lowers the effective-charge result without adding electron correlation.
- Gaussian integrals can be exact while the Gaussian representation remains incomplete and cusp-deficient.
- Reproducibility requires matrices, iteration history, tolerances, reference provenance, and independent algebraic checks.
Cross-Links
Section titled “Cross-Links”- Computational AMO and Quantum Chemistry
- Computational Atomic Structure
- Variational Helium Notebook
- Molecular Orbital Computation
- Helium Atom
- Hartree Method
- Hartree–Fock for Atoms
- Exchange and Correlation
- Hartree–Fock Approximation
- Variational Principle
- Eigenvalues and Eigenvectors
- Atomic Units
- Notebook Index
References
Section titled “References”- C. C. J. Roothaan, “New Developments in Molecular Orbital Theory,” Reviews of Modern Physics 23, 69–89 (1951), doi:10.1103/RevModPhys.23.69.
- G. G. Hall, “The Molecular Orbital Theory of Chemical Valency. VIII. A Method of Calculating Ionization Potentials,” Proceedings of the Royal Society A 205, 541–552 (1951), doi:10.1098/rspa.1951.0048.
- S. F. Boys, “Electronic Wave Functions. I. A General Method of Calculation for the Stationary States of Any Molecular System,” Proceedings of the Royal Society A 200, 542–554 (1950), doi:10.1098/rspa.1950.0036.
- P. Pulay, “Convergence Acceleration of Iterative Sequences. The Case of SCF Iteration,” Chemical Physics Letters 73, 393–398 (1980), doi:10.1016/0009-2614(80)80396-4.
- Y. Hatano and S. Yamamoto, “Accuracy of Hartree–Fock Energies and Physical Properties Calculated Using Lambda Functions for Helium, Lithium, and Beryllium Atoms,” Journal of Computer Chemistry, Japan – International Edition 11, article 2024-0032 (2025), doi:10.2477/jccjie.2024-0032.
- J. S. Sims and S. A. Hagstrom, “High-Precision Hy–CI Variational Calculations for the Ground State of Neutral Helium and Helium-Like Ions,” International Journal of Quantum Chemistry 90, 1600–1609 (2002), doi:10.1002/qua.10344.
- T. Kato, “On the Eigenfunctions of Many-Particle Systems in Quantum Mechanics,” Communications on Pure and Applied Mathematics 10, 151–177 (1957), doi:10.1002/cpa.3160100201.
- P.-O. Löwdin, “Correlation Problem in Many-Electron Quantum Mechanics. I,” Advances in Chemical Physics 2, 207–322 (1959), doi:10.1002/9780470143599.ch2.
- A. Szabo and N. S. Ostlund, Modern Quantum Chemistry: Introduction to Advanced Electronic Structure Theory, Dover (1996).
- T. Helgaker, P. Jørgensen, and J. Olsen, Molecular Electronic-Structure Theory, Wiley (2000), doi:10.1002/9781119019572.
- C. Froese Fischer, T. Brage, and P. Jönsson, Computational Atomic Structure: An MCHF Approach, Institute of Physics Publishing (1997).
- W. R. Johnson, Atomic Structure Theory: Lectures on Atomic Physics, Springer (2007), doi:10.1007/978-3-540-68013-0.
Further Study
Section titled “Further Study”The Molecular Orbital Computation page moves the same overlap and generalized-eigenvalue discipline to two centres. Its one-electron H₂⁺ model introduces bonding and antibonding combinations, nuclear repulsion, and geometry dependence while preserving the distinction among solver, basis, and model convergence. A molecular Gaussian Hartree–Fock implementation is the subsequent step; that is where the Gaussian product theorem and multicentre electron-repulsion integrals enter.