util

atomic_weight

util.atomic_weight.get_atomic_weight(element: str)[source]

Parser function to return atomic weight.

Parameters

element (str) – Atomic number of name

Returns

Atomic weight

Return type

float

k_points functions

util.k_points.explicit_reciprocal(k_file_lines: List[str]) InterPhon.util.KptPath[source]

Explicit designation of k-points in reciprocal coordinates.

Parameters

k_file_lines (List[str]) – List of each line of the KPOINTS file in VASP format

Returns

K-points

Return type

KptPath

util.k_points.gamma_centered(k_file_lines: List[str], _ind_pbc: numpy.ndarray) tuple[source]

Automatic k-point grid generation by Gamma-centered scheme.

Parameters
  • k_file_lines (List[str]) – List of each line of the KPOINTS file in VASP format

  • _ind_pbc (np.ndarray[int]) – Indices for the lattice direction of periodic boundary

Returns

A set of k_points and auto_k_points

Return type

tuple

util.k_points.line_path(k_file_lines: List[str], _ind_pbc: numpy.ndarray) InterPhon.util.KptPath[source]

Generation of k-path line connecting the high symmetry k-points by line-segmentation.

Parameters
  • k_file_lines (List[str]) – List of each line of the KPOINTS file in VASP format

  • _ind_pbc (np.ndarray[int]) – Indices for the lattice direction of periodic boundary

Returns

K-points along the line path

Return type

KptPath

util.k_points.monkhorst_pack(k_file_lines: List[str], _ind_pbc: numpy.ndarray) tuple[source]

Automatic k-point grid generation by Monkhorst-Pack scheme.

Parameters
  • k_file_lines (List[str]) – List of each line of the KPOINTS file in VASP format

  • _ind_pbc (np.ndarray[int]) – Indices for the lattice direction of periodic boundary

Returns

A set of k_points and auto_k_points

Return type

tuple

linear_tetrahedron_method functions

For more details on the demonstrated formula below, please find the following references:

Ref 1) Extensions of the tetrahedron method for evaluating spectral properties of solids, Journal of Physics C 12, 2991 (1979). Ref 2) FermiSurfer: Fermi-surface viewer providing multiple representation schemes, Computer Physics Communications 239, 197 (2019).

util.linear_tetrahedron_method.tetrahedron_1d(_freq: numpy.ndarray, _pdos: numpy.ndarray, k_points: List[numpy.ndarray], w_q: numpy.ndarray, v_q: numpy.ndarray, num_k_points: List[int], _ind_pbc: numpy.ndarray) numpy.ndarray[source]

The 1D version of linear tetrahedron method: linear line method.

Parameters
  • _freq (np.ndarray[float]) – ‘(num_dos,) size’ frequencies where DOS will be evaluated

  • _pdos (np.ndarray[float]) – ‘(num_mode, num_dos) size’ partial DOS for each phonon mode

  • k_points (List[np.ndarray]) – List of ‘(3,) size’ k-point

  • w_q (np.ndarray[float]) – ‘(num_k_points, num_mode) size’ eigen-frequency

  • v_q (np.ndarray[float]) – ‘(num_k_points, num_mode, num_mode) size’ eigen-mode

  • num_k_points (List[int]) – ‘(3,) size’ list for the number of automatic grid

  • _ind_pbc (np.ndarray[int]) – Indices for the lattice direction of periodic boundary

Returns

‘(num_mode, num_dos) size’ partial DOS for each phonon mode

Return type

np.ndarray[float]

util.linear_tetrahedron_method.tetrahedron_2d(_freq: numpy.ndarray, _pdos: numpy.ndarray, k_points: List[numpy.ndarray], w_q: numpy.ndarray, v_q: numpy.ndarray, num_k_points: List[int], _ind_pbc: numpy.ndarray) numpy.ndarray[source]

The 2D version of linear tetrahedron method: linear triangle method.

Parameters
  • _freq (np.ndarray[float]) – ‘(num_dos,) size’ frequencies where DOS will be evaluated

  • _pdos (np.ndarray[float]) – ‘(num_mode, num_dos) size’ partial DOS for each phonon mode

  • k_points (List[np.ndarray]) – List of ‘(3,) size’ k-point

  • w_q (np.ndarray[float]) – ‘(num_k_points, num_mode) size’ eigen-frequency

  • v_q (np.ndarray[float]) – ‘(num_k_points, num_mode, num_mode) size’ eigen-mode

  • num_k_points (List[int]) – ‘(3,) size’ list for the number of automatic grid

  • _ind_pbc (np.ndarray[int]) – Indices for the lattice direction of periodic boundary

Returns

‘(num_mode, num_dos) size’ partial DOS for each phonon mode

Return type

np.ndarray[float]

util.linear_tetrahedron_method.tetrahedron_3d(_freq: numpy.ndarray, _pdos: numpy.ndarray, k_points: List[numpy.ndarray], w_q: numpy.ndarray, v_q: numpy.ndarray, num_k_points: List[int], _ind_pbc: numpy.ndarray) numpy.ndarray[source]

The 3D version of linear tetrahedron method: linear tetrahedron method.

Parameters
  • _freq (np.ndarray[float]) – ‘(num_dos,) size’ frequencies where DOS will be evaluated

  • _pdos (np.ndarray[float]) – ‘(num_mode, num_dos) size’ partial DOS for each phonon mode

  • k_points (List[np.ndarray]) – List of ‘(3,) size’ k-point

  • w_q (np.ndarray[float]) – ‘(num_k_points, num_mode) size’ eigen-frequency

  • v_q (np.ndarray[float]) – ‘(num_k_points, num_mode, num_mode) size’ eigen-mode

  • num_k_points (List[int]) – ‘(3,) size’ list for the number of automatic grid

  • _ind_pbc (np.ndarray[int]) – Indices for the lattice direction of periodic boundary

Returns

‘(num_mode, num_dos) size’ partial DOS for each phonon mode

Return type

np.ndarray[float]

symmetry class

class util.symmetry.Symmetry2D(unit_cell, super_cell, user_arg)[source]

Symmetry class for searching and leveraging the 2D in-plane symmetry operations. The symmetry of a given crystal structure is analyzed using the instance methods, and resulting information is stored in the instance variables of this class.

Parameters
find_point_group_index(W_direct)[source]

Search index of point group operation of the given point group operation. This instance method returns: 1) _W_ind: index of point group operation.

Parameters

W_direct (np.ndarray[int]) – Point group operation W represented in direct

Returns

Index of point group operation

Return type

int

gen_additional_displacement()[source]

Set additional displacement vectors to make a total of three linearly independent displacement vectors.

search_cell_image_index(W_direct, cell)[source]

Search index of image atoms, in the given cell, transformed by the given point group operation. This instance method returns: 1) _same_cell_index: index of image atoms mapped onto by applying the given point group operation to atoms in the given cell.

Parameters
  • W_direct (np.ndarray[int]) – Point group operation W represented in direct coordinates

  • cell (core.UnitCell or core.SuperCell) – Instance of UnitCell or SuperCell class

Returns

Index of image atoms mapped onto by applying an (W, w) to atoms in the given cell

Return type

List[int]

search_image_atom()[source]

Search index of image atoms transformed by the point group operations of its instance crystal structure (self.unit_cell). This instance method returns: 1) self.point_group_ind: index of point group operation W belonging to symmetry operations of the crystal. 2) self.require_atom: index of atoms in unit cell to which displacements are required. 3) self.not_require_atom: index of atoms in unit cell to which displacements are not required. 4) self.same_supercell_index_select: index of image atoms mapped onto by applying an (W, w) to atoms in super cell.

Returns

self.point_group_ind, self.require_atom, self.not_require_atom, self.same_supercell_index_select

Return type

tuple

search_independent_displacement()[source]

Set independent displacement vectors by applying the point group operations to an arbitrary displacement vector. To generate a force constant matrix, three linearly independent displacement vectors are required for each atom in unit cell.

search_point_group()[source]

Search point group operations of its instance crystal structure (self.unit_cell). This instance method returns: 1) self.W_select: rotation part of an affine mapping (W, w) belonging to symmetry operations of the crystal. 2) self.w_select: translation part of an affine mapping (W, w) belonging to symmetry operations of the crystal. 3) self.same_index_select: index of image atoms mapped onto by applying an (W, w) to atoms in unit cell.

Returns

self.W_select, self.w_select, self.same_index_select

Return type

tuple

search_self_image_atom()[source]

Search index of point group operation by which atoms in self.require_atom are mapped onto the identical atoms.