MultisliceTransform#

class abtem.multislice.MultisliceTransform(potential, detectors=None, multislice_func=None, **multislice_func_kwargs)[source]#

Bases: WavesTransform[BaseMeasurements]

Transformation applying the multislice algorithm to wave functions, producing new wave functions or measurements.

Parameters:
  • potential (BasePotential) – A potential as BasePotential object.

  • detectors ((list of) BaseDetector, optional) – A detector or a list of detectors defining how the wave functions should be converted to measurements after running the multislice algorithm.

  • multislice_func (callable, optional) – The multislice function defining the multislice algorithm used (default is multislice_and_detect()).

  • **multislice_func_kwargs – Additional keyword arguments passed to the multislice function.

__init__(potential, detectors=None, multislice_func=None, **multislice_func_kwargs)[source]#

Methods

__init__(potential[, detectors, multislice_func])

apply(waves[, max_batch])

Run the multislice algorithm on the given wave functions.

copy()

Make a copy.

ensemble_blocks([chunks])

Split the ensemble into an array of smaller ensembles.

generate_blocks([chunks])

Generate chunks of the ensemble.

Attributes

axes_metadata

List of AxisMetadata.

base_axes_metadata

List of AxisMetadata of the base axes.

base_shape

Shape of the base axes.

detectors

List of detectors defining how the wave functions should be converted to measurements.

distributions

ensemble_axes_metadata

Axes metadata describing the ensemble axes added to the waves when applying the transform.

ensemble_shape

The shape of the ensemble axes added to the waves when applying the transform.

metadata

Metadata added to the waves when applying the transform.

multislice_func

The multislice function defining the multislice algorithm used.

potential

Electrostatic potential for each multislice slice.

shape

Shape of the ensemble.

apply(waves, max_batch='auto')[source]#

Run the multislice algorithm on the given wave functions. An output is returned for each detector.

Parameters:
  • waves (Waves) – The wave functions to run the multislice algorithm on.

  • max_batch (int or str, optional) – The maximum batch size to use for the multislice algorithm. If ‘auto’ the batch size is chosen automatically based on the available memory.

Returns:

waves – The wave functions after running the multislice algorithm.

Return type:

tuple of Waves and BaseMeasurements

property axes_metadata: AxesMetadataList#

List of AxisMetadata.

property base_axes_metadata: list[AxisMetadata]#

List of AxisMetadata of the base axes.

property base_shape: tuple[int, ...]#

Shape of the base axes.

copy()#

Make a copy.

Return type:

Self

property detectors: list[BaseDetector]#

List of detectors defining how the wave functions should be converted to measurements.

property ensemble_axes_metadata#

Axes metadata describing the ensemble axes added to the waves when applying the transform.

ensemble_blocks(chunks=None)#

Split the ensemble into an array of smaller ensembles.

Parameters:

chunks (iterable of tuples) – Block sizes along each dimension.

Return type:

Array

property ensemble_shape#

The shape of the ensemble axes added to the waves when applying the transform.

generate_blocks(chunks=1)#

Generate chunks of the ensemble.

Parameters:

chunks (iterable of tuples) – Block sizes along each dimension.

Return type:

Generator[tuple[tuple[int, ...], tuple[slice, ...], ndarray], None, None]

property metadata: dict#

Metadata added to the waves when applying the transform.

property multislice_func: Callable#

The multislice function defining the multislice algorithm used.

property potential: BasePotential#

Electrostatic potential for each multislice slice.

property shape: tuple[int, ...]#

Shape of the ensemble.