Skip to content

There are many negative values in the results of partial charge density for ABACUS #6108

Closed

Description

@Lweiweij

Describe the bug

When I use the ABACUS to calculate the partial charge density, I find that there are many negative values in the results, regardless of SPIN1 or SPIN2. Then, I set KPT from 1 3 3 to 1 6 6, the results of SPIN1 become all positive, and those of SPIN2 always have positive and negative values. I want to know how to get correct results with no negative value. Thanks for your help!

Image

Activity

  1. self-assigned this
    on Apr 3, 2025
  2. mohanchen commented on Apr 8, 2025

    @mohanchen
    Collaborator

    Thanks for pointing this out, we will try to fix it soon.

  3. mohanchen commented on Mar 21, 2026

    @mohanchen
    Collaborator

    Gemini said:

    In the context of Density Functional Theory (DFT), the short answer is: Physically, no; numerically, sometimes.

    Here is the breakdown of why this happens and what it means for your calculations:

    The Physical Reality
    From a strictly physical and quantum mechanical standpoint, electron density cannot be negative. It represents the probability density of finding an electron at a specific point in space. Since this density is derived from the square of the absolute value of the wavefunction, it is mathematically impossible for a real physical system to have a negative density. A negative value would imply a "negative probability," which has no meaning in physics.

    Why You Might See Negative Values
    If you encounter negative values in your output files or visualization software, it is usually due to one of the following technical reasons:

    Mathematical Artifacts (Fourier Transforms): Most DFT codes use plane waves to represent electron density. When you try to represent a very sharp change in density (like the area near an atomic nucleus) with a finite number of plane waves, you get "ringing" or oscillations. This is known as the Gibbs Phenomenon, which can cause the density to dip slightly below zero in the "troughs" of the wave.

    Pseudopotentials: Many calculations use pseudopotentials to smooth out the core electron region. If the pseudopotential is not perfectly "soft" or if the energy cutoff is too low, the numerical interpolation can result in tiny negative values.

    Difference Plots: If you are looking at a "Charge Density Difference" map (where you subtract the density of isolated atoms from the total density of a molecule), negative values are expected. In this specific context, a negative value does not mean "negative density"; it represents a depletion of electrons in that area compared to the reference state.

    When Should You Worry?
    Negligible Values: If the negative values are extremely small (e.g., -1e-10), it is simply a floating-point precision or numerical noise issue. You can safely ignore it.
    Significant Negative Values: If the negative values are large, it usually indicates that your Energy Cutoff (ENCUT) is too low or your grid is too coarse. This means your basis set is not sufficient to describe the electron distribution accurately.

  4. mohanchen commented on Mar 21, 2026

    @mohanchen
    Collaborator

    I will transfer this to discussion.

  5. locked and limited conversation to collaborators on Mar 21, 2026
  6. converted this issue into a discussion #7087 on Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

QuestionsRaise your quesiton! We will answer it.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions