struct rgpot::XcGrid

Overview

In-process XC kernel contraction (libxckernel C ABI). More…

#include <XcKernel.hpp>
 
struct XcGrid {
    // fields
 
    std::int64_t npts = 0;
    std::int64_t nbf = 0;
    const double* chi = nullptr;
    const double* dchi = nullptr;
    const double* lapl_chi = nullptr;
    const double* hess_chi = nullptr;
};

Detailed Documentation

In-process XC kernel contraction (libxckernel C ABI).

This is not a geometry PES. Do not subclass Potential. Do not add a PotentialConfig.xckernel arm (rgpot-qf6b, rgpot-nrve): operands are collocation + named Libxc derivative arrays + (perturbed) fields, not ForceInput; results are AO matrices, not PotentialResult energy/forces. No DFT host sends chi / dchi / weights over potserv in this slice.

Term ownership is XC-only (rgpot-nkyx). Coulomb, Hartree-Fock exact exchange, and range-separated exchange stay host-owned. libxckernel never evaluates functionals: the host mixes Libxc arrays and passes them in.

First slice (rgpot-chjn): families lda, gga, mgga_tau; max_order 2 (Fock o1 + fxc o2). TDA/RPA sigma assembly uses the singlet spin-adapted o2 kernels (xck_*_st_o2_p) plus host Coulomb. LDA TDA/RPA forms wv as w*rho*(v2rho2_0+v2rho2_1) and tiles stage B at PySCF BLKSIZE=128. GGA st_o2_p applyFxc uses the generated 7-term monomials via contract() (host long-double stage A/B). Double tiled stage B misses exclusive 1e-17 vs live gen_vind on the sto-3g pin. Dispatch is by kernel name; scalar operand order is read from <name>_scal_names / <name>_n_scal, not hard-coded.

Each XcKernel instance is a name + resolved ABI pointers. The C kernels are reentrant on distinct out/scal buffers. Do not share one out pointer across threads. Distinct instances may run concurrently.

Fields

const double* chi = nullptr

nbf * npts, row-major

const double* dchi = nullptr

3 * nbf * npts

const double* lapl_chi = nullptr

nbf * npts, or nullptr

const double* hess_chi = nullptr

6 * nbf * npts, or nullptr