Skip to content

Feat/issue 7726 dftu pw nspin fixes - #7744

Open
dyzheng wants to merge 3 commits into
deepmodeling:developfrom
dyzheng:feat/issue-7726-dftu-pw-nspin-fixes
Open

Feat/issue 7726 dftu pw nspin fixes#7744
dyzheng wants to merge 3 commits into
deepmodeling:developfrom
dyzheng:feat/issue-7726-dftu-pw-nspin-fixes

Conversation

@dyzheng

@dyzheng dyzheng commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

Fix #

Unit Tests and/or Case Tests for my changes

  • Commands run:
  • Result summary:
  • Checks not run, with reason:

What's changed?

  • Example: brief summary of the user-visible or developer-facing change.

Governance Notes

  • INPUT/docs changes:
  • Core module impact:
  • Exceptions requested:

dyzheng added 3 commits August 1, 2026 21:03
…r nspin=1

In cal_occ_pw():
- Swap the imaginary signs in the Pauli-to-spin conversion for nspin=4:
  index[1] (spin down-up): -i*vu_tmp[2] -> +i*vu_tmp[2]
  index[2] (spin up-down): +i*vu_tmp[2] -> -i*vu_tmp[2]
  The DFT+U vu array convention requires opposite sign from deeq_nc.

- Fix weight_eu for nspin=1: 0.25 -> 1.0
  nspin=1 has single occupancy, not the Pauli double-counting factor.

Verified with tests/17_DS_DFTU/08 and 09:
  08: -6792.33351671617 (ref -6792.33351670950, diff 6.7e-9 eV)
  09: -6364.26587638707 (ref -6364.26587639017, diff 3.1e-9 eV)
815_PW_DFTU_S2_Z  — nspin=2 DFT+U, matches ref -6792.33351671614
816_PW_DFTU_S4_XY — nspin=4 DFT+U, matches ref -6364.26587638708
@dyzheng
dyzheng requested a review from mohanchen August 1, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant