Repository navigation
Move the dV/dR sparse conversion out of module_gint and narrow three header includes - #8230
Open
Critsium-xy wants to merge 2 commits into
Open
Critsium-xy wants to merge 2 commits into
Critsium-xy wants to merge 2 commits into
Conversation
- xc_functional_op.h only needs GetTypeReal (source_base/macros.h) and the base_device tags its instantiations use; it no longer pulls source_psi/psi.h into the XC kernel. - vdwd2_parameters.h only names Input_para, so it includes input_parameter.h instead of parameter.h and the global PARAM object. - op_pw_exx.h only uses Conv_Coulomb_Pot_K::Coulomb_Type, which is defined in source_hamilt/module_xc/coulomb_config.h; it no longer includes the LCAO RI header conv_coulomb_pot_k.h. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gint_dvlocal::cal_dvlocal() integrates <phi|V|dphi> on the real-space grid. Its other two members only converted that result into the LCAO_HS_Arrays sparse format used by the dH output, which made module_gint include source_lcao/lcao_hs_arrays.h and source_lcao/module_ri/abfs_vector3_order.h. The conversion now lives next to its only caller, sparse_format::cal_dH in source_lcao/spar_dh.cpp, as file-local functions that take the three HContainers from Gint_dvlocal's existing getters. The bodies are unchanged; the dead locals and unused nspin/Grid_Driver parameters are dropped, and the wrapper ModuleGint::cal_dvlocal_R_sparse is removed. source_hamilt no longer includes source_lcao from module_gint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Critsium-xy
marked this pull request as ready for review
October 28, 2026 13:48
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
Static review found no implementation defect in the relocation or narrowed headers. git diff --check passed; build, runtime, and CI results were not verified.
Comment on lines
+327
to
+329
| ModuleGint::Gint_dvlocal gint_dvlocal(vr_eff1, nspin, npol); | ||
| gint_dvlocal.cal_dvlocal(); | ||
| cal_dvlocal_R_sparse(*gint_dvlocal.get_pvdpRx(), |
Collaborator
There was a problem hiding this comment.
Non-blocking: Please retain the planned nspin=2, multi-k out_mat_dh comparison as a regression for all three Cartesian components in both spin channels. The existing legacy CSR checks in tests/integrate/validation_tools/props_mat.sh compare only s1 files, so reusing them unchanged would leave s2 unchecked.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
Part of #7599 and #7604. This removes two of the includes from
source_hamiltintosource_lcaoandsource_pw, and one fromsource_pwintosource_lcao. The remainingsource_hamiltones (exx_info_ri.h,cal_pseudo.cpp) overlap open PRs #8176 and #8222 and are left for later.Unit Tests and/or Case Tests for my changes
python3 tools/03_code_analysis/agent_governance_check.py --staged --format text: warnings only, listed under Governance Notes.develop@e5ad53046for every file that reaches one of the changed headers. No file loses a header whose classes, aliases or macros it uses.out_mat_dh 1,nspin 2andgamma_only 0. The two existingout_mat_dhcases (02_NAO_Gamma/scf_out_dh,03_NAO_multik/scf_out_dh_t) usegamma_only 1andnspin 1, so no CI case reaches it. Before marking this ready, I will run a copy of03_NAO_multik/scf_out_dh_twithnspin 2on this branch and ondevelop, and compare the written dH matrices.What's changed?
Two commits, no intended behavior change:
source_hamilt/module_xc/kernels/xc_functional_op.h:source_psi/psi.h→source_base/module_device/types.h. The kernel only needsGetTypeReal(already included fromsource_base/macros.h) and thebase_devicetags.source_hamilt/module_vdw/vdwd2_parameters.h:source_io/module_parameter/parameter.h→input_parameter.h. OnlyInput_parais used; none of its includers touchPARAM.source_pw/module_pwdft/op_pw_exx.h:source_lcao/module_ri/conv_coulomb_pot_k.h→source_hamilt/module_xc/coulomb_config.h. OnlyConv_Coulomb_Pot_K::Coulomb_Typeis used, and it is defined there. The two files that callconv_coulomb_pot_k.hfunctions (ewald_vq.hpp,exx_lri.hpp) include it directly.module_ginttosource_lcao.Gint_dvlocal::cal_dvlocal()integrates ⟨φ|V|∇φ⟩ on the grid into threeHContainers; that part stays.cal_dvlocal_R_sparseanddistribute_pvdpR_sparse, only converted that result into theLCAO_HS_Arraysformat of the dH output. They were whymodule_gintincludedsource_lcao/lcao_hs_arrays.handsource_lcao/module_ri/abfs_vector3_order.h.source_lcao/spar_dh.cpp, next to their only callersparse_format::cal_dH, and take theHContainers from the existingget_pvdpR*()getters.nspin/Grid_Driverparameters are dropped, andtrace_lois read through the publicGint::get_gint_info()instead of the protected member.ModuleGint::cal_dvlocal_R_sparseand theLCAO_HS_Arraysforward declaration ingint_interface.hare removed.veff_dh.cpp, the other user ofGint_dvlocal, only callscal_dvlocal()and the getters and is untouched.Governance Notes
source_hamilt/module_gint,module_xc(kernel header),module_vdw(one header),source_pw/module_pwdft/op_pw_exx.h,source_lcao/spar_dh.cpp. No new files, so no CMake or Makefile changes.PARAM.globalv.nlocalline inspar_dh.cppis the existing call site, reformatted.🤖 Generated with Claude Code