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 QEdata-file-schema.xml;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 gaugeA_{k+q}^dagger d A_kand Fourier-transform it to the electron real-space cellsg(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 k-points, eigenvalues, Fermi level and lattice from |
|
Map |
|
PAO-gauge vertex in real space |
|
|
|
Dense-grid electron spectrum + Fermi-surface delta, shared by every q. |
|
|
Module Contents#
- PAOFLOW.elphon.elph_bloch.read_nscf(save_dir)[source]#
Read k-points, eigenvalues, Fermi level and lattice from
data-file-schema.xml.- Returns:
{'kpts_cart', 'kpts_cryst', 'eigs_ry', 'ef_ry', 'nbnd', 'nk', 'bg', 'at', 'alat', 'omega', 'fft'}.kpts_cartin 2*pi/alat,kpts_crystin reciprocal-lattice fractions, energies in Ry (referred to E_F),bgreciprocal vectors (rows, 2*pi/alat),atreal vectors (rows, alat).- Return type:
- 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:
- Returns:
ikq (ndarray
(nk,)int) – Index of the grid point equal tok + qmodulo a reciprocal vector.G0 (ndarray
(nk, 3)int) – The umklapp vectorG0 = (k + q) - k'in reciprocal-lattice units.
- PAOFLOW.elphon.elph_bloch.vertex_pao_R(d, A, ikq, kgrid_idx, ng)[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}^\dagger d_c(k) A_k)_{ij}, places them on the coarse k-grid and Fourier-transforms to the electron cellsR_e. The transform matches PAOFLOW’sHRsconvention so the result can be interpolated withPAOFLOW.elphon.eph_kq.estates_on_grid().- Parameters:
d (ndarray
(nk, nbnd, nbnd, ncart)) – Band-basis Cartesian deformation potentialsd_{mn,c}(k)(QE’sel_ph_mat/ahc_gkkon the coarse k-grid).A (ndarray
(nbnd, nawf, nk)) – PAO projectionsA_{n i}(k) = <psi_{nk}|phi_i>(arry['U'][..., ispin]).ikq (ndarray
(nk,)) – Index ofk+qon the coarse grid.kgrid_idx (ndarray
(nk, 3)int) – Integer grid labelsround(k_cryst * ng) % ngof each k-point.
- Returns:
The PAO-gauge vertex in the electron real-space cells.
- 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)[source]#
lambda_{q nu}with a Wigner-Seitz (EPW-style) electron interpolation.Same as
lambda_q_dense()but the vertexgRand the PAO HamiltonianHRsare 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, andk+qis 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 fromHRs(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:
- PAOFLOW.elphon.elph_bloch.precompute_dense_electrons(HRs, at, Nk, sigmas_ry, nelec, ng_vertex, ispin=0, kblock=4096, fs_window=8.0)[source]#
Dense-grid electron spectrum + Fermi-surface delta, shared by every q.
Diagonalises
H(k)once on the regularNk^3grid (Wigner-Seitz interpolation ofHRs). Because the electronic spectrum is q-independent,E(k+q)/V(k+q)for any commensurate q are index shifts of this array, solambda_q_dense_ws_fast()needs no per-q re-diagonalisation (the dominant cost oflambda_q_dense_ws()when looping over many q). The Wigner-Seitz phase of the coupling gridng_vertexis 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_Fat 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(itsshape[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.
- Returns:
Cache consumed by
lambda_q_dense_ws_fast()– keysNk,nawf,E(nkd, nawf)(Ry),V(nkd, nawf, nawf),dk(nsigma, nkd, nawf),dos(nsigma,), plus the cached vertex Wigner-Seitz phase (phkg,Midxg,Wg,ng_vertex).- Return type:
- PAOFLOW.elphon.elph_bloch.lambda_q_dense_ws_fast(gR, electrons, q_cryst, zmass, freqs_thz, kblock=4096)[source]#
lambda_{q nu}for one q, reusing aprecompute_dense_electrons()cache.Numerically identical to
lambda_q_dense_ws()(deterministiceigh), but the q-independent dense electron spectrum, Fermi level and Fermi-surface delta come fromelectrons; only the coupling vertex is interpolated per q, andk+qis an index shift (requiresNkcommensurate withq).- 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 * Nkmust be integer.zmass (ndarray
(nmode, ncart))freqs_thz (ndarray
(nmode,))kblock (int, optional)
- Returns:
{'lambda_qnu', 'gamma_ghz', 'dos_ef', 'nk_dense'}.- Return type: