Repository navigation
Feature: support EXX PW (screened hybrid) NSCF - #8093
Flying-dragon-boxing wants to merge 22 commits into
Conversation
|
@ABACUS-PR-BOT Review this PR, focus on code quality and user usability. |
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
Static review focused on code quality and user usability at c33bda5: two source-input compatibility issues and four non-blocking suggestions below. Independent source inspection and governance/whitespace checks completed; no builds, runtime tests or CI verification were performed.
| const std::string filename = ModuleIO::filename_output(readin_dir, "wf", "pw", iq, | ||
| exx_source_points_.ik2iktot, inp.nspin, nks, 2, false, false, -1); | ||
| std::ifstream in(filename, std::ios::binary); | ||
| const auto metadata = read_exx_source_header(in); |
There was a problem hiding this comment.
Non-blocking: Please include filename and the source index when annotating a header/grid validation failure. If one of many wfk files is missing or truncated, these new checks report only a generic EXX source error and exit before the existing reader can name the file, leaving the user to locate it manually. A focused diagnostic follow-up is fine.
…e occupations, fix doc suffix - Treat explicit zero exx_fock_alpha as an omitted Fock term in NSCF validation and in SCF/NSCF configuration comparison. - Reject out-of-range source occupations with a diagnostic naming the unsupported smearing, and require smearing_method fixed in the doc. - Add suffix hybrid to the SCF doc snippet so read_file_dir resolves. - Cover the explicit-zero Fock input in the workflow regression and the smearing diagnostic in the occupation unit test.
Drop tests/integrate/tools/test_hybrid_nscf.py and register two cases in tests/01_PW following the get_wf/get_pchg precedent: nscf_hse_same commits the frozen HSE SCF source (binary wavefunctions, eig_occ.txt, charge restart, INPUT.info) and solves the same mesh with more bands plus an explicit zero exx_fock_alpha; nscf_hse_path reads that source through a relative read_file_dir and solves an independent target k-point list. Bands are compared against committed references; both cases are registered for CPU and GPU suites. Update the documentation verification section.
Resolve conflicts: accept upstream deletion of docs/parameters.yaml and docs/advanced/input_files/input-main.md (both are generated in CI from source annotations since deepmodeling#7976; this branch's documentation edits live in the source annotations); keep both prepare_exx_nscf members and RT-TDDFT prepare_init_hamilt in esolver_ks_pw.h; keep both new case registrations in tests/01_PW/CASES_CPU.txt.
Only the MP smearing family can write occupations outside [0, k-point weight]; fixed, gauss, mv and fd stay non-negative and are accepted. Say so in the error message and the hybrid NSCF documentation.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6b9b9efd7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
set_source now takes the source basis, k points and occupations by value handle and keeps them alive itself, instead of storing observer pointers into ESolver members. prepare_exx_nscf becomes a free function with local state only, ESolver_KS_PW drops its four exx_source members, and the staging wavefunction copy is released when the function returns instead of persisting alongside the operator's own copy for the whole NSCF run. The precision-converting constructor now rejects operators with an installed source.
PW screened hybrid NSCF solves independent target K points and additional bands from a frozen SCF source. It reuses existing binary wavefunctions and
eig_occ.txt, with no changes to their formats or existing IO implementations.PW HSE shares LCAO's
exx_singularity_correction limitsdefault;gygipreserves the historical PW correction. Configuration differences and missingINPUT.infowarn and continue. Invalid numerical source data remains an error.Linked Issue
None.
Changes
nspin=1/2,kpar=bndpar=1. ACE, SOC, unscreened hybrid NSCF, forces and stress remain unsupported. PW EXX runs with symmetry disabled; inputsymmetry=0is reset to-1.Verification
Numerical regressions passed at
f7f73560f, usingOMP_NUM_THREADS=1:ctest --test-dir /tmp/abacus-hybrid-nscf-pr-build -V -R '^(MODULE_ESOLVER_pw_hybrid_source|MODULE_IO_read_item_serial)$' python3 tests/integrate/tools/test_hybrid_nscf.py /tmp/abacus-hybrid-nscf-pr-build/abacus_std_para --mpi-ranks 2 --workdir /tmp/hybrid-audit-cpu-regression python3 tests/integrate/tools/test_hybrid_nscf.py /tmp/abacus-hybrid-nscf-pr-gpu-build/abacus_pw_gpu --gpu --workdir /tmp/hybrid-audit-gpu-regressionBoth CPU/CUDA builds, four source-adapter unit cases, six INPUT cases and both workflow scripts passed. CPU/CUDA double results agree at printed precision; CUDA single differs by at most
1.41e-4 eVin the H fixture. Multi-rank CUDA, ROCm and cross-code convergence were not verified.The documentation follow-up rebuilt the CPU executable, checked
-h calculation, and regenerated both INPUT documents. Explicit and automatic target lists gave identical eigenvalues for input symmetry0and-1; the runtime reset warning was confirmed.Governance
Diff checks pass; governance reports no errors. Global references decrease by four; the remaining added reference passes the existing read directory into ESolver. New header includes declare stream/vector interfaces. No exception requested; PR remains draft.