How LAMMPS selects Central Atom for compute rdf

Dear Dr. Axel Kohlmeyer,

Hello Dr. Kohlmeyer. I was curious if I could ask a question on how LAMMPS computes radial distribution function.

How does LAMMPS choose the “central atom” or the reference atom.

For example, considering the following command:

compute myRDF all rdf 200 1 2 cutoff 5.0

I understand that the Type 1 atom are the central atoms and Type 2 is the distribution atoms.

Does LAMMPS randomly selects any single central atom that is Type 1?

If yes, once LAMMPS randomly selects any single central atom, does LAMMPS sticks with this same central atom throughout the entire simulation run to calculate the rdf, or does LAMMPS arbitrarily selects another different Type 1 atom for every different timesteps and calculates rdf.

If LAMMPS selects a random central atom of Type 1, is there a way to have LAMMPS select the same consistent randomly selected central atom for every repeated simulation?

Thank you so much for your time.


Masato Koizumi

Assumining you specify group all, compute rdf treats every
atom as the central atom and averages over all the results.
As the doc page explains, if you specify a group that
is a subset of atoms, only IJ pairs where both atoms are in

the group are included in the RDF. Again every such atom
will be considered as as central atom.