GPAW FFT, PAW, and Radial Implementation
The GPAW backend connects the mapped functional to smooth-grid FFT operations,
PAW/PASDW corrections, and their derivatives. Calculations construct the
functional with get_cider_functional() and
use CiderGPAW; the modules below implement
the numerical layers beneath those interfaces.
Smooth-grid forward and adjoint
ciderpress.gpaw.cider_kernel is the bridge between GPAW density arrays
and MappedXC or
MappedXC2. It assembles semilocal and
NLDF blocks in serialized order, applies normalization, calls the mapped
model, and distributes the returned derivatives to the density, gradient,
kinetic-energy-density, and NLDF potentials. The GGA/MGGA kernel classes also
assemble the explicit exchange and correlation terms selected by
get_cider_functional.
- class ciderpress.gpaw.cider_kernel.CiderKernel
Common mapped-model adapter used by the GPAW GGA and meta-GGA kernel classes. It assembles and normalizes the raw semilocal and NLDF features, calls the mapped evaluator, and distributes the returned derivatives to GPAW’s semilocal and NLDF potential arrays.
ciderpress.gpaw.cider_sl connects packaged semilocal CIDER23X models to
the same GGA/MGGA and PAW framework.
ciderpress.gpaw.nldf_interface wraps the compiled periodic NLDF
library. It distributes the real and reciprocal arrays, evaluates the kernel
interpolation and FFT convolutions, and provides the reverse contractions
needed for the XC potential and stress.
- class ciderpress.gpaw.nldf_interface.LibCiderPW
Owns the compiled serial or MPI convolution plan and its work arrays. Its forward and backward operations are an adjoint pair.
- class ciderpress.gpaw.nldf_interface.FFTWrapper
Adapts GPAW’s plane-wave descriptor and array distribution to the compiled CIDER FFT interface.
ciderpress.gpaw.cider_fft connects those operations to GPAW’s GGA and
meta-GGA XC framework. It gathers the smooth density ingredients, evaluates
the mapped energy density, adds the backward feature potential, and supplies
the smooth-grid force and stress terms.
- class ciderpress.gpaw.cider_fft.CiderGGA
Smooth-grid GGA CIDER implementation.
- class ciderpress.gpaw.cider_fft.CiderMGGA
Smooth-grid meta-GGA implementation, including kinetic-energy-density input and potential.
The interpolation controls qmax, lambd, and Nalpha define the
numerical representation of the density-dependent kernel. Energy, potential,
force, and stress calculations being compared must use the same controls.
Why PAW needs PASDW
In ordinary PAW, a local or semilocal XC energy can be decomposed into a smooth cell term and atom-centered all-electron-minus-pseudo corrections,
An NLDF at a point depends on density in a finite surrounding region. A final on-site energy correction leaves the convolution source outside the augmentation sphere unchanged. CiderPress transports that all-electron source with the PAW/PASDW construction introduced with CIDER23X. (PASDW stands for Projector Augmented/Smoothed Density Wave, and the concept is introduced in more detail in the CIDER23X paper. [1])
The transfer has two coupled stages. First, localized source functions \(g_i^A\) augment the smooth kernel source,
so that the convolved smooth feature reproduces the all-electron feature outside each augmentation sphere. Second, localized feature partial waves and dual projectors transfer the convolved fields back to the atomic support grids. Their projection coefficients have the form
The on-site all-electron and pseudo features use the same returned field, with the required localized residual added on the all-electron side. Their difference gives the PAW correction and includes the nonlocal information transported through the cell grid.
PAW/PASDW modules
ciderpress.gpaw.cider_paw coordinates the atom-to-grid source
augmentation, grid-to-atom return projection, on-site energy/potential, and
their force and stress contributions.
- class ciderpress.gpaw.cider_paw.CiderGGAPASDW
GGA smooth-grid functional with PASDW augmentation corrections.
- class ciderpress.gpaw.cider_paw.CiderMGGAPASDW
Meta-GGA counterpart, including PAW kinetic-energy-density response.
ciderpress.gpaw.atom_utils constructs the radial/angular auxiliary
bases, localized source and projector functions, overlap fits, and the
forward/backward atomic contractions used by PASDW.
- class ciderpress.gpaw.atom_utils.FastPASDWCiderKernel
Owns the per-setup PASDW data and applies atom-to-grid, grid-to-atom, energy, potential, force, and stress contractions for a calculation.
ciderpress.gpaw.fit_paw_gauss_pot builds the localized radial source
and projector bases.
ciderpress.dft.pwutil wraps the compiled spline, spherical-harmonic,
and atom/grid contraction kernels.
ciderpress.gpaw.atom_descriptor_utils applies the corresponding atomic
corrections when extracting fixed-density descriptor arrays and occupation
derivatives.
pasdw_ovlp_fit selects overlap fitting for the transfer and changes the
evaluated numbers. pasdw_store_funcs caches atom-centered projector
values: it trades memory for repeated cost and leaves the evaluated
functional unchanged.
Radial reconstruction and on-site correction
ciderpress.gpaw.interp_paw handles the radial on-site layer of the
PAW/PASDW route. It reconstructs differentiable all-electron and pseudo
partial-wave density ingredients on an appropriate radial grid and evaluates
the on-site GGA, meta-GGA, or CIDER correction. The returned derivatives are
contracted back into GPAW’s PAW density matrices.
- class ciderpress.gpaw.interp_paw.DiffPAWXCCorrection
Container for interpolated all-electron and pseudo partial-wave densities, radial derivatives, kinetic-energy-density terms, and projector transformations for one GPAW setup.
- class ciderpress.gpaw.interp_paw.DiffGGA
Differentiable radial GGA correction used by the CIDER PAW path.
- class ciderpress.gpaw.interp_paw.DiffMGGA
Differentiable radial meta-GGA correction, including reconstructed kinetic-energy-density terms.
ciderpress.gpaw.gpaw_grids supplies the radial-grid descriptors used
for this reconstruction.
For heavier elements, the implementation retains the setup’s native dense all-electron radial form inside the required cutoff; lighter elements use the generated CIDER radial representation. The implementation selects this radial treatment by element to control interpolation error.
Two safeguards preserve physical and numerical invariants:
A mapped point that exceeds an interpolation endpoint by floating-point roundoff is clipped to that endpoint. A request outside the source radial grid raises an error.
Interpolated all-electron and pseudo core kinetic-energy densities are bounded below by the von Weizsaecker value \(\tau_{\mathrm W}=|\nabla n|^2/(8n)\) (with the corresponding spherical-harmonic normalization used on the radial grid). This enforces the Fermi-hole-curvature/iso-orbital bound in the finite radial representation.
Forward/derivative contract
The PASDW transfer is linear, so the returned potential must be the exact adjoint of the discretized forward transfer. Forces additionally differentiate the localized functions and projectors with respect to atomic position; stress differentiates the reciprocal kernel and the cell-scaled transfer.
Validation covers smooth-grid and PAW feature values, potentials, forces, and stress at the same interpolation and projection settings. See Handling SCF Convergence Issues for SCF controls when encountering convergence issues, Numerical Evaluation in PySCF and GPAW for the complete backend path, and Extending CiderPress for implementation invariants.