PAOFLOW.elphon.pao_electrons#
The electronic side of the dense electron-phonon pipeline: PAO Hamiltonians from a QE save.
The dense-q properties (phonon_assisted_absorption_dense_q(),
carrier_scattering_dense_q()) take the
electron-phonon vertex from the EPW save (projections A and .epb files)
and the electronic Hamiltonian HRs as separate inputs. HRs may therefore
come from another save of the same crystal in the same PAO basis, e.g. an
eACBN0 (DFT+U+V, ortho-atomic) nscf whose PAO Hamiltonian already has the
right band gap: the band energies and eigenvectors are then those of that
Hamiltonian, while the coupling in the orbital basis stays that of the DFPT/EPW
run. This module builds such Hamiltonians, checks that two saves share the PAO
basis, and records the Hubbard provenance of a save.
Functions#
- pao_hamiltonian_from_save
Projections, PAO Hamiltonian, orbital centres and lattice data of a save.
- check_same_pao_basis
Raise unless two PAOFLOW runs span the same orbital basis on the same structure.
- check_orbital_dimensions
Shape guard between the coupling projections and the Hamiltonian.
- hubbard_info_from_save, format_hubbard_info
The Hubbard (DFT+U, DFT+U+V) parameters recorded in
data-file-schema.xml.
Classes#
PAO electronic structure of one QE save. |
Functions#
|
Build the PAO projections and Hamiltonian of a QE save. |
|
Check that two PAOFLOW runs span the same PAO basis on the same crystal. |
|
Shape guard between the coupling projections and the electronic Hamiltonian. |
|
Hubbard parameters recorded in |
|
One-line description of |
Module Contents#
- class PAOFLOW.elphon.pao_electrons.PAOElectrons[source]#
PAO electronic structure of one QE save.
- Variables:
savedir (str) – The QE save directory.
projections (ndarray or None) –
A_{ni}(k) = <phi_i|psi_nk>, shape(nbnd, nawf, nk)(Nonewhen not kept).HRs (ndarray) – PAO Hamiltonian (eV), shape
(nawf, nawf, n1, n2, n3, nspin).nscf (dict) –
read_nscf()of the save, plus'orbital_positions'(crystal coordinates of the orbital centres).data_controller (DataController) – The PAOFLOW data controller of the run (non-local velocity, basis checks).
expand_wedge (bool) – The symmetry expansion used by
pao_hamiltonian.hubbard (dict or None) –
hubbard_info_from_save()of the save (Nonefor a plain DFT run).
- PAOFLOW.elphon.pao_electrons.pao_hamiltonian_from_save(savedir, basispath=None, configuration='standard', pthr=0.95, *, expand_wedge=None, projector='internal', keep_projections=True, workpath=None, outputdir='output', save_overlaps=False, verbose=False, unfold_kpoints=False)[source]#
Build the PAO projections and Hamiltonian of a QE save.
- Parameters:
savedir (str) – QE save directory (
data-file-schema.xml, wavefunctions, UPF files).basispath (str, optional) – Directory of the radial basis tables (
paoflow-genbasis-ps); only forprojector='internal'.configuration (str or mapping, optional) – PAO basis preset (
'minimal','standard','extended') or a per-element shell dictionary (PAOFLOW.projections).pthr (float, optional) – Projectability threshold.
expand_wedge (bool, optional) – Symmetry expansion of
pao_hamiltonian:Falsefor an explicit full k list (the EPW nscf),Truefor an irreducible Monkhorst-Pack set.None(default) infers it: the k-points are expanded unless they already fill thenk1 x nk2 x nk3grid.projector ({'internal', 'projwfc'}, optional) – Internal atomic projections (
PAOFLOW.projections) or theprojwfc.xones of the save (read_atomic_proj_QE).keep_projections (bool, optional) – Keep a copy of the full projection matrix (needed only for the save that provides the coupling).
workpath (optional) – Passed to
PAOFLOW.PAOFLOW.outputdir (optional) – Passed to
PAOFLOW.PAOFLOW.save_overlaps (optional) – Passed to
PAOFLOW.PAOFLOW.verbose (optional) – Passed to
PAOFLOW.PAOFLOW.unfold_kpoints (bool, optional) – The save holds the irreducible wedge of a Gamma-centred
K_POINTS automaticnscf: unfold k-points, eigenvalues and wavefunctions to the full grid by symmetry (PAOFLOW.PAOFLOWunfold_kpoints), so that the projections cover every k and the Hamiltonian is built withexpand_wedge=False. Required for the save that provides the coupling (source='dfpt') when its nscf was not run on the full grid.
- Returns:
Projections,
HRs, lattice data with orbital centres, the data controller and the Hubbard provenance.- Return type:
- Raises:
ValueError – For an unknown
projector.
Notes
The call sequence is the one of the generated electron-phonon drivers (
projections->projectability->full_projections->pao_hamiltonian->read_nscf->pao_orbital_positions), so a driver that switches to this function reproduces its previous numbers.HRsis on the energy scale of this save (its Fermi level or highest occupied level at zero).savediris resolved against the current directory (notworkpath).
- PAOFLOW.elphon.pao_electrons.check_same_pao_basis(reference, other, *, names=('coupling save', 'electrons save'), tau_tol_bohr=1e-05)[source]#
Check that two PAOFLOW runs span the same PAO basis on the same crystal.
- Parameters:
reference (DataController or (arrays, attributes)) – The two runs after
projections/projectability(and optionallypao_hamiltonian).other (DataController or (arrays, attributes)) – The two runs after
projections/projectability(and optionallypao_hamiltonian).names (tuple of str, optional) – How the two runs are called in the error message.
tau_tol_bohr (float, optional) – Tolerance on the atomic and orbital positions (bohr).
- Returns:
Per-run summary of the quantities that may legitimately differ:
nbnds,nkpnts,kgrid,bnd(bands with good projectability),shift,Efermiandpthr(each a pair).- Return type:
- Raises:
ValueError – Listing every mismatch of the orbital count, spin, species and pseudopotentials, atoms, positions, lattice vectors, orbital identities and basis configuration.
Notes
The Hamiltonian of
otheris used with the coupling ofreferenceonly if both are expressed in the same orthonormal orbital basis: the same pseudopotentials, radial tables and shells, on the same atoms in the same order. The projectability outcome (bnd,shift) depends on the Kohn-Sham states and differs between functionals; it is reported, not enforced.
- PAOFLOW.elphon.pao_electrons.check_orbital_dimensions(A, HRs, orbital_positions=None)[source]#
Shape guard between the coupling projections and the electronic Hamiltonian.
- Parameters:
A (ndarray, shape
(nbnd, nawf, nk)) – PAO projections of the coupling save.HRs (ndarray, shape
(nawf, nawf, n1, n2, n3, nspin)) – PAO Hamiltonian (possibly of another save).orbital_positions (ndarray, shape
(nawf, 3), optional) – Orbital centres.
- Raises:
ValueError – If the orbital counts disagree.
- PAOFLOW.elphon.pao_electrons.hubbard_info_from_save(savedir)[source]#
Hubbard parameters recorded in
data-file-schema.xmlof a QE save.- Parameters:
savedir (str) – QE save directory.
- Returns:
Nonefor a plain DFT run. Otherwisekind('DFT+U','DFT+U+J','DFT+U+V'fromlda_plus_u_kind),projectors(U_projection_typeorHubbard_projectors), andterms: a list of(tag, attributes, value_eV)for every scalarHubbard_*child (Hubbard_U,Hubbard_V,Hubbard_J0, …), in file order. Occupation matrices are skipped.- Return type:
dict or None
Notes
The element layout of
<dftU>changed across QE versions; every scalar child whose tag starts withHubbard_is kept with its attributes (specie,label,spec1,index…) so that nothing is lost. Values are in Hartree in the XML and converted to eV.
- PAOFLOW.elphon.pao_electrons.format_hubbard_info(info, threshold_ev=1e-06)[source]#
One-line description of
hubbard_info_from_save()('PBE'forNone).- Parameters:
info (dict or None) – Output of
hubbard_info_from_save().threshold_ev (float, optional) – Terms below this magnitude are omitted.
- Returns:
E.g.
'DFT+U+V (ortho-atomic): Hubbard_U Si 3p 3.00 eV; Hubbard_V ... 1.66 eV'.- Return type: