PAOFLOW.projection.upf_gaussfit#
upf_gaussfit — Gaussian fitting of UPF radial pseudo-wavefunctions.
This module fits the radial pseudo-wavefunctions \(\chi_{nl}(r)\) stored
in Quantum ESPRESSO UPF pseudopotential files (versions 1 and 2) with
contracted Gaussian-type orbital (cGTO) expansions. The resulting basis
is used by the ACBN0 and eACBN0 workflows, where two-electron Coulomb
repulsion integrals computed in pyints require
analytic GTO representations of the projector functions.
Fitting procedure#
For each pseudo-wavefunction labelled \(n l\) the radial part is approximated as
where \((\alpha, \beta)\) control the geometric spacing of the exponents and \(c_j\) are the contraction coefficients. The two- parameter exponential progression means only \(N_\zeta + 2\) free parameters are needed regardless of the contraction length.
The fit minimises the least-squares residual
\(\sum_r [\chi_{nl}^\text{ref}(r) - r\, \chi_{nl}^\text{GTO}(r)]^2\)
using either the Levenberg–Marquardt algorithm (fit() with
least_squares=True, default) or conjugate-gradient minimisation.
Starting from \(N_\zeta = 2\) the multiplicity is increased by one
until the residual norm falls below threshold or \(N_\zeta = 5\).
Angular-momentum conventions#
Contraction coefficients output by build_basis_dict() and
write_basis_file() are expressed in the cubic (real) harmonic
basis with the following conventions for each \(l\):
\(l=0\) (s): single \((0,0,0)\) Cartesian GTO.
\(l=1\) (p): \(p_z, p_y, p_x\) in standard \((n_x,n_y,n_z)\) form.
\(l=2\) (d): \(d_{z^2}, d_{xz}, d_{yz}, d_{x^2-y^2}, d_{xy}\) as linear combinations of Cartesian GTOs (standard \(\sqrt{3}\) prefactors).
\(l=3\) (f): \(f_{z^3}, f_{xz^2}, f_{yz^2}, f_{z(x^2-y^2)}, f_{xyz}, f_{x(x^2-3y^2)}, f_{y(3x^2-y^2)}\) with appropriate prefactors.
These Cartesian tuples are consumed directly by
contr_coulomb() to evaluate four-centre
integrals.
Main entry point#
gaussian_fit()Read a UPF file, fit every pseudo-wavefunction, and return the atomic number together with the full Cartesian-GTO basis dictionary. Automatically increments \(N_\zeta\) until convergence.
I/O helpers#
read_upf()Parse the
<PP_PSWFC>section of a UPF v1 or v2 XML file and return the radial grid, integration weights, labels, angular momenta, and wavefunction arrays.read_atom_no_xml()Extract the element symbol and atomic number from a UPF XML header.
write_basis_file()Write the fitted basis to a Python-importable
.pyfile containing abasis_datadict keyed by atomic number.build_basis_dict()Convert per-orbital coefficient/exponent lists to the nested Cartesian-GTO tuple structure expected by
pyints.
Low-level fitting helpers#
gto()Evaluate the contracted radial GTO \(\chi^\text{GTO}(r)\) for given exponent/coefficient parameters.
target()/target_squared()Residual vector and sum-of-squares objective for
scipyoptimisers.fit()Fit a single pseudo-wavefunction channel with \(N_\zeta\) primitive Gaussians; returns coefficients, exponents, and an exit code.
Utilities#
spn_mapdictmapping element symbol → atomic number for Z = 1–112.get_atom_no()Look up atomic number from element symbol; raises if symbol unknown.
fact2()Recursive double factorial \(n!!\) used in GTO normalisation.
Attributes#
Functions#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents#
- PAOFLOW.projection.upf_gaussfit.fit(nzeta, label, l, r, rab, wfc, threshold, least_squares=True)[source]#