McStas - A neutron ray-trace simulation package

McStas is a general tool for simulating neutron scattering instruments and experiments. It is actively supported by DTU Physics, NBI KU, ESS, PSI and ILL

Simulated scattering from a hollow-cylinder vanadium sample.

The plot shows the intensity of scattered neutrons (red is highest intensity). The sample is at the center of the sphere with the neutron beam coming from the left. Clearly seen is the shadowing effect of the sample causing a lower intensity opposite the beam. Also seen is the effect of the non-symmetric geometry of the sample, causing lower intensity directly above and to the side of the sample.

Recent news

June 26th, 2017: Update-release 2.4.1 available

Dear all,

McStas 2.4.1 has been released and is ready for download via

Release changes are listed below, and the full list of project changes is also available at

Greetings from the McStas team - hope you will enjoy this new release! :-)

Peter Willendrup

Changes in McStas v.2.4.1, June 26th, 2017

McStas 2.4.1 is the sixth release in the 2.x series and fixes various issues with McStas 2.4, plus provides a small set of new developments.


Fixes of issues from last release:


Components and instruments:

May 19th, 2017: Three minor bugs/annoyances with 2.4

Three minor bugs/annoyances with 2.4 have been found, and now have fixes / workarounds:
  1. If you experience that your Python mcgui File->Preferences dialogue crashes (Issue 470), please:
  2. The MCPL_output component was shipped with a silly off-by-one error that may prevent you from merging the output. (Issue 475)
  3. On older Ubuntu's (14.04 tested), the dependency python3-pyqtgraph is not available (Issue 471)

We envisage that new issues can occur over the next weeks, and aim to fix these by a minor update release.

Please report any bug found to our GitHub issue system

Best and happy simulating! :-)

May 18th, 2017: Minor bug with McStas 2.4

A minor bug with McStas 2.4 has been found, which prevents the user from starting the File->Configuration dialogue in mcgui. If you encounter an error message like
/usr/share/mcstas/2.4/tools/Python/mcgui/../mccodelib/ SyntaxWarning: name 'configuration' is used prior to global declaration
  global configuration
user config does not exist: /home/farhi/.mcstas/2.4/mccode_config.json
Traceback (most recent call last):
  File "/usr/share/mcstas/2.4/bin/../tools/Python/mcgui/", line 615, in handleConfiguration
  File "/usr/share/mcstas/2.4/tools/Python/mcgui/", line 171, in showConfigDialog
    dlg = McConfigDialog()
  File "/usr/share/mcstas/2.4/tools/Python/mcgui/", line 1007, in __init__
    prefix = mccode_config.get_mccode_prefix()
AttributeError: 'module' object has no attribute 'get_mccode_prefix'
You should: Sorry for any inconvenience caused!

May 18th, 2017: Updated install instructions.

Dear all,

The content of the installation pages have been updated, please consult

May 17th, 2017: McStas 2.4 release!

Dear all,

McStas 2.4 has been released and is ready for download via

Selected highligts from the release are listed below. The full list of changes is also available at

Greetings from the McStas team - hope you will enjoy this new release! :-)

Peter Willendrup

Changes in McStas v.2.4, May 17th, 2017

McStas 2.4 is the fifth release in the 2.x series and fixes various issues with McStas 2.3, plus provides important new developments.

Note that we only provide 64 bit packages now, with the exception of Debian systems and the Windows platform! (32bit packages for a given platform can be made available on request)

March 17th, 2017: Video presentation about using iFit with McStas by Emmanuel Farhi (ILL)

Dear all,

Emmanuel Farhi (McStas team & ILL Spectroscopy Group) visited the ESS DMSC in Copenhagen today and gave a nice talk about using iFit and McStas together. The presentation was recorded and is now available for viewing online here. Further information below:

Using iFit to control McStas simulations, and more.

The iFit tool will be presented. It is a generic data analysis and fitting infrastructure. A special focus will be put on the ability to launch McStas simulations, and retrieve the monitor data. The fitting capability of iFit allows to optimise a defined figure of merit (e.g. monitor or so) by changing the instrument parameters. This type feature is for instance used in the guide-bot from Mads Bertelsen, but it is applicable to any instrument model. Other features will be presented, such as the 4D convolution of a McStas TAS-type instrument with an 4D S(q,w) dispersion volume, which could be used for e.g. Bifrost. More on

Previous news items: 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003,2002, 2001, 2000, 1999, 1998.