Skip to main content

Dyna: X-ray magnetic reflectivity simulation

Project description

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

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, run_reflectivity
from dyna.Samples.Samples import SampleIni

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(SampleIni(), experiment)
print(result.x, result.intensity)

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

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

The same file can be used directly from Python:

from dyna import load_config

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

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
  • (Python Only) Scriptable
  • (Matlab only) Genetic Algorithm (requires Optimization Toolbox)

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynaref-6.2.0.tar.gz (39.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynaref-6.2.0-py3-none-any.whl (39.8 MB view details)

Uploaded Python 3

File details

Details for the file dynaref-6.2.0.tar.gz.

File metadata

  • Download URL: dynaref-6.2.0.tar.gz
  • Upload date:
  • Size: 39.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for dynaref-6.2.0.tar.gz
Algorithm Hash digest
SHA256 2ca93087ca94b0d699317ee29ff404f6fcfca1c7b6de5528e6948350c0d42440
MD5 c1bbe5c92df5d5f3aa350a5e4c6ed690
BLAKE2b-256 e5a0bec52480eb602cc71852165c7d86d7b67b3bc60e2f2516eecb069f707c14

See more details on using hashes here.

File details

Details for the file dynaref-6.2.0-py3-none-any.whl.

File metadata

  • Download URL: dynaref-6.2.0-py3-none-any.whl
  • Upload date:
  • Size: 39.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for dynaref-6.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea2d2fd509712cddb186484f9dd9819177f2029f88e86480262e019745486a65
MD5 36019729ba3efd576a95197647c3a3a6
BLAKE2b-256 7667027d47b43e734cff5e953374bf47a2eb4eb06bf0399c5751b165482a9c84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page