Skip to content

feat(librpa): strict 2D/3D Coulomb kernels and 2D reader-v1 producer outputs - #8176

Open
AroundPeking wants to merge 6 commits into
deepmodeling:developfrom
AroundPeking:abacus-librpa-strict2d-oct17
Open

AroundPeking wants to merge 6 commits into
deepmodeling:developfrom
AroundPeking:abacus-librpa-strict2d-oct17

Conversation

@AroundPeking

Copy link
Copy Markdown

Problem

  • After the module_rpa split (Title: refactor(rpa): move LibRPA producer into module_rpa #8154), develop still lacks strict-2D support: the Ewald short-range tail machinery, direct 2D mixed-Fourier / 3D reciprocal Coulomb kernels, the strict-2D head normalization, and the 2D reader-v1 producer outputs needed by LibRPA's 2D (slab) GW/RPA pipeline.
  • Two latent defects surface once this machinery runs test geometries: the Ewald tail completeness check bounds the projected Gaussian tensor by the raw gaussianized-aux radius sum instead of the RI pipeline's integral support, so rpa_scf_gamma's guard shell always fails coverage in warn mode; and Symmetry_rotation_k::wigner_d overflows int factorials for l>=5, producing NaN rotation matrices.

Change

  • module_ri: port the strict-2D/3D kernels, Ewald tail planner/checker, Gaussian 2D integrals, MPI shell-key distribution, and LRI_CV extensions (adapted to develop's p_info_ri/timer conventions); restore the empty-abfs construction branch in Exx_LRI::init_spencer; bound the tail check's Gaussian support by min(cal_V_Rcut); evaluate wigner_d factorials in double.
  • module_rpa: port the strict-2D head sidecar and direct-Coulomb output wiring into output_ewald_coulomb with v1 naming, plus the LibRPA io writers (head / structure symmetry / BZ sampling) and ABFS preorthogonalization.
  • Input parameters and Exx_Info_RI / XC functional fields for all of the above, with read_input unit tests.
  • Tests: new 61_librpa_2d_reader_v1 producer contract (including the head sidecar) with single-rank-layout references; regenerated Ewald far-field coulomb_mat references for rpa_scf_gamma / rpa_scf_shrink_multik (energies unchanged to 4e-13 eV); unit tests for the kernels, tail utilities, io writers, and symmetry rotation.

Validation

  • ctest -R "MODULE_RI|MODULE_RPA|read_input|op_exx" — 24/24 pass, including the
    direct 2D/3D Coulomb kernels, the Ewald tail planner and utilities, the Gaussian
    2D integrals, the reader-v1 io writers, and the symmetry rotation tests.
  • 08_RI integration suite (4 MPI ranks): rpa_scf_gamma and rpa_scf_shrink_multik
    pass with the regenerated Ewald far-field references; bse_lr_multik,
    rt_tddft_pbe0_gamma, and the LibRPA producer contract (cases 60/61/64, including
    the strict-2D head sidecar) pass. The hse / lr_tddft / lr_relax failures seen
    locally are LibXC-dependent cases under an ENABLE_LIBXC=OFF build; CI builds
    with LibXC enabled.

…strict-2D RI-EXX

Add the strict-2D/3D Ewald Coulomb controls (ewald dimension, lambda, tail
check mode with tolerances and adaptive expansion limits, direct
mixed-Fourier 2D and reciprocal 3D Coulomb output selection with quadrature
orders, RPA ABFS preorthogonalization, EXX V-matrix screening thresholds)
to the input parameters, wire them through the EXX reading path, and extend
Exx_Info_RI and the XC functional type so downstream RI modules can consume
them. read_input unit tests cover the new keywords.
…metry wiring

Port the strict-2D RI-EXX machinery: direct mixed-Fourier 2D and reciprocal
3D bare-Coulomb kernels, the Ewald short-range tail planner with its
completeness check, Gaussian auxiliary-basis 2D integrals, MPI shell-key
distribution, and the extended LRI_CV pipeline, adapted to develop's
p_info_ri and timer conventions. Restore the empty-abfs construction
branch in Exx_LRI::init_spencer that the signature unification dropped.
The tail completeness check now bounds the projected Gaussian tensor by
the RI integral pipeline's own support min(cal_V_Rcut) instead of the raw
gaussianized-aux radius sum, which demanded identically-zero blocks and
failed coverage in warn mode. Evaluate wigner_d factorials in double so
high-L (l>=5) rotation matrices no longer overflow int and produce NaN.
Wire the EXX LCAO operator, LR-TDDFT esolver, RDMFT, and center2orbital
paths to the extended interfaces, and add unit tests for the kernels,
tail utilities, and symmetry rotation.
…s in module_rpa

Port the master_ghj output wiring that the module_rpa split dropped: the
strict-2D Coulomb head normalization sidecar written next to the reader-v1
Ewald outputs, the direct mixed-Fourier 2D / reciprocal 3D Coulomb output
block with its reader-v1 basis export, and the LibRPA io writers (2D head,
structure symmetry, BZ sampling) plus RPA ABFS preorthogonalization, all
using develop's v1 output naming. Unit tests cover the new io writers.
…cker kinds

Add tests/08_RI/61_librpa_2d_reader_v1 exercising the strict-2D Ewald
reader-v1 producer contract including the Coulomb head sidecar, with
references generated at the producer's single-rank layout, and register it
in the LibRPA producer case list. Extend check_librpa_producer.py with the
strict_2d_head kind and its self-test. Regenerate the Ewald far-field
coulomb_mat references of rpa_scf_gamma and rpa_scf_shrink_multik for the
ported tail machinery (energies unchanged to 4e-13 eV).
…il sources

Comment the construction the ported kernels implement: the positive Gram
quadrature of the direct mixed-Fourier route (the tan-mapped kz rule and
the Massidda-constrained Gamma plane), the analytic 2D Gaussian
compensation integrals, the Ewald tail planner decision table, the
Gaussian decay exponent search, and the strict-2D head normalization.
The new sources carried essentially no comments, repeating the review
finding from the reader-v1 producer PR.

Also drop the INTERFACE OpenMP link added to the device object library
during the port: this PR's OpenMP usage lives in the module_ri targets,
and develop links the same device objects without publishing OpenMP, so
the hunk was unrelated to this PR's scope.
The new operator_exx_nscf_cell_nearest test target referenced
lcao_set_mat2d.cpp with one ../ level too many, which only surfaces
when ENABLE_LIBRI=ON (the CI test configuration), breaking CMake
generate. Two new headers used #pragma once, which the repository
governance checker rejects; use traditional include guards, matching
the guard style of the neighboring headers.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant