nonrad.elphon module

Utilities to compute electron-phonon coupling.

This module provides various utilities to evaluate electron-phonon coupling strength using different first-principles codes.

nonrad.elphon.get_Wif_from_UNK(unks: list, init_unk_path: str, def_index: int, bulk_index: ndarray | Sequence[int], eigs: Sequence[float], fig=None) list[source]

Compute the electron-phonon matrix element using UNK files.

Evaluate the electron-phonon coupling matrix element using the information stored in the given UNK files. This is compatible with any first-principles code that write to the wannier90 UNK file format. The onus is on the user to ensure the wavefunctions are valid (i.e., norm-conserving).

Parameters:
  • unks (list((Q, unk_path))) – a list of tuples where the first value is the Q and the second is the path to the UNK file

  • init_unk_path (string) – path to the initial unk file for computing overlaps

  • def_index (int) – index corresponding to the defect wavefunction (1-based indexing)

  • bulk_index (int, list(int)) – index or list of indices corresponding to the bulk wavefunction (1-based indexing)

  • eigs (np.ndarray) – array of eigenvalues in eV where the indices correspond to those given by def_index and bulk_index

  • fig (matplotlib.figure.Figure) – optional figure object to plot diagnostic information

Returns:

electron-phonon matrix element Wif in units of eV amu^{-1/2} Angstrom^{-1} for each bulk_index

Return type:

list((bulk_index, Wif))

nonrad.elphon.get_Wif_from_WSWQ(wswqs: list, initial_vasprun: str, def_index: int, bulk_index: ndarray | Sequence[int], spin: int = 0, kpoint: int = 1, fig=None) list[source]

Compute the electron-phonon matrix element using the WSWQ files.

Read in the WSWQ files to obtain the overlaps. Then compute the electron- phonon matrix elements from the overlaps as a function of Q.

Parameters:
  • wswqs (list((Q, wswq_path))) – a list of tuples where the first value is the Q and the second is the path to the directory that contains the WSWQ file

  • initial_vasprun (string) – path to the initial vasprun.xml to extract the eigenvalue difference

  • def_index (int) – index corresponding to the defect wavefunction (1-based indexing)

  • bulk_index (int, list(int)) – index or list of indices corresponding to the bulk wavefunction (1-based indexing)

  • spin (int) – spin channel to read from (0 - up, 1 - down)

  • kpoint (int) – kpoint to read from (defaults to the first kpoint)

  • fig (matplotlib.figure.Figure) – optional figure object to plot diagnostic information

Returns:

electron-phonon matrix element Wif in units of eV amu^{-1/2} Angstrom^{-1} for each bulk_index

Return type:

list((bulk_index, Wif))

nonrad.elphon.get_Wif_from_wavecars(wavecars: list, init_wavecar_path: str, def_index: int, bulk_index: ndarray | Sequence[int], spin: int = 0, kpoint: int = 1, fig=None) list[source]

Compute the electron-phonon matrix element using the WAVECARs.

This function reads in the pseudo-wavefunctions from the WAVECAR files and computes the overlaps necessary.

* WARNING: USE AT YOUR OWN RISK * Because these are pseudo-wavefunctions, the core information from the PAWs is missing. As a result, the resulting Wif value may be unreliable. A good test of this is how close the Q=0 overlap is to 0. (it would be exactly 0. if you include the corrections from the PAWs). This should only be used to get a preliminary idea of the Wif value. ***********

Parameters:
  • wavecars (list((Q, wavecar_path))) – a list of tuples where the first value is the Q and the second is the path to the WAVECAR file

  • init_wavecar_path (string) – path to the initial wavecar for computing overlaps

  • def_index (int) – index corresponding to the defect wavefunction (1-based indexing)

  • bulk_index (int, list(int)) – index or list of indices corresponding to the bulk wavefunction (1-based indexing)

  • spin (int) – spin channel to read from (0 - up, 1 - down)

  • kpoint (int) – kpoint to read from (defaults to the first kpoint)

  • fig (matplotlib.figure.Figure) – optional figure object to plot diagnostic information

Returns:

electron-phonon matrix element Wif in units of eV amu^{-1/2} Angstrom^{-1} for each bulk_index

Return type:

list((bulk_index, Wif))