PAOFLOW.basis_gen.radial#
Radial Schroedinger solver for norm-conserving, USPP and PAW pseudopotentials.
The pseudo-atom Hamiltonian acting on the radial part \(u(r) = r R(r)\) of \(\psi_{lm}(r) = R(r) Y_{lm}\) is, for a given \((l, j)\) channel,
where \(\langle\beta_j | R\rangle = \int \beta_j(r) R(r) r^2 \, dr\). Using the UPF-stored quantity \(a_i(r) = r \beta_i(r)\) the nonlocal kernel in \(u\)-space becomes the symmetric outer product
For ultrasoft / PAW pseudopotentials the augmentation overlap operator
is built from upf.qqq and the eigenproblem becomes the generalized
\(H u = \varepsilon S u\) (solved with scipy.linalg.eigh(H, S)); the
returned \(u(r)\) is then normalised to \(\langle u|S|u\rangle \, \mathrm{d}r = 1\). For NC pseudos
(no augmentation) the path collapses to np.linalg.eigh(H) with the
ordinary \(L^2\) normalisation.
We discretise on a uniform mesh \(r_k = k \, \mathrm{d}r\), \(k = 1, \ldots, N-1\), with \(u(0) = u(R_{\mathrm{box}}) = 0\), \(\mathrm{d}r = R_{\mathrm{box}} / N\). \(V_{\mathrm{loc}}\) and \(a_i\) are interpolated (cubic spline) from the UPF log mesh onto this uniform grid; outside each projector’s cutoff_radius \(a_i\) is zero.
For SO UPFs the projectors are filtered by matching \((l, j)\) – callers
that request \((n, l)\) with j = None on an SO UPF get the \(j = l + 1/2\)
channel by default (override via the j argument).
All quantities are in Hartree atomic units. Output radial functions
are returned in the QE convention used by build_aewfc_basis: the
returned wfc[k] equals \(r_k R(r_k)\) (i.e. \(u(r_k)\)), normalised so that
\(\sum_k \mathrm{wfc}[k]^2 \, \mathrm{d}r = 1\).
Functions#
|
Solve H u = eps u for a single (l, j) channel in a box. |
|
Indices of the solver states that are neither ghosts nor the stored pseudo-orbitals. |
|
Return the (n, l[, j]) radial function on a uniform mesh. |
|
Lowest principal quantum number of the valence shells of angular momentum |
|
Heuristic: is |
Module Contents#
- PAOFLOW.basis_gen.radial.solve_radial_channel(upf, l, j=None, r_box=None, n_points=2000, n_states=6)[source]#
Solve H u = eps u for a single (l, j) channel in a box.
- Parameters:
upf (PAOFLOW.inputs.read_upf.UPF) – Parsed pseudopotential (norm-conserving).
l (int) – Orbital angular momentum.
j (float, optional) – Total angular momentum. Required (or auto-defaulted) only for spin-orbit UPFs.
r_box (float, optional) – Confining box radius (Bohr). Default min(upf.r[-1], 10.0).
n_points (int) – Number of intervals on the uniform mesh; the eigenproblem has n_points - 1 interior unknowns.
n_states (int) – Number of lowest eigenstates to return.
- Returns:
eps (ndarray, shape (n_states,)) – Eigenvalues in Hartree.
u (ndarray, shape (n_states, n_points - 1)) – Eigenfunctions u_n(r) = r * R_n(r) on the interior mesh, normalised so that sum u_n[k]**2 * dr = 1.
r (ndarray, shape (n_points - 1,)) – Interior mesh r_k = k * dr.
- PAOFLOW.basis_gen.radial.select_physical_states(upf, l, j, eps_all, U, r_uni, ghost_norm_ratio=3.0, ghost_sphere_weight=0.85, pswfc_overlap=0.5)[source]#
Indices of the solver states that are neither ghosts nor the stored pseudo-orbitals.
- Parameters:
upf (UPF)
l (channel)
j (channel)
eps_all (output of
solve_radial_channel()(UrowsS-normalised).)U (output of
solve_radial_channel()(UrowsS-normalised).)r_uni (output of
solve_radial_channel()(UrowsS-normalised).)ghost_norm_ratio (float, optional) – A state whose plain norm exceeds this multiple of its augmented norm lives where
Sis nearly singular: a ghost of the generalized problem (Ga PAW, d channel: ratio 10.8 for the spurious state at -3.4 Ha, 1.0 for physical ones).ghost_sphere_weight (float, optional) – A state with more than this fraction of its plain norm inside the largest projector radius of the channel is confined to the augmentation sphere (Ga PAW, s channel: the spurious state at -4.8 Ha); the polarisation shells the solver has to provide are diffuse. Not applied to channels without projectors.
pswfc_overlap (float, optional) – States whose augmented overlap with a stored pseudo-orbital of the channel exceeds it are that orbital (or a ghost mixing with it) and are excluded: the pseudo-orbital itself is used for the shell it belongs to.
- Returns:
Solver ranks of the remaining states, in order of increasing energy.
- Return type:
- PAOFLOW.basis_gen.radial.pseudize_shell(upf, n, l, j=None, r_box=None, n_points=2000, prefer_pswfc=True, cache=None)[source]#
Return the (n, l[, j]) radial function on a uniform mesh.
Shells that the pseudopotential carries as pseudo-orbitals (
PP_PSWFC) are returned as stored (interpolated, plain-normalised): they are the pseudo-atom’s own solutions, generated with the pseudopotential and the full atomic SCF, and the only functions consistent with the augmented metric of ultrasoft / PAW pseudopotentials.prefer_pswfc=Falserestores the radial solver for them (the behaviour before October 2026, useful to test the solver).The other shells (polarisation and radial-doubling shells of the presets) are eigenstates of the frozen-density pseudo-atom Hamiltonian in a box (
solve_radial_channel()), selected by physics rather than by rank: ghosts of the generalized augmented problem and the states that reproduce a stored pseudo-orbital are discarded (select_physical_states()), then the requested shell is thek-th remaining state withk = n - n_firstandn_firstthe principal quantum number of the first shell the solver has to provide, i.e. one above the highest pseudo-orbital of the channel, or, for a channel without pseudo-orbitals, the lowest valencenof thatlgiven the core of the pseudopotential (lowest_valence_n(); Si3D, As4D).cache(a dict the caller keeps across the shells of one pseudopotential) stores the channel solutions, so that several shells of one(l, j)channel cost one generalized eigenproblem.- Returns:
r (ndarray) – Uniform mesh (bohr).
u (ndarray) –
u(r) = r R(r).eps (float) – Solver eigenvalue (Hartree),
nanfor a stored pseudo-orbital.
- PAOFLOW.basis_gen.radial.lowest_valence_n(upf, l)[source]#
Lowest principal quantum number of the valence shells of angular momentum
l.The core of the pseudopotential holds
Z - z_valenceelectrons; filling the shells in the aufbau order with that many electrons gives the frozen core, and the first shell of eachlabove it is the lowest one the pseudo-atom can describe (As: core [Ar]3d10, so the lowest d shell is 4d; Si: core [Ne], 3d). Falls back to the atomic minimum (S->1, P->2, D->3, F->4) when the element or the valence charge is unknown.
- PAOFLOW.basis_gen.radial.is_frozen_core_shell(upf, n, l, eps, j=None)[source]#
Heuristic: is
(n, l[, j])a spurious frozen-core request?A pseudopotential that freezes a shell into the core (e.g. As 3d, whose 3d electrons are not in the As pseudo valence) carries no PSWFC for that shell and cannot bind it. Requesting such a shell makes
pseudize_shell()return an unbound, diffuse box mode that is linearly dependent with the genuine polarization shells and corrupts the projection basis.The request is flagged as frozen-core when all of the following hold:
the UPF has no PSWFC with the exact
(n, l[, j])label (a genuine semicore shell, e.g. Ga 3D, is present and so is never flagged);nlies below the largest PSWFC principal quantum numbernmax(above-valence polarization such as Ga 4D hasn >= nmaxand is never flagged); andthe solver eigenvalue is non-negative (the returned state is unbound, the signature of a confinement mode rather than a bound orbital).