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.
- base
- Linear algebraconcept
- Quantum mechanics (states & operators)
- L1
- L2
- L3
- L4
- ↳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.
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.
A converged SCF hands you a ladder: one energy per orbital, filled from the bottom with two electrons per rung. For water in a 6-31G basis that is 13 rungs — 5 occupied, 8 empty. The highest filled rung is the HOMO, the lowest empty one the LUMO, and the empty rungs are called virtual orbitals: solutions of the same one-electron equation that no electron actually occupies.
The ladder is the molecule's cast of characters. Chemistry happens at the frontier — the HOMO is where the molecule is easiest to ionize or attack, the LUMO where an incoming electron or an excited one lands. And spectroscopy, on this site's pages, is literally bookkeeping on this ladder: an excitation is an electron leaving rung for rung . The run below prints the actual ladder, twice — once per mean field — so you can see how much the rungs depend on who built them.
How literally can you read the ? There is exactly one rigorous statement: in exact Kohn-Sham theory the HOMO energy is minus the vertical ionization potential, . The asymptotic decay of the density is governed by , and the KS system must reproduce that decay, so its top level has no freedom. Every other eigenvalue — each deeper , the LUMO, all the virtuals — is scaffolding with no exact meaning.
And even the one rigorous statement holds only for the exact functional, which nobody has. With PBE, water's comes out at 6.2 eV against an experimental IP of 12.6 eV — off by a factor of two, the signature self-interaction error of semilocal functionals. Yet the same PBE calculation, asked for the IP the legitimate way (energy of cation minus energy of neutral), gives 12.4 eV. The functional's energies are far better than its eigenvalues. Keep the three gaps straight, too: the KS HOMO-LUMO gap, the fundamental gap (ionize here, attach there), and the optical gap (lowest excitation) are three different numbers, and only the first one is on the ladder.
Here is the structural difference from Hartree-Fock that matters for everything downstream. In Kohn-Sham theory every orbital — occupied and virtual alike — solves the same equation with the same local potential . A KS virtual is the answer to "where could one of these electrons go?" In Hartree-Fock the exchange operator acts differently: an occupied orbital feels the other electrons, but a virtual orbital feels all — it describes an extra electron stapled onto the molecule, not an excited resident.
The consequence is visible in the run below: HF virtuals sit too high (water's HF gap is 19.2 eV, PBE's is 7.2 eV) and are too diffuse, because they are anion states in disguise. For building excitations — which move a resident electron, not attach a new one — the KS virtuals are the better-shaped raw material, even from a functional whose eigenvalues are individually unreliable. Differences within one consistent ladder inherit a cancellation that absolute eigenvalues don't get.
This page exists because of what comes next. Take the occupied rungs and the virtual rungs ; every pair is a particle-hole excitation, and those pairs form the basis in which Casida's equation is written. The orbital-energy differences are the zeroth-order spectrum — the diagonal of the Casida matrix — and the orbitals themselves are the ingredients of every coupling element in it.
So the working attitude of linear-response TDDFT is: trust the set, not the individual numbers. The KS ladder is a well-conditioned starting point whose errors are systematic and correctable — and correcting them is precisely the job of the response machinery in the pages ahead.
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.
- Exact: the density, the total energy, the SCF IP (12.62 eV by construction), and , which the exact-KS ionization theorem pins to the vertical IP — the 6.2 would become 12.62.
- Improved but not exact-by-theorem: the deeper occupied eigenvalues. In practice exact-KS deeper levels track ionizations from those shells surprisingly well, but no theorem protects them.
- Still "wrong" on principle: the LUMO and the gap. The exact KS HOMO-LUMO gap does not equal — it misses the derivative-discontinuity piece — and it does not equal the optical gap either, which needs the response kernel on top. Some numbers on the ladder are only ever scaffolding, and knowing which ones is the point of this page.
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.