Skip to content

A first calculation: waterยค

Closed-shell water across the four built-in functionals: build the energy functional once per functional, solve with DIIS SCF.

import jax; jax.config.update("jax_enable_x64", True)
from dftax import KS, Molecule, scf
from dftax.energy.xc import LDA, PBE, PBE0, B3LYP

water = Molecule.from_xyz("O 0 0 0; H 0.7586 0 0.5043; H 0.7586 0 -0.5043", "sto-3g")
for xc in (LDA(), PBE(), PBE0(), B3LYP()):
    res = scf(KS(water, xc))
    print(f"{xc.name:6s}  E = {res.e_tot:.8f} Ha   converged={res.converged}")
LDA     E = -74.65301003 Ha   converged=True
PBE     E = -75.14721575 Ha   converged=True
PBE0    E = -75.16702192 Ha   converged=True
B3LYP   E = -75.23251109 Ha   converged=True