PDFCylinder#

class maicos.modules.pdfcylinder.PDFCylinder(g1: AtomGroup, g2: AtomGroup | None = None, bin_width_pdf_z: float = 0.3, bin_width_pdf_phi: float = 0.1, drwidth: float = 0.1, dmin: float | None = None, dmax: float | None = None, density: bool = False, origin: ndarray | None = None, bin_method: str = 'com', unwrap: bool = False, refgroup: AtomGroup | None = None, jitter: float = 0.0, concfreq: int = 0, dim: int = 2, zmin: float | None = None, zmax: float | None = None, rmin: float = 0, rmax: float | None = None, bin_width: float = 1, output: str = 'pdf.dat')[source]#

Bases: CylinderBase

Shell-wise one-dimensional (cylindrical) pair distribution functions.

The one-dimensional pair distribution functions \(g_{\text{1d}}(\phi)\) and \(g_{\text{1d}}(z)\) describes the pair distribution to particles which lie on the same cylinder along the angular and axial directions respectively. These functions can be used in cylindrical systems that are inhomogeneous along radial coordinate, and homogeneous in the angular and axial directions. It gives the average number density of \(g2\) as a function of angular and axial distances respectively from a \(g1\) atom. Then the angular pair distribution function is

\[g_{\text{1d}}(\phi) = \left \langle \sum_{i}^{N_{g_1}} \sum_{j}^{N_{g2}} \delta(\phi - \phi_{ij}) \delta(R_{ij}) \delta(z_{ij}) \right \rangle\]

And the axial pair distribution function is

\[g_{\text{1d}}(z) = \left \langle \sum_{i}^{N_{g_1}} \sum_{j}^{N_{g2}} \delta(z - z_{ij}) \delta(R_{ij}) \delta(\phi_{ij}) \right \rangle\]

Even though due to consistency reasons the results are called pair distribution functions the output is not unitless. The default output is is in dimension of number/volume in \(Å^{-3}\). If density is set to True, the output is normalised by the density of \(g2\).

Parameters:
  • g1 (MDAnalysis.core.groups.AtomGroup) – First AtomGroup.

  • g2 (MDAnalysis.core.groups.AtomGroup) – Second AtomGroup.

  • pdf_z_bin_width (float) – Binwidth of bins in the histogram of the axial PDF (Å).

  • pdf_phi_bin_width (float) – Binwidth of bins in the histogram of the angular PDF (Å).

  • drwidth (float) – radial width of a PDF cylindrical shell (Å), and axial or angular (arc) slices.

  • dmin (float) – the minimum pairwise distance between ‘g1’ and ‘g2’ (Å).

  • dmax (float) – the maximum pairwise distance between ‘g1’ and ‘g2’ (Å).

  • density (bool) – normalise the PDF by the density of ‘g2’ (\(Å^{-3}\)).

  • origin (numpy.ndarray) – Set origin of the cylindrical coordinate system (x,y,z). If None the origin will be set according to the refgroup parameter.

  • bin_method ({"com", "cog", "coc"}) –

    Method for the position binning.

    The possible options are center of mass ("com"), center of geometry ("cog"), and center of charge ("coc").

  • unwrap (bool) –

    When True, molecules that are broken due to the periodic boundary conditions are made whole.

    If the input contains molecules that are already whole, speed up the calculation by disabling unwrap. To do so, use the flag -no-unwrap when using MAICoS from the command line, or use unwrap=False when using MAICoS from the Python interpreter.

    Note: Molecules containing virtual sites (e.g. TIP4P water models) are not currently supported in MDAnalysis. In this case, you need to provide unwrapped trajectory files directly, and disable unwrap. Trajectories can be unwrapped, for example, using the trjconv command of GROMACS.

  • refgroup (MDAnalysis.core.groups.AtomGroup) – Reference AtomGroup used for the calculation. If refgroup is provided, the calculation is performed relative to the center of mass of the AtomGroup. If refgroup is None the calculations are performed with respect to the center of the (changing) box.

  • jitter (float) –

    Magnitude of the random noise to add to the atomic positions.

    A jitter can be used to stabilize the aliasing effects sometimes appearing when histogramming data. The jitter value should be about the precision of the trajectory. In that case, using jitter will not alter the results of the histogram. If jitter = 0.0 (default), the original atomic positions are kept unchanged.

    You can estimate the precision of the positions in your trajectory with maicos.lib.util.trajectory_precision(). Note that if the precision is not the same for all frames, the smallest precision should be used.

  • concfreq (int) – When concfreq (for conclude frequency) is larger than 0, the conclude function is called and the output files are written every concfreq frames.

  • dim ({0, 1, 2}) – Dimension for binning (x=0, y=1, z=1).

  • zmin (float) –

    Minimal coordinate for evaluation (in Å) with respect to the center of mass of the refgroup.

    If zmin=None, all coordinates down to the lower cell boundary are taken into account.

  • zmax (float) –

    Maximal coordinate for evaluation (in Å) with respect to the center of mass of the refgroup.

    If zmax = None, all coordinates up to the upper cell boundary are taken into account.

  • bin_width (float) – Width of the bins (in Å).

  • rmin (float) – Minimal radial coordinate relative to the center of mass of the refgroup for evaluation (in Å).

  • rmax (float) –

    Maximal radial coordinate relative to the center of mass of the refgroup for evaluation (in Å).

    If rmax=None, the box extension is taken.

  • output (str) – Output filename.

results.bin_pos#

Bin positions (in Å) ranging from rmin to rmax.

Type:

numpy.ndarray

results.phi_bins#

Angular distances to which the PDF is calculated with shape (pdf_nbins) (Å)

Type:

numpy.ndarray

results.z_bins#

axial distances to which the PDF is calculated with shape (pdf_nbins) (Å)

Type:

numpy.ndarray

results.phi_pdf#

Angular PDF with shape (pdf_nbins, n_bins) (\(\text{Å}^{-3}\))

Type:

numpy.ndarray

results.z_pdf#

Axial PDF with shape (pdf_nbins, n_bins) (\(\text{Å}^{-3}\))

Type:

numpy.ndarray

save() None[source]#

Save results of analysis to file specified by output.