FrozenPhonons
FrozenPhonons#
- class abtem.inelastic.phonons.FrozenPhonons(atoms, num_configs, sigmas, directions='xyz', ensemble_mean=True, seed=None)[source]#
Bases:
abtem.inelastic.phonons.BaseFrozenPhononsThe 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.
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.
Convert the frozen phonons to an ensemble of atoms.
Attributes
The unique atomic number of the atoms.
Base atomic configuration used for displacements.
List of AxisMetadata.
List of AxisMetadata of the base axes.
Shape of the base axes.
The cell of the atoms.
The directions of the random displacements.
List of AxisMetadata of the ensemble axes.
The mean of the ensemble of results from a multislice simulation is calculated.
Shape of the ensemble axes.
Number of atomic configurations.
Random seed for each displacement configuration.
Shape of the ensemble.
Displacement standard deviation for each atom.
- property atomic_numbers: numpy.ndarray#
The unique atomic number of the atoms.
- Return type
ndarray
- property atoms: ase.atoms.Atoms#
Base atomic configuration used for displacements.
- Return type
Atoms
- property axes_metadata: abtem.core.axes.AxesMetadataList#
List of AxisMetadata.
- Return type
AxesMetadataList
- property base_axes_metadata: list[abtem.core.axes.AxisMetadata]#
List of AxisMetadata of the base axes.
- Return type
list[AxisMetadata]
- property base_shape: tuple[int, ...]#
Shape of the base axes.
- Return type
tuple[int,...]
- property cell: ase.cell.Cell#
The cell of the atoms.
- Return type
Cell
- copy()#
Make a copy.
- property directions: str#
The directions of the random displacements.
- Return type
str
- property ensemble_axes_metadata: list[abtem.core.axes.AxisMetadata]#
List of AxisMetadata of the ensemble axes.
- Return type
list[AxisMetadata]
- 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.
- Return type
int
- property seed: tuple[int, ...]#
Random seed for each displacement configuration.
- Return type
tuple[int,...]
- 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.
- Return type
float | dict[str | int, float] | Sequence[float]