8.6 Read trajectories and build a defensible radial distribution function
These are unexecuted teaching inputs and starting settings to test. Original figures are schematics, not computed results. Use licensed VASP and PAW data, replace every placeholder, record the executable version and validate convergence.
8.6.1 Model, units and provenance
Use eV for energy, Å for length and eV/Å for force; 1 kbar = 0.1 GPa. State normalization per atom, molecule, primitive cell or simulation cell. Record PAW identifiers, release, ZVAL, ENMAX and permitted hashes; never redistribute POTCAR. SCF convergence addresses the chosen electronic problem; convergence of the target property requires separate tests.
Original schematic. Curves explain concepts; blank data areas await verified learner results. No calculation is claimed.
8.6.2 Worked case: procedure, interpretation and checks
Intuition
A snapshot can show a neighbour; an RDF answers whether neighbours occur more often at a distance than in a chosen uniform reference. It is a probability-density comparison, not just a histogram of bond lengths. The shell grows with radius, so the same raw count at a larger radius implies a lower local density. Peaks indicate preferred separations; their areas, with the proper density and shell measure, relate to coordination.
Prerequisites. Use an equilibrated trajectory, species identity and atom order, exact frame cadence, and valid periodic cells. Decide whether you need atom–atom, centre-of-mass, intermolecular-only, or site-specific structure. An O–H RDF in water includes the covalent bond unless you deliberately exclude atoms in the same molecule. A generic element selection cannot infer molecular identity after chemical reactions.
For a three-dimensional homogeneous mixture, define a bin with edges r₋ and r₊ and shell volume \(\Delta V=\frac{4\pi}{3}(r_+^3-r_-^3)\). Count ordered A-centred B neighbours, excluding self pairs. Normalize by the corresponding ideal-gas pair count. For distinct species at fixed volume, that count per frame is \(N_A N_B\Delta V/V\). For a same-species finite-N reference, use \(N_A(N_A-1)\Delta V/V\) when ordered self-excluded counts are used. A different package may adopt a thermodynamic-limit convention; document it rather than silently mixing curves. MDAnalysis RDF documentation
Practical steps
- Import and audit. Inspect first, middle and last frames; confirm atom count, species and cell. Compare an explicit interatomic distance with a visualizer. Confirm the reader preserves variable cells if relevant.
- Mark production. Keep raw data immutable; select an equilibration-trimmed view in the analysis script. Store frame indices and physical times in metadata.
- Choose pairs and geometry. State self-pair and intramolecular exclusions. Use the minimum-image convention for pair separations, with a tested routine for triclinic cells; component-wise rounding of fractional displacement is not a universal shortest-distance algorithm for arbitrary skewed lattices.
- Choose a safe cutoff. For a conventional bulk RDF, keep the spherical shell inside a valid minimum-image region, typically below half the shortest relevant periodic cell height, and verify the geometry. Bigger bins reduce noise but can hide narrow features; smaller bins are not automatically more accurate.
- Accumulate and normalize. For NpT, use each frame’s volume consistently with a declared estimator. Do not normalize all counts with the final cell. Near a free surface, spherical shells contain vacuum, so bulk normalization can create misleading results.
- Estimate uncertainty. Compute RDFs on several long contiguous blocks or independent trajectories, then compare peak position, integrated coordination and block variability. Thousands of adjacent frames are not thousands of independent samples.
- Check coordination directly. Integrate to a documented first-minimum cutoff, then compare with direct neighbour counts using the same pair definition and geometry. The cutoff itself can be uncertain or state-dependent.
This pseudocode is intentionally explicit about the missing parser and distance implementation. If using ASE, pin its version: its RDF source documents a partial-RDF normalization change in version 3.27.0. A software upgrade can change output without any physical change in the trajectory. ASE RDF implementation
Interpretation, traps and exercise
A liquid-like RDF often has short-range peaks and weaker long-range oscillations, but this does not by itself establish a liquid phase or equilibrated dynamics. Crystals at finite temperature also broaden their peaks. Compare translational order, MSD, density and visual evidence. Report r in Å and g(r) as dimensionless; coordination is a count, not a distance.
For a layered interface, calculate number density versus surface-normal position and a properly normalized in-plane pair function, or conditional pair distributions for a defined layer. Do not claim a 3D bulk RDF computed over slab-plus-vacuum volume is a bulk liquid property. For changing chemical identities, decide whether “molecule” is fixed by initial labels or recomputed from a documented bonding criterion.
Traps: including i=j and obtaining a giant zero-distance peak; double counting pairs while using a single-count denominator; mixing species fractions; using cell-vector length instead of a safe geometric cutoff in a skew cell; smoothing before estimating uncertainty; reading a coordination number from peak height instead of integral.
Exercise. Calculate a partial RDF two ways: a trusted library and a transparent small-system pair counter. Match their pair-count convention before comparing. Vary the bin width and first-shell cutoff; report what changes and why. Deliver a caption that states species, trajectory length, discarded interval, bin width and uncertainty method.
8.6.3 Unexecuted inputs and analysis scaffolds
These are unexecuted teaching inputs and starting settings to test. Original figures are schematics, not computed results. Use licensed VASP and PAW data, replace every placeholder, record the executable version and validate convergence.
8.6.3.1 Input block 1
# UNEXECUTED analysis pseudocode; deliberately not a drop-in parser
# inputs: validated production frames, pair selections, bin edges in Angstrom
for frame in production_frames:
assert frame.cell_is_valid and frame.atom_order_matches_manifest
distances = tested_periodic_distances(frame, A, B, exclude_self=True)
counts = histogram_with_documented_pair_convention(distances, edges)
ideal_counts = ideal_pair_count(frame.volume, A, B, edges)
save_frame_rdf(counts / ideal_counts)
# Form contiguous-block means, then estimate between-block variability.
8.6.4 Related learning paths
- 1.1 Four input files, one physical question
- 1.2 A convergence laboratory with an error budget
- 8.5 NpT dynamics, pressure units and a stable simulation cell
- 8.7 MSD, diffusion, unwrapping and honest error bars