Dispersion correction (D4)
Module: sci_form::dispersion (core; promoted from the experimental tier) Feature flag: none (core)
Validation and limits
| Question | Answer |
|---|---|
| Compared with | dftd4 4.3.0 |
| Measured separation | D3(HF-3c) 6.8e-9 Ha; D4(PBE) 6.2e-10 Ha (tolerance 1.59e-6 Ha) |
| Confidence region | 25 molecules |
| Main limitation | the standalone D4 path uses element-level C6 coefficients without coordination or charge dependence |
The raw rows and the exact tolerances are in the full validation matrix.
Overview
Implements the DFT-D4 dispersion correction with geometry-dependent
Theory
Dynamic Coefficients
Unlike fixed-parameter methods (D3), D4 uses coordination-number-dependent dispersion coefficients:
where weights
D4 Coordination Number
Two-Body Dispersion
with Becke-Johnson damping:
Three-Body ATM Term
API
use sci_form::dispersion::*;
// D4 coordination numbers
let cn = d4_coordination_number(&elements, &positions);
// Reference C6 coefficients
let c6 = get_c6_reference(6, 8); // C-O pair
// Full D4 energy
let config = D4Config {
s6: 1.0, s8: 0.95,
a1: 0.45, a2: 4.0,
three_body: false,
..Default::default()
};
let result = compute_d4_energy(&elements, &positions, &config);
// result.two_body_energy: f64 (Hartree)
// result.three_body_energy: f64
// result.total_energy: f64
// Numerical gradient
let gradient = compute_d4_gradient(&elements, &positions, &config);Default Parameters
| Parameter | Value | Description |
|---|---|---|
s6 | 1.0 | |
s8 | 0.95 | |
a1 | 0.45 | BJ damping parameter |
a2 | 4.0 | BJ damping radius (Bohr) |
s9 | 1.0 | Three-body scaling |
three_body | false | Enable ATM three-body term |
Element Coverage
H, B, C, N, O, F, Si, P, S, Cl, Br, I plus xTB transition metals: Ti, Cr, Mn, Fe, Co, Ni, Cu, Zn, Ru, Pd, Ag, Pt, Au.
Tests
cargo test --features beta-cpm --test experimental_gates -- test_d48 integration tests (tests/experimental/test_d4.rs) covering: coordination numbers, C6 reference values, C6 symmetry, BJ damping behavior, two-body energy negativity, three-body terms, gradient accuracy, and multi-element systems.
These tests live in the experimental_gates target — see Overview for the full command matrix.