Dispersion: 2-body terms#

Implementation of the 2-body dispersion terms.

class tad_dftd4.dispersion.twobody.TwoBodyTerm(*, damping_fn=<tad_dftd4.damping.functions.RationalDamping object>, charge_dependent=True)[source]#

Base class for two-body dispersion terms.

Parameters:
  • damping_fn (Damping, optional) – Damping function to evaluate distance-dependent contributions. Defaults to RationalDamping.

  • charge_dependent (bool, optional) – Whether the term is charge-dependent. Defaults to True.

Parameters:
calculate(numbers, positions, param, cn, model, q, r4r2, rvdw, cutoff)[source]#

Evaluate the energy for the dispersion term.

Parameters:
Return type:

Tensor

charge_dependent: bool#

Whether the term is charge-dependent, i.e., requires atomic charges for the calculation.

damping_fn: Damping#

Damping function to be used for the dispersion term.

tad_dftd4.dispersion.twobody.dispersion2(numbers, positions, param, c6, r4r2, rvdw=None, damping_function=<tad_dftd4.damping.functions.RationalDamping object>, cutoff=None, as_matrix=False)[source]#

Calculate dispersion energy between pairs of atoms.

Parameters:
  • numbers (Tensor) – Atomic numbers for all atoms in the system of shape (..., nat).

  • positions (Tensor) – Cartesian coordinates of all atoms (shape: (..., nat, 3)).

  • param (Param) – DFT-D3 damping parameters.

  • c6 (Tensor) – Atomic C6 dispersion coefficients.

  • r4r2 (Tensor) – r⁴ over r² expectation values of the atoms in the system.

  • rvdw (Tensor) – Pair-wise van der Waals radii of the atoms in the system.

  • damping_function (Damping, optional) – Damping function evaluate distance dependent contributions. Additional arguments are passed through to the function. Defaults to RationalDamping.

  • cutoff (Tensor | None, optional) – Real-space cutoff for two-body dispersion. Defaults to None, which will be evaluated to defaults.D4_DISP2_CUTOFF.

  • as_matrix (bool, optional) – Return dispersion energy as a matrix. If you sum up the dispersion energy from the matrix, do not forget the factor 0.5 that fixes the double counting. Defaults to False.

Returns:

Atom-resolved two-body dispersion energy.

Return type:

Tensor

Parameters: