Skip to main content

Maintenance made-with-python GIT Python 3.10

This repository contains the Dyna development files.

"Dynamic x-ray reflectivity off- or on-resonant regime for isotropic, magnetic and anisotropic (multi)layer simulations and refinements Program"

About The Project

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.

Among so many programs in the field, Dyna has several specificities : it includes anomalous, magnetic and anisotropic components in the index of refraction; it simulates reflectivities either versus angle, or versus x-ray energy, with arbitrary incident and out-going polarizations; it simulates Kerr and Faraday spectra, and transmittance through thin layers.

All the simulations can be simultaneously fitted against one model.

The program integrates a toolbox to create charge and magnetic factors from tables.

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

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.

Copyright Institut Neel, CNRS, Grenoble, France

Project Collaborators:

Questions to:

Stéphane Grenier, stephane.grenier@neel.cnrs.fr

Installation

pip install DynaRef

DynaRef is the name of the package available from Pypi, the DynaRef package contains Dyna. Just launch with:

% dyna

On macOS, a native Dyna.app bundle with the correct application name can be built using the instructions in docs/installation.rst.

Development install

git clone https://gitlab.com/dynadevgroup/Dyna
cd Dyna
pip install -e .
dyna

Python API

Dyna calculations can run without starting the Qt interface:

from dyna import Experiment, Formalism, load_builtin_sample, run_reflectivity

experiment = Experiment()
experiment.Formalism = Formalism.STEPANOV_ANGLE
experiment.Angle = [0.1, 5.0, 0.01, 0.0]
experiment.Energy[0] = 700.0

result = run_reflectivity(load_builtin_sample("w-si"), experiment)
print(result.x, result.intensity)

For reproducible batch calculations, use a JSON or YAML configuration such as examples/workflows/stepanov-angle.json or examples/workflows/stepanov-angle.yaml:

dyna-sim examples/workflows/stepanov-angle.json --output reflectivity.csv
dyna-sim examples/workflows/stepanov-angle.yaml --output reflectivity.csv
dyna-sim examples/workflows/stepanov-angle.json --output reflectivity.npz

The same file can be used directly from Python:

from dyna import load_config

result = load_config("examples/workflows/stepanov-angle.json").run()
result.save("reflectivity.csv")

Headless fitting is also available from JSON or YAML:

dyna-sim fit examples/workflows/fit-angle.json --summary fit-summary.json --output fitted.csv
dyna-sim fit examples/workflows/fit-angle.yaml --summary fit-summary.json --output fitted.csv

More ready-to-adapt examples are available in examples/README.md.

The graphical interface can also save and load Dyna projects as YAML files. This is the recommended project format for editable samples and experimental parameters; legacy project files can still be loaded. The GUI also provides sample-only YAML import/export actions for reusing the same layer stack across several projects.

In the GUI, Simulation Settings selects only the scan type (angular or energy), while the Formalism menu selects Parratt, the fast historical Elzo or Stepanov solver, or an exact Berreman-Elzo/Berreman-Stepanov validation solver. A practical workflow is to fit with Elzo or Stepanov and verify the final parameters with the corresponding Berreman choice.

Dyna also includes a small built-in YAML sample library:

from dyna import list_samples, load_builtin_sample

print(list_samples())
sample = load_builtin_sample("w-si")

List or export those samples from the command line with dyna-sim samples. The versioned YAML project and sample schema is documented in docs/yaml-format.rst.

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
  • Calculates Kerr MO rotation and ellipticities, providing that the angles are small, validity to be checked case by case
  • Scriptable

Testing

Integration tests are to be found in the tests folder. Testing is done with pytest, it needs packages listed in tests/requirements_tests.txt. Mainly : pytest, pytest-qt and pytest-env. To launch all integration tests first activate the Dyna's python environement and then in the terminal do:

pytest tests/

These tests mimic common user actions on the interface in order to check a basic minimum viability. As not all functionality is available, some tests have been written but are set to be skipped.

Documentations:

https://pydyna.readthedocs.io

The development backlog is maintained in TODO.md.

Metadata

Release files for DynaRef 6.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DynaRef 6.8.3
File Size Uploaded Provenance Actions
dynaref-6.8.3.tar.gz 24.2 MB Without provenance Details for dynaref-6.8.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for DynaRef 6.8.3
File Interpreter ABI Platform Actions
dynaref-6.8.3-py3-none-any.whl Python 3 none any Details for dynaref-6.8.3-py3-none-any.whl

Total release size: 48.6 MB

Release files / dynaref-6.8.3.tar.gz

Download URL dynaref-6.8.3.tar.gz
Size 24.2 MB
Tags Source
SHA-256 checksum
How to use checksums
d1fbb3af86f2df14b1dbe96d8a442ae4418903b68bfd8a7ea382124f8f60c3ba
BLAKE2b-256 checksum
How to use checksums
d94fc5541f835053cf772ff1805a6a0c8bdd707948c1b923a7ba4f23deece993
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / dynaref-6.8.3-py3-none-any.whl

Download URL dynaref-6.8.3-py3-none-any.whl
Size 24.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
76e8ed5bd4e83ada6f1afcb6ba6fc52d866260bc597f3867ba4af636edb0d070
BLAKE2b-256 checksum
How to use checksums
f0a88a5fda8e700111aee790821a0d50691dbc2339f2f648cce302ff2f516c2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for DynaRef 6.8.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page