Skip to content

Conversation

@sunliang98
Copy link
Collaborator

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

Key changes:

For nspin=4, spin-decomposed ELF components lack a rigorous, standard definition. Outputting them can cause user confusion. This pull request updates the handling and output of the ELF for noncollinear spin in both the documentation and the codebase. The changes ensure that only the total ELF is calculated and output for nspin = 4, rather than separate components for each spin channel. Additionally, new tests are added to verify this behavior.

ELF Output Logic and Calculation

  • Updated the ELF output logic in write_elf.cpp so that for nspin = 4, only the total ELF is calculated and written to elf.cube, instead of outputting separate files for each spin component. The calculation uses only the total charge density and kinetic energy density, and notes the absence of gauge invariance corrections.
  • Removed the previous restriction in read_input_item_output.cpp that prevented ELF output for nspin = 4, allowing ELF calculation in this case.

Documentation Updates

  • Updated the documentation in input-main.md to reflect the new ELF file naming convention (elf.cube for nspin = 1 and nspin = 4, elf1.cube/elf2.cube for nspin = 2), and clarified the ELF calculation for the noncollinear case.

Testing

  • Added a new test case 63_NO_KP_out_elf for nspin = 4 ELF output, including input files, reference results, and test registration.

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

@sunliang98 sunliang98 requested a review from mohanchen January 27, 2026 09:00
@mohanchen mohanchen added Feature Discussed The features will be discussed first but will not be implemented soon Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes labels Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Discussed The features will be discussed first but will not be implemented soon 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.

3 participants