NuMagSANS Documentation#

Overview#

NuMagSANS is a GPU-accelerated computational engine for the simulation and analysis of nuclear and magnetic small-angle neutron scattering (SANS).

The aim of NuMagSANS is to provide the complete set of experimentally accessible SANS cross sections and associated observables, including unpolarized measurements as well as spin-resolved and spin-polarized channels such as SANSPOL and POLARIS. Contributions from nuclear and magnetic scattering can be treated separately or in combination, making the framework applicable beyond purely magnetic scattering problems.

NuMagSANS is designed as a deterministic single-run computational engine with a clear execution pipeline and reproducible output.

\[\begin{split}\left. \begin{aligned} &\text{Atomistic spin dynamics} \\ &\text{Micromagnetics} \\ &\text{Spin--lattice dynamics} \\ &\text{MD / DFT / Monte Carlo / custom models} \end{aligned} \right\} \longrightarrow \left\{ N(\mathbf r),\, \mathbf M(\mathbf r) \right\} \longrightarrow \mathrm{NuMagSANS} \longrightarrow \frac{d\Sigma}{d\Omega}(\mathbf q)\end{split}\]

Key Features#

  • GPU-accelerated atomistic SANS computation

  • Full polarization analysis (spin-flip, non-spin-flip, chiral terms)

  • 2D and 1D scattering cross sections

  • Correlation functions and pair distribution functions

  • Spectral decomposition of scattering amplitudes

  • Python facade for simplified workflow integration

  • Version-matched machine-readable context for AI-assisted simulation setup

AI-assisted simulation setup#

NuMagSANS provides a machine-readable guide that helps general-purpose AI assistants generate and check input layouts, Python configuration scripts, rotation sweeps, and output selections without guessing the specialized API. After installation, print the context for the local version with:

python -m NuMagSANS > numagsans-context.txt

The assistant supports preparation and consistency checking; NuMagSANS remains a deterministic simulator, and scientific assumptions, validation, and interpretation remain the user’s responsibility. See AI-assisted simulations for the recommended workflow.

Corresponding Publication#

If you use NuMagSANS in your work, please cite:

NuMagSANS: a GPU-accelerated open-source software package for the generic computation of nuclear and magnetic small-angle neutron scattering observables of complex systems.

M. P. Adams and A. Michels, Journal of Applied Crystallography 59, 3 (2026).

@article{adams2026numagsans_paper,
  author  = {Adams, Michael P. and Michels, Andreas},
  title   = {{\it NuMagSANS}: a GPU-accelerated open-source software package for the generic computation of nuclear and magnetic small-angle neutron scattering observables of complex systems},
  journal = {Journal of Applied Crystallography},
  year    = {2026},
  volume  = {59},
  number  = {3},
  pages   = {},
  month   = {Jun},
  doi     = {10.1107/S160057672600258X},
  url     = {https://doi.org/10.1107/S160057672600258X},
}

License#

NuMagSANS is released under the MIT License.