Coordination number: Counting functions#
This module contains all the counting functions used throughout the projects of the Grimme group. This includes the following counting functions: - exponential (DFT-D3, EEQ) - error function (DFT-D4) - double exponential (GFN2-xTB)
Additionally, the analytical derivatives for the counting functions are also provided and can be used for checking the autograd results.
- tad_mctc.ncoord.count.derf_count(r, r0, kcn=7.5)[source]#
Derivative of error function counting function w.r.t. the distance.
- Parameters:
r (Tensor) – Internuclear distances.
r0 (Tensor) – Covalent atomic radii (R_AB = R_A + R_B).
kcn (Tensor | float | int, optional) – Steepness of the counting function. Defaults to
tad_mctc.ncoord.defaults.KCN_D3.
- Returns:
Derivative of count of coordination number contribution.
- Return type:
Tensor
- tad_mctc.ncoord.count.dexp_count(r, r0, kcn=16.0)[source]#
Derivative of the exponential counting function w.r.t. the distance.
- Parameters:
r (Tensor) – Internuclear distances.
r0 (Tensor) – Covalent atomic radii (R_AB = R_A + R_B).
kcn (Tensor | float | int, optional) – Steepness of the counting function. Defaults to
tad_mctc.ncoord.defaults.KCN_D3.
- Returns:
Derivative of count of coordination number contribution.
- Return type:
Tensor
- tad_mctc.ncoord.count.dgfn2_count(r, r0, ka=10.0, kb=20.0, r_shift=2.0)[source]#
Exponential counting function for coordination number contributions as used in GFN2-xTB.
- Parameters:
r (Tensor) – Internuclear distances.
r0 (Tensor) – Covalent atomic radii (R_AB = R_A + R_B) or cutoff radius.
ka (Tensor | float | int, optional) – Steepness of the first counting function. Defaults to
tad_mctc.ncoord.defaults.KA.kb (Tensor | float | int, optional) – Steepness of the second counting function. Defaults to
tad_mctc.ncoord.defaults.KB.r_shift (Tensor | float | int, optional) – Offset of the second counting function. Defaults to
tad_mctc.ncoord.defaults.R_SHIFT.
- Returns:
Count of coordination number contribution.
- Return type:
Tensor
- tad_mctc.ncoord.count.erf_count(r, r0, kcn=7.5)[source]#
Error function counting function for coordination number contributions.
- Parameters:
r (Tensor) – Internuclear distances.
r0 (Tensor) – Covalent atomic radii (R_AB = R_A + R_B).
kcn (Tensor | float | int, optional) – Steepness of the counting function. Defaults to
tad_mctc.ncoord.defaults.KCN_D3.
- Returns:
Count of coordination number contribution.
- Return type:
Tensor
- tad_mctc.ncoord.count.exp_count(r, r0, kcn=16.0)[source]#
Exponential counting function for coordination number contributions.
- Parameters:
r (Tensor) – Internuclear distances.
r0 (Tensor) – Covalent atomic radii (R_AB = R_A + R_B).
kcn (Tensor | float | int, optional) – Steepness of the counting function. Defaults to
tad_mctc.ncoord.defaults.KCN_D3.
- Returns:
Count of coordination number contribution.
- Return type:
Tensor
- tad_mctc.ncoord.count.gfn2_count(r, r0, ka=10.0, kb=20.0, r_shift=2.0)[source]#
Exponential counting function for coordination number contributions as used in GFN2-xTB.
- Parameters:
r (Tensor) – Internuclear distances.
r0 (Tensor) – Covalent atomic radii (R_AB = R_A + R_B) or cutoff radius.
ka (Tensor | float | int, optional) – Steepness of the first counting function. Defaults to
tad_mctc.ncoord.defaults.KA.kb (Tensor | float | int, optional) – Steepness of the second counting function. Defaults to
tad_mctc.ncoord.defaults.KB.r_shift (Tensor | float | int, optional) – Offset of the second counting function. Defaults to
tad_mctc.ncoord.defaults.R_SHIFT.
- Returns:
Count of coordination number contribution.
- Return type:
Tensor