McStas is a Monte Carlo ray-tracing simulator designed for neutron scattering instruments and experiments. Researchers use it to investigate how neutrons travel through instrument components, interact with samples and reach detectors.
Neutron scattering facilities depend on carefully designed beamlines to deliver particles with suitable energies, directions and polarisation. McStas allows scientists to construct virtual instruments and examine their expected performance before committing to physical changes.
The software uses a descriptive approach to instrument construction. Sources, guides, monochromators, choppers, samples and detectors can be assembled into a model of the experimental arrangement. McStas then generates an executable simulation from the instrument description and traces neutron trajectories through the components.
This approach is valuable for instrument design, experiment planning and the interpretation of measured scattering data. Scientists can adjust geometries, investigate individual components and compare proposed configurations using reproducible numerical experiments.
McStas shares its underlying development platform with McXtrace, which provides related capabilities for X-ray instruments.
This is free and open source software.
Key Features
- Monte Carlo ray tracing of neutron scattering instruments.
- High-level instrument descriptions translated into executable simulations.
- Reusable libraries of neutron sources, guides, collimators and detectors.
- Components for monochromators, analysers, choppers and samples.
- Simulation of continuous and pulsed neutron sources.
- Modelling of triple-axis and time-of-flight instruments.
- Support for polarised neutron experiments.
- Configurable instrument geometry and component parameters.
- Parameter scans for investigating instrument performance.
- Visual inspection of instrument layouts and neutron trajectories.
- Histogram, monitor and event-data output for subsequent analysis.
- NeXus and HDF5 data output for scientific workflows.
- Parallel execution for computationally demanding simulations.
- Graphical and command-line interfaces for simulation control.
- Cross-platform support – runs on Linux, macOS, and Windows.
Website: www.mcstas.org
Support:
Developer: Risø / ILL / KU and contributors
License: GNU General Public License v3.0

McStas is written in C. Learn C with our recommended free books and free tutorials.
Related Software
| Physics Tools | |
|---|---|
| ROOT | Solves the data analysis challenges of high-energy physics |
| OpenFOAM | Facilitates the numerical solution of partial differential equations |
| McStas | Neutron ray-trace simulation application |
| Octopus | Real-space, real-time implementation of TDDFT |
| Geant4 | Toolkit for the simulation of the passage of particles through matter |
| Rivet | Particle-physics MC analysis toolkit |
| HepMC | Event record for High Energy Physics Monte Carlo generators |
| Elmer | Finite Element Software for Multiphysical Problems |
| PYTHIA | Generation of high-energy physics events |
| CP2K | Quantum chemistry and solid state physics software package |
| Sherpa | Monte Carlo event generator |
| FastJet | Software for jet finding in pp and e+e− collisions |
| SU2 | Suite for multiphysics simulation and design |
| Herwig | Multi-purpose particle physics event generator |
| Tracker | Video analysis and modeling tool designed to be used in education |
| WarpX | Advanced electromagnetic and electrostatic Particle-In-Cell code |
| Step | Interactive physics simulator |
| Meep | Electromagnetic simulation - finite-difference time-domain method |
| LHAPDF | General purpose C++ interpolator |
| ESPResSo | Molecular dynamics package |
| DualSPHysics | Smoothed Particle Hydrodynamics solver |
| Basilisk | Numerical simulation framework for solving partial differential equations |
| Gerris Flow Solver | Tool for generic numerical simulations of flows |
| ASL | Hardware accelerated multiphysics simulation platform |
Read our verdict in the software roundup.
| Ray Tracing Software | |
|---|---|
| POV-Ray | Full-featured ray tracer |
| Blender | 3D content creation suite with a huge range of uses |
| McXtrace | Monte Carlo Xray Tracing for simulation X-ray beamlines and experiments |
| McStas | Simulator for neutron scattering instruments and experiments |
| Embree | High-performance ray tracing library |
| LuxCoreRender | Rendering system for physically correct image synthesis |
| pbrt | Physically based ray tracing system |
| OSPRay | Scalable and portable ray tracing engine |
| BRL-CAD | Combinatorial Constructive Solid Geometry (CSG) solid modeling system |
| Visionaray | C++ ray tracing template library |
| MantaRay | Advanced renderer using modern rendering techniques |
| YafaRay | Montecarlo raytracing engine |
| Tachyon | Parallel / multiprocessor ray tracing system |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.