Skip to content

refactor(deltaspin): split lambda loop diagnostics and add ScState tests - #8116

Merged
mohanchen merged 3 commits into
deepmodeling:developfrom
hujieting:task3-deltaspin-split
Oct 10, 2026
Merged

mohanchen merged 3 commits into
deepmodeling:developfrom
hujieting:task3-deltaspin-split

Conversation

@hujieting

Copy link
Copy Markdown
Collaborator

Summary

This PR refactors the DeltaSpin module by separating the lambda scanning diagnostics from the main optimization loop and adding unit tests for ScState::cal_escon().

Changes

  • Move run_lambda_linear_scan() from lambda_loop.cpp to the new lambda_loop_diag.cpp.
  • Update CMakeLists.txt to include the new source file.
  • Reduce lambda_loop.cpp from 621 to 405 lines.
  • Add three GoogleTest cases for ScState::cal_escon():
    • CalEsconEmpty
    • CalEsconSingleAtom
    • CalEsconMultiAtom
  • Register the new test target in CMake.

Verification

  • DeltaSpin module compilation and linking succeeded.
  • Existing DeltaSpin tests: 6/6 passed.
  • New GoogleTest cases: 3/3 passed.
  • Git diff check passed.
  • Governance check completed without blocking violations.

Notes

  • No numerical algorithms or physical calculations were modified.
  • No changes from Task 1 or Task 2 are included.
  • The refactoring and unit tests are organized into two separate commits.

@hujieting hujieting added Refactor Refactor ABACUS codes collinear/non-collinear/SOC/delta-spin Issues related to SOC labels Oct 10, 2026
@mohanchen
mohanchen merged commit 15feb6a into deepmodeling:develop Oct 10, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

collinear/non-collinear/SOC/delta-spin Issues related to SOC Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants