Skip to content

Histogram-based Debye method (with/without PBC) #12

Description

@mlund

Summary

Add a histogram-based Debye evaluation method (binned interatomic distances → I(q) = Σ_r h(r) sin(qr)/(qr)) to complement the current exact O(N²) direct pair sum, with an optional periodic (minimum-image) mode. This is the approach used by AUSAXS, gmx scattering, and debyer.

A single addition that ties several threads together: fast Debye, a clean PBC Debye path, AUSAXS-style partial-histogram fitting, and cheap trajectory accumulation.

Motivation / benefits

  • Speed — histogram the pairwise distances once, then evaluate any q-grid cheaply: O(N_bins · N_q) vs the direct sum's O(N² · N_q). Optional Monte-Carlo pair sampling (gmx-style coverage) gives an O(N) approximate path for large systems.
  • Periodicity (the main point) — the histogram is the natural home for minimum-image (MIC) distances: MIC pair distances drop straight into the bins. This gives a general condensed/periodic Debye path:
    • monatomic fluid/solid and molecular fluids (cross-boundary correlations via nearest image; intramolecular distances recovered for molecules < L/2 with no connectivity),
    • dilute solute (reduces to the isolated-molecule profile),
    • optional continuum cut-off correction (debyer-style) for r_c < L/2: subtract (4π ρ / q³)(q r_c cos q r_c − sin q r_c) (+ optional sinc/Lorch damping) — important for low-q S(q) of condensed systems, negligible for dilute solutes. Beware double-counting against the excluded-volume model, which already subtracts a homogeneous bulk.
  • Fitting — partial histograms by form-factor-type pair (atom–atom, atom–water, water–water; cf. AUSAXS) recombine over the fit knobs c1/c2 cheaply — the Debye analogue of the cached MultipoleModel.
  • Trajectories — per-frame histograms are additive, so ⟨I(q)⟩ over an ensemble is one accumulation + one transform (debyer's multi-frame trick), efficient for long trajectories.

Cost / caveats

  • Binning trades the direct sum's exactness for a discretization error controlled by bin width — mitigate with narrow and/or weighted bins.
  • q-dependent form factors require per-(type-pair) histograms (or a q-dependent histogram) to combine correctly.

Scope (suggested)

  • Histogram (binned) Debye kernel, non-periodic, validated against the existing direct Debye.
  • Partial histograms per form-factor-type pair; cached recombination over c1/c2.
  • Periodic (MIC) mode using the per-frame box; half-box (r_c < L/2) guard/warning.
  • Optional continuum cut-off correction (+ sinc/Lorch damping) for condensed systems; document interaction with excluded-volume subtraction.
  • Monte-Carlo pair-sampling option for large systems.
  • Trajectory histogram accumulation across frames.

References

  • AUSAXS — Lytje & Pedersen 2025, J Appl Cryst 58, 1332 (partial histograms, weighted bins).
  • gmx scattering (GROMACS 2024+) — histogram Debye, MIC, Monte-Carlo coverage.
  • debyer (M. Wojdyr) — MIC + continuum cut-off correction (+ sinc/Lorch damping) for bulk.

Context: arose from the Acta Cryst D software-paper Periodicity discussion (make-whole vs MIC-Debye vs reciprocal-lattice explicit).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions