Skip to content

RDF descriptors ​

The radial distribution function (RDF) descriptor summarises the distribution of pairwise distances in a conformer. sci-form rdf samples a radial grid and smooths each pair distance with a Gaussian.

flowchart LR
    A[Elements + coordinates] --> B[All atom pairs]
    B --> C[Pair distances]
    C --> D[Gaussian smoothing beta]
    D --> E[Weighted RDF curves]
    E --> F[Unweighted, mass, EN, charge]

Formula ​

For a grid radius rk, atom weights wi and pair distances rij:

RDFw(rk)=14πrk2∑i<jwiwjexp[−β(rk−rij)2].

The grid is the midpoint rule

rk=(k+12)rmaxN,k=0,…,N−1.

The output carries four curves:

FieldWeight wi
rdf_unweighted1
rdf_massatomic mass
rdf_electronegativityPauling electronegativity
rdf_chargeper-atom charge qi

n_pairs is N(N−1)/2, the number of atom pairs contributing before smoothing.

Charges ​

--charges supplies per-atom charges (length must equal the atom count). When omitted, Gasteiger charges are derived from the geometry. Elements without Gasteiger parameters are an error.

Example ​

bash
$ sci-form rdf "[8,1,1]" "$WATER" --n-points 3
{
  "radii": [2.0, 6.0, 10.0],
  "rdf_unweighted": [1.142211742551103e-12, 0.0, 0.0],
  "rdf_mass": [1.1605602319834438e-12, 0.0, 0.0],
  "rdf_electronegativity": [5.528304833947339e-12, 0.0, 0.0],
  "rdf_charge": [4.8110740318794345e-14, 0.0, 0.0],
  "beta": 100.0,
  "n_pairs": 3
}

With only three grid points the O-H distances near 1 Å fall between samples, so the values are tiny; use the default 128 points for a useful curve.

Validation and limits ​

  • At least two atoms are required.
  • beta and r_max must be finite and > 0; n_points must be ≥ 2.
  • The charge array must match the atom count and be finite.
  • The Python wrapper now routes through compute_rdf_checked, so coordinate mismatches and invalid beta/r_max/n_points raise ValueError instead of silently returning empty or truncated descriptors.
  • The descriptor is a smoothed pair-distance histogram, not a density-normalized experimental g(r). It is not periodic and does not apply a finite-size correction.
  • No external RDF gate is in-tree; compare only within the same beta, r_max and weighting scheme.

Surfaces ​

SurfaceEntry point
CLIsci-form rdf "<elements>" "<coords>" [--charges JSON] [--beta 100] [--r-max 12] [--n-points 128]
Rustml::rdf_descriptors::compute_rdf, compute_rdf_checked
Pythoncompute_rdf(elements, coords, charges, beta, r_max, n_points)
WASMcompute_rdf(elements_json, coords_json, charges_json, beta, r_max, n_points)

Released under the MIT License.