PAOFLOW.hamiltonian.nonlocal_velocity#
PAO orbital catalog and basis-convention helpers of the velocity operator.
Historically this module held the non-local pseudopotential velocity correction
\(\Delta p = m/(i\hbar)[V_{\rm NL}, \mathbf r]\), removed in October 2026: PAOFLOW’s
velocity is the commutator \(i[H, \mathbf r]\) of a Hamiltonian that already contains
\(V_{\rm NL}\), so the term double counted it (Si: 0.87 of the exact plane-wave
\(\varepsilon_2\) with the position dipoles, Fe anomalous Hall peak \(\times1.7\)); the
missing part of the orbital-centre velocity is the position-dipole term of
PAOFLOW.hamiltonian.position_dipoles. The file keeps its name and the pieces that the
dipoles use: the PAO radial channels and per-site orbital mapping (PAOCatalog,
load_pao_orbitals()), the orbital cutoffs and lattice search, PAOFLOW’s orbital signs
(pao_orbital_signs()), the Löwdin transformation (lowdin_transform()) and the
scalar-to-(j, m_j) rotation (scalar_to_jm_matrix()). The catalog needs only the
atomic orbitals (the basis tables of the projection, or the UPF PP_PSWFC block), so any
pseudopotential type is accepted: the norm-conserving restriction of the removed term (its
Kleinman-Bylander projectors) went with it.
Classes#
One radial PAO channel from a UPF (per species, per shell). |
|
Per-species PAO radial channels. |
|
One real-spherical-harmonic PAO basis function on a given site. |
|
Per-atom mapping into the PAO basis. |
|
Top-level container for the loaded PAO atomic-orbital data. |
Functions#
|
Convert Quantum-ESPRESSO 1-indexed real-Y_lm |
|
Load PAO atomic radial functions and the per-site basis mapping. |
|
Return the numerical real-space cutoff of a PAO channel. |
|
Largest PAO radial cutoff on a given site (via |
|
Sign of every PAOFLOW orbital with respect to the real-space orbitals of the tables. |
|
Transform an operator matrix from the atomic to the Löwdin-orthonormal PAO basis. |
|
Spin-double a scalar PAO matrix and rotate it to the relativistic |
Module Contents#
- PAOFLOW.hamiltonian.nonlocal_velocity.qe_m_index_to_std(qe_m, l)[source]#
Convert Quantum-ESPRESSO 1-indexed real-Y_lm
mto the standard \(m \in \{-l, \dots, +l\}\) convention used byPAOFLOW.hamiltonian._two_center.QE orders the \(2l+1\) real spherical harmonics as
(Y_{l,0}, Y_{l,+1}, Y_{l,-1}, Y_{l,+2}, Y_{l,-2}, \\dots)indexed byqe_m = 1, 2, 3, .... The mapping is:qe_m = 1\(\\to\)m = 0qe_m = 2k\(\\to\)m = +k(k = 1, \\dots, l)qe_m = 2k+1\(\\to\)m = -k(k = 1, \\dots, l)
- class PAOFLOW.hamiltonian.nonlocal_velocity.PAOChannelData[source]#
One radial PAO channel from a UPF (per species, per shell).
- Variables:
label (str) – UPF shell label (e.g.
'2S','3P','3D').l (int) – Angular momentum.
R_radial (np.ndarray, shape
(npoints,)) – Pseudo-wavefunction radial part \(R(r) = (r\,R(r))/r\) (UPF’sr\,Rdivided byrwith ther=0end-point extrapolated forl=0– see_upf_wfc_to_radial()).wfc (np.ndarray, shape
(npoints,)) – Original UPF array \(r\,R(r)\) (kept verbatim for callers that prefer the UPF convention, e.g. matchingPAOFLOW.projection.do_atwfc_proj.radialfft_simpson()).occupation (float) – UPF
occupationattribute (non-negative; zero for unoccupied but available shells).
- R_radial: numpy.ndarray[source]#
- class PAOFLOW.hamiltonian.nonlocal_velocity.PAOSpeciesData[source]#
Per-species PAO radial channels.
- Variables:
label (str) – Species label as it appears in
data_arrays['species'].pseudo_file (str) – UPF filename.
upf (UPF) – Parsed UPF object (shared with
BetaSpeciesDatawhen both catalogs are loaded for the same species).r (np.ndarray, shape
(npoints,)) – Radial mesh (Bohr).rab (np.ndarray, shape
(npoints,)) – Radial integration weights.channels (list[PAOChannelData]) – Radial channels in UPF order (one per occupied PSWFC shell).
- channels: list[PAOChannelData][source]#
- class PAOFLOW.hamiltonian.nonlocal_velocity.PAOOrbitalEntry[source]#
One real-spherical-harmonic PAO basis function on a given site.
- Variables:
basis_index (int) – Position in the global
PAOCatalog.basislist – matches the PAOFLOW orbital index0..nawf-1produced byPAOFLOW.projection.do_atwfc_proj.build_pswfc_basis_all().site_index (int) – Site index
J(matchesdata_arrays['tau']).channel_index (int) – Index into
PAOSpeciesData.channels.l (int) – Angular momentum.
m (int) – Standard real-Y_lm magnetic quantum number \(m \in [-l, +l]\) (converted from QE’s 1-indexed
qe_mviaqe_m_index_to_std()).qe_m (int) – Original QE 1-indexed magnetic index (preserved for cross-checks against
build_pswfc_basis_alland the QE projection matrices).label (str) – UPF shell label.
- class PAOFLOW.hamiltonian.nonlocal_velocity.PAOSiteData[source]#
Per-atom mapping into the PAO basis.
- Variables:
index (int) – Site index
J.label (str) – Species label.
tau (np.ndarray, shape
(3,)) – Cartesian position \(\boldsymbol{\tau}_J\) (Bohr).species (PAOSpeciesData) – Reference to the per-species PAO data.
orbitals (list[PAOOrbitalEntry]) – Real-Y_lm basis functions belonging to this site, in PAOFLOW basis order (channel-major, m sweeps inside each channel).
basis_offset (int) – Index in the global PAO basis where this site’s block starts.
- species: PAOSpeciesData[source]#
- orbitals: list[PAOOrbitalEntry][source]#
- class PAOFLOW.hamiltonian.nonlocal_velocity.PAOCatalog[source]#
Top-level container for the loaded PAO atomic-orbital data.
- Variables:
species (dict[str, PAOSpeciesData]) – Per-species data, keyed by species label.
sites (list[PAOSiteData]) – Per-atom entries (length
natoms).basis (list[PAOOrbitalEntry]) – Flat PAO basis in PAOFLOW order;
len(basis) == nawf.total_nlm (int) – \(\sum_J \sum_\text{channels} (2l+1)\) – the dimension of the PAO basis.
- species: dict[str, PAOSpeciesData][source]#
- sites: list[PAOSiteData] = [][source]#
- basis: list[PAOOrbitalEntry] = [][source]#
- PAOFLOW.hamiltonian.nonlocal_velocity.load_pao_orbitals(data_controller)[source]#
Load PAO atomic radial functions and the per-site basis mapping.
The orbital catalog of the position dipoles (
PAOFLOW.hamiltonian.position_dipoles); any pseudopotential type (norm-conserving, ultrasoft, PAW), since only the atomic orbitals are read.When
data_arrays['atomic_basis']is present (PAOFLOW stashes it insidePAOFLOW.projections()after the projector basis has been built), the catalog is reconstructed from those records so that the dipoles are those of exactly the orbitals that produceddHksp. This is required when the production run uses an AE / extended basis (BASIS/<elem>/*.dat) whose orbital count and radial mesh do not match the UPF pswfc set.Falls back to parsing
upf.pswfcdirectly whenatomic_basisis not present (legacy / unit-test path).- Parameters:
data_controller (DataController) –
Required:
arrays['species']: list of(label, pseudo_file)((label, title)for VASP).arrays['atoms']: per-site list of species labels.arrays['tau']:(natoms, 3)Cartesian positions (Bohr).attributes['fpath']: directory containing the UPF files (QE), or the run folder whose POTCAR datasetsPAOFLOW.inputs.pseudopotentialslocates (VASP).
Optional:
arrays['atomic_basis']: per-orbital dicts (seePAOFLOW.projection.do_atwfc_proj.build_pswfc_basis_all()) with keysatom, tau, l, m, label, r, wfc.
- Returns:
Loaded species data, per-site mapping, and flat PAO basis.
- Return type:
- Raises:
RuntimeError – On missing species, a tau/atoms shape mismatch, or when
atomic_basisrecords for the same species disagree on the radial mesh.
- PAOFLOW.hamiltonian.nonlocal_velocity.pao_cutoff_radius(channel, r, tol=0.0001)[source]#
Return the numerical real-space cutoff of a PAO channel.
The pseudo-wavefunction \(r\,R(r)\) (stored as
PAOChannelData.wfc) decays smoothly to zero outside the core. This helper returns the smallestr_csuch that \(|r R(r)| < \mathrm{tol} \times \max_r |r R(r)|\) for every grid point \(r > r_c\).- Parameters:
channel (PAOChannelData) – PAO radial channel.
r (np.ndarray, shape
(npoints,)) – Radial mesh fromPAOSpeciesData.r.tol (float, optional) – Relative threshold (default
1e-4).
- Returns:
Cutoff radius in Bohr.
r[-1]is returned if the tail never drops belowtol× peak.- Return type:
- PAOFLOW.hamiltonian.nonlocal_velocity.site_pao_cutoff(site, tol=0.0001)[source]#
Largest PAO radial cutoff on a given site (via
pao_cutoff_radius()).
- PAOFLOW.hamiltonian.nonlocal_velocity.pao_orbital_signs(pao_catalog)[source]#
Sign of every PAOFLOW orbital with respect to the real-space orbitals of the tables.
PAOFLOW’s atomic Bloch orbitals (
calc_atwfc_k) are built in reciprocal space with the phase \(i^l\) and thecalc_ylmgharmonics, which carry an extra-1on odd|m|; transformed back to real space they are \((-1)^l (-1)^{|m| \bmod 2}\) times \(R(r) Y_{lm}(\hat r)\) with the tesseral harmonics ofPAOFLOW.hamiltonian._two_center. A matrix with two PAO indices built from the tables therefore transforms with the product of the two signs. Measured on the Si basis (3S 3P 3D 4S 4P) against the plane-wave overlaps and Berry connection of the PAOFLOW orbitals (agreement to \(10^{-3}\) and 2 %); the odd-|m|factor alone flips every \(s\)–\(p\) and \(p\)–\(d\) element.- Parameters:
pao_catalog (PAOCatalog)
- Returns:
+1or-1per orbital in PAOFLOW basis order.- Return type:
np.ndarray, shape
(nawf,)
- PAOFLOW.hamiltonian.nonlocal_velocity.lowdin_transform(matrix_k, overlap_k)[source]#
Transform an operator matrix from the atomic to the Löwdin-orthonormal PAO basis.
PAOFLOW’s Hamiltonian,
dHkspand band velocities are expressed in the symmetrically orthogonalised orbitals \(\omega = \varphi S^{-1/2}\); a matrix computed between the raw atomic orbitals \(\varphi\) (such as the two-centre \(\Delta p\)) must be transformed as\[M^{\omega}(\mathbf k) = S^{-1/2}(\mathbf k)\, M^{\varphi}(\mathbf k)\, S^{-1/2}(\mathbf k)\]before it is added to them. For a diffuse basis this is not a small correction: on the standard Si set (Bloch-overlap eigenvalues \(5\cdot10^{-4}\) to 20) the untransformed \(\Delta p\) has its largest elements 4–5 times too small.
- Parameters:
matrix_k (np.ndarray, shape
(nk, 3, n, n)or(nk, n, n), complex) – Operator in the atomic-orbital Bloch basis.overlap_k (np.ndarray, shape
(nk, n, n), complex) – Hermitian positive-definite Bloch overlap \(S(\mathbf k)\) of the same orbitals, in the same phase convention.
- Returns:
The transformed operator, same shape as
matrix_k.- Return type:
np.ndarray
- Raises:
ValueError – If \(S(\mathbf k)\) is not positive definite (linearly dependent orbitals).
- PAOFLOW.hamiltonian.nonlocal_velocity.scalar_to_jm_matrix(matrix_k, pao_catalog)[source]#
Spin-double a scalar PAO matrix and rotate it to the relativistic
(j, m_j)basis.Uses the same per-shell unitaries (
_jm_shell_transform()) and channel layout as the PAO index ofassemble_beta_projections_jm(), so that e.g. the Bloch overlap \(S(\mathbf k)\) of the scalar orbitals becomes the overlap of the(j, m_j)basis in which the relativisticdHkspis expressed.- Parameters:
matrix_k (np.ndarray, shape
(nk, nawf, nawf), complex) – Spin-independent matrix in the scalar (tesseral) PAO basis.pao_catalog (PAOCatalog)
- Return type:
np.ndarray, shape
(nk, 2 nawf, 2 nawf), complex