Skip to content

Shortcut: RDF

Module gridtools
Description Usage
Calculate the radial distribution function used in 1 tutorialsused in 0 eggs
output value type
the radial distribution function grid

Details and examples

Calculate the radial distribution function

This shortcut can be used to evaluate the radial distribution function for a collection of atoms. The following example illustrates how it can be used to compute the average radial distribution from a trajectory:

Click on the labels of the actions for more information on what each action computes
tested on2.11
rdf: RDFCalculate the radial distribution function This action is a shortcut. More details GROUPthe atoms that are being used to calculate the RDF=1-108 MAXRthe maximum distance to use for the rdf=2.5 GRID_BINthe number of bins to use when computing the RDF=25 KERNEL the type of kernel to use for computing the histograms for the RDF=DISCRETE STRIDE the frequency with which to compute the rdf and accumulate averages=1 CLEAR the frequency with which to clear the estimate of the rdf=0
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=rdf FILE the file on which to write the grid=rdf.dat

If you expand the shortcut in this input you can see how the radial distribution function is computed using KDE actions and that the average is obtained by using ACCUMULATE actions. By using expanded versions of this shortcut you can thus calculate and print the instantaneous value of the radial distribution function. Alternatively, if you use the CLEAR option in the ACCUMULATE commands you can calculate radial distribution functions from various parts of the trajectory.

The following example shows how you can use this function to calculate the radial distribution for the atoms in GROUPB around the atoms in GROUPA. Notice that the DISCRETE keyword has been removed here so we are using kernel density estimation to compute the radial distribution function.

Click on the labels of the actions for more information on what each action computes
tested on2.11
rdf: RDFCalculate the radial distribution function This action is a shortcut and it has hidden defaults. More details GROUPAthe atoms that you would like to compute the RDF about=1-108 GROUPBthe atoms that you would like to to use when computing the RDF around the atoms that were specified with GROUPA=109-300 MAXRthe maximum distance to use for the rdf=2.5 GRID_BINthe number of bins to use when computing the RDF=25 BANDWIDTHthe bandwidths for kernel density esimtation=0.01 DENSITYthe reference density to use when normalizing the RDF=1 STRIDE the frequency with which to compute the rdf and accumulate averages=1 CLEAR the frequency with which to clear the estimate of the rdf=0
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=rdf FILE the file on which to write the grid=rdf.dat

We have also used the DENSITY keyword to set the background density that is used when normalizing the radial distribution function explicity to 1 atom. When this keyword is not used, this density is calculated by dividing the number of atoms by the volume of the box as you can see if you expand the shortcut in the first input above.

Notice that you can also use the NO_AVERAGE keyword as shown below to calculate an independent RDF around each of the atoms:

Click on the labels of the actions for more information on what each action computes
tested on2.11
rdf: RDFCalculate the radial distribution function This action is a shortcut and it has hidden defaults. More details GROUPAthe atoms that you would like to compute the RDF about=1-3 GROUPBthe atoms that you would like to to use when computing the RDF around the atoms that were specified with GROUPA=4-108 MAXRthe maximum distance to use for the rdf=2.5 GRID_BINthe number of bins to use when computing the RDF=25 BANDWIDTHthe bandwidths for kernel density esimtation=0.01 DENSITYthe reference density to use when normalizing the RDF=1 STRIDE the frequency with which to compute the rdf and accumulate averages=1 NO_AVERAGE output a two-dimensional grid with separate RDF functions for each of the central atoms CLEAR the frequency with which to clear the estimate of the rdf=0
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=rdf FILE the file on which to write the grid=rdf.dat

This command will output a function on a grid. The first coordinate is the distance between atoms. The second coordinate is then then an index that tells you, which central atom. In other words, the input above will output three radial distribution functions. The first of these is the radial distribution function around atom 1, the second is the radial distribution function around atom 2 and the last is the radial distribution function around atom 3.

Input

The atoms that serve as the input for this action are specified using one or more of the keywords in the following table.

Keyword Type Description
GROUP atoms the atoms that are being used to calculate the RDF
GROUPA atoms the atoms that you would like to compute the RDF about
GROUPB atoms the atoms that you would like to to use when computing the RDF around the atoms that were specified with GROUPA

Full list of keywords

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
GROUP input none the atoms that are being used to calculate the RDF
GROUPA input none the atoms that you would like to compute the RDF about
GROUPB input none the atoms that you would like to to use when computing the RDF around the atoms that were specified with GROUPA
GRID_BIN compulsory none the number of bins to use when computing the RDF
KERNEL compulsory GAUSSIAN the type of kernel to use for computing the histograms for the RDF
CUTOFF compulsory 6.25 the cutoff at which to stop evaluating the kernel functions is set equal to sqrt(2x)bandwidth in each direction where x is this number
MAXR compulsory none the maximum distance to use for the rdf
BANDWIDTH compulsory none the bandwidths for kernel density esimtation
CLEAR compulsory 1 the frequency with which to clear the estimate of the rdf
STRIDE compulsory 1 the frequency with which to compute the rdf and accumulate averages
DENSITY optional not used the reference density to use when normalizing the RDF
NO_AVERAGE optional false output a two-dimensional grid with separate RDF functions for each of the central atoms

deprecated keywords

The keywords in the following table can still be used with this action but have been deprecated

Keyword Description
ATOMS You should use GROUP instead of this keyword which was used in older versions of PLUMED and is provided for back compatibility only