# Dispersion model#

Implementation of D3 model to obtain atomic C6 coefficients for a given geometry.

Examples

```>>> import torch
>>> import tad_dftd3 as d3
>>> numbers = d3.util.to_number(["O", "H", "H"])
>>> positions = torch.Tensor([
...     [+0.00000000000000, +0.00000000000000, -0.73578586109551],
...     [+1.44183152868459, +0.00000000000000, +0.36789293054775],
...     [-1.44183152868459, +0.00000000000000, +0.36789293054775],
... ])
>>> ref = d3.reference.Reference()
>>> rcov = d3.data.covalent_rad_d3[numbers]
>>> cn = d3.ncoord.coordination_number(numbers, positions, rcov, d3.ncoord.exp_count)
>>> weights = d3.model.weight_references(numbers, cn, ref, d3.model.gaussian_weight)
>>> c6 = d3.model.atomic_c6(numbers, weights, ref)
>>> torch.set_printoptions(precision=7)
>>> print(c6)
tensor([[10.4130478,  5.4368815,  5.4368815],
[ 5.4368811,  3.0930152,  3.0930152],
[ 5.4368811,  3.0930152,  3.0930152]])
```

Calculate atomic dispersion coefficients.

Parameters
• numbers (Tensor) – The atomic numbers of the atoms in the system.

• weights (Tensor) – Weights of all reference systems.

• reference (Reference) – Reference systems for D3 model.

Returns

Atomic dispersion coefficients.

Return type

Tensor

Calculate weight of indivdual reference system.

Parameters
• dcn (Tensor) – Difference of coordination numbers.

• factor (float) – Factor to calculate weight.

Returns

Weight of individual reference system.

Return type

Tensor

tad_dftd3.model.weight_references(numbers, cn, reference, weighting_function=<function gaussian_weight>, epsilon=1e-20, **kwargs)[source]#

Calculate the weights of the reference system.

Parameters
• numbers (Tensor) – The atomic numbers of the atoms in the system.

• cn (Tensor) – Coordination numbers for all atoms in the system.

• reference (Reference) – Reference systems for D3 model.

• weighting_function (Callable) – Function to calculate weight of individual reference systems.

Returns

Weights of all reference systems

Return type

Tensor