dxtb.components.base.ClassicalABC

dxtb.components.base.ClassicalABC#

class dxtb.components.base.ClassicalABC[source]#

Bases: ABC

Abstract base class for calculation of classical contributions.

Methods

get_cache

Store variables for energy calculation.

get_energy

Obtain energy of the contribution.

abstract get_cache(numbers, ihelp=None, **kwargs)[source]#

Store variables for energy calculation.

Return type:

ComponentCache

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

  • ihelp (IndexHelper) – Helper class for indexing.

Returns:

Cache class for storage of variables.

Return type:

Cache

Parameters:

Note

The cache of a classical contribution does not require positions as it only becomes useful if numbers remain unchanged and positions vary, i.e., during geometry optimization.

abstract get_energy(positions, cache, **kwargs)[source]#

Obtain energy of the contribution.

Return type:

Tensor

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

  • cache (Cache) – Cache for the parameters.

Returns:

Atomwise energy contributions.

Return type:

Tensor

Parameters: