xnn.common.models.registry.add_dispersion#
- xnn.common.models.registry.add_dispersion(model, spec)[source]#
Wrap
modelin a D3 or D4 dispersion correction.The same hook
build_model()applies forextra["dispersion"], exposed so deployment code can add dispersion to a trained model after its weights are loaded.- Parameters:
model (InteratomicPotential or None) – The short-range model to correct (
Nonefor pure dispersion).spec (dict, str or True) –
{"name": "d4" | "d3", **options}with the options ofDFTD4/DFTD3; a bare name string; orTruefor the PBE0-D4 defaults.
- Returns:
D4DispersionorD3Dispersionaroundmodel.- Return type:
- Raises:
KeyError – For a dispersion name other than
"d3"or"d4".