Probe#

class abtem.waves.Probe(semiangle_cutoff=None, extent=None, gpts=None, sampling=None, energy=None, soft=True, tilt=(0.0, 0.0), device=None, aperture=None, aberrations=None, positions=None, metadata=None, **kwargs)[source]#

Bases: _WavesBuilder

Represents electron-probe wave functions for simulating experiments with a convergent beam, such as CBED and STEM.

Parameters:
  • semiangle_cutoff (float, optional) – The cutoff semiangle of the aperture [mrad]. Ignored if a custom aperture is given.

  • extent (float or two float, optional) – Lateral extent of wave functions [Å] in x and y directions. If a single float is given, both are set equal.

  • gpts (two ints, optional) – Number of grid points describing the wave functions.

  • sampling (two float, optional) – Lateral sampling of wave functions [1 / Å]. If ‘gpts’ is also given, will be ignored.

  • energy (float, optional) – Electron energy [eV]. If not provided, inferred from the wave functions.

  • soft (float, optional) – Taper the edge of the default aperture [mrad] (default is 2.0). Ignored if a custom aperture is given.

  • tilt (two float, two 1D BaseDistribution, 2D BaseDistribution, optional) – Small-angle beam tilt [mrad]. This value should generally not exceed one degree.

  • device (str, optional) – The probe wave functions will be build and stored on this device (‘cpu’ or ‘gpu’). The default is determined by the user configuration.

  • aperture (BaseAperture, optional) – An optional custom aperture. The provided aperture should be a subtype of BaseAperture.

  • aberrations (dict or Aberrations) – The phase aberrations as a dictionary.

  • transforms (list of WaveTransform) – A list of additional wave function transforms which will be applied after creation of the probe wave functions.

  • kwargs – Provide the aberrations as keyword arguments, forwarded to the Aberrations.

__init__(semiangle_cutoff=None, extent=None, gpts=None, sampling=None, energy=None, soft=True, tilt=(0.0, 0.0), device=None, aperture=None, aberrations=None, positions=None, metadata=None, **kwargs)[source]#

Methods

__init__([semiangle_cutoff, extent, gpts, ...])

apply_transform(transform[, max_batch, lazy])

build([scan, max_batch, lazy])

Build probe wave functions at the provided positions.

check_can_build([potential])

Check whether the wave functions can be built.

copy()

Make a copy.

ensemble_blocks([chunks])

Split the ensemble into an array of smaller ensembles.

generate_blocks([chunks])

Generate chunks of the ensemble.

match_grid(other[, check_match])

Match the grid to another object with a Grid.

multislice(potential[, scan, detectors, ...])

Run the multislice algorithm for probe wave functions at the provided positions.

profiles([angle])

Create a line profile through the center of the probe.

scan(potential[, scan, detectors, ...])

Run the multislice algorithm from probe wave functions over the provided scan.

select_block(index, chunks)

Select a block from the ensemble.

show([complex_images])

Show the intensity of the probe wave function.

transition_potential_scan(potential, ...[, ...])

type potential:

BasePotential | Atoms

Attributes

aberrations

Phase aberrations of the probe wave functions.

accelerator

Accelerator object describing the acceleration energy.

angular_sampling

Reciprocal-space sampling in units of scattering angles [mrad].

antialias_cutoff_gpts

The number of grid points along the x and y direction in the simulation grid at the antialiasing cutoff scattering angle.

antialias_valid_gpts

The number of grid points along the x and y direction in the simulation grid for the largest rectangle that fits within antialiasing cutoff scattering angle.

aperture

Condenser or probe-forming aperture.

axes_metadata

List of AxisMetadata.

base_axes_metadata

List of AxisMetadata for the base axes in real space.

base_shape

Shape of the base axes of the waves.

ctf

Contrast transfer function describing the probe.

cutoff_angles

Scattering angles at the antialias cutoff [mrad].

device

The device where the waves are created.

dtype

The datatype of waves.

energy

Electron acceleration energy in electron volts.

ensemble_axes_metadata

List of AxisMetadata of the ensemble axes.

ensemble_shape

Shape of the ensemble axes of the waves.

extent

Extent of grid for each dimension in Ångstrom.

full_cutoff_angles

Scattering angles corresponding to the full wave function size [mrad].

gpts

Number of grid points for each dimension.

grid

Simulation grid.

metadata

Metadata describing the probe wave functions.

positions

The position(s) of the probe.

reciprocal_space_axes_metadata

List of AxisMetadata for base axes in reciprocal space.

reciprocal_space_sampling

Reciprocal-space sampling in reciprocal Ångstrom.

rectangle_cutoff_angles

Scattering angles corresponding to the sides of the largest rectangle within the antialias cutoff [mrad].

sampling

Grid sampling for each dimension in Ångstrom per grid point.

semiangle_cutoff

The semiangle cutoff [mrad].

shape

Shape of the waves.

soft

True if the aperture has a soft edge.

tilt

The small-angle tilt of applied to the Fresnel propagator [mrad].

wavelength

Relativistic wavelength in Ångstrom.

property aberrations: Aberrations#

Phase aberrations of the probe wave functions.

property accelerator: Accelerator#

Accelerator object describing the acceleration energy.

property angular_sampling: tuple[float, float]#

Reciprocal-space sampling in units of scattering angles [mrad].

property antialias_cutoff_gpts: tuple[int, int]#

The number of grid points along the x and y direction in the simulation grid at the antialiasing cutoff scattering angle.

property antialias_valid_gpts: tuple[int, int]#

The number of grid points along the x and y direction in the simulation grid for the largest rectangle that fits within antialiasing cutoff scattering angle.

property aperture: Aperture#

Condenser or probe-forming aperture.

property axes_metadata: AxesMetadataList#

List of AxisMetadata.

property base_axes_metadata: list[AxisMetadata]#

List of AxisMetadata for the base axes in real space.

property base_shape: tuple[int, int]#

Shape of the base axes of the waves.

build(scan=None, max_batch='auto', lazy=None)[source]#

Build probe wave functions at the provided positions.

Parameters:
  • scan (array of xy-positions or BaseScan, optional) – Positions of the probe wave functions. If not given, scans across the entire potential at Nyquist sampling.

  • max_batch (int, optional) – The number of wave functions in each chunk of the Dask array. If ‘auto’ (default), the batch size is automatically chosen based on the abtem user configuration settings “dask.chunk-size” and “dask.chunk-size-gpu”.

  • lazy (bool, optional) – If True, create the wave functions lazily, otherwise, calculate instantly. If not given, defaults to the setting in the user configuration file.

Returns:

probe_wave_functions – The built probe wave functions.

Return type:

Waves

check_can_build(potential=None)#

Check whether the wave functions can be built.

copy()#

Make a copy.

property ctf#

Contrast transfer function describing the probe.

property cutoff_angles: tuple[float, float]#

Scattering angles at the antialias cutoff [mrad].

property device#

The device where the waves are created.

property dtype#

The datatype of waves.

property energy#

Electron acceleration energy in electron volts.

property ensemble_axes_metadata: list[AxisMetadata]#

List of AxisMetadata of the ensemble axes.

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#

Shape of the ensemble axes of the waves.

property extent: tuple[float] | tuple[float, float] | tuple[float, ...]#

Extent of grid for each dimension in Ångstrom.

property full_cutoff_angles: tuple[float, float]#

Scattering angles corresponding to the full wave function size [mrad].

generate_blocks(chunks=1)#

Generate chunks of the ensemble.

Parameters:

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

property gpts: tuple[int] | tuple[int, int] | tuple[int, ...]#

Number of grid points for each dimension.

property grid: Grid#

Simulation grid.

match_grid(other, check_match=False)#

Match the grid to another object with a Grid.

property metadata: dict#

Metadata describing the probe wave functions.

multislice(potential, scan=None, detectors=None, max_batch='auto', lazy=None)[source]#

Run the multislice algorithm for probe wave functions at the provided positions.

Parameters:
  • potential (BasePotential or Atoms) – The scattering potential. Optionally atoms can be directly given.

  • scan (array of xy-positions or BaseScan, optional) – Positions of the probe wave functions. If not given, scans across the entire potential at Nyquist sampling.

  • detectors (BaseDetector or 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. If not given, defaults to the flexible annular detector.

  • max_batch (int, optional) – The number of wave functions in each chunk of the Dask array. If ‘auto’ (default), the batch size is automatically chosen based on the abtem user configuration settings “dask.chunk-size” and “dask.chunk-size-gpu”.

  • lazy (bool, optional) – If True, create the wave functions lazily, otherwise, calculate instantly. If None, this defaults to the setting in the user configuration file.

Returns:

measurements

Return type:

BaseMeasurements or Waves or list of BaseMeasurement

property positions: BaseScan#

The position(s) of the probe.

profiles(angle=0.0)[source]#

Create a line profile through the center of the probe.

Parameters:

angle (float, optional) – Angle with respect to the x-axis of the line profile [degree].

Return type:

RealSpaceLineProfiles

property reciprocal_space_axes_metadata: list[AxisMetadata]#

List of AxisMetadata for base axes in reciprocal space.

property reciprocal_space_sampling: tuple[float] | tuple[float, float] | tuple[float, ...]#

Reciprocal-space sampling in reciprocal Ångstrom.

property rectangle_cutoff_angles: tuple[float, float]#

Scattering angles corresponding to the sides of the largest rectangle within the antialias cutoff [mrad].

property sampling: tuple[float] | tuple[float, float] | tuple[float, ...]#

Grid sampling for each dimension in Ångstrom per grid point.

scan(potential, scan=None, detectors=None, max_batch='auto', lazy=None)[source]#

Run the multislice algorithm from probe wave functions over the provided scan.

Parameters:
  • potential (BasePotential or Atoms) – The scattering potential.

  • scan (BaseScan) – Positions of the probe wave functions. If not given, scans across the entire potential at Nyquist sampling.

  • detectors (BaseDetector, 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. See abtem.measurements.detect for a list of implemented detectors.

  • max_batch (int, optional) – The number of wave functions in each chunk of the Dask array. If ‘auto’ (default), the batch size is automatically chosen based on the abtem user configuration settings “dask.chunk-size” and “dask.chunk-size-gpu”.

  • lazy (bool, optional) – If True, create the measurements lazily, otherwise, calculate instantly. If None, this defaults to the value set in the configuration file.

Return type:

BaseMeasurements | Waves | list[BaseMeasurements | Waves]

Returns:

  • detected_waves (BaseMeasurements or list of BaseMeasurement) – The detected measurement (if detector(s) given).

  • exit_waves (Waves) – Wave functions at the exit plane(s) of the potential (if no detector(s) given).

select_block(index, chunks)#

Select a block from the ensemble.

Parameters:
  • index (tuple of ints) – Index of selected block.

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

property semiangle_cutoff#

The semiangle cutoff [mrad].

property shape#

Shape of the waves.

show(complex_images=False, **kwargs)[source]#

Show the intensity of the probe wave function.

Parameters:
  • complex_images (bool) – If true shows complex images using domain-coloring instead of the intensity.

  • kwargs (Keyword arguments for the Images.show() function.) –

property soft#

True if the aperture has a soft edge.

property tilt#

The small-angle tilt of applied to the Fresnel propagator [mrad].

transition_potential_scan(potential, transition_potentials, scan=None, detectors=None, sites=None, double_channel=True, threshold=1.0, max_batch='auto', lazy=None)[source]#
Parameters:
  • potential (BasePotential | Atoms) – The potential to be used for calculating the transition potentials. It can be an instance of BasePotential or an Atoms object.

  • transition_potentials (BaseTransitionPotential | list[BaseTransitionPotential]) – The transition potentials to be used for multislice calculations. It can be an instance of BaseTransitionPotential or a list of BaseTransitionPotential objects.

  • scan (tuple | BaseScan, optional) – The scan parameters. It can be a tuple or an instance of BaseScan. Defaults to None.

  • detectors (BaseDetector | list[BaseDetector], optional) – A detector or a list of detectors defining how the wave functions should be converted to measurements after running the multislice algorithm. See abtem.measurements.detect for a list of implemented detectors. Defaults to None, which

  • sites (SliceIndexedAtoms | Atoms, optional) – The slice indexed atoms to be used for multislice calculations. It can be an instance of SliceIndexedAtoms or an Atoms object. Defaults to None.

  • detectors_elastic (BaseDetector | list[BaseDetector], optional) – The elastic detectors to be used for recording the measurements. It can be an instance of BaseDetector or a list of BaseDetector objects. Defaults to None.

  • double_channel (bool, optional) – A boolean indicating whether to use double channel for recording the measurements. Defaults to True.

  • max_batch (int | str, optional) – The maximum batch size for parallel processing. It can be an integer or the string “auto”. Defaults to “auto”.

  • lazy (bool, optional) – A boolean indicating whether to use lazy evaluation for the calculations. Defaults to None.

Returns:

The calculated waves or measurements, depending on the value of lazy.

Return type:

Waves | BaseMeasurements

property wavelength#

Relativistic wavelength in Ångstrom.