negative electron density for GAPW total electron density, how can it happen?

Skip to first unread message

Oct 16, 2021, 9:46:00 AMOct 16
to cp2k
Dear Dr. Matthias Krack and Professor Hutter,

For the GAPW electron density, when I print the total electron density, there are negative electron density, how does it happen? 

GAPW total electron density = smooth part from planewave + hard atomic part - soft atomic part. The negative electron density should come from the soft atomic part, but since both soft atomic part and hard atomic part uses the same grid (or they donot use the same grid??), so on each grid point, the electron density should be positive, could you please explain the negative electron density? 



Print the total electronic density in the case of a GAPW run. This keyword has only an effect, if PAW atoms are present. The default is to print only the soft part of the electronic density and to ignore the hard part. NOTE: The total density in real space might exhibit unphysical features like spikes due to the finite and thus truncated g vector expansion

Fangyong Yan

Oct 16, 2021, 10:20:56 AMOct 16
I tried a gapw from 

./CP2K/7.1.0/cp2k-7.1.0/tests/QS/regtest-gapw/H2O-gapw-all.inp, only add the "E_DENSITY_CUBE section", and found negative electron density from the file "result.cube". Could you please explain why there is negative electron density in the cube file? Thanks!




    3    0.000000    0.000000    0.000000

   45    0.251963    0.000000    0.000000

   45    0.000000    0.251963    0.000000

   45    0.000000    0.000000    0.251963

    8    0.000000    0.000000    0.000000   -0.123941

    1    0.000000    0.000000   -1.430780    0.983687

    1    0.000000    0.000000    1.430780    0.983687

  0.55551E+05 -0.61415E+04  0.66719E+04 -0.33066E+04  0.35688E+04 -0.23749E+04

  0.23718E+04 -0.18855E+04  0.17973E+04 -0.15715E+04  0.14811E+04 -0.13583E+04

  0.12870E+04 -0.12124E+04  0.11604E+04 -0.11127E+04  0.10765E+04 -0.10461E+04

  0.10230E+04 -0.10052E+04  0.99304E+03 -0.98579E+03  0.98343E+03 -0.98586E+03

  0.99314E+03 -0.10055E+04  0.10232E+04 -0.10465E+04  0.10767E+04 -0.11135E+04

  0.11605E+04 -0.12139E+04  0.12867E+04 -0.13615E+04  0.14787E+04 -0.15799E+04

  0.17875E+04 -0.19082E+04  0.23469E+04 -0.24114E+04  0.35686E+04 -0.32541E+04

  0.69140E+04 -0.60820E+04  0.53954E+05

  0.10368E+05  0.83448E+03  0.17183E+04  0.20744E+03  0.78478E+03 -0.72663E+02

  0.40657E+03 -0.15777E+03  0.25373E+03 -0.16793E+03  0.18995E+03 -0.15672E+03

  0.15869E+03 -0.14385E+03  0.14086E+03 -0.13338E+03  0.12997E+03 -0.12585E+03

  0.12331E+03 -0.12108E+03  0.11967E+03 -0.11878E+03  0.11851E+03 -0.11881E+03

  0.11969E+03 -0.12117E+03  0.12334E+03 -0.12607E+03  0.12993E+03 -0.13386E+03

  0.14057E+03 -0.14492E+03  0.15762E+03 -0.15947E+03  0.18620E+03 -0.17620E+03

  0.24058E+03 -0.18270E+03  0.37093E+03 -0.12134E+03  0.74876E+03  0.21976E+03

  0.18608E+04  0.96817E+03  0.10165E+05

  0.38519E+03  0.13257E+04  0.80997E+03  0.68951E+03  0.34302E+03  0.29382E+03

  0.10720E+03  0.11634E+03  0.14240E+02  0.52706E+02 -0.11783E+02  0.31739E+02

 -0.18038E+02  0.23679E+02 -0.18960E+02  0.20166E+02 -0.18465E+02  0.18478E+02

 -0.17803E+02  0.17621E+02 -0.17348E+02  0.17246E+02 -0.17196E+02  0.17240E+02

 -0.17365E+02  0.17590E+02 -0.17865E+02  0.18369E+02 -0.18664E+02  0.19833E+02

 -0.19536E+02  0.22706E+02 -0.19745E+02  0.28715E+02 -0.17318E+02  0.42439E+02

 -0.50561E+01  0.80997E+02  0.47041E+02  0.20501E+03  0.23665E+03  0.59612E+03

The added E_DENSITY_CUBE section for H2O-gapw-all.inp,




    &END XC



         STRIDE 1 1 1

         FILENAME =result.cube

         TOTAL_DENSITY .true.






      ABC 6.0 6.0 6.0



    O   0.000000    0.000000   -0.065587

    H   0.000000   -0.757136    0.520545

    H   0.000000    0.757136    0.520545


You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Fangyong Yan

Oct 16, 2021, 3:02:44 PMOct 16
OK, the negative electron density is disturbing, however, I figure out how to get it right: use the wavefunction to get the electron density, and it works. 

Reply all
Reply to author
0 new messages