abtem.core.complex#

Module Contents#

Functions#

abs2

Fast calculation of the absolute square of a complex number.

complex_exponential

Fast calculation of the complex exponential.

complex_exponential_scaled

Compute exp(i * scale * x) without creating a temporary real array.

API#

abtem.core.complex.abs2(...) ndarray | dask.array.core.Array[source]#

Fast calculation of the absolute square of a complex number.

abtem.core.complex.complex_exponential(...) ndarray | dask.array.core.Array[source]#

Fast calculation of the complex exponential.

abtem.core.complex.complex_exponential_scaled(...) ndarray | dask.array.core.Array[source]#

Compute exp(i * scale * x) without creating a temporary real array.

On GPU, the scale multiplication is fused into the sin/cos kernel, saving one slice-sized real buffer allocation per chunk compared to the two-step complex_exponential(scale * x).

On CPU, falls back to the equivalent two-step computation (NumPy/Numba).

Parameters:
  • x (array-like) – Real-valued input array.

  • scale (float) – Scalar multiplier applied before the exponential.