phonon_lifetime.pristine package#
Pristine system and modes.
- class phonon_lifetime.pristine.PristineMode(*, _system: PristineSystem, _omega: float, _primitive_vector: ndarray[tuple[int], dtype[complex128]], _q: tuple[float, float, float])#
Bases:
NormalMode[PristineSystem]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 q_val: tuple[float, float, float]#
- property system: PristineSystem#
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.
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.pristine.PristineModes(*, _system: PristineSystem, _omega: ndarray[Any, dtype[floating]], _modes: ndarray[Any, dtype[complex128]], _q_vals: ndarray[Any, dtype[floating]])#
Bases:
NormalModes[PristineSystem]Result of a normal mode calculation for a phonon system.
- at_branch(branch: int) PristineModesAtBranch#
- get_mode_idx(branch: int, q: int | tuple[int, int, int]) int#
- get_mode_idx(branch: int, q: None = None) ndarray[tuple[int], dtype[int64]]
Get the index of a mode by branch and q point.
- property n_branch: int#
Number of branches.
- property n_modes: int#
The number of modes in the calculation.
- property n_q: int#
Number of q points.
- property omega: ndarray[tuple[int], dtype[floating]]#
A np.array of frequencies for each mode.
- property q_vals: ndarray[Any, dtype[floating]]#
The q values for each mode, shape (n_q, 3).
- select_mode(branch: int, q: int | tuple[int, int, int]) PristineMode#
Select a mode by branch and q point.
- property system: PristineSystem#
The system that this normal mode belongs to.
- class phonon_lifetime.pristine.PristineSystem(*, primitive_masses: ndarray[tuple[int], dtype[floating]], primitive_cell: ndarray[tuple[int, int], dtype[floating]], primitive_atom_fractions: ndarray[tuple[int, int], dtype[floating]], n_repeats: tuple[int, int, int], strain: PristineStrainTensor | None = None, primitive_symbols: list[str] | None = None)#
Bases:
SystemRepresents a System of atoms.
- as_pristine() PristineSystem#
Return a new System with no defects.
- get_modes() PristineModes#
Get the normal modes of the system.
- property masses: ndarray[tuple[int], dtype[floating]]#
Mass of every atom in the system.
- property n_primitive_atoms: int#
Number of atoms in the primitive cell.
- property n_repeats: tuple[int, int, int]#
Number of repeats of the primitive cell in each direction (nx, ny, nz).
- property primitive_atom_fractions: ndarray[tuple[int, int], dtype[floating]]#
The positions of the atoms as a fraction of the primitive cell.
primitive_atom_positions[i] is the position (x, y, z) of the i’th atom in the primitive cell.
- property primitive_cell: ndarray[tuple[int, int], dtype[floating]]#
Primitive cell lattice vectors.
primitive_cell[i] is the vector (x, y, z) for the i’th lattice vector of the primitive cell.
- property primitive_masses: ndarray[tuple[int], dtype[floating]]#
Mass of the atoms in the unit cell.
- property primitive_strain: PristineStrainTensor#
The strain tensor for the primitive system.
- property primitive_symbols: list[str]#
Symbols of the atoms in the unit cell.
- property strain_tensor: ndarray[tuple[int, int, Literal[3], Literal[3]], dtype[float64]]#
Strain tensor matrix for the system.
strain_tensor[i, j, alpha, beta] is the force constant between the i’th and j’th atom in the system, for each pair of cartesian directions (alpha, beta).
- property symbols: list[str]#
Symbols of all the atoms in the system.
- with_strain(strain: PristineStrainTensor) PristineSystem#
Return a new PristineSystem with the same properties but different forces.
- phonon_lifetime.pristine.plot_dispersion_1d(result: PristineModesAtBranch, idx: tuple[int, int] = (0, 0), *, ax: Axes | None = None) tuple[Figure, Axes, Line2D]#
- phonon_lifetime.pristine.plot_dispersion_2d_xy(result: PristineModesAtBranch, idx: int = 0, *, ax: Axes | None = None) tuple[Figure, Axes, QuadMesh]#
- phonon_lifetime.pristine.with_ase_forces(system: System, *, periodic: tuple[bool, bool, bool] = (True, True, True), n_repeats: tuple[int, int, int] | None = None) PristineSystem#
Return a new PristineSystem with forces calculated using ASE.
Parameters#
- system: System
The system to calculate forces for. The system should be a pristine system, or at least have a well defined primitive cell.
- periodic: tuple[bool, bool, bool]
Whether to apply periodic boundary conditions in each direction when calculating forces. This will affect which atoms are considered nearest neighbors.
- n_repeats: tuple[int, int, int] | None
The number of repeats to use when calculating forces. If None, will simulate the full system.
- phonon_lifetime.pristine.with_nearest_neighbor_forces(system: System, spring_constant: float, *, cutoff: float = 2.46, periodic: tuple[bool, bool, bool] = (True, True, True)) PristineSystem#
Return a new PristineSystem with nearest neighbor forces added.
The forces are added in the form of a spring force between nearest neighbor, with the given spring constant. The cutoff is used to determine which atoms are considered nearest neighbor.