Skip to content

Feature: use new format of CSR file for out_mat_hs2 and out_mat_ds, out_mat_t, out_mat_r, out_mat_xc2#6991

Open
dyzheng wants to merge 27 commits intodeepmodeling:developfrom
dyzheng:out_mat_hs2_refactor
Open

Feature: use new format of CSR file for out_mat_hs2 and out_mat_ds, out_mat_t, out_mat_r, out_mat_xc2#6991
dyzheng wants to merge 27 commits intodeepmodeling:developfrom
dyzheng:out_mat_hs2_refactor

Conversation

@dyzheng
Copy link
Copy Markdown
Collaborator

@dyzheng dyzheng commented Mar 2, 2026

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

@mohanchen mohanchen requested a review from zhubonan March 4, 2026 04:58
@mohanchen mohanchen added Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes Input&Output Suitable for coders without knowing too many DFT details labels Mar 4, 2026
@mohanchen mohanchen requested a review from ErjieWu March 4, 2026 05:00
Copy link
Copy Markdown
Collaborator

@zhubonan zhubonan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the parameter description update to the read_input_item_oputput.cpp source code file regenerate parameters.yaml and input-main.md. See also: https://abacus.deepmodeling.com/en/latest/CONTRIBUTING.html#how-to-regenerate

@dyzheng dyzheng force-pushed the out_mat_hs2_refactor branch from be54bb1 to f7cce86 Compare March 4, 2026 07:50
@ErjieWu
Copy link
Copy Markdown
Collaborator

ErjieWu commented Mar 5, 2026

Format of reference files in integration tests should be updated as well. LGTM.

@dyzheng dyzheng force-pushed the out_mat_hs2_refactor branch from f7cce86 to 460ebf6 Compare March 9, 2026 04:23
@dyzheng dyzheng requested review from ErjieWu and zhubonan March 9, 2026 09:02
Copy link
Copy Markdown
Collaborator

@ErjieWu ErjieWu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

dyzheng and others added 9 commits March 16, 2026 21:45
Enable the previously commented-out H(R) matrix comparison in
catch_properties.sh and regenerate all CSR reference files for
scf_out_hsr, scf_out_hsr_spin4, and nscf_out_hsr_tr_rr to match
the new CSR output format. Add missing hrs1_nao.csr.ref for nscf test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The CI build uses C++11 where std::make_unique is not available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dyzheng dyzheng force-pushed the out_mat_hs2_refactor branch from 72d9bc0 to e779d98 Compare March 16, 2026 14:16
@dyzheng dyzheng requested a review from mohanchen March 17, 2026 10:46
dyzheng and others added 4 commits March 30, 2026 12:23
…r handling

- Add write-read round-trip consistency test for Output_HContainer/Read_HContainer
- Add sparse threshold filtering, precision parameter, and nspin=2 tests
- Add clear error message when HR files missing for init_chg=hr
- Update CMakeLists.txt with new test targets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When all matrix elements of an R-vector are below sparse_threshold,
Output_HContainer skipped writing that R-block entirely, but the
file header still declared the full nR count from size_R_loop().
This caused csrFileReader to hit EOF when reading HR files with
sparse R-blocks (e.g. init_chg=hr), while DM files were unaffected
because all R-vectors had nonzero elements.

Also made csr_reader more robust by skipping comment/empty lines
instead of hardcoding 9 readLine() calls for the CSR format block.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve conflicts in write_HS_R.cpp and write_HS_sparse.cpp by keeping
the refactored versions that removed the old output_HSR and save_HSR_sparse
functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dyzheng dyzheng requested a review from mohanchen March 30, 2026 06:08
@dyzheng dyzheng requested a review from mohanchen March 31, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants