Repository navigation
Conversation
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
left a comment
There was a problem hiding this comment.
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.
| item.description = "Post-SCF cut-Coulomb kernel: hard preserves Spencer truncation; log_erfc uses erfc(log(r/Rc)/log(rpa_cut_width))/2r. Applies to compressed and uncompressed cut exports; full Coulomb is unchanged. Forces and stresses for log_erfc are not validated."; | ||
| item.default_value = "hard"; | ||
| item.unit = ""; | ||
| read_sync_string(input.rpa_cut_coulomb); |
There was a problem hiding this comment.
Please declare both enum choices with item.domain.set_choices. A valueless rpa_cut_coulomb or rpa_cut_radius line followed by another INPUT item reaches unchecked str_values[0] before these callbacks, while extra tokens are silently ignored. The callbacks also run only on rank 0 after broadcasts; the width bounds can use the common set_rule path while retaining its existing numeric scalar parsing. Parser-level tests should cover the original token sequences.
There was a problem hiding this comment.
Addressed in 73d698b649bb0bd91f6638fd0ccbee6490ae3e02: the enum choices and width rule now validate original tokens before the readers, with shared error propagation before parameter broadcasts. Static reinspection also covered the new parser assertions; no product or MPI tests were run in this review.
| // tags, so the full-Coulomb/ground-state exchange kernel is unchanged. | ||
| if (inp.rpa) | ||
| { | ||
| for (auto& cut_family : exx_info.info_ri.coulomb_param) |
There was a problem hiding this comment.
With rpa=true, dft_functional=hse and default exchange parameters, this map contains only Erfc, so rpa_cut_coulomb=log_erfc and rpa_cut_radius=inscribed are silently ignored here. Please reject or explicitly diagnose these unsupported requests and document the Fock-only scope, with a configuration-level regression. The existing HSE kernel convention can remain unchanged.
There was a problem hiding this comment.
Addressed in 73d698b649bb0bd91f6638fd0ccbee6490ae3e02: initialization now rejects nondefault kernel/radius requests on an Erfc-only map, and the INPUT descriptions state the Fock-only scope. This was checked by static source tracing; the new configuration test's LibRI-disabled registration issue is tracked separately. No runtime validation was performed.
| EXPECT_DOUBLE_EQ(Conv_Coulomb_Pot_K::log_erfc_cut_factor(0.0, 32.0, cut_width), 0.0); | ||
| EXPECT_NEAR(Conv_Coulomb_Pot_K::log_erfc_cut_factor(0.2, 32.0, 1.00000001), | ||
| 1.0 - std::cos(6.4), 1.e-13); | ||
| for (int cut_index = 1; cut_index <= 100; ++cut_index) |
There was a problem hiding this comment.
Non-blocking: please add independent finite-width Fourier reference values, including the maximum allowed width and an oscillatory case. The [0,2] bounds also hold for an aliased positive quadrature, so they do not protect the ordinary finite-width shape. The current scalar comparisons found no formula defect; this regression coverage can follow after merge.
| for (size_t cut_ik = 0; cut_ik < psik2_ccp.size(); ++cut_ik) | ||
| { | ||
| psik2_ccp[cut_ik] += cut_alpha * ModuleBase::FOUR_PI * orbs.get_psif()[cut_ik] | ||
| * log_erfc_cut_factor(orbs.get_k_radial()[cut_ik], cut_radius, cut_width); |
There was a problem hiding this comment.
Non-blocking: please consider tabulating the cutoff factor once per distinct momentum grid, radius and width within this conversion, then reusing it across auxiliary orbitals. The factor is independent of the orbital amplitude, but the recursive conversion repeats its 128-or-more-panel quadrature at nonzero momentum on shared grids. A local table avoids global mutable state, and this can follow after merge if current performance is acceptable.
… 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
left a comment
There was a problem hiding this comment.
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.
| AddTest( | ||
| TARGET MODULE_HAMILT_RpaCutoffConfig | ||
| LIBS parameter base device | ||
| SOURCES test_exx_info.cpp ../exx_info.cpp |
There was a problem hiding this comment.
Please gate this target or its PBE section on ENABLE_LIBRI. The parent test directory is enabled with MPI and Libxc alone, while LibRI defaults OFF; without __EXX, init_exx_info skips RI initialization for PBE and the new test then calls .at(Fock) on an empty map at test_exx_info.cpp:37. This is a statically identified failing test path in that configuration; please retain coverage for both feature settings.
|
|
@ABACUS-PR-BOT Please solve this conflict |
Hi Huangjing, It is true that the smoothed Coulomb interaction is nonzero at 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 |
|
Resolved the develop merge conflict in |
|
Find out the error which occurs in #7794 |
Unit Tests and/or Case Tests for my changes
Commands run:
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.