Skip to content

fix: nspin = 2 for init_chg=dm#6975

Merged
mohanchen merged 6 commits intodeepmodeling:developfrom
dyzheng:nspin2-dm
Feb 26, 2026
Merged

fix: nspin = 2 for init_chg=dm#6975
mohanchen merged 6 commits intodeepmodeling:developfrom
dyzheng:nspin2-dm

Conversation

@dyzheng
Copy link
Collaborator

@dyzheng dyzheng commented Feb 22, 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 #6974

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 added the Features Needed The features are indeed needed, and developers should have sophisticated knowledge label Feb 24, 2026
@mohanchen mohanchen self-requested a review February 24, 2026 08:27
…_chg=hr tests

The CSR file format was updated (commit 9c1a061) with spin info, ucell
data, and CSR comment block headers, but the unit test still wrote the old
format, causing parse failures. Rewrote write_test_csr to use write_dmr_csr
so the test always produces the current format. Added HR read tests for
nspin=1 and nspin=2 covering the init_chg=hr code path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mohanchen mohanchen added the Refactor Refactor ABACUS codes label Feb 25, 2026
Use POSIX mkdir() from <sys/stat.h> instead of system("mkdir -p")
for C++11 compatibility, and remove system("rm -rf") cleanup calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dyzheng dyzheng requested a review from mohanchen February 26, 2026 07:51
Copy link
Collaborator

@mohanchen mohanchen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@mohanchen mohanchen left a comment

Choose a reason for hiding this comment

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

LGTM

@mohanchen mohanchen merged commit 10ba137 into deepmodeling:develop Feb 26, 2026
15 checks passed
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 Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We need init_chg = dm for nspin =2 case

2 participants