phonon_lifetime.modes package#
A collection of code for manipulating normal modes.
- class phonon_lifetime.modes.CanonicalMode(*, omega: float, vector: ndarray[tuple[int, int], dtype[complex128]], system: S)#
Bases:
NormalMode,GenericA normal mode in the canonical form, with vectors provided explicitly.
- property omega: float#
The frequency of the mode.
- property system: S#
The system that this normal mode belongs to.
- property vector: ndarray[tuple[int, int], dtype[complex128]]#
The vector of the mode, an (n_atoms, 3) array.
- class phonon_lifetime.modes.NormalMode#
Bases:
ABC,GenericRepresents a normal mode of the system.
- as_canonical() CanonicalMode#
Convert this mode to the canonical form.
- abstract property omega: float#
The frequency of the mode.
- abstract property system: S#
The system that this normal mode belongs to.
- abstract property vector: ndarray[tuple[int, int], dtype[complex128]]#
The vector of the mode, an (n_atoms, 3) array.
For a mode with multiple atoms in a primitive cell, the vector is ordered (n_primitive_atoms, n_repeats_x, n_repeats_y, n_repeats_z, 3).
- class phonon_lifetime.modes.NormalModes#
Bases:
ABC,GenericRepresents all normal modes of a system.
- as_canonical() CanonicalModes#
Convert this mode to the canonical form.
- abstract property n_modes: int#
The number of modes in the calculation.
- abstract property omega: ndarray[tuple[int], dtype[floating]]#
A np.array of frequencies for each mode.
- abstract property system: S#
The system that this normal mode belongs to.
- property vectors: ndarray[tuple[int, int], dtype[complex128]]#
The vector of the mode, an (n_modes, n_atoms * 3) array.
- phonon_lifetime.modes.animate_mode_1d_x(mode: NormalMode, times: ndarray[Any, dtype[floating]] | None = None, idx: tuple[int, int] = (0, 0), *, ax: Axes | None = None) tuple[Figure, Axes, ArtistAnimation]#
- phonon_lifetime.modes.animate_mode_xy(mode: NormalMode, times: ndarray[Any, dtype[floating]] | None = None, *, ax: Axes3D | None = None, bond_cutoff: float = inf, scale_bond_lines: bool = True, scale_displacement: float = 1.0) tuple[Figure, Axes3D, ArtistAnimation]#
- phonon_lifetime.modes.animate_mode_xyz(mode: NormalMode, times: ndarray[Any, dtype[floating]] | None = None, *, ax: Axes3D | None = None, bond_cutoff: float = inf, scale_bond_lines: bool = True) tuple[Figure, Axes3D, ArtistAnimation]#
- phonon_lifetime.modes.get_mode_displacement(mode: NormalMode, time: float = 0.0) ndarray[Any, Any]#
Get the displacement of the mode at a given time.
returns an array of displacements (n_atoms, 3) at the given time.
- phonon_lifetime.modes.plot_mode_1d_x(mode: NormalMode, time: float = 0, idx: tuple[int, int] = (0, 0), *, ax: Axes | None = None) tuple[Figure, Axes, Line2D]#
- phonon_lifetime.modes.plot_mode_xy(mode: NormalMode, time: float = 0, *, ax: Axes3D | None = None, bond_cutoff: float = inf, scale_bond_lines: bool = True, scale_displacement: float = 1.0) tuple[Figure, Axes3D, tuple[PathCollection, Artist]]#
- phonon_lifetime.modes.plot_mode_xyz(mode: NormalMode, time: float = 0, *, ax: Axes3D | None = None, bond_cutoff: float = inf, scale_bond_lines: bool = True) tuple[Figure, Axes3D, tuple[PathCollection, Artist]]#
- phonon_lifetime.modes.repeat_mode(mode: NormalMode[__annotationlib_name_1__], n_repeats: tuple[int, int, int]) NormalMode[__annotationlib_name_2__]#
Repeat a mode to create a new mode for a larger system.
- phonon_lifetime.modes.repeat_modes(modes: NormalModes, n_repeats: tuple[int, int, int]) NormalModes[RepeatSystem]#
Repeat a set of modes to create new modes for a larger system.