Technical Documentation

Documentation of the physics, algorithms, and implementation details behind the SimEx-Debye Scattering Simulator.

See the code repository at: https://git.xfel.eu/simulation/simex-debye/.

Simulation Details

The Debye Scattering Equation

The simulator computes scattering intensity via the Debye scattering equation, which provides the orientational average for isotropic samples. We compute relative orientationally averaged molecular scattering (up to an overall scale factor); detector and beamline prefactors are handled separately or not modeled.

I(Q)=i=1Nj=1Nfi(Q)fj(Q)sin(Qrij)QrijI(Q) = \sum_{i=1}^{N} \sum_{j=1}^{N} f_i(Q) f_j(Q) \frac{\sin(Q r_{ij})}{Q r_{ij}}
fi(Q)atomic form factor for atom irijrirj (interatomic distance in A˚)2θscattering angle;θ=half-angleQ4πλsin(θ) (momentum transfer in A˚1) \begin{aligned} f_i(Q) &\coloneqq \text{atomic form factor for atom } i \\ r_{ij} &\coloneqq \lVert \mathbf{r}_i - \mathbf{r}_j \rVert \text{ (interatomic distance in } \AA\text{)} \\ 2\theta &\coloneqq \text{scattering angle}; \quad \theta = \text{half-angle} \\ Q &\coloneqq \frac{4\pi}{\lambda} \sin(\theta) \text{ (momentum transfer in } \AA^{-1}\text{)} \end{aligned}
Ipairs(Q)=i<jfi(Q)fj(Q)sin(Qrij)Qrij ⁣:pair contributionsIself(Q)=i=1Nfi2(Q) ⁣:self-terms (diagonal)I(Q)=2Ipairs(Q)+Iself(Q) ⁣:total intensityO(N2,NQ) ⁣:complexity for N atoms, NQ Q-points \begin{aligned} I_{\text{pairs}}(Q) = \sum_{i<j} f_i(Q) f_j(Q) \frac{\sin(Qr_{ij})}{Qr_{ij}} &\colon \text{pair contributions} \\ I_{\text{self}}(Q) = \sum_{i=1}^{N} f_i^2(Q) &\colon \text{self-terms (diagonal)} \\ I(Q) = 2 I_{\text{pairs}}(Q) + I_{\text{self}}(Q) &\colon \text{total intensity} \\ \mathcal{O}(N^2, N_Q) &\colon \text{complexity for } N \text{ atoms, } N_Q \text{ Q-points} \end{aligned}

Atomic Form Factors

Cromer-Mann (1968)

4-Gaussian + constant parameterization (coefficients stored locally for 98 elements).

f0(Q)=k=14akexp(bk(Q4π)2)+cf_0(Q) = \sum_{k=1}^{4} a_k \exp\left(-b_k \left(\frac{Q}{4\pi}\right)^2\right) + c
Waasmaier–Kirfel (1995)
Alternative parameterization via periodictable using cromermann.fxrayatq().

Computes f0(Q)f_0(Q) only (no anomalous f(E),f(E)f'(E), f''(E) corrections). This ignores dispersion corrections and may be inaccurate near absorption edges or when resonant scattering effects are significant.

Difference Scattering Pipeline

For pump–probe time-resolved XSS experiments, the difference signal ΔI(Q)\Delta I(Q) combines solute structural change with solvent thermal response. Time dependence arises through the excitation fraction α(t)\alpha(t) and solvent heating parameters, not structural evolution.

Solute Difference

Load ground and excited state structures (XYZ), compute intensities:

ΔI(Q)=Iexcited(Q)Iground(Q)\Delta I(Q) = I_{\text{excited}}(Q) - I_{\text{ground}}(Q)
Solvent Response

Load experimental (S/T)(\partial S/\partial T) data and interpolate onto the Q grid.


This is multiplied by a scalar temperature rise (or fitted amplitude) to estimate the solvent contribution to the signal.

Combined Signal

The measured difference signal combines both contributions:

ΔI(Q,t)α(t)ΔIsolute(Q)+β(t)ΔIsolvent,unit(Q)\Delta I(Q,t) \approx \alpha(t) \cdot \Delta I_{\text{solute}}(Q) + \beta(t) \cdot \Delta I_{\text{solvent,unit}}(Q) where α(t)\alpha(t) is the time-dependent excited state fraction, and β(t)\beta(t) is the solvent-heating amplitude (e.g., proportional to temperature jump).

Image Reconstruction Pipeline

We forward-simulate a 2D detector image by applying the same effects that are corrected during 1D reduction, then re-integrate as a consistency check.

1. Forward project 1D signal onto detector coordinates

Simulated 1D difference signal is projected onto detector geometry.


The 1D curve is mapped to a 2D image (radius vs azimuthal angle).

2. Map radial coordinate → pixel geometry
...
3. Apply absorption
...
4. Apply solid-angle correction
...
5. Apply polarization correction
...
6. Apply flat-field
...
7. Add dark/background
...
8. Add noise
...
9. Add geometry uncertainty
...
10. Azimuthally integrate to validate closure
...

Usage

1. Load Structures

Upload XYZ or PDB files for ground and excited states. Structures are parsed via SimEx-Lite SampleData to extract atomic numbers and positions.

2. Configure Solvent

Select a solvent with (S/T)(\partial S/\partial T) differential data. Set concentration to scale the solute contribution relative to the solvent background.

3. Set Pump Parameters

Define photon energy (eV), excess energy deposited as heat per absorption, and excitation fraction (α(t)\alpha(t)). The heat deposition is used to estimate temperature jump and solvent response amplitude.

4. Detector Geometry

Configure sample-detector distance and beam center. Supports European XFEL detectors with module layouts.

5. Compute & Analyze

View ΔI(Q)\Delta I(Q) with separated contributions: total signal, scaled solute difference (αΔIsolute\alpha \cdot \Delta I_{\text{solute}}), and solvent thermal response. Identify optimal Q-ranges for your experiment.

6. Compare & Export

Compare multiple simulation configurations, save results for analysis, and use predictions to optimize beamtime parameters.