Generating magnetization maps
Functions for generating magnetization configurations of spin textures.
- PyLorentz.utils.magnetizations.hopfion(dim: int = 128, dimz: int | None = None, R: float | None = None, H: float | None = None, wr: float | None = None, wh: float | None = None, type: str = 'bloch', Q: int = 1) numpy.ndarray[source]
Magnetization pattern for a hopfion with Hopf index +/- 1.
From: Wang, X. S., Qaiumzadeh, A. & Brataas, A. Current-Driven Dynamics of Magnetic Hopfions. Phys. Rev. Lett. 123, 147203 (2019).
- Parameters:
dim (int) – xy dimension. Defaults to 128.
dimz (int, optional) – z dimension. Defaults to dim/4.
R (float, optional) – Hopfion radius. Defaults to dim*0.15.
H (float, optional) – Hopfion height. Defaults to dim*0.08.
wr (float, optional) – Hopfion radial domain wall parameter. Defaults to dim*0.08.
wh (float, optional) – Hopfion z-direction domain wall parameter. Defaults to dim*0.04.
type (str, optional) – Hopfion type, “bloch” or “neel”. Defaults to “bloch”.
Q (int, optional) – Hopf charge, +/- 1. Defaults to 1.
- Returns:
Array of shape [3, dimz, dim, dim], representing the magnetization components.
- Return type:
np.ndarray
- PyLorentz.utils.magnetizations.hopfion_cylinder(L: int = 32, dim: Tuple[int, int, int] | None = None, pad: int | None = None, background: str = 'none') numpy.ndarray[source]
Create a Hopfion cylinder magnetization pattern.
From: Suctcliffe: Hopfions in chiral magnets. L is height, 3L is radius, padded with 2L, so total dims (L, 8L, 8L).
This is an in-plane hopfion of sorts, with an extra winding around the outside as it is confined to a patterned cylinder.
- Parameters:
L (int) – Height of the cylinder. Defaults to 32.
dim (tuple, optional) – Dimensions of the cylinder. Defaults to (L, 3L, 3L).
pad (int, optional) – Padding around the cylinder. Defaults to None.
background (str) – Background type, “none”, “pos”, or “neg”. Defaults to “none”.
- Returns:
Array of shape [3, dimz, dimy, dimx], representing the magnetization components.
- Return type:
np.ndarray
- PyLorentz.utils.magnetizations.lillihook(dim: int, rad: float | None = None, Q: int = 1, gamma: float = 1.5708, P: int = 1, show: bool = False) numpy.ndarray[source]
Define a skyrmion magnetization.
This function makes a skyrmion magnetization as calculated and defined in [1]. It returns three 2D arrays of size (dim, dim) containing the x, y, and z magnetization components at each pixel.
- Parameters:
dim (int) – Dimension of lattice.
rad (float, optional) – Radius parameter. Defaults to dim//16.
Q (int) – Topological charge. 1: skyrmion, 2: biskyrmion, -1: antiskyrmion.
gamma (float) – Helicity. 0 or Pi: Neel, Pi/2 or 3Pi/2: Bloch. Defaults to 1.5708.
P (int) – Polarity (z direction in center), +/- 1. Defaults to 1.
show (bool) – If True, will plot the x, y, z components.
- Returns:
Array of shape [3, dim, dim], representing the magnetization components, [mag_z, mag_y, mag_x].
- Return type:
np.ndarray
References
Lilliehöök, D., Lejnell, K., Karlhede, A. & Sondhi, S. Quantum Hall Skyrmions with higher topological charge. Phys. Rev. B 56, 6805–6809 (1997).
- PyLorentz.utils.magnetizations.bloch(dim: int, chirality: str = 'cw', pad: bool | int = True, ir: float = 0, show: bool = False, bkg: str = 'pos', sigma: float | None = None, empty_bkg: bool = False) numpy.ndarray[source]
Create a Bloch vortex magnetization structure.
This function produces a rough approximation of the desired structure. For the chirality, “cw” vs “ccw” is defined for oring=’upper’ (y goes down).
- Parameters:
dim (int) – Dimension of lattice.
chirality (str) – ‘cw’ (clockwise rotation) or ‘ccw’ (counter-clockwise rotation).
pad (Union[bool, int]) – Whether or not to leave some space between the edge of the magnetization and the edge of the image. Defaults to True.
ir (float) – Inner radius of the vortex in pixels.
show (bool) – If True, will show the x, y, z components in plot form.
bkg (str) – Background type, “pos” or “neg”. Defaults to “pos”.
sigma (Optional[float]) – Sigma for Gaussian filter. Defaults to None.
empty_bkg (bool) – If True, will empty the background. Defaults to False.
- Returns:
Array of shape [3, dim, dim], representing the magnetization components, [mag_z, mag_y, mag_x].
- Return type:
np.ndarray
- PyLorentz.utils.magnetizations.neel(dim: int, chirality: str = 'io', pad: bool | int = True, ir: float = 0, show: bool = False) numpy.ndarray[source]
Create a Neel magnetization structure.
This function produces a rough approximation of the desired structure. For Neel in particular, this can lead to weird artifacts in simulated LTEM images, and we recommend using micromagnetics simulated input magnetization.
- Parameters:
dim (int) – Dimension of lattice.
chirality (str) – ‘cw’ (clockwise rotation) or ‘ccw’ (counter-clockwise rotation).
pad (Union[bool, int]) – Whether or not to leave some space between the edge of the magnetization and the edge of the image. Defaults to True.
ir (float) – Inner radius of the vortex in pixels.
show (bool) – If True, will show the x, y, z components in plot form.
- Returns:
Array of shape [3, dim, dim], representing the magnetization components, [mag_z, mag_y, mag_x].
- Return type:
np.ndarray
- PyLorentz.utils.magnetizations.blochII(dim: int, direction: str = 'right', pad: bool | int = True, ir: float = 0, show: bool = False, sigma: float | None = None, cp1: int | None = None, cp2: int | None = None) numpy.ndarray[source]
Create a type II Bloch bubble.
- Parameters:
dim (int) – Dimension of lattice.
direction (str) – Direction of the bubble, “right”, “left”, “top”, “bottom”.
pad (Union[bool, int]) – Whether or not to leave some space between the edge of the magnetization and the edge of the image. Defaults to True.
ir (float) – Inner radius of the vortex in pixels.
show (bool) – If True, will show the x, y, z components in plot form.
sigma (Optional[float]) – Sigma for Gaussian filter. Defaults to None.
cp1 (Optional[int]) – Control point 1 for defining middle section. Defaults to None.
cp2 (Optional[int]) – Control point 2 for defining middle section. Defaults to None.
- Returns:
Array of shape [3, dim, dim], representing the magnetization components, [mag_z, mag_y, mag_x].
- Return type:
np.ndarray