Skip to content

eig_occ.txt: Occupation numbers below 1e-15 should be printed as 0 instead of tiny values (machine precision noise) #7243

@xinchenhou

Description

@xinchenhou

Describe the bug

In the eig_occ.txt output file, electronic occupation numbers that are effectively zero (due to machine precision) are printed as very small numbers like 1e-27, 1e-58, etc. These values have no physical meaning and are just numerical noise from the solver. They make the output file harder to read and parse automatically.

Expected behavior

Maybe we can add a small threshold (e.g., 1.0e-15) when writing occupation numbers to eig_occ.txt. For example, if occupation < 1e-15, print 0.0 instead of the tiny numerical value.

To Reproduce

No response

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugsBugs that only solvable with sufficient knowledge of DFT

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions