exatomic.algorithms.pcf module
Pair Correlation Functions
- exatomic.algorithms.pcf.radial_pair_correlation(universe, a, b, dr=0.05, start=1.0, stop=13.0, length='Angstrom', window=1)[source]
Compute the angularly independent pair correlation function.
This function is sometimes called the pair radial distribution function. The quality of the result depends strongly on the amount of two body distances computed (see
compute_two_body()
) in the case of a periodic unvierse. Furthermore, the result can be skewed if only a single atom a (or b) exists in each frame. In these situations one can use the window and dr parameter to adjust the result accordingly. Reasonable values for dr range from 0.1 to 0.01 and reasonable values for window range from 1 to 5 (default is 1 - no smoothing).pcf = radial_pair_correlation(universe, "O", "O") pcf.plot(secondary_y="Pair Count")
\[ \begin{align}\begin{aligned}g_{AB}\left(r\right) = \frac{V}{4\pi r^{2}\Delta r MN_{A}N_{B}} \sum_{m=1}^{M}\sum_{a=1}^{N_{A}}\sum_{b=1}^{N_{B}}Q_{m} \left(r_{a}, r_{b}; r, \Delta r\right)\\\begin{split}Q_{m}\left(r_{a}, r_{b}; r, \Delta r\right) = \begin{cases} \ &1\ \ if\ r - \frac{\Delta r}{2} \le \left|r_{a} - r_{b}\right|\lt r + \frac{\Delta r}{2} \\ &0\ \ otherwise \\ \end{cases}\end{split}\end{aligned}\end{align} \]- Parameters:
- Returns:
pcf (
DataFrame
) – Pair correlation distribution and count
Note
If a, b are strings pairs are determined using atomic symbols. If integers or lists/tuples are passed pairs are determined by atomic labels (see
get_atom_labels()
). Arrays are assumed to be index values directly.Tip
Depending on the type of two body computation (or data) used, the volume may not be the cell volume; the normalization factor (the prefactor) is the volume sampled during computation of two body properties divided by the number of properties used in the histogram (the triple summation above, divided by the normalization for the radial distance outward).
Warning
Using a start and stop length different from 0 and simple cubic cell dimension will cause the y axis magnitudes to be inaccurate. This can be remedied by rescaling values appropriately.
- exatomic.algorithms.pcf.radial_pcf_out_of_core(hdftwo, hdfout, u, pairs, **kwargs)[source]
Out of core radial pair correlation calculation.
Atomic two body data is expected to have been computed (see
compute_atom_two_out_of_core()
) An example is given below. Note the importance of the definition of pairs and the presence of additional arguments.radial_pcf_out_of_core("in.hdf", "out.hdf", uni, {"O_H": ([0], "H")}, length="Angstrom", dr=0.01)
- Parameters:
hdftwo (str) – HDF filepath containing atomic two body data
hdfout (str) – HDF filepath to which radial PCF data will be written (see Note)
u (
Universe
) – Universepairs (dict) – Dictionary of string name keys, values of
a
,b
arguments (see Note)kwargs – Additional keyword arguments to be passed (see Note)
Note
Results will be stored in the hdfout HDF file. Keys are of the form
radial_pcf_key
. The keys ofpairs
are used to store the output while the values are used to perform the pair correlation itself.