McXtrace logo

McXtrace - An X-ray ray-trace simulation package

Synchrotron SOLEIL DTU Physics


About McXtrace
 Project Partners
 Project People


 Wiki (GitHub)

Mailing list



Code-repository (GitHub)

Report bugs (GitHub)

McXtrace - Monte Carlo Xray Tracing, is a joint venture by

DTU_logo.gif Soleil.png

Our code is based on technology from mcstas_logo_thumb.png

Code repository (shared with 'McStas') is located at

For information on our progress, please subscribe to our user mailinglist..

Recent McXtrace News

The latest McXtrace news.

Migrating from McXtrace 1.x to 3.x? - Use the wiki-based guides

McXtrace 3.2 quick mxdoc bugfix

[07/07/2022]Dear all, a minor annoyance in the 3.2 release of McXtrace has been found:
Many of the component information headers will not render correctly in mxdoc / the html documentation.
To fix the problem locally on your machine, please:
  1. Replace your McXtrace 3.2 $MCXTRACE/tools/Python/mccodelib/ by the one available on mccode-3 on GitHub
  2. Run mxdoc -i (with needed admin credentials if needed, command replaces the html files in $MCXTRACE
A fresh McXtrace release will be spun out later in the summer or early fall.

McXtrace 3.2 released

[06/07/2022]Dear all, The new 3.2 release of McXtrace is now out:

McXtrace "next-generation", v. 3.2 is built and ready for download!

Download and installation instructions are available via our GitHub INSTALL-doc pages.

Selected highligts from the releases are listed below. The full list of changes for both releases is also available at our CHANGES_McXtrace document

!!! Please start your migration to 3.x: !!!The earlier McXtrace 1.7.1 was the "finals update" to the 1.x series, sharing a subset of tool features with McXtrace 3.1. The Wiki has a dedicated section on McXtrace 1.x -> McXtrace 3.x conversion that includes:

- If you are still in trouble, please write us a GitHub issue or an email to

Release highligts

  • McXtrace 3.2 is the third official release in the 3.x series, with a modernised code-generator and support for GPU acceleration on NVIDIA cards.
  • Thanks to all members of the joint McStas-McXtrace team, you guys ROCK!
  • Fixes of issues from last 3.x release:
  • Documentation & guides:
    • Inline component documentation has been given an overhaul, most component doc pages should now render in a meaningful way
  • Installation:
    • As usual, our install docs are available on the McCode GitHub page
    • The meta-packages for Debian/Ubuntu and Fedora are named e.g. mcxtrace-suite-python-ng 'next generation' for 3.x and mcxtrace-suite-python for the 1.x series packages.
    • OpenACC GPU (and CPU multicore) acceleration is at the time of release still ONLY supported on Linux systems, as this is the only platform targeted by the NVIDIA HPC package. Versions 20.x-23.x should all work. On Windows 64bit systems, support is expected to arrive "later", but you may run on your GPU via the so-called "Windows Subsystem for Linux" (WSL). macOS is unfortunately not supported by NVIDIA HPC acceleration.
    • McXtrace 3.2 enables further components and instruments GPU. Effectively all functionality has been ported to 3.x.
  • Interoperability with other codes:
    • McXtrace now ships with a "python-aware" code generator for generating "McStasScript" code, example:
      • mcxtrace-pygen Instrument.instr --> generates
    • Using 'jupytext' this file may easily be converted to a notebook:
      • jupytext --to ipynb --> generates Instrument_generated.ipynb
    • See for more information on McStasScript, that also works for X-rays even though being labed McStas for our "neutron sibling".
    • Thanks to the work of José Robledo (FZJ), we now have a better interface to the Small-Angle Scattering models from SASview, aka. SASmodels.
      Due to the big number of included models that each correspond to a McXtrace component, these are now found in the "sasmodels" folder of your McXtrace installation.
  • Tools:
    • mxplot (-pyqtgraph) has received a couple of bugfixes relating to plotting in log-mode.
    • mxrun has now a number of --optimize options to Optimize beam-line parameters. Specify min,max or min,start,max for parameters to vary. the default optimizer is Powell from SciPy. You may choose the monitor to optimize, or all. Use mxrun -h for more help.
    • mxgui Run dialogue now allows to Optimize beam-line parameters. Specify min,max or min,start,max for parameters to vary. the default optimizer is Powell from SciPy. You may choose the monitor to optimize, or all.
  • Components and Instruments:
    • As mentioned above, SASmodels now come in the form of 94 (!) components in the sasmodels folder.
    • The Isotropic_Sqw sample by Emmanuel Farhi has received a number of updates.
    • The Fluorescence sample by Emmanuel Farhi has received a number of updates.
    • PowderN and Single_crystal may now use material definition from a CIF file, calls the cif2hkl tool behind the scenes, work done by Emmanuel Farhi.
    • New instrument SOLEIL_CASSIOPEE.instr from Emmanuel Farhi.
    • Many updates to SOLEIL_ instruments.
  • Core simulation framework / code-generator:
    • McXtrace will now issue a warning if you generate GROUPS of a single component, as this may lead to unphysical results. (GROUPS are intended for 2 or more components in an "exclusive-or" setup.
  • Platforms:
    • We still support 64bit Windows 10/11 on Intel, all recent 64bit macOS including 13.0 Ventura and later on both Intel and Apple Silicon/M1 processors. Debian-based distros on Intel and Arm, Fedora on Intel.
    • On macOS and Windows we now bundle a Mambaforge Python with the installation.
We hope you will enjoy this new release!!!
2022, 2021, 2020 and older News

Last Modified: Friday, 07-Jul-2023 18:25:02 CEST
Search website mailinglist archive GitHub repos