Skip to content

fix(nupdown): only set two_fermi when nupdown is non-zero#7371

Open
dyzheng wants to merge 1 commit into
deepmodeling:developfrom
dyzheng:fix/nupdown-zero-two-fermi
Open

fix(nupdown): only set two_fermi when nupdown is non-zero#7371
dyzheng wants to merge 1 commit into
deepmodeling:developfrom
dyzheng:fix/nupdown-zero-two-fermi

Conversation

@dyzheng
Copy link
Copy Markdown
Collaborator

@dyzheng dyzheng commented May 21, 2026

When nupdown=0.0 is explicitly set in INPUT, it should behave the same as not setting nupdown at all. Previously, reading any nupdown value would unconditionally set two_fermi=true, causing different code paths even when nupdown=0.0.

Now two_fermi is only set to true when nupdown != 0.0, making nupdown=0 equivalent to not specifying the parameter.

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 #7299

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 ...

When nupdown=0.0 is explicitly set in INPUT, it should behave the same
as not setting nupdown at all. Previously, reading any nupdown value
would unconditionally set two_fermi=true, causing different code paths
even when nupdown=0.0.

Now two_fermi is only set to true when nupdown != 0.0, making nupdown=0
equivalent to not specifying the parameter.
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.

Possible inconsistent behavior of nupdown = 0.0 and omitted nupdown in nspin=2 FM calculation

1 participant