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),
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):
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),
implemented by NeutronStructureFactorConstraint (in barns, with
\(\bar b\) in fm). Its real-space counterpart (eq. 10) is
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,
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):
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.