PAOFLOW.elphon.long_range#

Long-range (dipole and quadrupole) part of the electron-phonon coupling and of the dynamical matrix.

The Fourier interpolation of the coupling and of the force constants from the coarse grids to the dense ones cannot represent the non-analytic long-range fields of a polar crystal: the Fröhlich vertex diverges as \(1/|q|\) and the dipole-dipole term of the dynamical matrix sets the LO-TO splitting. Both are therefore subtracted on the coarse grid, the short-range remainder is interpolated, and the analytic model is added back at every dense q (Verdi and Giustino, PRL 115, 176401 (2015); Sjakste et al., PRB 92, 054307 (2015); quadrupoles: Brunin et al., PRL 125, 136601 (2020)). The model follows EPW’s rgd_blk_epw and rgd_blk (EPW/src/longrange.f90, QE 7.5), so that the two codes agree term by term:

\[g^{\mathcal L}_{\kappa\alpha}(q) = \frac{4\pi e^2}{\Omega}\sum_{G\ne -q} \frac{e^{-(q+G)\cdot\varepsilon^\infty\cdot(q+G)/4\alpha}}{(q+G)\cdot\varepsilon^\infty\cdot(q+G)} \, e^{-i(q+G)\cdot\tau_\kappa}\Big[\, i\,(q+G)\cdot Z^*_\kappa\,\big|_\alpha + \tfrac12 (q+G)\cdot Q^{\kappa}_{\alpha}\cdot(q+G)\Big],\]

in the PAO gauge diagonal in the orbital indices (EPW: the identity in the Wannier gauge), and the dipole-dipole force constants with the same Ewald sum and the q = 0 self term that enforces the acoustic sum rule. Rydberg units (e^2 = 2); q and G in 2 pi / alat on input, bohr^-1 inside.

Attributes#

Classes#

LongRangeModel

Analytic long-range model of a crystal (dielectric tensor, Born charges, quadrupoles).

Functions#

read_quadrupole_fmt(path, nat)

Read EPW's quadrupole.fmt (one header line, then atom dir Qxx Qyy Qzz Qyz Qxz Qxy).

impose_charge_neutrality(born_charges)

Born charges with the acoustic (charge-neutrality) sum rule imposed (QE zasr = 'simple').

Module Contents#

PAOFLOW.elphon.long_range.E2_RY = 2.0[source]#
PAOFLOW.elphon.long_range.DEFAULT_ALPHA = 1.0[source]#
PAOFLOW.elphon.long_range.DEFAULT_GMAX = 14.0[source]#
PAOFLOW.elphon.long_range.read_quadrupole_fmt(path, nat)[source]#

Read EPW’s quadrupole.fmt (one header line, then atom dir Qxx Qyy Qzz Qyz Qxz Qxy).

Parameters:
  • path (str)

  • nat (int) – Number of atoms (3 nat data lines are expected).

Returns:

Q[atom, displacement, p, q] (symmetric in p, q), the convention of EPW Qmat.

Return type:

ndarray (nat, 3, 3, 3)

PAOFLOW.elphon.long_range.impose_charge_neutrality(born_charges)[source]#

Born charges with the acoustic (charge-neutrality) sum rule imposed (QE zasr = 'simple').

Parameters:

born_charges (array_like (nat, 3, 3))

Returns:

Z*_kappa - (1/nat) sum_kappa' Z*_kappa', so that sum_kappa Z*_kappa = 0.

Return type:

ndarray (nat, 3, 3)

class PAOFLOW.elphon.long_range.LongRangeModel[source]#

Analytic long-range model of a crystal (dielectric tensor, Born charges, quadrupoles).

Parameters:
  • epsilon (ndarray (3, 3)) – High-frequency dielectric tensor.

  • born_charges (ndarray (nat, 3, 3)) – Z*[atom, field, displacement] (QE zeu(field, displacement, atom)).

  • tau_alat (ndarray (nat, 3)) – Atomic positions, Cartesian, units of alat.

  • alat (float) – Lattice parameter (bohr).

  • at (ndarray (3, 3)) – Direct (rows, alat) and reciprocal (rows, 2 pi / alat) lattice vectors.

  • bg (ndarray (3, 3)) – Direct (rows, alat) and reciprocal (rows, 2 pi / alat) lattice vectors.

  • quadrupoles (ndarray (nat, 3, 3, 3), optional) – Q[atom, displacement, p, q] (read_quadrupole_fmt()); None for dipoles only.

  • alpha (float, optional) – Ewald parameter in (2 pi / alat)^2: EPW uses 1 (the default here, for the coupling); QE’s q2r.x/matdyn.x use (alat / 2 pi)^2 (from_dynamical_matrices()). The value only moves weight between the analytic and the interpolated parts.

  • gmax (float, optional) – Cutoff of the G sum (EPW gmax = 14).

Notes

The Gaussian damping uses the dielectric norm (q+G).eps.(q+G) as EPW does (its documentation writes |q+G|^2). The G box is centred on the vector that minimises |q+G|.

epsilon: numpy.typing.NDArray[numpy.float64][source]#
born_charges: numpy.typing.NDArray[numpy.float64][source]#
tau_alat: numpy.typing.NDArray[numpy.float64][source]#
alat: float[source]#
at: numpy.typing.NDArray[numpy.float64][source]#
bg: numpy.typing.NDArray[numpy.float64][source]#
quadrupoles: numpy.typing.NDArray[numpy.float64] | None = None[source]#
alpha: float = 1.0[source]#
gmax: float = 14.0[source]#
property nat: int[source]#

Number of atoms.

property tpiba: float[source]#

2 pi / alat (bohr^-1).

property omega: float[source]#

Cell volume (bohr^3).

property tau_cart: numpy.typing.NDArray[numpy.float64][source]#

Atomic positions in bohr.

property has_quadrupoles: bool[source]#

Whether a quadrupole tensor is present (and not identically zero).

is_polar(tolerance=0.1)[source]#

max |Z*| > tolerance.

signature()[source]#

Short hash of the tensors and parameters (vertex-cache key component).

classmethod from_dfpt(setup, quadrupoles=None, **kwargs)[source]#

From a CoarseVertexSetup (Γ dynamical matrix tensors).

Raises:

ValueError – If ph.x ran without epsil (no dielectric tensor in the dyn file).

classmethod from_coupling(coupling_dir, save_dir, prefix=None, quadrupoles=None, **kwargs)[source]#

From the ph.x outputs (_ph0/ or pp.py save/) and the nscf save.

Parameters:
  • coupling_dir (str) – Directory with the dynamical matrices (locate_dfpt_files()).

  • save_dir (str) – QE save for the lattice and atomic positions.

  • prefix (str, optional)

  • quadrupoles (ndarray (nat, 3, 3, 3) or str, optional) – Tensor or path of an EPW quadrupole.fmt file.

classmethod from_dynamical_matrices(dyn, zasr='simple', alpha=None, **kwargs)[source]#

From read_dynamical_matrices() (the q2r.x chain).

Parameters:
  • dyn (dict) – Its epsilon, born_charges, tau_cart (alat), alat, at, bg.

  • zasr ({'simple', 'no'}, optional) – Impose charge neutrality on the Born charges (q2r.x zasr).

  • alpha (float, optional) – Ewald parameter; None takes QE’s (alat / 2 pi)^2 (q2r.x), which makes the interpolated dispersion that of matdyn.x.

Raises:

ValueError – Without a dielectric tensor (ph.x run without epsil).

classmethod from_epw(epw, nscf, quadrupoles=None, **kwargs)[source]#

From load_epw_coupling() (epsi, zstar) and read_nscf.

coefficients(q_cryst)[source]#

Long-range vertex per Cartesian displacement at q (Ry/bohr).

Parameters:

q_cryst (array_like (3,)) – q in crystal coordinates.

Returns:

  • coeff_delta (ndarray (3 nat,), complex) – Coefficient of the orbital identity (EPW coeff_delta), mode index 3 kappa + alpha.

  • coeff_r (ndarray (3, 3 nat), complex or None) – Coefficient of the position operator (EPW coeff_r), present with quadrupoles only.

vertex_pao(q_cryst, nawf, orbital_positions=None)[source]#

The long-range vertex in the PAO gauge, (nawf, nawf, 3 nat) (Ry/bohr).

Parameters:
  • q_cryst (array_like (3,))

  • nawf (int) – Number of PAO orbitals.

  • orbital_positions (ndarray (nawf, 3), optional) – Orbital centres (crystal coordinates), used for the position-operator term of the quadrupole model (EPW’s Wannier position matrix); ignored for dipoles only.

Notes

Diagonal in the orbitals, as EPW’s identity in the Wannier gauge; the same matrix is subtracted from every coarse k and added at every dense k of this q.

dynamical_matrix(q_cryst)[source]#

Long-range force constants at q (Ry/bohr^2, (3 nat, 3 nat), not mass-weighted).

The q-dependent dipole, dipole-quadrupole and quadrupole-quadrupole terms plus the q = 0 self term on the atom-diagonal blocks (EPW rgd_blk, signe = +1). Subtract it from the coarse C(q) before the q -> R_p transform and add it back at every dense q.