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. The results will be written to the rdf.out file.

Mathematical details

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)\) represents the number of particle pairs with distances between \(r\) and \(r + dr\), \(V\) is the volume of the system, and \(N\) is the total number of particles in the system.

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)\) is defined as

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

where \(dN_{ab}(r, dr) = dN_{ba}(r, dr)\) is the number of \((a, b)\) particle pairs with distances between \(r\) and \(r + dr\).

Syntax

This keyword is used as follows:

compute_rdf <cutoff> <num_bins> <interval> [atom <i1> <i2> atom <i3> <i4> ...]

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.

Without the optional parameters, only the total RDF will be calculated.

To additionally calculate the partial RDF for a pair of species, one can specify the types of the two species after the word “atom”. The types 0, 1, 2, … correspond to the species in the potential file in order. Currently, one can specify at most 6 pairs.

Example

compute_rdf 8.0 400 1000 # total RDF every 1000 MD steps with 400 data up to 8 Angstrom compute_rdf 8.0 400 1000 atom 0 0 atom 1 1 atom 0 1 # additionally calculate 3 partial RDFs