EmpiricalDispersion

class psi4.driver.EmpiricalDispersion(name_hint=None, level_hint=None, param_tweaks=None, **kwargs)[source]

Bases: object

Lightweight unification of empirical dispersion calculation modes.

dashlevel

Name of dispersion correction to be applied. Resolved from name_hint and/or level_hint into a key of empirical_dispersion_resources.dashcoeff.

Type:{‘d1’, ‘d2’, ‘d3zero’, ‘d3bj’, ‘d3mzero’, ‘d3mbj’, ‘chg’, ‘das2009’, ‘das2010’, ‘nl’, ‘dmp2’}
dashparams

Complete (number and parameter names vary by dashlevel) set of parameter values defining the flexible parts of dashlevel. Resolved into a complete set (keys of dashcoeff[dashlevel][‘default’]) from name_hint and/or dashcoeff_supplement and/or user param_tweaks.

Type:dict
fctldash

If dashparams for dashlevel corresponds to a defined, named, untweaked “functional-dashlevel” set, then that functional. Otherwise, empty string.

Type:str
description

Tagline for dispersion dashlevel.

Type:str
dashlevel_citation

Literature reference for dispersion dashlevel in general, not necessarily for dashparams.

Type:str
dashparams_citation

Literature reference for dispersion parameters, if dashparams corresponds to a defined, named, untweaked “functional-dashlevel” set with a citation. Otherwise, empty string.

Type:str
dashcoeff_supplement

See description in qcengine.programs.empirical_dispersion_resources.from_arrays. Used here to “bless” the dispersion definitions attached to the procedures/dft/*_functionals-defined dictionaries as legit, non-custom, and of equal validity to qcengine.programs.empirical_dispersion_resources.dashcoeff itself for purposes of validating fctldash.

Type:dict
engine

Compute engine for dispersion. One of Psi4’s internal libdisp library, Grimme’s DFTD3 executable, or nl.

Type:{‘libdisp’, ‘dftd3’, ‘nl’, ‘mp2d’}
disp

Only present for engine=libdisp. Psi4 class instance prepared to compute dispersion.

Type:psi4.core.Dispersion
ordered_params

Fixed-order list of relevant parameters for dashlevel. Matches DFT_DISPERSION_PARAMETERS ordering. Used for printing.

Type:list
Parameters:
  • name_hint (str, optional) – Name of functional (func only, func & disp, or disp only) for which to compute dispersion (e.g., blyp, BLYP-D2, blyp-d3bj, blyp-d3(bj), hf+d). Any or all parameters initialized from dashcoeff[dashlevel][functional-without-dashlevel] or dashcoeff_supplement[dashlevel][functional-with-dashlevel] can be overwritten via `param_tweaks.
  • level_hint (str, optional) – Name of dispersion correction to be applied (e.g., d, D2, d3(bj), das2010). Must be key in dashcoeff or “alias” or “formal” to one.
  • param_tweaks (list or dict, optional) – Values for the same keys as dashcoeff[dashlevel][‘default’] (and same order if list) used to override any or all values initialized by name_hint. Extra parameters will error.
  • engine (str, optional) – Override which code computes dispersion. See above for allowed values. Really only relevant for -D2, which can be computed by libdisp or dftd3.

Methods Summary

compute_energy(molecule, wfn) Compute dispersion energy based on engine, dispersion level, and parameters in self.
compute_gradient(molecule, wfn) Compute dispersion gradient based on engine, dispersion level, and parameters in self.
compute_hessian(molecule, wfn) Compute dispersion Hessian based on engine, dispersion level, and parameters in self.
print_out() Format dispersion parameters of self for output file.

Methods Documentation

compute_energy(molecule: psi4.core.Molecule, wfn: psi4.core.Wavefunction = None) → float[source]

Compute dispersion energy based on engine, dispersion level, and parameters in self.

Parameters:
  • molecule (psi4.core.Molecule) – System for which to compute empirical dispersion correction.
  • wfn – Location to set QCVariables
Returns:

Dispersion energy [Eh].

Return type:

float

Notes

DISPERSION CORRECTION ENERGY
Disp always set. Overridden in SCF finalization, but that only changes for “-3C” methods.
self.fctldash + DISPERSION CORRECTION ENERGY
Set if fctldash nonempty.
compute_gradient(molecule: psi4.core.Molecule, wfn: psi4.core.Wavefunction = None) → psi4.core.Matrix[source]

Compute dispersion gradient based on engine, dispersion level, and parameters in self.

Parameters:
  • molecule (psi4.core.Molecule) – System for which to compute empirical dispersion correction.
  • wfn – Location to set QCVariables
Returns:

(nat, 3) dispersion gradient [Eh/a0].

Return type:

psi4.core.Matrix

compute_hessian(molecule: psi4.core.Molecule, wfn: psi4.core.Wavefunction = None) → psi4.core.Matrix[source]

Compute dispersion Hessian based on engine, dispersion level, and parameters in self. Uses finite difference, as no dispersion engine has analytic second derivatives.

Parameters:
  • molecule (psi4.core.Molecule) – System for which to compute empirical dispersion correction.
  • wfn – Location to set QCVariables
Returns:

(3*nat, 3*nat) dispersion Hessian [Eh/a0/a0].

Return type:

psi4.core.Matrix

print_out()[source]

Format dispersion parameters of self for output file.

compute_energy(molecule: psi4.core.Molecule, wfn: psi4.core.Wavefunction = None) → float[source]

Compute dispersion energy based on engine, dispersion level, and parameters in self.

Parameters:
  • molecule (psi4.core.Molecule) – System for which to compute empirical dispersion correction.
  • wfn – Location to set QCVariables
Returns:

Dispersion energy [Eh].

Return type:

float

Notes

DISPERSION CORRECTION ENERGY
Disp always set. Overridden in SCF finalization, but that only changes for “-3C” methods.
self.fctldash + DISPERSION CORRECTION ENERGY
Set if fctldash nonempty.
compute_gradient(molecule: psi4.core.Molecule, wfn: psi4.core.Wavefunction = None) → psi4.core.Matrix[source]

Compute dispersion gradient based on engine, dispersion level, and parameters in self.

Parameters:
  • molecule (psi4.core.Molecule) – System for which to compute empirical dispersion correction.
  • wfn – Location to set QCVariables
Returns:

(nat, 3) dispersion gradient [Eh/a0].

Return type:

psi4.core.Matrix

compute_hessian(molecule: psi4.core.Molecule, wfn: psi4.core.Wavefunction = None) → psi4.core.Matrix[source]

Compute dispersion Hessian based on engine, dispersion level, and parameters in self. Uses finite difference, as no dispersion engine has analytic second derivatives.

Parameters:
  • molecule (psi4.core.Molecule) – System for which to compute empirical dispersion correction.
  • wfn – Location to set QCVariables
Returns:

(3*nat, 3*nat) dispersion Hessian [Eh/a0/a0].

Return type:

psi4.core.Matrix

print_out()[source]

Format dispersion parameters of self for output file.