phonon_lifetime.modes package#

A collection of code for manipulating normal modes.

class phonon_lifetime.modes.MassDefect(*, defects: list[tuple[str, int]])#

Bases: object

A mass defect in the system.

defects: list[tuple[str, int]]#
class phonon_lifetime.modes.MassDefectMode(*, _system: System, _omega: float, _modes: ndarray, _defect: MassDefect)#

Bases: NormalMode

A normal mode of a system with a mass defect.

property omega: float#

The frequency of the mode.

property system: System#

The system that this normal mode belongs to.

property vector: ndarray[tuple[int, int], dtype[complex128]]#

The vector of the mode.

class phonon_lifetime.modes.MassDefectNormalModeResult(*, system: System, omega: ndarray[Any, dtype[floating]], modes: ndarray[Any, dtype[floating]], _defect: MassDefect)#

Bases: NormalModeResult

Result of a normal mode calculation for a mass defect system.

get_mode(branch: int, q: int | tuple[int, int, int]) MassDefectMode#

Get the normal mode for a given branch and q point.

modes: np.ndarray[Any, np.dtype[np.floating]]#
property n_branch: int#

The number of branches in the calculation.

property n_q: int#

The number of q points in the calculation.

omega: np.ndarray[Any, np.dtype[np.floating]]#
system: System#
class phonon_lifetime.modes.NormalMode#

Bases: ABC

Represents a normal mode of the system.

abstract property omega: float#

The frequency of the mode.

abstract property system: System#

The system that this normal mode belongs to.

abstract property vector: ndarray[tuple[int, int], dtype[complex128]]#

The vector of the mode.

class phonon_lifetime.modes.NormalModeResult#

Bases: ABC

Result of a normal mode calculation for a phonon system.

get_all_modes() list[NormalMode]#

Get all the normal modes in the calculation.

abstractmethod get_mode(branch: int, q: int | tuple[int, int, int]) NormalMode#

Get the normal mode for a given branch and q point.

abstract property n_branch: int#

The number of branches in the calculation.

abstract property n_q: int#

The number of q points in the calculation.

class phonon_lifetime.modes.PristineMode(*, _system: System, _omega: float, _primitive_vector: ndarray, _q_val: ndarray)#

Bases: NormalMode

A normal mode of a pristine system.

property omega: float#

The frequency of the mode.

property primitive_vector: ndarray[tuple[int], dtype[complex128]]#

The primitive vector of the mode.

property system: System#

The system that this normal mode belongs to.

property vector: ndarray[tuple[int, int], dtype[complex128]]#

The vector of the mode.

class phonon_lifetime.modes.PristineNormalModeResult(*, system: System, omega: ndarray[Any, dtype[floating]], modes: ndarray[Any, dtype[floating]], q_vals: ndarray[Any, dtype[floating]])#

Bases: NormalModeResult

Result of a normal mode calculation for a phonon system.

get_mode(branch: int, q: int | tuple[int, int, int]) PristineMode#

Get the normal mode for a given branch and q point.

modes: np.ndarray[Any, np.dtype[np.floating]]#
property n_branch: int#

The number of branches in the calculation.

property n_q: int#

The number of q points in the calculation.

omega: np.ndarray[Any, np.dtype[np.floating]]#
q_vals: np.ndarray[Any, np.dtype[np.floating]]#
system: System#
class phonon_lifetime.modes.VacancyDefect(*, defects: list[int])#

Bases: object

A vacancy defect in the system.

defects: list[int]#
class phonon_lifetime.modes.VacancyMode(*, _system: System, _omega: float, _modes: ndarray, _defect: VacancyDefect)#

Bases: NormalMode

A normal mode of a system with a vacancy.

property omega: float#

The frequency of the mode.

property system: System#

The system that this normal mode belongs to.

property vector: ndarray[tuple[int, int], dtype[complex128]]#

The vector of the mode.

class phonon_lifetime.modes.VacancyNormalModeResult(*, system: System, omega: ndarray[Any, dtype[floating]], modes: ndarray[Any, dtype[floating]], _defect: VacancyDefect)#

Bases: NormalModeResult

Result of a normal mode calculation for a vacancy system.

get_mode(branch: int, q: int | tuple[int, int, int]) NormalMode#

Get the normal mode for a given branch and q point.

modes: np.ndarray[Any, np.dtype[np.floating]]#
property n_branch: int#

The number of branches in the calculation.

property n_q: int#

The number of q points in the calculation.

omega: np.ndarray[Any, np.dtype[np.floating]]#
system: System#
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_2d_xy(mode: NormalMode, times: ndarray[Any, dtype[floating]] | None = None, idx: int = 0, *, ax: Axes | None = None) tuple[Figure, Axes, ArtistAnimation]#
phonon_lifetime.modes.calculate_normal_modes(system: System, *, defect: None = None) PristineNormalModeResult#
phonon_lifetime.modes.calculate_normal_modes(system: System, *, defect: VacancyDefect) VacancyNormalModeResult
phonon_lifetime.modes.calculate_normal_modes(system: System, *, defect: MassDefect) MassDefectNormalModeResult
phonon_lifetime.modes.plot_1d_dispersion(result: PristineNormalModeResult, branch: int, idx: tuple[int, int] = (0, 0), *, ax: Axes | None = None) tuple[Figure, Axes, Line2D]#
phonon_lifetime.modes.plot_dispersion_2d_xy(result: PristineNormalModeResult, branch: int, idx: int = 0, *, ax: Axes | None = None) tuple[Figure, Axes, QuadMesh]#
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_2d_xy(mode: NormalMode, time: float = 0, idx: int = 0, *, ax: Axes | None = None) tuple[Figure, Axes, Quiver]#