Test: Add <phi|r_a|p_{l,m}> snap_psibeta unit test#7587
Open
AsTonyshment wants to merge 2 commits into
Open
Conversation
mohanchen
approved these changes
Jul 6, 2026
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.
Linked Issue
No linked issue; this PR is a focused RT-TDDFT unit-test and numerical-convention cleanup for the velocity-gauge beta-projector snapshot path.
Unit Tests and/or Case Tests for my changes
This PR extends the existing
MODULE_LCAO_tddft_snap_psibeta_half_testGoogleTest target to cover real Ti orbital and UPF beta-projector data. The test comparessnap_psibeta_half_tddftat zero vector potential against the existingcal_r_overlap_R::get_psi_r_betatwo-center reference path for both projector overlaps and Cartesian position moments.Focused check:
ctest --test-dir build -R '^MODULE_LCAO_tddft_snap_psibeta_half_test$' --output-on-failureExact Verification Performed
What's changed?
snap_psibeta_half_tddft_testwith real Ti orbital data and Ti UPF beta projectors.nlm[0] = <phi|p_{l,m}>andnlm[1..3] = <phi|r_a|p_{l,m}>.r * p_l(r).p_l(r) * r^2 drvolume-integral contribution from storedr * p_l(r)data.cal_r_overlap_Rorbital-index maps robust when a test-builtUnitCellhas more orbitals thanPARAM.globalv.nlocal.Governance Checklist
GlobalV/GlobalC/PARAMadded=10, removed=18, net_delta=-8 in the Agent Governance report). The flaggedcal_r_overlap_R.cpplines are migration-neutral formatting/partial-cleanup lines in a legacy writer/reference path that already depends onPARAM.globalvfor matrix dimensions, output directories, spin polarization, and rank-gated sparse output.cal_r_overlap_R.hinclude is not a new logical dependency; the header already neededsource_lcao/module_ri/abfs-vector3_order.hfor the publicstd::set<Abfs::Vector3_Order<int>>signature, and the diff only moves it within the include block.MODULE_LCAO_tddft_snap_psibeta_half_testare listed insource/source_lcao/module_rt/test/CMakeLists.txt.@coderabbitai reviewif automatic review does not start.INPUT Parameter Changes
docs/parameters.yamlupdated: no.docs/advanced/input_files/input-main.mdupdated: no.Core Module Impact
source_lcao/module_rt; test-only reference coverage throughsource_io/module_hs/cal_r_overlap_R.r * p_l(r). The main behavioral risk is numerical drift in beta-projector overlaps, which is covered by comparison against the existing two-center reference path.Governance Exception
cal_r_overlap_Ris a legacy sparse-output/reference helper that still readsPARAM.globalv,PARAM.inp, andGlobalV::DRANKdirectly for matrix dimensions, output paths, spin layout, and root-rank IO. This PR reduces the total global-reference budget and does not introduce a new ownership pattern; it only keeps the existing path usable as a two-center reference for the focused RT-TDDFT test.source/source_io/module_hs/cal_r_overlap_R.cppandsource/source_io/module_hs/cal_r_overlap_R.h.cal_r_overlap_R, sparse matrix output, and call sites that is outside this focused test/numerical-fix PR.cal_r_overlap_Rto explicit context inputs for dimensions, spin polarization, output directories, and rank-gated IO in a dedicated cleanup PR.