PotentialDipole

class torchpme.PotentialDipole(smearing: float | None = None, exclusion_radius: float | None = None, epsilon: float = 0.0)[source]

Pair potential energy function between point dipoles.

The intercation is described as

\[V(\vec{r}) = \frac{(\vec{\mu}_i \cdot \vec{\mu}_j)}{r^3} - \frac{3 (\vec{\mu}_i \cdot \vec{r}) (\vec{\mu}_j \cdot \vec{r}) }{r^5}\]

where \(r=|\vec{r}|\).

Parameters:
  • smearing (float | None) – float or torch.Tensor containing the parameter often called “sigma” in publications, which determines the length-scale at which the short-range and long-range parts of the naive \(1/r\) potential are separated. The smearing parameter corresponds to the “width” of a Gaussian smearing of the particle density.

  • exclusion_radius (float | None) – A length scale that defines a local environment within which the potential should be smoothly zeroed out, as it will be described by a separate model.

  • epsilon (float) – Dielectric constant of the medium in which the dipoles are embedded.

f_cutoff(vector: Tensor) Tensor[source]

Default cutoff function defining the local region that should be excluded from the computation of a long-range model. Defaults to a shifted cosine \((1+\cos \pi r/r_\mathrm{cut})/2\).

Parameters:

vector (Tensor) – torch.tensor containing the vectors at which the potential is to be evaluated.

Return type:

Tensor

from_dist(vector: Tensor) Tensor[source]

Full dipolar potential as a function of \(\mathbf{r}\).

Parameters:

vector (Tensor) – torch.tensor containing the vectors at which the potential is to be evaluated.

Return type:

Tensor

sr_from_dist(vector: Tensor) Tensor[source]

Short-range part of the pair potential in real space.

Parameters:
  • dist – torch.tensor containing the distance vectors at which the potential is to be evaluated.

  • vector (Tensor)

Return type:

Tensor

lr_from_dist(vector: Tensor) Tensor[source]

Long-range of the range-separated dipolar potential.

Used to subtract out the interior contributions after computing the long-range part in reciprocal (Fourier) space.

Parameters:

vector (Tensor) – torch.tensor containing the vectors at which the potential is to be evaluated.

Return type:

Tensor

lr_from_k_sq(k_sq: Tensor) Tensor[source]

Fourier transform of the long-range part of the potential.

Parameters:

k_sq (Tensor) – torch.tensor containing the squared lengths (2-norms) of the wave vectors k at which the Fourier-transformed potential is to be evaluated

Return type:

Tensor

self_contribution() Tensor[source]

A correction that depends exclusively on the “charge” on every particle and on the range splitting parameter. Foe example, in the case of a Coulomb potential, this is the potential generated at the origin by the fictituous Gaussian charge density in order to split the potential into a SR and LR part.

Return type:

Tensor

background_correction(volume) Tensor[source]

A correction designed to compensate for the presence of divergent terms. For instance, the energy of a periodic electrostatic system is infinite when the cell is not charge-neutral. This term then implicitly assumes that a homogeneous background charge of the opposite sign is present to make the cell neutral.

Return type:

Tensor