Skip to content

Add RPA smooth coulomb cutoff for V_cut - #8212

Merged
mohanchen merged 9 commits into
deepmodeling:developfrom
HGAQ:feat/rpa-smooth-coulomb
Nov 1, 2026
Merged

mohanchen merged 9 commits into
deepmodeling:developfrom
HGAQ:feat/rpa-smooth-coulomb

Conversation

@HGAQ

@HGAQ HGAQ commented Oct 23, 2026

Copy link
Copy Markdown

Unit Tests and/or Case Tests for my changes
Commands run:

cmake -S publish_checks -B publish_checks/build
cmake --build publish_checks/build -j 2
ctest --test-dir publish_checks/build --output-on-failure

# Production executable checks
./build/abacus_std_para --version
./build/abacus_std_para -h rpa_cut_coulomb
./build/abacus_std_para --check-input

What's changed?
Adds an optional log-erfc smooth Coulomb cutoff to the post-SCF RPA export workflow. The existing hard spherical cutoff remains the default.

Three INPUT parameters control the kernel, radius convention, and smoothing width:

rpa_cut_coulomb log_erfc
rpa_cut_radius legacy
rpa_cut_width 1.091868692359

An independent inscribed radius option uses half the shortest nonzero Born–von Karman superlattice vector, including integer combinations of lattice vectors.

The implementation updates the truncated-Coulomb path, including RI fits that use this metric. Matching RI coefficients, cut Coulomb matrices, and screened interactions must therefore be regenerated together. The full-Coulomb kernel definition and downstream interpolation rules remain unchanged.

Governance Notes
INPUT/docs changes: Registered and validated the three new parameters. Regenerated docs/parameters.yaml and docs/advanced/input_files/input-main.md from the executable. Defaults preserve hard / legacy behavior.
Dependencies: Configuration is passed explicitly through the existing RI parameter structure; no additional global-variable references are introduced.
Header dependency: is required because std::array appears in the public shortest-vector function signature.
Build/test integration: Registered the new implementation and focused tests in the corresponding CMake files. The numerical helper passes a C++11 build.
Scope: Based on the production baseline c2fa3ac. Unrelated local interface changes and calculation outputs are excluded.

HGAQ added 3 commits October 23, 2026 12:50
Add a log-erfc radial cutoff and an independent BvK inscribed-radius
option. Preserve hard/legacy defaults and apply the smooth Fourier factor
through the post-SCF cut-Coulomb path, including RI fits using that metric.
Register and validate the three INPUT parameters, log the selected radius,
and document consistent downstream RI/Vcut/W use.

Regenerate parameters.yaml and input-main.md from the production executable;
add a usage guide and focused kernel/INPUT tests.

Validation:
- Fresh C++11 build of the kernel GoogleTests; CTest 1/1 passed (2 test cases).
- Production executable --version and -h rpa_cut_coulomb passed.
- Fresh --check-input: hard/legacy, smooth/legacy and smooth/inscribed
  accepted; invalid mode, radius and width rejected (6/6).
- All 11 changed source/build/test files byte-match the compiled production
  source copy. Full application build and Si W/BSE runs were performed in
  that production copy, which also has pre-existing local interface changes;
  a full application build of this isolated checkout was not repeated.
- git diff --cached --check passed; staged governance has no errors.
  Its sole header warning is required: std::array appears in the public
  shortest-vector function signature, so <array> must be included.
- New kernel/header/test files pass the repository quality scorer (3/3).

Based on production baseline c2fa3ac.
Unrelated local BSE/interface changes and numerical output are excluded.
…yout

Resolve generated-document modify/delete conflicts by following develop:
parameter YAML/Markdown are generated artifacts, not tracked sources.
Retain the three INPUT registrations and local documentation copies.

Move the smooth-kernel test into module_ri/unittests with the current
naming convention and register it alongside existing tests. Preserve all
upstream RI sources and add the helper to the legacy Makefile object list.
Adapt INPUT tests to TestParameters and the current check_item helper.
The numerical cutoff implementation is unchanged.

Validation on the merged tree:
- CMake configuration with MPI/LCAO/LibRI/Libxc and BUILD_TESTING=ON passed.
- Built MODULE_RI_smooth_cut_coulomb and MODULE_IO_read_item_serial.
- Both CTest targets passed.
- Syntax checks with current build flags passed for exx_info.cpp,
  conv_coulomb_pot_k.cpp, exx_lri_detail.cpp and read_inp_exx_dftu.cpp.
- INPUT test source syntax check passed; no conflict markers remain.
- git diff --check origin/develop passed.

No full application rebuild or new scientific calculations were performed.

@ABACUS-PR-BOT ABACUS-PR-BOT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review of bf59ad2e2a5ab508e7b6a559254463aa01e5c977 after independent assessments. The inline notes cover INPUT validation, supported kernel scope, and two nonblocking follow-ups. Independent scalar checks found no confirmed Fourier-formula or shortest-vector defect. No product build or ABACUS/MPI execution was performed; CI diagnostics were unavailable.

@HGAQ HGAQ changed the title Feat/rpa smooth coulomb Add RPA smooth coulomb cutoff for V_cut Oct 23, 2026
… kernels

Declare cutoff mode/radius choices and width bounds through the shared
INPUT domain validator. Missing values, extra tokens, invalid choices and
non-finite/out-of-range widths now fail before reader callbacks/broadcasts.

Reject non-default cutoff requests for RPA configurations without a Fock
component, including default HSE. Preserve existing Erfc kernel behavior
and document the Fock-only scope in the INPUT metadata.

Add parser-level regressions for the original malformed token sequences
and configuration coverage for default HSE, rejected HSE cutoff requests,
and accepted PBE cutoff settings. Numerical kernels and caching are unchanged.

Validation: MODULE_IO_input_domain_reader, MODULE_IO_read_item_serial and
MODULE_HAMILT_RpaCutoffConfig all passed (3/3 CTest targets). Staged diff
whitespace and governance checks reported no errors. Generated YAML and
Markdown were checked locally for enum choices, width bounds and scope;
they remain untracked build artifacts under current develop policy.

@ABACUS-PR-BOT ABACUS-PR-BOT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incremental static review of 73d698b649bb0bd91f6638fd0ccbee6490ae3e02 after independent assessments. The previous INPUT-domain and Erfc-only handling concerns are addressed; the new inline note covers a LibRI-disabled test path. The two earlier nonblocking follow-ups remain unchanged. No product build or MPI tests were run; CI diagnostics were unavailable, and production tail/export convergence and legacy-v0 arbitrary k-point support remain unverified.

@AroundPeking

Copy link
Copy Markdown

log_erfc needs a larger rpa_ccp_rmesh_times

The smooth switch f(r) = ½·erfc[ln(r/Rc)/ln w] is not compactly supported at Rc: it equals erfc(t)/2 at r = Rc·w^t, so with the default width (w^8 ≈ 2.0) the potential only becomes negligible around 1.5–2 Rc, whereas the hard Spencer cutoff is exactly zero beyond Rc. Both the ccp radial window and the V(R) cell range scale with rpa_ccp_rmesh_times, so this cutoff needs a correspondingly larger value — roughly 1.5–2× what was sufficient for the hard cutoff (e.g. 15–20 if 10 was only just enough), especially for converged k-meshes where Rc ≈ 0.5–0.62 × supercell length. Too small a value silently truncates the smooth tail and reintroduces a hard edge at the box boundary. exx_ccp_rmesh_times does not need to change.

@mohanchen mohanchen added EXX/lr-TDDFT/RPA/BSE/GW Related to beyond DFT methods Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests labels Oct 25, 2026
@Critsium-xy

Copy link
Copy Markdown
Collaborator

@ABACUS-PR-BOT Please solve this conflict

@HGAQ

HGAQ commented Oct 27, 2026

Copy link
Copy Markdown
Author

log_erfc needs a larger rpa_ccp_rmesh_times

The smooth switch f(r) = ½·erfc[ln(r/Rc)/ln w] is not compactly supported at Rc: it equals erfc(t)/2 at r = Rc·w^t, so with the default width (w^8 ≈ 2.0) the potential only becomes negligible around 1.5–2 Rc, whereas the hard Spencer cutoff is exactly zero beyond Rc. Both the ccp radial window and the V(R) cell range scale with rpa_ccp_rmesh_times, so this cutoff needs a correspondingly larger value — roughly 1.5–2× what was sufficient for the hard cutoff (e.g. 15–20 if 10 was only just enough), especially for converged k-meshes where Rc ≈ 0.5–0.62 × supercell length. Too small a value silently truncates the smooth tail and reintroduces a hard edge at the box boundary. exx_ccp_rmesh_times does not need to change.

Hi Huangjing,

It is true that the smoothed Coulomb interaction is nonzero at $R_{c}$. However, $R_{c}$ is actually follows the definition of hard cutoff, rather than its numerical boundary. This follows the modified Spencer–Alavi scheme in Ren et al., Phys. Rev. Materials 5, 013807 (2021), Sec. III B, Eq. (34).

I agree that the numerical window must accommodate the tail. For our current Si calculations, however, rpa_ccp_rmesh_times=10 already gives a radial window of approximately 80 Bohr. Even after allowing for the 8-Bohr auxiliary-basis radius, this covers nearly 2$R_{c}$ for $9\times9\times9$ k-point.

@ABACUS-PR-BOT

Copy link
Copy Markdown
Collaborator

Resolved the develop merge conflict in 2430c4713c770b1607868fe38419b83773b8de0e by retaining both sets of INPUT tests unchanged. The four focused IO suites and eight MPI INPUT-error cases passed on CPU (12/12). Full RPA numerical validation was not rerun; CI status remains unverified because the configured checks connector is unavailable.

@HGAQ

HGAQ commented Oct 27, 2026

Copy link
Copy Markdown
Author

Find out the error which occurs in #7794

HGAQ and others added 4 commits October 29, 2026 16:23
Split PBE coverage from HSE and guard RI assertions with __EXX. Verify the empty RI map without LibRI and cutoff propagation with LibRI.

Validation: isolated C++11 builds of test_exx_info.cpp and exx_info.cpp with and without __EXX, using __NORMAL for tool_quit.cpp; both CTest entries passed (HSE and PBE each). No full product build or MPI tests. Diff whitespace and governance checks passed with a documentation-review warning. No docs changes needed because only tests change.
@mohanchen
mohanchen merged commit d437d51 into deepmodeling:develop Nov 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EXX/lr-TDDFT/RPA/BSE/GW Related to beyond DFT methods Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants