compute_rdf

This keyword is used to compute the radial distribution function (RDF) for all atoms or pairs of species. It works for both classical MD and PIMD.

Syntax

This keyword is used as follows:

compute_rdf <cutoff> <num_bins> <interval>

Parameters

This means that the RDF calculations will be performed every interval steps, with num_bins data points evenly distributed from 0 to cutoff (in units of Ångstrom) in terms of the distance between atom pairs.

Partial RDFs for all element pairs are computed automatically.

Output

The results will be written to the rdf.out file.

Examples

compute_rdf 8.0 400 1000 # Calculate all RDFs every 1000 MD steps with 400 data up to 8 Angstrom

Notes

Method

The RDF is proportional to the relative probability of finding atomic pairs at a distance around \(r\) in the system, and to a large extent, reflects the local structural information of the system. It is defined as

\[g (r) = \frac{V}{N^2}\frac{dN(r, dr)}{4\pi r^2 dr},\]

where \(dN(r,dr)\) counts ordered center-neighbor pairs of distinct atoms in the radial interval, \(V\) is the volume of the system, and \(N\) is the total number of particles in the system.

Thus each unordered geometric pair contributes twice to the total count. Self pairs are excluded, while the normalization uses \(N^2\).

It is also possible to calculate the RDF between different element types. In a system with \(N_a\) atoms of type \(a\) and \(N_b\) atoms of type \(b\), \(g_{ab}(r)\) and \(g_{ba}(r)\) are defined as

\[g_{ab}(r) = g_{ba}(r) = \frac{V}{N_a N_b} \frac{dN_{ab}(r, dr)}{4\pi r^2 dr},\]

Here, \(dN_{ab}\) counts ordered pairs with the center of type \(a\) and the neighbor of type \(b\). For different types, each geometric \(a\)-\(b\) pair contributes once to \(dN_{ab}\) and once to \(dN_{ba}\). For the same type, both directions are included in \(dN_{aa}\), and the denominator is \(N_a^2\); self pairs remain excluded.

In the discrete histogram, \(\Delta r=\mathtt{cutoff}/\mathtt{num\_bins}\) and the output radius is the bin center \(r_b=(b+1/2)\Delta r\). Pairs with \(b\Delta r < r \le (b+1)\Delta r\) enter bin \(b\), including the outer cutoff in the last bin. The normalization uses the shell-volume approximation \(4\pi r_b^2\Delta r\). Each sampled configuration is normalized using its own volume, and the reported RDF is the arithmetic mean over the samples.