PAOFLOW.elphon.pseudopotential_terms#

Bare pseudopotential terms of the electron-phonon vertex (norm-conserving).

The induced potential of ph.x (dvscf) excludes the bare ionic contribution; the vertex adds, as EPW’s dvqpsi_us3 / dvqpsi_us_only3 and compute_dvloc:

  • the derivative of the local pseudopotential, dV^loc_{kappa alpha}(q + G) = -i (q+G)_alpha V^loc_kappa(|q+G|) exp(-i (q+G).tau_kappa);

  • the derivative of the Kleinman-Bylander projectors, sum_ij [ |d beta_i> D_ij <beta_j| + |beta_i> D_ij <d beta_j| ] with d beta(k+G) = -i (k+G) beta(k+G).

The radial tables V^loc(q) and beta(q) mirror QE’s (upflib/vloc_mod.f90, upflib/beta_mod.f90: Simpson integration on the UPF mesh, dq = 0.01 bohr^-1, four-point Lagrange interpolation) so that the vertex reproduces EPW’s epmatq to the rounding level. Fully relativistic projectors used in a scalar run are averaged as QE’s average_pp. Spherical harmonics follow ylmr2 (real, QE ordering).

Attributes#

Classes#

LocalPotentialTable

V^loc(q) of one species on QE's interpolation table (Ry, includes the Coulomb tail).

KleinmanBylanderProjectors

Kleinman-Bylander projectors beta_i(k+G) and D_ij (Ry) of all atoms (QE init_us_2).

Functions#

qe_simpson(func, rab)

Simpson integration on a logarithmic mesh, as QE's simpson (odd or even mesh).

radial_cutoff_index(r[, rcut])

QE's msh: number of mesh points up to rcut, made odd.

lagrange4(table, q[, dq])

Four-point Lagrange interpolation of a table table[i] = f(i dq) (QE interp_beta).

real_spherical_harmonics_qe(lmax, vectors)

Real spherical harmonics in QE's ylmr2 ordering and sign convention.

average_relativistic_projectors(upf)

Scalar projectors and D of a fully relativistic UPF used without spin-orbit (QE average_pp).

scalar_projectors(upf)

Projectors and D (Ry) of a UPF as used in a scalar-relativistic run.

spinor_coefficient(l, j, m, spin)

Clebsch-Gordan coefficient of QE's spinor (spin = 1 up, 2 down; m = m_j - 1/2).

spherical_index(l, j, m, spin)

QE sph_ind: the orbital m_l of the spin component of the |l j m_j> spinor.

real_to_complex_harmonics([lmax])

QE rot_ylm: rot[lmax + m_complex, real index] for the ylmr2 real harmonics.

spin_orbit_coefficient(l, j, mi, mk, s1, s2, rot)

QE fcoef(ih, kh, is1, is2) for two real-harmonic projectors mi, mk (0-based) of the same (l, j).

relativistic_projectors(upf)

Projectors of a fully relativistic UPF used with spin-orbit coupling (no averaging).

bare_local_perturbation(tables, species_of_atom, ...)

Periodic part of dV^loc / du_{kappa alpha}(q) on the grid (EPW compute_dvloc).

projector_q_table(upf, nb, beta, l, q, r, rab, kkbeta, ...)

Radial table beta_l(q) of one projector on the interpolation grid (QE init_us_1).

nonlocal_perturbation(kb, coefficients_k, kpg_k, ...)

dV^NL / du_{kappa alpha} |psi_nk> on the k+q+G sphere (EPW dvqpsi_us_only3).

Module Contents#

PAOFLOW.elphon.pseudopotential_terms.E2 = 2.0[source]#
PAOFLOW.elphon.pseudopotential_terms.FPI[source]#
PAOFLOW.elphon.pseudopotential_terms.DQ = 0.01[source]#
PAOFLOW.elphon.pseudopotential_terms.RCUT_LOCAL = 10.0[source]#
PAOFLOW.elphon.pseudopotential_terms.qe_simpson(func, rab)[source]#

Simpson integration on a logarithmic mesh, as QE’s simpson (odd or even mesh).

Parameters:
  • func (ndarray (mesh,))

  • rab (ndarray (mesh,)) – dr/di of the mesh.

PAOFLOW.elphon.pseudopotential_terms.radial_cutoff_index(r, rcut=RCUT_LOCAL)[source]#

QE’s msh: number of mesh points up to rcut, made odd.

PAOFLOW.elphon.pseudopotential_terms.lagrange4(table, q, dq=DQ)[source]#

Four-point Lagrange interpolation of a table table[i] = f(i dq) (QE interp_beta).

Parameters:
  • table (ndarray (..., nq))

  • q (ndarray (n,)) – Abscissae (>= 0); values whose stencil leaves the table are zero.

Return type:

ndarray (..., n)

PAOFLOW.elphon.pseudopotential_terms.real_spherical_harmonics_qe(lmax, vectors)[source]#

Real spherical harmonics in QE’s ylmr2 ordering and sign convention.

Parameters:
  • lmax (int)

  • vectors (ndarray (n, 3)) – Directions (any length; the zero vector gives the cos theta = 0 limit).

Returns:

Column lm = l^2 + 1 + 2m (1-based) is cos(m phi) type, lm + 1 sin(m phi).

Return type:

ndarray (n, (lmax+1)^2)

PAOFLOW.elphon.pseudopotential_terms.average_relativistic_projectors(upf)[source]#

Scalar projectors and D of a fully relativistic UPF used without spin-orbit (QE average_pp).

Parameters:

upf (UPF) – PAOFLOW.inputs.read_upf.UPF with beta[i]['j'] set.

Returns:

betas (list of r beta(r) arrays), lll (list of int), cutoff (list of int), dion_ry (nbeta, nbeta).

Return type:

dict

PAOFLOW.elphon.pseudopotential_terms.scalar_projectors(upf)[source]#

Projectors and D (Ry) of a UPF as used in a scalar-relativistic run.

PAOFLOW.elphon.pseudopotential_terms.LMAXX = 3[source]#
PAOFLOW.elphon.pseudopotential_terms.spinor_coefficient(l, j, m, spin)[source]#

Clebsch-Gordan coefficient of QE’s spinor (spin = 1 up, 2 down; m = m_j - 1/2).

PAOFLOW.elphon.pseudopotential_terms.spherical_index(l, j, m, spin)[source]#

QE sph_ind: the orbital m_l of the spin component of the |l j m_j> spinor.

PAOFLOW.elphon.pseudopotential_terms.real_to_complex_harmonics(lmax=LMAXX)[source]#

QE rot_ylm: rot[lmax + m_complex, real index] for the ylmr2 real harmonics.

PAOFLOW.elphon.pseudopotential_terms.spin_orbit_coefficient(l, j, mi, mk, s1, s2, rot)[source]#

QE fcoef(ih, kh, is1, is2) for two real-harmonic projectors mi, mk (0-based) of the same (l, j).

PAOFLOW.elphon.pseudopotential_terms.relativistic_projectors(upf)[source]#

Projectors of a fully relativistic UPF used with spin-orbit coupling (no averaging).

class PAOFLOW.elphon.pseudopotential_terms.LocalPotentialTable(upf, omega, qmax, dq=DQ)[source]#

V^loc(q) of one species on QE’s interpolation table (Ry, includes the Coulomb tail).

Parameters:
  • upf (UPF) – Pseudopotential (vloc in Hartree on the UPF mesh, val the valence charge).

  • omega (float) – Cell volume (bohr^3).

  • qmax (float) – Largest |q + G| needed (bohr^-1); the table extends four steps beyond.

  • dq (float, optional) – Table step (bohr^-1).

dq[source]#
omega[source]#
zp[source]#
table[source]#
PAOFLOW.elphon.pseudopotential_terms.bare_local_perturbation(tables, species_of_atom, tau_alat, q_cart, g_miller, g_cart, tpiba, fft_grid)[source]#

Periodic part of dV^loc / du_{kappa alpha}(q) on the grid (EPW compute_dvloc).

Parameters:
Returns:

dvloc_{3 kappa + alpha}(r) in Ry/bohr.

Return type:

ndarray (3 nat, nr1, nr2, nr3), complex

PAOFLOW.elphon.pseudopotential_terms.projector_q_table(upf, nb, beta, l, q, r, rab, kkbeta, pref)[source]#

Radial table beta_l(q) of one projector on the interpolation grid (QE init_us_1).

Parameters:
  • upf (UPF or PotcarDataset) – The dataset of the species.

  • nb (int) – Projector index within the dataset.

  • beta (ndarray (mesh,)) – r beta(r) on the radial mesh.

  • l (int) – Angular momentum.

  • q (ndarray (nqx,)) – Interpolation grid (bohr^-1).

  • r (ndarray (mesh,)) – Radial mesh (bohr) and dr/di.

  • rab (ndarray (mesh,)) – Radial mesh (bohr) and dr/di.

  • kkbeta (int) – Number of mesh points of the projector support.

  • pref (float) – 4 pi / sqrt(omega).

Returns:

\(\frac{4\pi}{\sqrt\Omega}\int_0^{r_{kkbeta}} r^2 \beta(r) j_l(qr)\, dr\), Simpson integration on the mesh as QE’s beta_mod.

Return type:

ndarray (nqx,)

Notes

A VASP dataset (PotcarDataset) stores the projector VASP applies to the plane waves as a reciprocal-space table projector_q_tables[nb], \(P(q) = 4\pi\int \tilde p(r) j_l(qr) r^2 dr\); that table is interpolated (cubic spline, zero beyond its last point) and divided by \(\sqrt\Omega\) instead, so that the augmented metric of the projections is the one of the WAVECAR bands.

class PAOFLOW.elphon.pseudopotential_terms.KleinmanBylanderProjectors(upf_by_species, species_of_atom, omega, qmax, dq=DQ, spin_orbit=False, require_norm_conserving=True)[source]#

Kleinman-Bylander projectors beta_i(k+G) and D_ij (Ry) of all atoms (QE init_us_2).

Parameters:
  • upf_by_species (dict) – Species -> PAOFLOW.inputs.read_upf.UPF (norm-conserving).

  • species_of_atom (sequence of str) – Species of every atom.

  • omega (float) – Cell volume (bohr^3).

  • qmax (float) – Largest |k+G| needed (bohr^-1): sqrt(ecutwfc) for the stored spheres.

  • dq (float, optional) – Table step (bohr^-1).

  • spin_orbit (bool, optional) – Fully relativistic projectors with the spinor coupling matrix (QE dvan_so); otherwise fully relativistic UPFs are averaged as in a scalar run.

  • require_norm_conserving (bool, optional) – Raise on ultrasoft / PAW pseudopotentials (default, the electron-phonon vertex needs the norm-conserving form of the non-local potential). With False the projectors of augmented pseudopotentials are tabulated too and Q (or Q_so with spin_orbit=True) holds the integrated augmentation charges, which is what the overlap operator S = 1 + sum_ij q_ij |beta_i><beta_j| of the projections needs.

Variables:
  • atom_of_projector (ndarray (nproj,) int)

  • l_of_projector (ndarray (nproj,) int)

  • D (ndarray (nproj, nproj) or None) – Block diagonal per atom, coupling projectors with equal (l, m) (Ry); None with spin-orbit coupling.

  • Q (ndarray (nproj, nproj) or None) – Integrated augmentation charges \(q_{ij}\) with the same block structure as D (dimensionless); None when every species is norm-conserving or with spin-orbit coupling.

  • D_so (ndarray (2, 2, nproj, nproj) complex or None) – Spinor coupling D^{s1 s2}_{ij} = dion_{nb_i nb_j} fcoef(i, j, s1, s2) (Ry).

  • Q_so (ndarray (2, 2, nproj, nproj) complex or None) – Augmentation charges in the spinor basis (QE qq_so) for ultrasoft / PAW projectors with spin-orbit coupling, see _spinor_augmentation(); None for norm-conserving sets and without spin-orbit coupling (then Q).

dq[source]#
omega[source]#
spin_orbit = False[source]#
species_of_atom[source]#
tables: dict[str, numpy.typing.NDArray[numpy.float64]][source]#
lll: dict[str, list[int]][source]#
jjj: dict[str, list[float]][source]#
dion: dict[str, numpy.typing.NDArray[numpy.float64]][source]#
qqq: dict[str, numpy.typing.NDArray[numpy.float64] | None][source]#
atom_of_projector[source]#
l_of_projector[source]#
j_of_projector[source]#
lmax[source]#
property nproj: int[source]#

Number of projectors (all atoms, all m).

at(kpg_cart, tau_alat, tpiba)[source]#

beta_i(k+G) for the vectors of one sphere.

Parameters:
  • kpg_cart (ndarray (npw, 3)) – k + G (Cartesian, 2 pi / alat).

  • tau_alat (ndarray (nat, 3)) – Positions (Cartesian, alat).

  • tpiba (float) – 2 pi / alat (bohr^-1).

Returns:

(4 pi / sqrt(Omega)) (-i)^l beta_l(|k+G|) Y_lm(k+G) exp(-i (k+G).tau).

Return type:

ndarray (nproj, npw), complex

PAOFLOW.elphon.pseudopotential_terms.nonlocal_perturbation(kb, coefficients_k, kpg_k, kpg_kq, tau_alat, tpiba, beta_k=None, beta_kq=None)[source]#

dV^NL / du_{kappa alpha} |psi_nk> on the k+q+G sphere (EPW dvqpsi_us_only3).

Parameters:
  • kb (KleinmanBylanderProjectors)

  • coefficients_k (ndarray (nb, npol * npw_k), complex) – Bands at k (spinor components concatenated for npol = 2).

  • kpg_k (ndarray (npw_k, 3), (npw_kq, 3)) – k + G and k + q + G' (Cartesian, 2 pi / alat); the latter are the vectors of the stored block at k' = k + q - G0, so no umklapp relabelling is needed.

  • kpg_kq (ndarray (npw_k, 3), (npw_kq, 3)) – k + G and k + q + G' (Cartesian, 2 pi / alat); the latter are the vectors of the stored block at k' = k + q - G0, so no umklapp relabelling is needed.

  • tau_alat (ndarray (nat, 3))

  • tpiba (float)

  • beta_k (ndarray, optional) – Precomputed kb.at(...) of the two spheres.

  • beta_kq (ndarray, optional) – Precomputed kb.at(...) of the two spheres.

Returns:

sum_{i in kappa} beta_i(k+q+G') [ ps1_{i n alpha} + (k+q+G')_alpha ps2_{i n alpha} ] with ps1 = D alphap_alpha, alphap_alpha = <beta| i tpiba (k+G)_alpha |psi>, ps2 = -i tpiba D becp, becp = <beta|psi>; with spin-orbit coupling D is the spinor matrix D^{s1 s2} and the spin components are coupled (EPW ps1_nc).

Return type:

ndarray (3 nat, nb, npol * npw_kq), complex