PAOFLOW.elphon.dfpt_vertex#
Coarse electron-phonon vertex from ph.x DFPT outputs (the native replacement of EPW’s epbwrite).
For every q of the coarse grid the Cartesian matrix elements
are assembled from the induced potential of ph.x (dvscf: Hartree and
exchange-correlation response), the bare local pseudopotential derivative and the
Kleinman-Bylander derivative terms, with the nscf wavefunctions of the same save directory
that provides the PAO projections. The irreducible q of ph.x are unfolded to the full
grid by rotating the induced potential on the FFT grid (QE dfile_star) and using the
true wavefunctions at k and k + Sq; time-reversal partners use the conjugate
potential. The result reproduces EPW’s epmatq (Ry/bohr, no 1/sqrt(2 M omega)) and
feeds PAOFLOW.elphon.elph_bloch.vertex_pao_R() unchanged, or is built directly in
the projected PAO basis phi_j,k = sum_n A*_nj(k) psi_nk (identical by linearity, never
forming the band-basis array).
Classes#
One q of the full coarse grid and how it derives from an irreducible q. |
|
Everything that does not depend on q: wavefunction geometry, tables, symmetries. |
Functions#
|
Cartesian matrix of a crystal rotation |
|
|
|
Unfold the irreducible q-points to the full coarse grid. |
|
|
|
Induced potential of every Cartesian displacement at a star member (QE |
|
|
|
Orbital rotation matrices of every space-group operation ( |
|
|
|
Generate |
Module Contents#
- class PAOFLOW.elphon.dfpt_vertex.StarMember[source]#
One q of the full coarse grid and how it derives from an irreducible q.
- Variables:
- umklapp: numpy.typing.NDArray[numpy.int_][source]#
- PAOFLOW.elphon.dfpt_vertex.cartesian_rotation(rotation, at)[source]#
Cartesian matrix of a crystal rotation
x -> R x(positions in crystal coordinates).- Parameters:
rotation (ndarray
(3, 3)) – Acts on crystal coordinates of positions.at (ndarray
(3, 3)) – Lattice vectors as rows.
- PAOFLOW.elphon.dfpt_vertex.rotate_q(rotation, q_cryst, at, bg)[source]#
S qin crystal (reciprocal) coordinates for a crystal rotation of positions.
- PAOFLOW.elphon.dfpt_vertex.star_members(q_irr_cryst, group, qgrid, at, bg, time_reversal=True)[source]#
Unfold the irreducible q-points to the full coarse grid.
- Parameters:
q_irr_cryst (ndarray
(nq_irr, 3))group (SpaceGroup)
qgrid (sequence of int) – Coarse q-grid
(nq1, nq2, nq3).at (ndarray
(3, 3)) – Lattice and reciprocal vectors (rows).bg (ndarray
(3, 3)) – Lattice and reciprocal vectors (rows).time_reversal (bool, optional) – Also use
q -> -q(non-magnetic systems).
- Returns:
One entry per grid point, ordered by irreducible q then by discovery.
- Return type:
list of StarMember
- Raises:
ValueError – If the stars do not tile the grid exactly once (symmetry mismatch between
ph.xand the nscf run, or a wrong q-grid).
- PAOFLOW.elphon.dfpt_vertex.rotate_periodic_field(field, rotation, translation)[source]#
f'(x) = f(g^-1 x)on the FFT grid for the space-group operationg: x -> R x - t.- Parameters:
field (ndarray
(..., nr1, nr2, nr3))rotation (ndarray
(3, 3)int)translation (ndarray
(3,)) – Crystal coordinates; must be commensurate with the grid.
- Raises:
ValueError – If the operation does not map the grid onto itself.
- PAOFLOW.elphon.dfpt_vertex.cartesian_perturbation_potentials(dvscf_patterns, u, q_irr_cryst, member, group, tau_cryst, at, bg)[source]#
Induced potential of every Cartesian displacement at a star member (QE
dfile_star).- Parameters:
dvscf_patterns (ndarray
(3 nat, nr1, nr2, nr3)) –dvscfrecords at the irreducible q (pattern basis, one spin component).u (ndarray
(3 nat, 3 nat)) – Displacement patterns (columns).q_irr_cryst (ndarray
(3,)) – The irreducible q.member (StarMember)
group (SpaceGroup)
tau_cryst (ndarray
(nat, 3)) – Atomic positions (crystal coordinates).at (ndarray
(3, 3))bg (ndarray
(3, 3))
- Returns:
Lattice-periodic part of
dV^Hxc / du_{kappa alpha}atmember.q_cryst.- Return type:
ndarray
(3 nat, nr1, nr2, nr3), complex
- class PAOFLOW.elphon.dfpt_vertex.CoarseVertexSetup(save_dir, dfpt_dir, qgrid, prefix=None, pseudo_dir=None, cache_bytes=256 * 1024**2, unfold_kpoints=None)[source]#
Everything that does not depend on q: wavefunction geometry, tables, symmetries.
- Parameters:
save_dir (str) – nscf save directory (Gamma-centred k-grid, the one used for the projections): either the full grid or, with
K_POINTS automatic, its irreducible wedge.dfpt_dir (str) –
ph.xoutputs (seePAOFLOW.elphon.dfpt_io.locate_dfpt_files()).qgrid (sequence of int) – Coarse q-grid of the DFPT run.
prefix (str, optional) – QE prefix (inferred when omitted).
pseudo_dir (str, optional) – Directory of the UPF files (default: the save directory, where QE copies them).
cache_bytes (int, optional) – Memory budget of the per-rank cache of plane-wave blocks and projectors.
unfold_kpoints (bool, optional) – The save holds the irreducible wedge: rotate the stored Bloch functions to every point of the full grid (
WavefunctionProvider).None(default) detects it fromdata-file-schema.xml(a Gamma-centredmonkhorst_packelement with fewer stored k-points than the grid);Falseraises for such a save. The projectionsAmust then come frompao_hamiltonian_from_save(..., unfold_kpoints=True).
- Variables:
provider (WavefunctionProvider or None) – Set when the k-points are unfolded.
- block(ik)[source]#
Plane-wave block of k-point
ik(cached withincache_bytes).With unfolded k-points the block is rotated from its irreducible representative.
- long_range_tensors()[source]#
(epsilon (3, 3), born_charges (nat, 3, 3)), zeros whenph.xhad noepsil.
- pao_vertex_at_q(member, A, kgrid_idx, ng, basis='auto', bands=None)[source]#
PAO-gauge vertex
g_q(R_e)of one coarse q, the output ofvertex_pao_R().- Parameters:
member (StarMember)
A (ndarray
(nbnd, nawf, nk)) – PAO projectionsA_ni(k) = <phi_i|psi_nk>of the same nscf save.kgrid_idx (ndarray
(nk, 3)int) – Integer grid labels of the k-points.basis ({'auto', 'pao', 'band'}, optional) –
'pao'applies the perturbation to the projected PAO Bloch functionsphi_j,k = sum_n A*_nj(k) psi_nk(nawffunctions per k);'band'to thenbndbands and rotates afterwards;'auto'takes the cheaper one. The two agree to rounding.bands (sequence of int, optional) – Band subset of the projector (see
pao_vertex_k()).
- Return type:
ndarray
(nawf, nawf, 3 nat, n1, n2, n3), complex
- pao_vertex_k(member, A, ng, basis='auto', bands=None)[source]#
PAO-gauge vertex
g_q(k)_{ij,c}of one coarse q on the k-grid (before theR_etransform).- Parameters:
member – As
pao_vertex_at_q().A – As
pao_vertex_at_q().ng – As
pao_vertex_at_q().basis – As
pao_vertex_at_q().bands (sequence of int, optional) – Restrict the band projector to these nscf bands (EPW’s
exclude_bandsbookkeeping, for comparisons); default: all bands of the projections.
- Returns:
In the k order of the nscf run.
- Return type:
ndarray
(nk, nawf, nawf, 3 nat), complex
- potential_at(member)[source]#
Total perturbing potential (induced + bare local) of every Cartesian mode at
member.- Return type:
ndarray
(3 nat, nr1, nr2, nr3)on the smooth grid, Ry/bohr.
- matrix_elements(member, potential, ik, ikq, umklapp, left=None, right=None)[source]#
<chi_{m,k+q}| dV/du_c |chi_{n,k}>for one k (bands, or projected functions).- Parameters:
member (StarMember)
potential (ndarray
(3 nat, nr1, nr2, nr3)) – Frompotential_at().ik (int) – Indices of
kand of the grid pointk' = k + q - G0.ikq (int) – Indices of
kand of the grid pointk' = k + q - G0.umklapp (ndarray
(3,)int) –G0.left (ndarray
(nbnd, n), optional) – Coefficient matricesBsuch that the functions arechi_j = sum_n B*_nj psi_natk + q(left) andk(right);Noneuses the bands themselves.right (ndarray
(nbnd, n), optional) – Coefficient matricesBsuch that the functions arechi_j = sum_n B*_nj psi_natk + q(left) andk(right);Noneuses the bands themselves.
- Return type:
ndarray
(3 nat, n_left, n_right), complex, Ry/bohr
- band_vertex_at_q(member, bands=None)[source]#
Band-basis Cartesian vertex
d[k, m, n, c]of one q (all k of the coarse grid).- Parameters:
member (StarMember)
bands (sequence of int, optional) – Band subset (default: all nscf bands).
- Returns:
The layout of
PAOFLOW.elphon.elph_bloch.vertex_pao_R()(matk+q).- Return type:
ndarray
(nk, nb, nb, 3 nat), complex
- PAOFLOW.elphon.dfpt_vertex.orbital_shells(data_controller)[source]#
(shells_per_atom, atom_labels)of a PAOFLOW basis, the inputs of the orbital rotation.- Parameters:
data_controller (DataController) – After
projections.- Returns:
shells_per_atom (dict) – Species label -> list of
lof its shells (arrays['shells']).atom_labels (list of str) – Species label of every atom (
arrays['atoms']).
- PAOFLOW.elphon.dfpt_vertex.pao_vertex_rotation_operators(setup, shells_per_atom, atom_labels, ng)[source]#
Orbital rotation matrices of every space-group operation (
pao_symWigner-D).- Parameters:
setup (CoarseVertexSetup)
shells_per_atom – See
orbital_shells().atom_labels – See
orbital_shells().ng (sequence of int) – Coarse k-grid.
- Returns:
The operator set of
PAOFLOW.elphon.symmetry.build_dv_symmetry_operators()plus'rotations'(crystal, acting on positions),'translations'and'equivalent_atoms'of the group.- Return type:
- PAOFLOW.elphon.dfpt_vertex.rotate_pao_vertex(gk, kpts_cryst, q0_cryst, member, setup, ops, ng, conjugate_u=False)[source]#
g_{S q0}(S k)for every k of the grid fromg_{q0}(k)(PAO basis).- Parameters:
gk (ndarray
(nk, nawf, nawf, 3 nat)) –g_{q0}(k)_{ij,c}in the k order ofkpts_cryst(the output layout ofCoarseVertexSetup.pao_vertex_at_q()before the transform toR_e).kpts_cryst (ndarray
(nk, 3))q0_cryst (ndarray
(3,)) – The irreducible q ofgk.member (StarMember) – Target star member (
S q0or-S q0, plus its umklapp vector).setup (CoarseVertexSetup)
ops (dict) – From
pao_vertex_rotation_operators().conjugate_u (bool, optional) – Use
U^daggerinstead ofU(convention switch of the Wigner-D matrices).
- Returns:
g_{q}(k)atq = member.q_cryst, in the k order ofkpts_cryst.- Return type:
ndarray
(nk, nawf, nawf, 3 nat)
Notes
The PAO Bloch sums carry the cell phase,
phi_{j,k} = sum_R exp(i k.R) w_j(r - R - tau_j)(structure factorexp(-i (k+G).tau)), so underg: r -> R r + fwithR tau_a + f = tau_a' + L_athey transform asO_g phi_{j,k} = exp(-i Sk.L_j) sum_j' D_j'j phi_{j',Sk}and the displacement operators asO_g dV_{q,kappa alpha} O_g^-1 = exp(-i Sq.L_kappa) sum_beta M_beta alpha dV_{Sq,kappa' beta}; hence\[g_{Sq}(Sk)_{i'j',\kappa'\beta} = \sum_{ij\alpha} D_{i'i}\, e^{-i(Sk+Sq)\cdot L_i}\, g_q(k)_{ij,\kappa\alpha}\, e^{+i Sk\cdot L_j}\, D^*_{j'j}\, M_{\beta\alpha}\, e^{+i Sq\cdot L_\kappa}.\]Both
g_q(k)and the stored vertex are periodic in k and q in this convention, so grid representatives need no extra phases; time-reversal partners are the complex conjugate (real orbitals, no spin-orbit coupling). The identity holds when the band projector of the projections commutes with the operation (complete multiplets innbnd), whichunfolded_pao_vertices()checks on one member.
- PAOFLOW.elphon.dfpt_vertex.unfolded_pao_vertices(setup, A, kpts_cryst, ng, ops, irreducible, basis='auto', check_member=True, tol=1e-06, conjugate_u=True)[source]#
Generate
(member, g_q(k))for every star member of the given irreducible q.The vertex is computed once per irreducible q and rotated to its star (
rotate_pao_vertex()); for the first star with more than one member one rotated member is also computed directly and compared.- Parameters:
setup (CoarseVertexSetup)
A (ndarray
(nbnd, nawf, nk))kpts_cryst (ndarray
(nk, 3))ng (sequence of int)
ops (dict) – From
pao_vertex_rotation_operators().irreducible (sequence of int) – Indices of the irreducible q to process.
basis (str, optional)
check_member (bool, optional) – Perform the self-check (one direct computation).
tol (float, optional) – Largest tolerated relative deviation of the self-check.
conjugate_u (bool, optional) – Wigner-D convention (
Truereproduces the direct vertices).
- Yields:
tuple –
(member, gk)withgk(nk, nawf, nawf, 3 nat).- Raises:
ValueError – If the self-check deviates by more than
tol: the nscf band set cuts a degenerate multiplet at some k-point (the projected PAO functions are then not symmetric); changenbndso that the highest band is isolated everywhere, or useunfold='full'.