“Know how to solve every problem that has been solved.” “What I cannot create, I do not understand.” — Richard Feynman

Kohn-Sham Orbitals

Density Functional Theory

What you need to know first 9 concepts, 5 layers

The requisite-knowledge inventory for this page, bottom-up: the primitives at the base, combined upward until you reach what this page assumes. Skim the layers you already own; start wherever the ground gets unfamiliar.

  1. base
  2. L1
  3. L2
  4. L3
  5. L4
  6. you are here

1 of these are concepts without a dedicated page yet — the grey chips. Following the linked ones first makes the rest land.

Kohn-Sham orbitals are the solutions of a made-up problem: non-interacting electrons in a potential engineered so their density matches the real molecule's. They were introduced as computational scaffolding, with no promise of meaning anything — and then became the pictures chemists reach for first, and the coordinate system every excited-state calculation on this site is built in. Five ways to see what they are and how much to trust them.

read it as

The interacting many-electron problem is unsolvable, so Kohn-Sham DFT swaps it for one that isn't: electrons that ignore each other completely, moving in a single shared potential . The swap comes with one non-negotiable condition — is defined as whatever potential makes the non-interacting density equal the true interacting density, point by point.

The are the Kohn-Sham orbitals. Nothing in the construction says they are wavefunctions of anything physical — the fictitious electrons don't repel, so their determinant is not the molecule's wavefunction. The density is the only quantity the theory certifies. Everything else about the orbitals is a bonus we have to argue for case by case, which is exactly what the rest of this page does.

Two mean fields, one molecule

Water in 6-31G, solved twice: once with Hartree-Fock, once with Kohn-Sham PBE. Same 13 basis functions, same 10 electrons, two different one-electron ladders.

import numpy as np
from pyscf import gto, scf, dft

HA_EV = 27.211386

# Water, experimental-ish geometry (r = 0.9572 A, angle = 104.52 deg)
mol = gto.M(
    atom="""O  0.0000  0.0000  0.1173
            H  0.0000  0.7572 -0.4692
            H  0.0000 -0.7572 -0.4692""",
    basis="6-31g", verbose=0)

mf_hf = scf.RHF(mol).run()          # Hartree-Fock mean field
mf_ks = dft.RKS(mol)                # Kohn-Sham mean field...
mf_ks.xc = "PBE"                    # ...with the PBE functional
mf_ks.kernel()

nocc = mol.nelectron // 2
for i in range(nocc + 3):           # occupied ladder + first 3 virtuals
    print(f"MO {i+1}  HF {mf_hf.mo_energy[i]*HA_EV:9.3f} eV"
          f"   PBE {mf_ks.mo_energy[i]*HA_EV:9.3f} eV")
H2O / 6-31G: 10 electrons, 13 basis functions, nocc = 5, nvir = 8
E(RHF) = -75.983974 Ha    E(PBE) = -76.298106 Ha

  MO  occ  HF eps (eV)  PBE eps (eV)
   1  occ     -559.480      -510.198
   2  occ      -36.902       -25.254
   3  occ      -19.316       -12.932
   4  occ      -15.255        -8.018
   5  occ      -13.643        -6.197  <- HOMO
   6  vir        5.541         0.982  <- LUMO
   7  vir        8.156         3.357
   8  vir       28.769       20.880

HOMO-LUMO gap:   HF 19.184 eV    PBE 7.179 eV
-eps_HOMO:       HF 13.643 eV    PBE 6.197 eV    (exp. vertical IP 12.62 eV)
Delta-SCF IP:    HF 10.978 eV    PBE 12.396 eV

Read the last three lines against experiment (water's vertical IP is 12.62 eV). Hartree-Fock's eV is Koopmans' theorem doing its party trick: removing the orbital without letting the others relax overestimates the IP, missing correlation underestimates it, and the two errors partially cancel into a respectable number. PBE's eigenvalue misses by 6.4 eV — the electron sees a smeared copy of itself in the density and is pushed upward, the self-interaction error in its purest form. But ask PBE the question thermodynamically (SCF: cation minus neutral) and it answers 12.40 eV, the best number in the table. Same functional, same orbitals — the difference is only in which output you chose to read.

Meanwhile the two gaps differ by nearly a factor of three (19.18 vs 7.18 eV), exactly the KS-virtuals-vs-HF-virtuals story from framing 4. Neither gap is the optical gap: water's first absorption sits near 7.4 eV, and getting from either ladder to that number is what particle-hole theory and Casida's equation are for.

Try First

Each prompt asks a checkable question about the working code or math above — predict an output, derive a sign, state an invariant, find a bug. Commit to an answer before clicking "reveal." That commitment is the whole point: if your answer matched, you understand the piece you were looking at; if it didn't, that's the part worth re-reading.

predict
Before running anything: methane, ammonia, or any closed-shell molecule you like, any basis. Will the Hartree-Fock HOMO-LUMO gap be larger or smaller than the Kohn-Sham (semilocal functional) gap — and by roughly what kind of factor? Argue from what potential each virtual orbital feels, not from the water numbers above.
why does this work
The output shows PBE's missing the IP by 6.4 eV while PBE's SCF IP lands within 0.25 eV of experiment. Both numbers come from the same functional and the same converged orbitals. Why does the total-energy difference so thoroughly beat the eigenvalue?
what if
Suppose someone hands you the exact exchange-correlation functional and you redo the PBE column. Which numbers in the output become exact, which merely improve, and which stay wrong as a matter of principle?

Where this goes

The ladder is the statics. The dynamics — light in, electron promoted, spectrum out — is bookkeeping on pairs of rungs, and that is the next page: particle-hole excitations, the occupied-to-virtual grid that becomes the basis of Casida's equation. If instead you want the machinery that produced the ladder, the SCF iteration builds it from scratch, and Hartree-Fock is the exchange-only sibling these orbitals are always compared against.