Run a real SCF in your browser
Quantum Chemistry
What you need to know first 8 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.
This is not a re-implementation, an animation, or a recording. The button below runs a real
restricted Hartree-Fock calculation for H₂ in the STO-3G basis — primitive Gaussian integrals,
the two-electron tensor, symmetric orthogonalization, and the SCF loop — and converges to the
Szabo & Ostlund textbook energy, -1.11671 hartree. It all happens in your browser,
in WebAssembly, with no server.
What you just ran
The SCF is written in Knot, a small numerical language. Knot doesn't ship a Python-style interpreter weighing megabytes — its compiler lowers the program to plain C, and that C compiles to a 47 KB WebAssembly module. The three tabs above are the same program at three zoom levels: the Knot source you'd write, the C it lowers to, and the WebAssembly that actually executes. One source, lowered twice.
That is the whole point of compiling instead of interpreting: the thing running in your browser is the same computation that would run, at full speed, on a cluster — not a slower teaching imitation of it.
The SCF is not the only program riding this pipeline: the same compiler runs a symbolic-regression engine in the browser — 4.4 million candidate formulas raced against sampled data by a 42 KB module.
Follow the SCF, line by line
The Knot source reads like the math. If you want the derivation behind each piece — the variational principle, the Gaussian product theorem, the Fock matrix, the Roothaan-Hall equations, and the self-consistent loop — work through the Quantum Chemistry course, or read the from-scratch series starting at the SCF iteration.