Dyna is a simulation program for reflectivity and transmittance of x-rays and optics, aimed at determining structural, magnetic and electronic stackings in ultrathin multilayers.

Dyna performs x-ray reflectivity simulation and fits.

It includes anomalous, magnetic and anisotropic components in the index of refraction. Dyna simulates reflectivities either versus angle, or versus x-ray energy, with arbitrary incident and outgoing polarizations; it simulates Kerr and Faraday spectra, and transmittance.

Simulations of angular or energy scans can be simultaneously fitted against one model.

The program integrates a toolbox to create charge and magnetic scattering factors from the tables bundled with the code.

Dyna was also designed for pedagogical aims, making easy to slide parameters for on-the-fly calculations.

Dyna is an on-going free and open-source project, under Python + Qt, or Matlab environments. Dyna can also be freely downloaded, and support is offered to users upon reasonable request.

🔬 Dyna at a Glance

DescriptionSimulation and refinement of X-ray/optical reflectivity, transmittance, Kerr, and Faraday effects for ultrathin multilayers.
Developed byInstitut Néel, CNRS, Grenoble, France
LicenseGPL-2.0-or-later (Free & Open Source)
Latest Version6.8.3 (August 2026)

✨ Key Features

CategoryCapabilities
PhysicsAnomalous, magnetic, and anisotropic index of refraction (Spin-orbit coupling in valence states negligible)
Scan TypesAngular (θ), Q-space, Energy (E), or fixed Q (Arbitrary incident & outgoing polarizations: σ, π, circ±)
MagnetismMagnetic-sensitive susceptibility, arbitrary magnetization direction (Euler angles: φ, γ), Kerr & Faraday rotation/ellipticity (small-angle approximation)
AnisotropyUniaxial symmetry along film depth (Oriented molecules, orbitally ordered films)
FittingMulti-fit: simultaneous refinement against multiple datasets (angle/energy scans, any polarization, constraints, parameter limits)

🧮 Calculation Formalisms

TypeMethods
ScalarParratt (fast analytical)
MagneticMagnetic Parratt (transverse), Elzo, Stepanov (fast analytical), Berreman-Elzo, Berreman-Stepanov (exact 4×4 tensor validation)
TransmissionStructural & magnetic-sensitive transmittance (Parratt, Elzo, Stepanov)

🎯 Typical Use Cases

ApplicationDetails
StructuralLayer thickness, density, roughness in multilayers
MagneticMagnetization profiles, domain structures, magnetic depth profiling
ElectronicAnomalous dispersion (f’, f”) from atomic tables
PedagogyInteractive parameter sliding for on-the-fly effects

⚙️ Technical Details

FieldDetails
LanguagePython ≥ 3.10 + Qt5 (GUI) or headless API
DependenciesNumPy, SciPy, Matplotlib, PyYAML, PyQt5
Installationpip install DynaRef (GUI: dyna | Headless: dyna-sim)
PlatformsLinux, macOS, Windows

🔗 Resources

ResourceLink
Documentationpydyna.readthedocs.io
Source Codegitlab.com/dynadevgroup/Dyna
ContactStéphane Grenier – stephane.grenier@neel.cnrs.fr

Features

  • magnetic-sensitive susceptibility, arbitrary magnetic moment direction described by Euler angles, with the limitation of neglictible spin-orbit coupling in the valence states
  • anisotropic susceptibility, in the limitation of an uniaxial symmetry along the depth of the film, for the simulation of oriented molecules or orbitally ordered films (not in python code yet)
  • structural and magnetic sensitive transmittance.
  • Angular/Q scans
  • Energy spectra at fix angle or fix Q
  • Polarization Analysis, in and out
  • Refinement in user-defined interval, with limits on parameters, and constrains between parameters
  • Multifit : one system is refined by simultaneous simulations of various data (angle and energy scans, of any polarization, energy or angle configurations).
  • Calculates Scattering Factors from Tables
  • GUI workflows
  • Scriptable simulations
  • Scriptable fitting
  • JSON/YAML config files
  • YAML GUI project persistence
  • Scientific regression tests

API (Application Programming Interface)

Users can script or automate Dyna’s functionality without using the GUI. It is designed for developers or advanced users who want to integrate Dyna into their own workflows or scripts.

CLI (Command Line Interface)

Run Dyna simulations, fits, or other tasks directly from the command line (e.g., Terminal on Linux/macOS or Command Prompt/PowerShell on Windows).

Reference

In case of use, please cite the reference paper :

X-ray resonant magnetic reflectivity of stratified magnetic structures: Eigenwave formalism and application to a W/Fe/W trilayer

M. Elzo, et al., Journal of Magnetism and Magnetic Materials, 324 (2), pp. 105-112 (2012)

http://dx.doi.org/10.1016/j.jmmm.20… preprint

Screenshots

All in one GUI, experiment and sample description, optimization panel, sliders to play around with parameters.
Dyna integrates a GUI to plot and build charge and magnetic x-ray scattering factors.

Provenance

Dyna was developped from Elza Bontempi‘s Reftool within Matlab environment. Reftool was using Zak’s formalism, which was revisited and simplified, leading to Elzo’s formalisms. Both formalisms are based on the usual matricial optical formalism. The scattering formalism, by Stepanov and Sinha, was coded in order to better treat thick systems, notably for transmissivity (or “transmittance”).

We swiched to Python since 2020 for portability.

Top image: study of the sun reflection on water by Leonardo, from a codex in display at Da Vinci’s exhibition in 2019, Musée du Louvre. (S. G.)