pytc.kmat.calc_kmat_kernels_from_aux

pytc.kmat.calc_kmat_kernels_from_aux(xi_phi, xi_grad, weights, L_aux, H_aux)[source]

Recover the ISDF K1/K3 kernels from auxiliary pair contractions.

L_aux is already required by the three-body TC term and contains

L_aux[l, g, c] = sum_h xi_phi[l, h] w_h grad_c u(g, h).

If the same grid pass also forms

H_aux[l, g] = sum_h xi_phi[l, h] w_h |grad u(g, h)|^2,

the two K kernels are exact one-grid contractions:

K1[k, l, c] = sum_g xi_grad[k, g, c] w_g L_aux[l, g, c] K3[k, l]    = sum_g xi_phi[k, g] w_g H_aux[l, g].

This removes the separate rank-by-rank double-grid scan. It is an algebraic identity, not a Jastrow or ISDF approximation. The caller is responsible for streaming grid panels on production-size systems; this compact routine is the in-core parity reference for that future path.