Getting started

Running a calculation

DFTSW27 reads one input file and writes its report to standard output:

$ OMP_NUM_THREADS=8 ./run_dft input.yaml > output.out

Always set OMP_NUM_THREADS; the program is OpenMP-parallel. The basis-set files are in the basis/ directory of the distribution and are referenced from the input as basis/<name>.nw. For a first calculation, work through Tutorial 1 and the tour of the input file and of the output.

Input format

The input is a restricted subset of YAML: sections start in column 1, keys are indented below them, # starts a comment. An unknown key inside sic: stops the run, so check spelling.

# DFTSW27 online manual example: water, PBE
system:
  charge: 0
  unpaired_electrons: 0
  units: angstrom

functional:
  exchange: pbe
  correlation: pbe

basis:
  name: def2-TZVP
  file: basis/def2-TZVP.nw

scf:
  conv_tol: 1.0e-8

coulomb:
  method: eri

atoms:
  - element: O
    position: [0.000000,  0.000000,  0.117300]
  - element: H
    position: [0.000000,  0.757200, -0.469200]
  - element: H
    position: [0.000000, -0.757200, -0.469200]

Section

Purpose

system

charge, unpaired_electrons (n\(_\alpha\) − n\(_\beta\)), units (bohr default or angstrom)

functional

exchange, correlation, hybrids, local hybrids, dispersion (1. DFT: all functionals, 9. Local hybrid functionals)

basis

NWChem-format basis file (file:; the name: is only a label). Cartesian functions only

coulomb

how the Coulomb matrix is built: eri, poisson, density_fitting, analytic

scf, mixing

convergence, guess, spin occupation, restart (2. SCF: all methods)

job, optimization, frequencies, raman

what to compute (3. Vibrational frequencies, 4. IR and Raman spectra)

sic

self-interaction correction (5. FLOSIC)

cube

volumetric output (6. Cube plots)

atoms

element, position, optional moment, core, per-atom mesh

Geometries can also come from an XYZ file: system: geometry_file: mol.xyz, with per-atom overrides in atoms: selected by index or element.

The integration grid and the Coulomb method

DFT needs a numerical grid. Each atom has its own mesh (mesh: {nrpt: ..., lm: ...} in its atoms: entry); by default the program uses a table of meshes that is accurate for energy differences. Atoms with an explicit lm get that angular order for everything. For comparisons with integral-based programs use coulomb: method: eri.

Unless you choose a method, DFTSW27 uses the numerical Poisson solver for DFT energy runs and all SIC runs, and exact integrals (eri) for Hartree–Fock, gradients, TDDFT and noncollinear runs. The choice is printed at the start of the output. Poisson energies differ from eri by about 10⁻⁵ Ha for small molecules. See Becke and Dickson for the solver and Becke for the grid scheme.

Reading the output

The output starts with the input echo and the method summary, then lists one line per SCF iteration (e_total, energy change, density change, DIIS error), the orbital energies and a Results block:

  Results
 ================================================================
 converged      = T
 iterations     = 9
 e_total (Ha)   =     -76.3773251306

The line grid quadrature: integrated density = ... error = ... tells you whether the grid is adequate: an error above about 10⁻⁶ means energies are off at the mHa level and a finer mesh is needed. Tutorial 21 reads a complete output block by block.

Reference documents

The distribution contains the User Manual (every input key, concise) and the complete reference z_fullM.pdf (theory and details). This site follows them but is deliberately shorter.