xnn.common.featurizers.cutoff.MollifierCutoff#

class xnn.common.featurizers.cutoff.MollifierCutoff(cutoff)[source]#

Bases: Module

Bump-function envelope exp(1 - 1 / (1 - (r / rc)^2)), smooth to every order.

Equal to 1 at r = 0 and to 0 for r >= rc with every derivative continuous at the cutoff. AIMNet2 (Anstine et al., Chem. Sci. 2025) uses it to switch off the short-range part of the Coulomb energy that its network has learned implicitly; it is also the radial cutoff of SpookyNet (Unke et al., Nat. Commun. 2021, eq 16).

Parameters:

cutoff (float) – Cutoff radius rc; the envelope is zero for r >= cutoff.

forward(r)[source]#

Evaluate the envelope at the given distances.

Parameters:

r (Tensor) – Interatomic distances of arbitrary shape (...).

Returns:

The envelope values, same shape as r, in [0, 1] and zero for r >= cutoff.

Return type:

Tensor