abtem.magnetism.pauli#

Module Contents#

Functions#

apply_A_xy_dot_nabla_xy

Compute the action of the operator $A_{xy} cdot nabla_{xy}$ on the wave functions using the central difference gradient.

central_difference_gradient_cbc

Compute the gradient of a 2D array using central differences with constant boundary conditions and Numba.

central_difference_gradient_pbc

Compute the gradient of a 2D array using central differences with periodic boundary conditions and Numba.

API#

abtem.magnetism.pauli.apply_A_xy_dot_nabla_xy(...)[source]#

Compute the action of the operator $A_{xy} cdot nabla_{xy}$ on the wave functions using the central difference gradient.

Parameters:
  • A (ndarray) – Vector field of shape (2, N, M) representing the operator A.

  • wave_functions (ndarray) – Array of shape (…, N, M) representing the wave functions.

  • sampling (two floats) – Spacing between points in the x and y directions.

Returns:

result – Result of the operation $A cdot nabla_{xy} psi$.

Return type:

ndarray

abtem.magnetism.pauli.central_difference_gradient_cbc(...)[source]#

Compute the gradient of a 2D array using central differences with constant boundary conditions and Numba.

Parameters:
  • X (ndarray) – Array of shape (…, N, M) where the last two dimensions are the 2D grid.

  • dx (float) – Spacing between points in the x direction.

  • dy (float) – Spacing between points in the y direction.

Returns:

  • grad_x (numpy.ndarray) – Gradient of X with respect to x.

  • grad_y (numpy.ndarray) – Gradient of X with respect to y.

abtem.magnetism.pauli.central_difference_gradient_pbc(...)[source]#

Compute the gradient of a 2D array using central differences with periodic boundary conditions and Numba.

Parameters:
  • X (ndarray) – Array of shape (…, N, M) where the last two dimensions are the 2D grid.

  • dx (float) – Spacing between points in the x direction.

  • dy (float) – Spacing between points in the y direction.

Returns:

  • grad_x (numpy.ndarray) – Gradient of X with respect to x.

  • grad_y (numpy.ndarray) – Gradient of X with respect to y.