[QE-users] Calculating the total (valence + core) charge

Alberto Otero de la Roza aoterodelaroza at gmail.com
Tue Oct 2 12:04:42 CEST 2018


Hi Jan,

> What you say makes sense, but doesn't it render the plot_num=21 feature kind
> of useless then?

Not really: The all-electron density is very much correct on the grid
points. The only problem is that the you are representing a region
with umpteen electrons with one or two grid points, so the quadrature
error is lousy. It still has uses, though. For instance, if you want
to plot isosurfaces of the density or compare it to experimental data
or other all-electron calculations away from the nuclei or maybe find
Bader basins.

> BTW, using the plot_num=0 for the pseudo charge density also doesn't give me
> reasonable results, possibly for the same reason. I guess I need finer grids
> even for that case?

No, that should come out correct because that quantity is what is
internally normalized by QE to the number of valence electrons. Any
disagreement with the correct number of valence electrons comes from
the limited precision in a cube file (if you are using one) and you
should get ~6 significant digits correct. I recommend checking the
calculations. It should be the sum of all the cube points:

awk 'NF==6{a=1}a{sum+=($1+$2+$3+$4+$5+$6)}END{printf "%.10f\n",sum}' bleh.cube

times the cell volume in bohr^3 (i.e. what the QE output says) divided
by the number of grid points (the product of the first field in lines
4, 5, and 6 of the cube file).

Best,

Alberto


More information about the users mailing list