mag2exp.sans.chiral_function#

mag2exp.sans.chiral_function(field, /, polarisation=(0, 0, 1))#

Calculation of the chiral function \(-2\pi i \chi\).

The chiral function can be calculated using

\[-2\pi i \chi = \frac{d\sum^{+-}}{d\Omega} - \frac{d\sum^{-+}}{d\Omega}\]

where \(\frac{d\sum^{+-}}{d\Omega}\) and \(\frac{d\sum^{-+}}{d\Omega}\) are the spin-flip cross sections.

Note that this function returns the quantity \(-2\pi i \chi\).

Parameters:
  • field (discretisedfield.field) – Magnetisation field.

  • polarisation (turple) – Defines the polarisation direction of the incoming reutron beam with respect to the sample reference frame.

Returns:

Chiral function \(-2\pi i \chi\).

Return type:

discretisedfield.Field

Examples

  1. Visualising the chiral function with matplotlib.

>>> import discretisedfield as df
>>> import micromagneticmodel as mm
>>> import numpy as np
>>> import mag2exp
>>> mesh = df.Mesh(p1=(-25e-9, -25e-9, -25e-9),
...                p2=(25e-9, 25e-9, 25e-9),
...                cell=(1e-9, 1e-9, 1e-9))
>>> def v_fun(point):
...     x, y, z = point
...     q = 10e-9
...     return (0,
...             np.sin(2 * np.pi * x / q),
...             np.cos(2 * np.pi * x / q))
>>> field = df.Field(mesh, nvdim=3, value=v_fun, norm=1e5)
>>> field.sel('z').mpl()
>>> cf = mag2exp.sans.chiral_function(field,
...                                   polarisation=(1, 0, 0))
>>> cf.sel(k_z=0).mpl.scalar()
../../_images/mag2exp-sans-chiral_function-1_00.png
../../_images/mag2exp-sans-chiral_function-1_01.png