This plugin provides a simple graphical user interface to the measure gofr and measure rdf commands in VMD, which calculate the spherical atomic radial distribution function g(r) between the atom coordinates in two selections over a given trajectory or a subset thereof. You have to have a trajectory already loaded into VMD and have the option to either view the resulting g(r) and/or the corresponding number integral in MultiPlot windows or write the result of the calculation to a file.


- Selections have to be defined (default is empty). Typical radial distribution functions are computed between elements (same or different), but due to the power of VMD's selection language syntax, very sophisticated distribution functions may be computed.

- The normalization of g(r) has little meaning unless you enable processing of the periodic boundary conditions and have a fixed set of atoms in the selection. The number integrals are computed directly and thus provide accurate coordination numbers.

- You can use the 'Set unit cell dimension' dialog from the 'Utilities' menu to set the simulation cell information for all frames of the current molecule.

- The output file created by the save option contains three columns, the value of r, g(r), and the number integral over g(r).

- In case a selection is empty in a frame, an empty histogram is added to the sum over all frames.

- Optimizations:

  • Do not activate Update Selections unless needed.
  • If you have CUDA capable hardware, you can try enabling the GPU version. Particularly on large problems, it can be significantly faster, however, it has not been as rigorously tested as thoroughly as the (default) multi-threaded CPU version.
  • If you want to look at a 'local' distribution function, i.e. Selection 1 is one atom or a small number of atoms in close proximity, you should consider using a selection with the keywords "<selection text 2> and (within <max r> of <selection text 1>)" or "<selection text 2> and (pbwithin <max r> of <selection text 1>)". This can reduce the execution time drastically at the expense of no longer getting a consistent normalization. Since this is usally a qualitative measurement anyways, this should not matter in most cases.

Literature on g(r) calculations.

A short introduction on radial distribution functions can be found at

The GPU accelerated CUDA implementation is described in this paper: B.G. Levine, J.E. Stone and A. Kohlmeyer, "Fast Analysis of Molecular Dynamics Trajectories with Graphics Processing Units - Radial Distribution Function Histogramming", J. Comp. Phys, in Press, (2011) (

For more detailed explanation of radial distribution and pair correlation functions, the following text books are recommended.

  • J. P. Hansen and I. R. McDonald, Theory of Simple Liquids, Academic Press, London (1986)
  • Donald A. McQuarrie, Satistical Mechanics, University Science Books, 2nd Rev Ed edition (2000)
  • David Chandler, Introduction to Modern Statistical Mechanics, Oxford University Press, USA (1987)


Axel Kohlmeyer.