Coordination number: DFT-D3

Coordination number: DFT-D3#

Calculation of coordination number for DFT-D3.

tad_mctc.ncoord.d3.cn_d3(numbers, positions, counting_function=<function exp_count>)[source]#

Compute the D3 fractional coordination number using the default parameters described in tad_mctc.ncoord.defaults.

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

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

  • counting_function (CountingFunction, optional) – Counting function used for the DFT-D3 coordination number. Defaults to the exponential counting function tad_mctc.ncoord.count.exp_count().

Returns:

Coordination numbers for all atoms (shape: (..., nat)).

Return type:

Tensor

tad_mctc.ncoord.d3.cn_d3_gradient(numbers, positions, *, dcounting_function=<function dexp_count>, rcov=None, cutoff=None, **kwargs)[source]#

Compute the derivative of the fractional coordination number with respect to atomic positions.

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

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

  • dcounting_function (CountingFunction, optional) – Derivative of the counting function. Defaults to tad_mctc.ncoord.count.dexp_count().

  • rcov (Tensor | None, optional) – Covalent radii for each species. Defaults to None.

  • cutoff (Tensor | None, optional) – Real-space cutoff. Defaults to None.

  • kwargs (dict[str, Any]) – Pass-through arguments for counting function. For example, kcn, the steepness of the counting function, which defaults to tad_mctc.ncoord.defaults.KCN_D3.

Returns:

Coordination numbers for all atoms (shape: (..., nat, nat, 3)).

Return type:

Tensor

Raises:

ValueError – If shape mismatch between numbers, positions and rcov is detected.