Skip to main content

Simulates x-ray magnetic scattering

Project description

This package can be used to simulate magnetic scattering and Fourier transform holography from a structure.

Installation

magneticScattering can be installed through pip:

(.venv)$ pip install magneticScattering

Documentation

Comprehensive documentation with examples is available online at readthedocs.

Quickstart

To calculate the observed magnetic scattering from a system, three classes describing the experimental setup must first be specified, namely the:

  1. Sample

  2. Beam

  3. Geometry

These classes are then passed to the Scatter class in order to perform the calculation. In the following sections, these parameters are described in more detail and examples are provided.

Sample

The Sample is initialized with the following parameters:

Sample(sample_length, scattering_factors, magnetic_configuration)
  • sample_length: size of the sample in meters as a scalar or a two-component vector in meters

  • scattering_factors: scattering factors list [f0, f1, f2]. These are the complex pre-factors corresponding to the charge, magnetic circular and magnetic linear scattering. The real part is the refractive index (or phase) and the imaginary part is the dissipation (or absorption)

  • structure: the magnetic configuration of the sample as a numpy array with shape (3, nx, ny) (charge component will be inferred) or (4, nx, ny) with the charge component at index 0

Beam

The Beam is initialized with the following parameters:

Beam(wavelength, beam_fwhm, polarization)
  • wavelength: wavelength of incident radiation in meters.

  • beam_fwhm: full width at half maximum of the beam as a scalar or a two-component vector in meters.

  • polarization: four-component polarization in the form of a Stokes vector.

Geometry

The Geometry is initialized with the following parameters:

Geometry(angle, detector_distance)
  • angle: The angle of incidence between the beam and the sample in degrees.

  • detector_distance: The distance between the sample and the detector in meters.

The geometry use here is such that the beam travels in the positive z-directions when angle_d = 0 and along the negative y-direction when angle_d = 90.

The sample plane is the x-y plane, such that the \(m_x\) and \(m_y\) components are in-plane, and \(m_z\) is out of plane.

Scatter

To compute the scattering pattern, call the Scatter class with the three classes from before as arguments:

Scatter(Sample, Beam, Geometry)

The intensity of the scattering can be obtained from Scatter.intensity or plotted directly using functions in the plot submodule. For example, for a labyrinthine structure

Magnetization components of a labyrinthine magnetic domain structure

the full-view scattering pattern (left) can be used to isolate a region of interest (left, red rectangle) to calculate a higher resolution scattering. The difference between the scattering obtained from the two circular polarizations is shown on the right

Full view of the scattering pattern, with a red rectangle representing the desired region of interest Higher resolution scattering pattern of the region of interest

References

van der Laan, G., “Theory from Soft X-ray resonant magnetic scattering of magnetic nano structures,” https://doi.org/10.1016/j.crhy.2007.06.004

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

magneticscattering-0.2.1.tar.gz (158.2 kB view details)

Uploaded Source

Built Distribution

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

magneticscattering-0.2.1-py3-none-any.whl (157.0 kB view details)

Uploaded Python 3

File details

Details for the file magneticscattering-0.2.1.tar.gz.

File metadata

  • Download URL: magneticscattering-0.2.1.tar.gz
  • Upload date:
  • Size: 158.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for magneticscattering-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4a450aa1a4fe3976c32c9777e02859e8d464c0e5784cca24b979c665adca7c49
MD5 d645bebfce0ee5177aaad182cad8837f
BLAKE2b-256 c85066731e09bee2fca4aa4bbb9e0936f452f60028d975d55fde14bb67648dbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for magneticscattering-0.2.1.tar.gz:

Publisher: release.yml on apseros/magneticScattering

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file magneticscattering-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for magneticscattering-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 900c160800f1f6ebecbf070fe3b9047713727ffce7c6bd677901154822064ef8
MD5 c8f7b887e231e58ee8f0a91a5601bb01
BLAKE2b-256 49529659144ca3f91893296c55fc22a0751b4bddfcbe23c2ea5398238df2d97c

See more details on using hashes here.

Provenance

The following attestation bundles were made for magneticscattering-0.2.1-py3-none-any.whl:

Publisher: release.yml on apseros/magneticScattering

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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