NCrystal: A library for thermal neutron transport

Xiao Xiao Cai, T. Kittelmann*

*Corresponding author for this work

Research output: Contribution to journalJournal articleResearchpeer-review

268 Downloads (Pure)


An open source software package for modelling thermal neutron transport is presented. The code facilitates Monte Carlo-based transport simulations and focuses in the initial release on interactions in both mosaic single crystals as well as polycrystalline materials and powders. Both coherent elastic (Bragg diffraction) and incoherent or inelastic (phonon) scattering are modelled, using basic parameters of the crystal unit cell as input. Included is a data library of validated crystal definitions, standalone tools and interfaces for C++, C and Python programming languages. Interfaces for two popular simulation packages, Geant4 and McStas, are provided, enabling highly realistic simulations of typical components at neutron scattering instruments, including beam filters, monochromators, analysers, samples, and detectors. All interfaces are presented in detail, along with the end-user configuration procedure which is deliberately kept user-friendly and consistent across all interfaces. An overview of the relevant neutron scattering theory is provided, and the physics modelling capabilities of the software are discussed. Particular attention is given here to the ability to load crystal structures and form factors from various sources of input, and the results are benchmarked and validated against experimental data and existing crystallographic software. Good agreements are observed.
Program summary:
Program Title: NCrystal Program Files doi:
Licensing provisions: Apache License, Version 2.0 (for core NCrystal).
Programming language: C++, C and Python
External routines/libraries: Geant4, McStas
Nature of problem: Thermal neutron transport in structured materials is inadequately supported in popular Monte Carlo transport applications, preventing simulations of a range of otherwise interesting setups.
Solution method: Provide models for thermal neutron transport in flexible open source library, to be used standalone or as backend in existing Monte Carlo packages. Facilitate validation and work sharing by making it possible to share material configurations between supported applications.
Original languageEnglish
Article number106851
JournalComputer Physics Communications
Number of pages30
Publication statusPublished - 2020


  • Thermal neutron scattering
  • Simulations
  • Monte Carlo
  • Crystals
  • Bragg diffraction


Dive into the research topics of 'NCrystal: A library for thermal neutron transport'. Together they form a unique fingerprint.

Cite this