class PartialStructureFactor(md_trajectory, start_time=None, end_time=None, pair_selection=None, maximum_q_value=None, q_resolution=None, cutoff_radius=None, resolution=None, time_resolution=None, info_panel=None)

Constructor for the PartialStructureFactor object.

  • md_trajectory (MDTrajectory | AtomicConfiguration) – The MDTrajectory or configuration to calculate the partial structure factor for.
  • start_time (PhysicalQuantity of type time) – The start time.
    Default: 0.0 * fs
  • end_time (PhysicalQuantity of type time) – The end time.
    Default: The last frame time
  • pair_selection (sequence) – Only consider interactions between these groups of atoms. A sequence has to contain containing two of the following types: Element, tag name, list of indices, or None.
    Default: all interactions
  • maximum_q_value (PhysicalQuantity of type inverse length) – The maximum scattering vector length.
    Default: 15.0 / Angstrom
  • q_resolution (PhysicalQuantity of type inverse length) – The binning of the scattering vectors.
    Default: 0.05 / Angstrom
  • cutoff_radius (PhysicalQuantity of type length) – Upper limit on sampled distances.
    Default: Half the diagonal of the unit cell
  • resolution (PhysicalQuantity of type length) – The binning of the radial distribution function.
    Default: 0.05 * Angstrom
  • time_resolution (PhysicalQuantity of type time) – The time interval between snapshots in the MD trajectory that are included in the analysis.
  • info_panel (InfoPanel (Plot2D)) – Info panel to show the calculation progress.
    Default: No info panel

Return the partial structure factor.


Return the list of scattering vector magnitudes.

Usage Examples

Load an MDTrajectory and calculate the PartialStructureFactor between aluminum and oxygen atoms:

md_trajectory = nlread('')[-1]

partial_sq = PartialStructureFactor(md_trajectory,
                                    pair_selection=[Aluminum, Aluminum])

# Get the q-values and the partial structure factor.
q_values = partial_sq.qRange().inUnitsOf(Angstrom**-1)
s_q      =

# Plot the data using pylab.
import pylab

pylab.plot(q_values, s_q, label='Al-Al structure factor')
pylab.xlabel('q (1/Ang)')


This object calculates the isotropic (i.e. averaged over all scattering angles) PartialStructureFactor. It is therefore predominantly aimed at the characterization of amorphous materials.

The partial structure factor is calculated as described in Ref. [mGJ02]:

\[S_{\alpha, \beta}(q) = \delta_{\alpha, \beta} + 4 \pi \rho (c_{\alpha} c_{\beta})^{1/2} \int_0^{r_{max}} r^2 [g_{\alpha, \beta}(r) - 1] \frac{\sin(qr)}{qr}\frac{\sin(\pi r_{max}r)}{\pi r_{max} r} dr\]

where \(g_{\alpha,\beta}(r)\) is the partial radial distribution function.

If no element pair is selected, then all atoms are treated equally and the full radial distribution function is used to calculate \(S(q)\).

If the pair_selection parameter contains partially overlapping lists, the delta-function in the equation for \(S(q)\) is evaluated as \(\sqrt{\frac{ N_a N_b }{N^2}}\).

The cutoff_radius parameter determines the range of the radial distribution function. This parameter might have an influcence on the calculated structure factor at small scattering vectors.

[mGJ02]G. Gutiérrez and B. Johansson. Molecular dynamics study of structural properties of amorphous al2o3. Phys. Rev. B, 65:104202, Feb 2002. doi:10.1103/PhysRevB.65.104202.