DiporderStructureFactor#

class maicos.DiporderStructureFactor(atomgroup: AtomGroup, bin_method: str = 'com', grouping: str = 'molecules', refgroup: AtomGroup | None = None, unwrap: bool = True, jitter: float = 0.0, concfreq: int = 0, qmin: float = 0, qmax: float = 6, dq: float = 0.01, output: str = 'sq.dat')[source]#

Bases: AnalysisBase

Structure factor for dipoles.

Extension the standard structure factor \(S(q)\) by weighting it with different the normalized dipole moment \(\hat{\boldsymbol{\mu}}\) of a group according to

\[S(q)_{\hat{\boldsymbol{\mu}} \hat{\boldsymbol{\mu}}} = \left \langle \frac{1}{N} \sum_{i,j=1}^N \hat \mu_i \hat \mu_j \, \exp(-i\boldsymbol q\cdot [\boldsymbol r_i - \boldsymbol r_j]) \right \rangle\]

For the correlation time estimation the module will use the value of the structure factor with the smallest possible \(q\) value.

For an detailed example on the usage refer to the how-to on dipolar correlation functions. For general details on the theory behind the structure factor refer to Small-angle X-ray scattering.

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – A AtomGroup for which the calculations are performed.

  • 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.

  • qmin (float) – Starting q (1/Å)

  • qmax (float) – Ending q (1/Å)

  • dq (float) – bin_width (1/Å)

  • output (str) – Output filename.

results.q#

length of binned q-vectors

Type:

numpy.ndarray

results.structure_factors#

Structure factor

Type:

numpy.ndarray

save() None[source]#

Save results of analysis to file specified by output.