Local environments

class featomic.cutoff.Cutoff(radius: float, smoothing: SmoothingFunction | None)

The Cutoff class contains the definition of local environments, where an atom environment is defined by all its neighbors inside a sphere centered on the atom with the given spherical cutoff radius.

During an atomistic simulation, atoms entering and exiting the sphere will create discontinuities. To prevent them, one can use a smoothing function, smoothing introducing new atoms inside the neighborhood.

class featomic.cutoff.ShiftedCosine(*, width: float)

Bases: SmoothingFunction

Shifted cosine smoothing function, with the following form:

\[\begin{split}f(r) = \begin{cases} 1 & \text{for } r \le r_c - \sigma \\ 1/2 \left(1 + \frac{\cos(\pi (r - r_c + \sigma)}{\sigma} \right) & \text{for } r_c - \sigma \le r \le r_c \\ 0 & \text{for } r \gt r_c \\ \end{cases}\end{split}\]

with \(r_c\) the cutoff radius and \(\sigma\) is the width of the smoothing (roughly how far from the cutoff smoothing should happen).

Parameters:

width – width of the smoothing (\(\sigma\) in the equation above)

class featomic.cutoff.Step

Bases: SmoothingFunction

Step smoothing function, i.e. no smoothing.

This function is equal to 1 inside the cutoff radius and to 0 outside of the cutoff radius, with a discontinuity at the cutoff.

class featomic.cutoff.SmoothingFunction

Base class representing radial cutoff smoothing functions.

You can inherit from this class to define new smoothing functions, implementing compute() accordingly. If the new smoothing function has corresponding hyper parameters in the native calculators, you should also implement get_hypers().

abstract compute(cutoff: float, positions: ndarray, *, derivative: bool) ndarray

Compute the smoothing function on grid points at the given positions.

Parameters:
  • cutoff – spherical cutoff radius

  • positions – positions of the grid points where the smoothing function should be evaluated

  • derivative – should this function return the values of the smoothing function or it’s derivatives