RDFDiporder¶
- class maicos.RDFDiporder(g1: AtomGroup, g2: AtomGroup | None = None, bin_width: float = 0.1, rmin: float = 0.0, rmax: float = 15.0, bin_method: str = 'com', norm: str = 'rdf', grouping: str = 'residues', unwrap: bool = True, pack: bool = True, refgroup: AtomGroup | None = None, jitter: float = 0.0, concfreq: int = 0, output: str = 'diporderrdf.dat')[source]¶
Bases:
AnalysisBase
Spherical Radial Distribution function between dipoles.
The implementation is heavily inspired by
MDAnalysis.analysis.rdf.InterRDF
and is according to Zhang and Galli[1] given by\[g_\mathrm{\hat{\boldsymbol{\mu}}, \hat{\boldsymbol{\mu}}}(r) = \frac{1}{N} \left\langle \sum_i \frac{1}{n_i(r)} \sum_{j=1}^{n_i(r)} (\hat{\boldsymbol{\mu}}_i \cdot \hat{\boldsymbol{\mu}}_j) \right \rangle\]where \(\hat{\boldsymbol{\mu}}\) is the normalized dipole moment of a
grouping
and \(n_i(r)\) is the number of dipoles within a spherical shell of distance \(r\) and \(r + \delta r\) from dipole \(i\).For the correlation time estimation the module will use the value of the RDF with the largest possible \(r\) value.
For an detailed example on the usage refer to the how-to on dipolar correlation functions.
- Parameters:
g1 (MDAnalysis.core.groups.AtomGroup) – First AtomGroup.
g2 (MDAnalysis.core.groups.AtomGroup) – Second AtomGroup.
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.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"
).norm (str, {'rdf', 'density', 'none'}) – For ‘rdf’ calculate \(g_{ab}(r)\). For ‘density’ the single group density \(n_{ab}(r)\) is computed. ‘none’ computes the number of particles occurences in each spherical shell.
grouping ({
"atoms"
,"residues"
,"segments"
,"molecules"
,"fragments"
}) –Atom grouping for the calculations.
The possible grouping options are the atom positions (in the case where
grouping="atoms"
) or the center of mass of the specified grouping unit (in the case wheregrouping="residues"
,"segments"
,"molecules"
or"fragments"
).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 useunwrap=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.pack (bool) –
When
True
, molecules are put back into the unit cell. This is required because MAICoS only takes into account molecules that are inside the unit cell.If the input contains molecules that are already packed, speed up the calculation by disabling packing with
pack=False
.refgroup (MDAnalysis.core.groups.AtomGroup) – Reference
AtomGroup
used for the calculation. Ifrefgroup
is provided, the calculation is performed relative to the center of mass of the AtomGroup. Ifrefgroup
isNone
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 everyconcfreq
frames.output (str) – Output filename.
- results.bins¶
radial distances to which the RDF is calculated with shape (
rdf_nbins
) (Å)- Type:
- results.rdf¶
RDF either in \(\text{eÅ}^{-2}\) if norm is
"rdf"
or"density"
or \(\text{eÅ}\) if norm is"none"
.- Type:
References