FrozenPhonons#

class abtem.inelastic.phonons.FrozenPhonons(atoms, num_configs, sigmas, directions='xyz', ensemble_mean=True, seed=None)[source]#

Bases: BaseFrozenPhonons

The frozen phonons randomly displace the atomic positions to emulate thermal vibrations.

Parameters:
  • atoms (ASE.Atoms) – Atomic configuration used for displacements.

  • num_configs (int) – Number of frozen phonon configurations.

  • sigmas (float or dict or list) –

    If float, the standard deviation of the displacements is assumed to be identical for all atoms. If dict, a displacement standard deviation should be provided for each species. The atomic species can be specified as atomic number or a symbol, using the ASE standard. If list or array, a displacement standard deviation should be provided for each atom.

    Anistropic displacements may be given by providing a standard deviation for each principal direction. This may be a tuple of three numbers for identical displacements for all atoms. A dict of tuples of three numbers to specify displacements for each species. A list or array with three numbers for each atom.

  • directions (str, optional) – The displacement directions of the atoms as a string; for example ‘xy’ (default) for displacement in the x- and y-direction (i.e. perpendicular to the propagation direction).

  • ensemble_mean (bool, optional) – If True (default), the mean of the ensemble of results from a multislice simulation is calculated, otherwise, the result of every frozen phonon configuration is returned.

  • seed (int or sequence of int) – Seed(s) for the random number generator used to generate the displacements, or one seed for each configuration in the frozen phonon ensemble.

__init__(atoms, num_configs, sigmas, directions='xyz', ensemble_mean=True, seed=None)[source]#

Methods

__init__(atoms, num_configs, sigmas[, ...])

copy()

Make a copy.

ensemble_blocks([chunks])

Split the ensemble into an array of smaller ensembles.

generate_blocks([chunks])

Generate chunks of the ensemble.

randomize(atoms)

Randomize the atoms.

select_block(index, chunks)

Select a block from the ensemble.

to_atoms_ensemble()

Convert the frozen phonons to an ensemble of atoms.

Attributes

atomic_numbers

The unique atomic number of the atoms.

atoms

Base atomic configuration used for displacements.

axes_metadata

List of AxisMetadata.

base_axes_metadata

List of AxisMetadata of the base axes.

base_shape

Shape of the base axes.

cell

The cell of the atoms.

directions

The directions of the random displacements.

ensemble_axes_metadata

List of AxisMetadata of the ensemble axes.

ensemble_mean

The mean of the ensemble of results from a multislice simulation is calculated.

ensemble_shape

Shape of the ensemble axes.

num_configs

Number of atomic configurations.

seed

Random seed for each displacement configuration.

shape

Shape of the ensemble.

sigmas

Displacement standard deviation for each atom.

property atomic_numbers: ndarray#

The unique atomic number of the atoms.

property atoms: Atoms#

Base atomic configuration used for displacements.

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.

property cell: Cell#

The cell of the atoms.

copy()#

Make a copy.

property directions: str#

The directions of the random displacements.

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_mean#

The mean of the ensemble of results from a multislice simulation is calculated.

property ensemble_shape#

Shape of the ensemble axes.

generate_blocks(chunks=1)#

Generate chunks of the ensemble.

Parameters:

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

property num_configs: int#

Number of atomic configurations.

randomize(atoms)[source]#

Randomize the atoms.

Parameters:

atoms (Atoms) –

Return type:

Atoms

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

Random seed for each displacement configuration.

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 shape#

Shape of the ensemble.

property sigmas: float | dict[str | int, float] | Sequence[float]#

Displacement standard deviation for each atom.

to_atoms_ensemble()[source]#

Convert the frozen phonons to an ensemble of atoms.

Returns:

atoms_ensemble

Return type:

AtomsEnsemble