PAOFLOW.elphon.elph_bloch#

Shared Bloch / PAO-gauge vertex machinery for the electron-phonon PAO route.

Provides the geometry reader and the interpolation primitives used by PAOFLOW.elphon.do_pao_eph to turn QE’s coarse-grid Cartesian coupling into the dense-grid Eliashberg properties:

  • read_nscf() – k-points, eigenvalues, Fermi level and lattice from the QE data-file-schema.xml;

  • atom_masses() – per-species masses expanded to the atoms of the cell;

  • kq_index_map() – k -> (index of k+q on the grid, umklapp G0);

  • vertex_pao_R() – rotate the band-basis Cartesian coupling into the PAO gauge A_{k+q}^T d A_k^* (A_{ni} = <phi_i|psi_n>) and Fourier-transform it to the electron real-space cells g(R_e);

  • lambda_q_dense_ws() – Wigner-Seitz interpolate the electrons (HRs) and the vertex to a dense grid and evaluate the Fermi-surface double delta -> lambda_{q nu}.

Attributes#

Functions#

read_nscf(save_dir[, unfold])

Read k-points, eigenvalues, Fermi level and lattice from data-file-schema.xml.

pao_orbital_positions(data_controller, at)

Centre of every PAO orbital in crystal coordinates.

atom_masses(species_masses, species, atom_names)

Expand per-species masses to one mass per atom.

kq_index_map(kpts_cryst, q_cryst, nkgrid[, tol])

Map k -> (index of k+q on the grid, umklapp G0).

vertex_pao_R(d, A, ikq, kgrid_idx, ng[, long_range])

PAO-gauge vertex in real space g(R_e) for one q (EPW electron transform).

pao_vertex_to_cells(gk_b, kgrid_idx, ng)

Place a PAO-gauge vertex g(k) on the coarse k-grid and transform it to g(R_e).

lambda_q_dense_ws(gR, HRs, q_cryst, ng_coarse, at, ...)

lambda_{q nu} with a Wigner-Seitz (EPW-style) electron interpolation.

precompute_dense_electrons(HRs, at, Nk, sigmas_ry, ...)

Dense-grid electron spectrum + Fermi-surface delta, shared by every q.

bloch_states_at(electrons, k_cryst)

Energies (Ry) and eigenvectors of the cached PAO Hamiltonian at arbitrary k-points.

group_velocities_at(electrons, k_cryst, at, alat[, step])

|v_nk|-ready group velocities (Ry bohr) at arbitrary k by central differences.

vertex_phases_at(electrons, k_cryst)

Vertex Wigner-Seitz phases e^{2 pi i k.n} (nk, nws) at arbitrary k-points.

vertex_phases(electrons, k_indices)

Wigner-Seitz phases of the coupling vertex for a block of dense k-points.

release_dense_electrons(electrons)

Free the MPI shared memory of precompute_dense_electrons() (comm given).

fermi_surface_plasma_frequency(electrons, cell_volume)

Intraband (Drude) plasma-frequency tensor from the dense Fermi surface.

band_velocities(electrons, k_indices[, bands, ...])

Band-basis velocity matrix elements <m k|v_alpha|n k> on the dense grid.

vertex_ws_coefficients(gR, electrons)

Wigner-Seitz weighted vertex cells, flattened for the dense-k matmul.

band_vertex(gn_flat, phkg, Vkq, Vk, zmass[, long_range])

Band- and mode-resolved coupling g_{mn,nu}(k, q) for a block of dense k.

lambda_q_dense_ws_fast(gR, electrons, q_cryst, zmass, ...)

lambda_{q nu} for one q, reusing a precompute_dense_electrons() cache.

Module Contents#

PAOFLOW.elphon.elph_bloch.HARTREE_TO_RY = 2.0[source]#
PAOFLOW.elphon.elph_bloch.RY_TO_THZ = 3289.842[source]#
PAOFLOW.elphon.elph_bloch.VERTEX_WS_SIGN = 1[source]#
PAOFLOW.elphon.elph_bloch.RY_TO_EV = 13.605693122994[source]#
PAOFLOW.elphon.elph_bloch.AMU_RY = 911.4442421[source]#
PAOFLOW.elphon.elph_bloch.read_nscf(save_dir, unfold=False)[source]#

Read k-points, eigenvalues, Fermi level and lattice from data-file-schema.xml.

Parameters:
Returns:

{'kpts_cart', 'kpts_cryst', 'eigs_ry', 'ef_ry', 'nbnd', 'nk', 'bg', 'at', 'alat', 'omega', 'fft'}. kpts_cart in 2*pi/alat, kpts_cryst in reciprocal-lattice fractions, energies in Ry (referred to E_F), bg reciprocal vectors (rows, 2*pi/alat), at real vectors (rows, alat).

Return type:

dict

PAOFLOW.elphon.elph_bloch.pao_orbital_positions(data_controller, at)[source]#

Centre of every PAO orbital in crystal coordinates.

Parameters:
  • data_controller (DataController) – PAOFLOW data after projections (arrays['basis'] holds each orbital’s Cartesian tau in bohr, attributes['alat'] the lattice parameter).

  • at (ndarray, shape (3, 3)) – Direct lattice vectors (rows, alat units), e.g. read_nscf(...)['at'].

Returns:

Orbital centres, input of the orbital-pair Wigner-Seitz interpolation of precompute_dense_electrons().

Return type:

ndarray, shape (nawf, 3)

PAOFLOW.elphon.elph_bloch.atom_masses(species_masses, species, atom_names)[source]#

Expand per-species masses to one mass per atom.

Parameters:
  • species_masses (sequence of float) – Mass of each species (amu), in the order of species (the ATOMIC_SPECIES order, as EPW’s amass(i)).

  • species (sequence of str) – Species names, e.g. list(read_nscf(...)['species']).

  • atom_names (sequence of str) – Species name of every atom in the cell, e.g. read_nscf(...)['atom_names'].

Returns:

Mass of each atom (amu), the masses_amu expected by eliashberg_from_qe_coupling() and eliashberg_dense_q().

Return type:

ndarray, shape (nat,)

Raises:

ValueError – If the number of masses differs from the number of species, or an atom has an unknown species.

PAOFLOW.elphon.elph_bloch.kq_index_map(kpts_cryst, q_cryst, nkgrid, tol=1e-05)[source]#

Map k -> (index of k+q on the grid, umklapp G0).

Parameters:
  • kpts_cryst (ndarray (nk, 3)) – k-points in crystal coordinates.

  • q_cryst (ndarray (3,)) – q-point in crystal coordinates.

  • nkgrid (tuple(int, int, int)) – Monkhorst-Pack grid dimensions (for snapping to integer grid indices).

Returns:

  • ikq (ndarray (nk,) int) – Index of the grid point equal to k + q modulo a reciprocal vector.

  • G0 (ndarray (nk, 3) int) – The umklapp vector G0 = (k + q) - k' in reciprocal-lattice units.

PAOFLOW.elphon.elph_bloch.vertex_pao_R(d, A, ikq, kgrid_idx, ng, long_range=None)[source]#

PAO-gauge vertex in real space g(R_e) for one q (EPW electron transform).

Rotates the band-basis deformation potentials to the PAO gauge, g^{PAO}_{ij,c}(k) = (A_{k+q}^T d_c(k) A_k^*)_{ij}, places them on the coarse k-grid and Fourier-transforms to the electron cells R_e (fftn / N). lambda_q_dense_ws_fast() evaluates it back with exp(+2 pi i k.R), whereas the electron Hamiltonian follows PAOFLOW’s Hks = fftn(HRs) (exp(-2 pi i k.R)), so both are taken at the same physical k.

Parameters:
  • d (ndarray (nk, nbnd, nbnd, ncart)) – Band-basis Cartesian deformation potentials d_{mn,c}(k) = <psi_{m,k+q}|dV/du_c|psi_{n,k}> (QE’s el_ph_mat / ahc_gkk on the coarse k-grid).

  • A (ndarray (nbnd, nawf, nk)) – PAO projections A_{n i}(k) = <phi_i|psi_{nk}> (arry['U'][..., ispin]), the convention of both the internal projector and QE’s projwfc.x.

  • ikq (ndarray (nk,)) – Index of k+q on the coarse grid.

  • kgrid_idx (ndarray (nk, 3) int) – Integer grid labels round(k_cryst * ng) % ng of each k-point.

  • ng (tuple(int, int, int)) – Coarse k-grid dimensions.

  • long_range (ndarray (nawf, nawf, ncart), optional) – Analytic long-range vertex of this q (LongRangeModel), subtracted from the PAO-gauge vertex at every k so that only the short-range part is Fourier-interpolated; the dense drivers add it back (band_vertex()).

Returns:

The PAO-gauge vertex in the electron real-space cells.

Return type:

ndarray (nawf, nawf, ncart, n1, n2, n3) complex

Notes

With A_{ni}(k) = \langle\phi_i|\psi_{nk}\rangle the PAO vertex is the band-projected operator

\[g^{PAO}_{ij,c}(k) = \sum_{mn} \langle\phi_i|\psi_{m,k+q}\rangle\, d_{mn,c}(k)\, \langle\psi_{nk}|\phi_j\rangle = \left(A_{k+q}^{T}\, d_c(k)\, A_k^{*}\right)_{ij},\]

i.e. \(\langle\phi_i|P_{k+q}\, \partial V/\partial u_c\, P_k|\phi_j\rangle\). Each band index enters once as a bra and once as a ket, so the result does not depend on the band phases, provided d and A are built from the same Kohn-Sham states. It is the operator that the band-basis contraction V_{k+q}^\dagger g V_k (PAO eigenvectors of H = A E A^\dagger) maps back to d.

PAOFLOW.elphon.elph_bloch.pao_vertex_to_cells(gk_b, kgrid_idx, ng)[source]#

Place a PAO-gauge vertex g(k) on the coarse k-grid and transform it to g(R_e).

Parameters:
  • gk_b (ndarray (nk, nawf, nawf, ncart)) – g^{PAO}_{ij,c}(k) of every coarse k-point.

  • kgrid_idx (ndarray (nk, 3) int) – Integer grid labels of the k-points (see vertex_pao_R()).

  • ng (tuple(int, int, int)) – Coarse k-grid dimensions.

Returns:

g(R_e) = N^-1 sum_k exp(-2 pi i k.R) g(k) (the tail of vertex_pao_R()).

Return type:

ndarray (nawf, nawf, ncart, n1, n2, n3) complex

PAOFLOW.elphon.elph_bloch.lambda_q_dense_ws(gR, HRs, q_cryst, ng_coarse, at, zmass, freqs_thz, sigmas_ry, Nk, ispin=0, kblock=4096, nelec=None, spin_degeneracy=2.0)[source]#

lambda_{q nu} with a Wigner-Seitz (EPW-style) electron interpolation.

spin_degeneracy (2 for scalar bands, 1 for spinors) sets the Fermi level of nelec electrons.

Same as lambda_q_dense() but the vertex gR and the PAO Hamiltonian HRs are interpolated to the dense grid with explicit Wigner-Seitz real-space sums (proper zone-boundary degeneracy weights) instead of a plain zero-padding Fourier embed, and k+q is evaluated directly at (k+q) (no grid roll).

Parameters:
  • gR (ndarray (nawf, nawf, ncart, n1, n2, n3)) – Vertex real-space cells; its grid may differ from HRs (e.g. a coarse 6^3 coupling combined with a dense 18^3 electron Hamiltonian).

  • HRs (ndarray (nawf, nawf, m1, m2, m3, nspin))

  • q_cryst (ndarray (3,)) – q-point in crystal coordinates (exact, not restricted to the coarse grid).

  • ng_coarse (ignored) – Kept for backward compatibility; the H and vertex grids are read from the array shapes so the two may differ.

  • at (ndarray (3, 3)) – Real-lattice vectors (rows, alat units) for the WS construction.

  • zmass (see lambda_q_dense().)

  • freqs_thz (see lambda_q_dense().)

  • sigmas_ry (see lambda_q_dense().)

  • Nk (see lambda_q_dense().)

Returns:

{'lambda_qnu', 'gamma_ghz', 'dos_ef', 'nk_dense'}.

Return type:

dict

PAOFLOW.elphon.elph_bloch.precompute_dense_electrons(HRs, at, Nk, sigmas_ry, nelec, ng_vertex, ispin=0, kblock=4096, fs_window=8.0, orbital_positions=None, velocities=False, alat=None, diagonal_velocities=False, keep_bands=None, comm=None, spin_degeneracy=2.0, adaptive_smearing=None)[source]#

Dense-grid electron spectrum + Fermi-surface delta, shared by every q.

spin_degeneracy (2 for scalar bands, 1 for spinors with spin-orbit coupling) sets the Fermi level of nelec electrons; it must match the degeneracy the caller uses for the density of states and the plasma frequency.

Diagonalises H(k) once on the regular Nk^3 grid (Wigner-Seitz interpolation of HRs). Because the electronic spectrum is q-independent, E(k+q) / V(k+q) for any commensurate q are index shifts of this array, so lambda_q_dense_ws_fast() needs no per-q re-diagonalisation (the dominant cost of lambda_q_dense_ws() when looping over many q). The Wigner-Seitz phase of the coupling grid ng_vertex is cached too, so the per-q vertex interpolation reduces to a single BLAS matmul.

Parameters:
  • HRs (ndarray (nawf, nawf, m1, m2, m3, nspin)) – PAO Hamiltonian (E_F at 0).

  • at (ndarray (3, 3)) – Real-lattice vectors (rows, alat units) for the Wigner-Seitz sums.

  • Nk (int) – Dense grid size.

  • sigmas_ry (array_like) – Fermi-surface smearing(s) (Ry).

  • nelec (float or None) – Valence electrons for the dense Fermi-level recompute (None -> 0).

  • ng_vertex (tuple(int, int, int)) – Real-space grid of the coupling vertex gR (its shape[3:6]).

  • ispin (int, optional)

  • kblock (int, optional)

  • fs_window (float, optional) – Fermi-surface window in smearings for the shell mask (default 8, exact to exp(-fs_window^2)); lower it to prune wide-band metals more aggressively.

  • orbital_positions (ndarray (nawf, 3), optional) – Orbital centres in crystal coordinates (pao_orbital_positions()). When given, H and the vertex are interpolated with orbital-pair Wigner-Seitz images (_ws_lattice_pairs()), which keeps the dense bands and couplings symmetric in cells with several atoms; None uses the single-site images of _ws_lattice().

  • velocities (bool, optional) – Also cache the real-space terms of the velocity operator so that band_velocities() can evaluate v(k) in the gauge of V (default False; the other keys are unchanged either way).

  • alat (float, optional) – Lattice parameter (bohr); required with velocities=True.

  • diagonal_velocities (bool, optional) – With velocities, also cache the band velocities velocity_diag (nkd, nawf, 3) (Ry bohr, averaged over degenerate subspaces) for the plasma frequency and the transport coupling. These are the group velocities \(\partial_{\mathbf k}\varepsilon\); the non-local pseudopotential correction belongs to interband dipoles only.

  • keep_bands (callable, optional) – E (nkd, nawf) [Ry] -> band indices: store the eigenvectors (and the diagonal velocities) of these bands only, V (nkd, nawf, nband), to save memory on dense grids (energies are kept for all bands; the indices are stored as 'bands'). None keeps all bands.

  • comm (mpi4py communicator, optional) – With a communicator, E and V live in MPI shared memory, one copy per node, and the diagonalisation is split between the ranks of each node (identical results). Release them with release_dense_electrons() once every rank is done. None keeps private arrays (serial use).

  • adaptive_smearing (float, optional) – Adaptive Fermi-surface smearing (Yates et al.; 0.7 is the usual Gaussian prefactor): the delta of every state has the width adaptive_smearing * |v_nk| * dk with dk the spacing of the dense grid (state_widths()), floored at the corresponding entry of sigmas_ry; the Fermi level, dk, dos and the shell follow ('widths' (nsigma, nkd, nawf) is stored). Needs velocities=True, diagonal_velocities=True and all bands kept.

Returns:

Cache consumed by lambda_q_dense_ws_fast() – keys Nk, nawf, E (nkd, nawf) (Ry), V (nkd, nawf, nawf), dk (nsigma, nkd, nawf), dos (nsigma,), plus the vertex Wigner-Seitz images (Nintg, Midxg, Wg, ng_vertex; the phases of a block of k come from vertex_phases()). With velocities=True it also holds 'velocity', the input of band_velocities().

Return type:

dict

PAOFLOW.elphon.elph_bloch.bloch_states_at(electrons, k_cryst)[source]#

Energies (Ry) and eigenvectors of the cached PAO Hamiltonian at arbitrary k-points.

Parameters:
Returns:

  • energies (ndarray (nk, nawf)) – Same scale and convention as electrons['E'].

  • vectors (ndarray (nk, nawf, nawf)) – Columns, in the gauge of electrons['V'] (band_vertex() takes them).

PAOFLOW.elphon.elph_bloch.group_velocities_at(electrons, k_cryst, at, alat, step=0.0001)[source]#

|v_nk|-ready group velocities (Ry bohr) at arbitrary k by central differences.

Parameters:
  • electrons (dict) – Output of precompute_dense_electrons().

  • k_cryst (ndarray (nk, 3))

  • at (ndarray (3, 3)) – Lattice vectors (rows, alat units).

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

  • step (float, optional) – Finite-difference step (2 pi / alat units) along each Cartesian direction.

Returns:

d e_n / d k of the energy-ordered bands (Ry bohr); at band crossings the sorted bands exchange character, which only matters for the ordering, not for the magnitudes used by the adaptive widths.

Return type:

ndarray (nk, nawf, 3)

PAOFLOW.elphon.elph_bloch.vertex_phases_at(electrons, k_cryst)[source]#

Vertex Wigner-Seitz phases e^{2 pi i k.n} (nk, nws) at arbitrary k-points.

PAOFLOW.elphon.elph_bloch.vertex_phases(electrons, k_indices)[source]#

Wigner-Seitz phases of the coupling vertex for a block of dense k-points.

Parameters:
Returns:

\(e^{2\pi i\,\mathbf k\cdot\mathbf n}\) for the vertex cells electrons['Nintg'] (computed per block instead of stored for the whole grid, which would cost 16 nkd nws bytes per rank).

Return type:

ndarray, shape (nb, nws), complex

PAOFLOW.elphon.elph_bloch.release_dense_electrons(electrons)[source]#

Free the MPI shared memory of precompute_dense_electrons() (comm given).

Collective over the communicator passed to precompute_dense_electrons(); the arrays E and V must not be used afterwards.

Parameters:

electrons (dict) – Output of precompute_dense_electrons().

PAOFLOW.elphon.elph_bloch.fermi_surface_plasma_frequency(electrons, cell_volume, isig=0, spin_degeneracy=2.0)[source]#

Intraband (Drude) plasma-frequency tensor from the dense Fermi surface.

Parameters:
  • electrons (dict) – Cache of precompute_dense_electrons() with velocities=True.

  • cell_volume (float) – Unit-cell volume (bohr^3).

  • isig (int, optional) – Smearing index of the Fermi-surface delta electrons['dk'].

  • spin_degeneracy (float, optional) – 2 without spin-orbit coupling, 1 with it.

Returns:

\((\hbar\omega_p)^2_{\alpha\beta}\) in eV^2.

Return type:

ndarray, shape (3, 3)

Notes

\[\omega^2_{p,\alpha\beta} = \frac{4\pi e^2 g_s}{\Omega N_k} \sum_{n\mathbf k} v^\alpha_{n\mathbf k} v^\beta_{n\mathbf k}\, \delta(\varepsilon_{n\mathbf k} - \mu),\]

with \(e^2 = 2\) in Rydberg units; for free electrons it reduces to \(4\pi n e^2/m\).

PAOFLOW.elphon.elph_bloch.band_velocities(electrons, k_indices, bands=slice(None), position_dipoles=None)[source]#

Band-basis velocity matrix elements <m k|v_alpha|n k> on the dense grid.

Evaluates the PAO velocity operator at the dense k-points K[k_indices] and rotates it with the cached eigenvectors V, so the result shares the gauge of the band-basis coupling of band_vertex() (required whenever g and v interfere, as in phonon-assisted absorption).

Parameters:
  • electrons (dict) – Output of precompute_dense_electrons() with velocities=True.

  • k_indices (ndarray, shape (nb,), int) – Flat indices into the dense grid electrons['K'].

  • bands (ndarray of int or slice, optional) – Bands kept in the rotation (default all nawf).

  • position_dipoles (callable, optional) – K_cryst (nb, 3) -> (nb, 3, nawf, nawf): the position dipoles \(\mathbf d(\mathbf k)\) of the PAO basis in bohr (position_dipole_operator()); adds the commutator \(i[H(\mathbf k), \mathbf d(\mathbf k)]\) in the orbital basis before the band rotation (see Notes).

Returns:

v_{mn,alpha}(k) in Ry bohr (Rydberg atomic units, hbar = 1).

Return type:

ndarray, shape (nb, 3, nband, nband), complex

Notes

In the lattice-periodic PAO Bloch basis of H(k) the velocity operator \(i[H, \mathbf{r}]\), with the position operator diagonal on the orbital centres \(\boldsymbol{\tau}_i\), is

\[\mathbf{v}_{ij}(\mathbf{k}) = \partial_{\mathbf{k}} H_{ij}(\mathbf{k}) + i\, H_{ij}(\mathbf{k})\, (\boldsymbol{\tau}_j - \boldsymbol{\tau}_i),\]

the PAO analogue of EPW’s vme = 'wannier' (and minus PAOFLOW’s dHksp of do_gradient()). The band matrix is \(V_k^\dagger \mathbf{v}(\mathbf{k}) V_k\).

With position_dipoles the off-diagonal position matrix of the orbitals is included as well, \(\mathbf{v} \mathrel{+}= i[H, \mathbf d(\mathbf k)]\), whose band-basis form \(i(\varepsilon_n - \varepsilon_m) d_{nm}\) is the analogue of EPW’s Berry-connection term; it vanishes on the diagonal and inside degenerate blocks by construction.

Its diagonal is exactly the group velocity \(\partial_{\mathbf k}\varepsilon_{n\mathbf k}\) (Hellmann-Feynman), with the non-local pseudopotential already inside the PAO Hamiltonian; no separate \([V_{\rm NL}, \mathbf r]\) term is needed (one was carried until October 2026 and double counted it).

PAOFLOW.elphon.elph_bloch.vertex_ws_coefficients(gR, electrons)[source]#

Wigner-Seitz weighted vertex cells, flattened for the dense-k matmul.

Parameters:
  • gR (ndarray, shape (nawf, nawf, ncart, n1, n2, n3), complex) – PAO-gauge vertex real-space cells for one q (grid == ng_vertex).

  • electrons (dict) – Output of precompute_dense_electrons().

Returns:

Coefficients gn with g(k) = vertex_phases(electrons, k) @ gn.

Return type:

ndarray, shape (nws, nawf*nawf*ncart), complex

PAOFLOW.elphon.elph_bloch.band_vertex(gn_flat, phkg, Vkq, Vk, zmass, long_range=None)[source]#

Band- and mode-resolved coupling g_{mn,nu}(k, q) for a block of dense k.

Parameters:
  • gn_flat (ndarray, shape (nws, nawf*nawf*ncart), complex) – Output of vertex_ws_coefficients().

  • phkg (ndarray, shape (nb, nws), complex) – Vertex Wigner-Seitz phases of the block (vertex_phases()).

  • Vkq (ndarray, shape (nb, nawf, nband), complex) – Eigenvectors at k+q (rows m) and k (columns n); a band subset may be passed as column slices.

  • Vk (ndarray, shape (nb, nawf, nband), complex) – Eigenvectors at k+q (rows m) and k (columns n); a band subset may be passed as column slices.

  • zmass (ndarray, shape (nmode, ncart)) – Mass-scaled phonon eigenvectors z / sqrt(M) (Rydberg mass units).

  • long_range (ndarray, shape (nawf, nawf, ncart), optional) – Analytic long-range vertex of this q in the PAO gauge (vertex_pao()), added back to the interpolated short-range part at every k of the block.

Returns:

g_{mn,nu} = <m, k+q| dV_{q nu} |n, k> in Rydberg units, without the zero-point factor \(1/\sqrt{2\omega_{q\nu}}\).

Return type:

ndarray, shape (nb, nmode, nband_kq, nband_k), complex

PAOFLOW.elphon.elph_bloch.lambda_q_dense_ws_fast(gR, electrons, q_cryst, zmass, freqs_thz, kblock=4096, pair_coupling=None, pair_weights=None, pair_q_weight=None, transport=False, long_range=None)[source]#

lambda_{q nu} for one q, reusing a precompute_dense_electrons() cache.

Numerically identical to lambda_q_dense_ws() (deterministic eigh), but the q-independent dense electron spectrum, Fermi level and Fermi-surface delta come from electrons; only the coupling vertex is interpolated per q, and k+q is an index shift (requires Nk commensurate with q).

Parameters:
  • gR (ndarray (nawf, nawf, ncart, n1, n2, n3)) – PAO-gauge vertex real-space cells for this q (grid == ng_vertex).

  • electrons (dict) – Output of precompute_dense_electrons().

  • q_cryst (ndarray (3,)) – q-point (crystal coordinates); q * Nk must be integer.

  • zmass (ndarray (nmode, ncart))

  • freqs_thz (ndarray (nmode,))

  • kblock (int, optional)

  • pair_coupling (FermiSurfacePairCoupling, optional) – Also accumulate the state-resolved Fermi-surface coupling of the anisotropic Migdal-Eliashberg equations (FermiSurfacePairCoupling). Its window is added to the Fermi-surface shell.

  • pair_weights (ndarray (nmode,), optional) – Mode weights passed to pair_coupling (q-star multiplicity over the number of q, 0 for excluded modes); required with pair_coupling.

  • pair_q_weight (float, optional) – q-star multiplicity over the number of q (Coulomb pairs); required with pair_coupling.

  • long_range (ndarray (nawf, nawf, ncart), optional) – Long-range vertex of this q added at every k (band_vertex()).

  • transport (bool, optional) – Also return the transport coupling lambda_tr_qnu (needs precompute_dense_electrons(..., velocities=True)): the same double delta weighted by \(\mathbf v_{n\mathbf k}\cdot(\mathbf v_{n\mathbf k} - \mathbf v_{m\mathbf k+\mathbf q})/\langle v^2\rangle_{FS}\) (Allen’s transport Eliashberg function, trace form).

Returns:

{'lambda_qnu', 'gamma_ghz', 'dos_ef', 'nk_dense'}, plus 'lambda_tr_qnu' with transport.

Return type:

dict