Skip to content

Radial functions

Radial basis functions turn distances into scalar model features. ELFES includes fixed and learnable spherical Bessel bases and a fixed Gaussian basis. PolynomialEnvelope supplies a smooth cutoff factor that can be combined with a distance expansion.

SphericalBesselBasis

SphericalBesselBasis(cutoff: float, num_basis: int)

Bases: _SphericalBesselBasis

Fixed orthonormal zero-order spherical Bessel radial basis.

For cutoff radius \(r_\mathrm{c}\) and \(n = 1, \ldots, N\), the basis functions are

\[ B_n(r) = \sqrt{\frac{2}{r_\mathrm{c}}} \frac{\sin(n\pi r / r_\mathrm{c})}{r}. \]

They are orthonormal on \([0, r_\mathrm{c}]\) with radial measure \(r^2\,\mathrm{d}r\). At the origin, the implementation uses the analytic limit

\[ B_n(0) = \sqrt{\frac{2}{r_\mathrm{c}}}\frac{n\pi}{r_\mathrm{c}}. \]

The frequencies \(n\pi\) are fixed.

Parameters:

  • cutoff (float) –

    Cutoff radius \(r_\mathrm{c}\).

  • num_basis (int) –

    Number of basis functions \(N\).

LearnableSphericalBesselBasis

LearnableSphericalBesselBasis(cutoff: float, num_basis: int)

Bases: _SphericalBesselBasis

Learnable zero-order spherical Bessel radial basis.

This basis has the same initial functions as :class:SphericalBesselBasis, but optimizes their dimensionless frequencies, initialized to \(n\pi\) for \(n = 1, \ldots, N\).

Parameters:

  • cutoff (float) –

    Cutoff radius \(r_\mathrm{c}\).

  • num_basis (int) –

    Number of basis functions \(N\).

GaussianBasis

GaussianBasis(cutoff: float, num_basis: int, *, width_scale: float = 2.0)

Bases: Module

Fixed Gaussian basis with uniformly spaced centers.

For \(n = 0, \ldots, N - 1\), define

\[ \begin{aligned} \mu_n &= \frac{n r_\mathrm{c}}{N - 1}, \\ \Delta &= \frac{r_\mathrm{c}}{N - 1}, \\ \sigma &= s\Delta, \end{aligned} \]

The basis functions are

\[ G_n(r) = \exp\left[-\frac{1}{2}\left(\frac{r - \mu_n}{\sigma}\right)^2\right]. \]

The centers and widths are fixed rather than learned. Gaussian functions do not vanish at \(r_\mathrm{c}\), so a separate cutoff remains necessary when edge messages must go smoothly to zero.

Parameters:

  • cutoff (float) –

    Cutoff radius \(r_\mathrm{c}\) and location of the final center.

  • num_basis (int) –

    Number of Gaussian functions \(N\); must be at least two.

  • width_scale (float, default: 2.0 ) –

    Width scale \(s\) relative to the center spacing.

PolynomialEnvelope

PolynomialEnvelope(cutoff: float, power: int = 6)

Bases: Module

DimeNet polynomial envelope with two vanishing derivatives.

With \(x = r / r_\mathrm{c}\) and positive integer power \(p\), the cutoff is

\[ E(r) = \begin{cases} 1 - \dfrac{(p+1)(p+2)}{2}x^p + p(p+2)x^{p+1} - \dfrac{p(p+1)}{2}x^{p+2}, & r < r_\mathrm{c}, \\ 0, & r \ge r_\mathrm{c}. \end{cases} \]

Its value, slope, and curvature all reach zero at \(r_\mathrm{c}\), giving a smooth transition to zero. The default \(p = 6\) is the common NequIP-style choice.

Parameters:

  • cutoff (float) –

    Cutoff radius \(r_\mathrm{c}\).

  • power (int, default: 6 ) –

    Polynomial power \(p\).