Repository navigation
Conversation
3.11 only writes wfk*_pw.txt for esolver_type=ksdft: ESolver_SDFT_PW overrides
iter_finish() and never reaches ModuleIO::write_wfc_pw, so SDFT/MDFT runs cannot
be inspected in real space at all.
Reuse out_wfc_pw as the switch and dump, from after_scf(), the deterministic
(Kohn-Sham) orbitals, the raw stochastic orbitals, the ones orthogonalized
against the KS subspace, and the occupation-filtered ones sqrt(f(H))|chi> that
enter the charge density. The writer reuses the wfk{k}_pw.txt text layout, so
the existing post-processing (FFT to real space) works unchanged.
The Makefile-based build (source/Makefile.Objects) lists its objects explicitly, so the new writer has to be registered there as well; otherwise `make -f ../Makefile` fails with an undefined reference to ModuleIO::write_wfc_pw_txt_selected().
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.Linked Issue
Part 1/3 of the SDFT work reported in #8379 and #8380. This part is a standalone feature (it makes
the SDFT/MDFT wavefunctions visible) and does not fix those two issues; the DOS and entropy fixes
are in part 2/3 (#8382).
Unit Tests and/or Case Tests for my changes
abacus -h out_wfc_pwmpirun -np 4 abacusontests/06_SDFT/01_PW_SDFT_10S_M(Al,esolver_type sdft) without_wfc_pw 1esolver_type ksdft,nbands 12,out_wfc_pw 1, thendiffof the headers ofwfk1_pw.txtandwfc_sto_k1_pw.txttests/06_SDFTthroughtests/integrate/Autotest.sh(24 cases, 116 checks)cmake --build --target abacus_pw_paraon top of the currentdevelop-h out_wfc_pwreports the new availability(
basis_type==pw and (esolver_type==ksdft or esolver_type==sdft))wfc_sto_k1_pw.txtandwfc_shchi_k1_pw.txt; every coefficient of the rawstochastic orbital has
|c| = 1/sqrt(nbands_sto) = 0.316228<Reciprocal Lattice Vector>,<G vectors>and< Band N >layout of our files isidentical to the
wfk1_pw.txtthat the KSDFT solver writes for the same celltests/06_SDFT: 116/116 checks passserialiser whose only meaningful verification is the byte layout compared against the KSDFT output
of the same cell, which the case test above checks.
What's changed?
out_wfc_pwis accepted foresolver_type=sdftbut produced nothing:ESolver_SDFT_PWoverridesiter_finish()and never reachesModuleIO::write_wfc_pw, so SDFT/MDFT runs could not be inspectedin real space at all.
ESolver_SDFT_PW::after_scf()now dumps, whenout_wfc_pw != 0, four sets of orbitals with theexisting
wfk{k}_pw.txttext layout (so the same post-processing works unchanged):OUT.*/wfc_ks_k*_pw.txt|chi>->OUT.*/wfc_sto_k*_pw.txtOUT.*/wfc_chiortho_k*_pw.txtsqrt(f(H))|chi~>that enter the charge density->
OUT.*/wfc_shchi_k*_pw.txtWith
bndpar > 1every band group writes its own files (bg<i>_suffix) and a warning is printed.No new INPUT keyword is introduced.
Governance Notes
out_wfc_pwparameter are updated in
source_io/module_parameter/read_inp_out.cpp.docs/parameters.yamlanddocs/advanced/input_files/input-main.mdare generated from thoseInput_Itemregistrations, sothere is no documentation update required here.
ESolver_SDFT_PW::after_scf(); the KSDFT path is untouched.The writer lives in a new module (
module_stodft/sto_wfc_out.{h,cpp}) that takes everything throughModuleIO::WfcDumpContext/WfcDumpSpecand has no global-state dependency.Global dependency budget(+4 references inoutput_wfc_sdft()), see below.Governance Exception
and the band-parallel warning goes to the running log. In this version
ESolver_SDFT_PWhas noaccessor for them, so the new function reads
GlobalV::ofs_running,GlobalV::MY_POOL,GlobalV::MY_BNDGROUPandPARAM.globalv.global_out_dironce per run (net +4).source/source_esolver/esolver_sdft_pw.cpp, functionoutput_wfc_sdft()only.module_stodft/sto_wfc_out.*adds no global reference.immediately unless
out_wfc_pw != 0andistep == 0.ESolver::after_scf()/ModuleIOinterfaces, a much larger cross-layer change than the feature.Driverlevel, pass it through
after_scf(), and delete the global reads.