Skip to content

Total scattering

The scattering constraints follow the conventions of Keen (2001); equation numbers below refer to that paper. Everything is built from the partial radial distribution functions, which LAMMPS computes directly from the configuration.

Partial radial distribution functions

For species \(i, j\) with concentrations \(c_i = N_i/N\) (eq. 8),

\[ g_{ij}(r) \;=\; \frac{n_{ij}(r)}{4\pi r^2\,\mathrm{d}r\,\rho_j}, \]

where \(n_{ij}(r)\) counts type-\(j\) atoms between \(r\) and \(r+\mathrm{d}r\) around a type-\(i\) atom and \(\rho_j = c_j\rho_0\), with \(\rho_0 = N/V\) the atomic number density. RDFConstraint obtains these from a LAMMPS compute rdf on a fixed grid up to r_max (at most half the shortest box length).

Faber–Ziman partial structure factors

Each partial is Fourier transformed (eq. 6):

\[ A_{ij}(Q) - 1 \;=\; \rho_0 \int_0^\infty 4\pi r^2 \big[g_{ij}(r) - 1\big]\,\frac{\sin Qr}{Qr}\,\mathrm{d}r . \]

In practice the integral is a sum over the RDF bins, \(\sum_k r_k^2\,\Delta r_k\,[g_{ij}(r_k)-1]\,\mathrm{sinc}(Qr_k)\); the \(Q\)\(r\) kernel is precomputed once per constraint at install time, so each Monte Carlo step costs one small matrix product per dataset.

Neutron: \(F_N(Q)\) and \(G_N(r)\)

The total structure factor weights the partials by concentration and coherent scattering length (eq. 9),

\[ F_N(Q) \;=\; \sum_{i,j} c_i c_j \bar b_i \bar b_j \big[A_{ij}(Q) - 1\big], \]

implemented by NeutronStructureFactorConstraint (in barns, with \(\bar b\) in fm). Its real-space counterpart (eq. 10) is

\[ G_N(r) \;=\; \sum_{i,j} c_i c_j \bar b_i \bar b_j \big[g_{ij}(r) - 1\big], \]

implemented by NeutronTotalRDFConstraint, which compares on the RDF grid restricted to the experimental \(r\)-range. Data in the form \(D(r) = 4\pi r \rho_0\, G(r)\) (eq. 29) is handled with is_dofr=True.

For hydrogen-containing samples the effective scattering length interpolates between the isotopes,

\[ \bar b_\mathrm{H} \;=\; (1 - x)\,\bar b_{^1\mathrm{H}} + x\,\bar b_{^2\mathrm{H}}, \]

set by deuteration_ratio \(x\) (\(\bar b_{^1\mathrm{H}} = -3.74\) fm, \(\bar b_{^2\mathrm{H}} = +6.67\) fm). Built-in scattering lengths can be overridden per element with the scattering_lengths argument.

X-ray: \(F_X(Q)\)

For X-rays the constant scattering lengths are replaced by \(Q\)-dependent atomic form factors \(f_i(Q)\) (eqs. 55–57):

\[ F_X(Q) \;=\; \sum_{i,j} c_i c_j\, f_{ij}(Q)\,\big[A_{ij}(Q) - 1\big], \qquad f_{ij}(Q) \;=\; \frac{f_i(Q)\,f_j(Q)} {\Big[\sum_k c_k f_k(Q)\Big]^2}, \]

so that \(F_X(Q)\) is normalised per (mean) electron. XrayStructureFactorConstraint evaluates \(f_i(Q)\) from the standard five-Gaussian analytic parameterisation, tabulated for \(Z = 1\)–98. Because measured X-ray patterns often carry an arbitrary overall scale, this constraint by default rescales the model by the analytic least-squares factor \(s = (\mathbf{y}^\text{calc}\!\cdot\mathbf{y}^\text{exp}) /(\mathbf{y}^\text{calc}\!\cdot\mathbf{y}^\text{calc})\) before computing χ² (minimise_differences=True).

Finite-box broadening

A configuration of finite extent truncates the Fourier integral at \(r_\text{max}\), which broadens the model \(F(Q)\) by the box's sinc window. Rather than sharpening the model, the experimental data is convolved with the same window so both are compared on an equal footing:

fq = ScatteringData.from_file("sample.nfq", sigmas=0.01)
fq.apply_finite_box_correction(r_max=r_max, inplace=True)

Use the same r_max as the RDFConstraint. This mirrors the box-function convolution used by RMCProfile.

Reference

  • D. A. Keen, J. Appl. Cryst. 34, 172–177 (2001) — A comparison of various commonly used correlation functions for describing total scattering.