Skip to content

DFT

Two maps a theorem promises, learned directly

Density functional theory is what makes ext2chg and chg2tau meaningful targets in the first place — one map that a theorem guarantees exists, one functional that orbital-free DFT needs and no closed form supplies. The Fourier Neural Operator that realizes them is on the FNO page.

The Hohenberg–Kohn map, and why it can be learned at all

Hohenberg and Kohn proved in 1964 that the external potential Vext and the ground-state density ρ determine one another uniquely — the density fixes the potential up to a constant, and every ground-state property is in principle a functional of ρ alone. What the theorem gives is existence, not a formula: no closed form for Vext ↦ ρ is known. ext2chg treats that gap as a learning problem rather than an approximation to patch — one forward pass through a Fourier Neural Operator, trained to realize a map a sixty-year-old theorem already guarantees exists.

  • Vext is computed natively from POTCAR pseudopotential tables, matching VASP to a relative 5×10⁻⁵ — the map's input is exact, not resampled from someone else's grid
  • Falls back to a Gaussian pseudo-ion model when no pseudopotential is available — and says which one it used
  • A physics-informed electron-count term keeps ∫ρ close to the nominal valence charge, the one global constraint the theorem itself implies
  • Every predicted field is written in CHGCAR format, readable by any standard DFT tool

Orbital-free DFT's missing functional: τ[ρ]

Kohn–Sham DFT sidesteps the kinetic energy by reintroducing single-particle orbitals — accurate, but at the cost of solving N coupled equations instead of one. Orbital-free DFT keeps the promise of a theory in ρ alone, but only if the kinetic energy density τ[ρ] is known as an explicit functional, and none is known exactly. Thomas–Fermi and von Weizsäcker are the two analytic limits — one from a uniform electron gas, one from a single orbital — and neither describes a real bonded system well. chg2tau fits τ[ρ] directly against reference kinetic energy densities, with the physics built into the architecture rather than left to a penalty term to discover on its own.

  • A Pauli-residual head predicts τ = τvW[ρ] + softplus(·), so the Hoffmann–Ostenhof bound τ ≥ τvW holds by construction, not by penalty
  • Thomas–Fermi and von Weizsäcker are the two closed-form baselines any learned τ[ρ] has to beat — see Foundation Models for the held-out comparison
  • An optional Sobolev (H¹) loss penalizes error in ∇τ, not only in τ itself

Physics constraints, layered in deliberately

Every constraint weight in PhysicsInformedLoss defaults to zero, so training reduces exactly to the supervised baseline until a term is switched on deliberately — a badly scaled physical constraint degrades accuracy while looking principled, so each one earns its place against a baseline before it stays on. What is available once switched on is standard DFT machinery, made differentiable.

  • Charge conservation: ∫ρ pinned to the valence electron count read from the pseudopotentials
  • Positivity and the von Weizsäcker bound, as soft penalties or as the Pauli-residual head's hard constraint
  • An Euler–Lagrange residual checks the orbital-free stationarity condition directly, not just the fields it is built from
  • Differentiable Hartree, LDA/PW92 and PBE exchange–correlation potentials, all evaluated in torch for training-time use

Keep reading

One Fourier layer for every grid shape, device- and precision-explicit, spectral resampling that preserves the electron count.

Ingest, cache, train, predict, evaluate — and the committee/active-learning loop around it.

Held-out accuracy, the comparison against analytic functionals, how to get a trained model, and the roadmap beyond one element.

Try it on your own structure

Install it, or read the manual first.