# Total number of electrons from DOS and PDOS - what's the theory behind it?

Let say we need to determine the total number of electrons of an FCC material (let say, two silicon atoms in the unit cell, using numerical/mathematical approach.

How can we get the total number of electrons using 'spherical integration' of density of states or partial density of states? If there's equations or diagrams that could help explain this, that would be welcome too.

(I have quantum espresso DOS and PDOS outputs. The answer can be based on this, or can be based on purely numerical/mathematical approach)

If you integrate the DOS, $$g(E)$$, up to the Fermi-level, $$E_F$$, the area should be very close to the number of electrons, $$N$$; i.e.

$$N \approx \int_{-\infty}^{E_f} g(E) dE \tag{1}.$$

You'll have to be careful what the normalisation is for the DOS, but this will only affect the definition of $$N$$, e.g. whether it's the number of electrons per unit cell, or per unit volume, or per atom etc.

The reason the integral is usually only "close" to the number of electrons, $$N$$, is because it is standard practice to apply a smearing function in the calculation to better approximate the integral over the Brillouin zone. If you include this smearing function, $$f(E-E_F)$$, in the integrand and integrate over all energies, then the result should be exact:

$$N = \int_{-\infty}^{\infty} f(E-E_F) g(E) dE \tag{2}.$$

This relationship is actually the definition of the Fermi energy $$E_F$$, so it really should be reliable. If you find that you don't get the correct answer, you should check that you are using the same broadening function and width - e.g. some programs ask for the smearing width as the standard deviation of the broadening, and some as the full-width half-maximum (FWHM).

There may also be some small discrepancies in the electron count if you use a Fermi energy calculated on one k-point grid, and then do the integral on the DOS from a different k-point grid. In practice, this usually arises when the Fermi energy is from the self-consistent (SCF) ground state calculation, and the DOS is calculated from a non-self-consistent calculation performed on a finer k-point grid.

• Thanks Dr. Hasnip. In CASTEP, does N is the number of electrons per unit cell, or per unit volume, or per atom please?
– Sha
Commented Nov 16, 2022 at 4:44
• Thank you very much @Phil Hasnip. This is really very helpful information. Could you give idea how can we get the total number of electrons from a 3D charge density file possibly with spherical integration (XSF or cube file, obtained from Quantum Espresso)? I mean any theoretical idea and it's python procedure could be very helpful.
– Sak
Commented Nov 17, 2022 at 6:23
• @Sak if you plot the total PDOS, it will sum up to the electrons of both; be careful though, if you plot the atom's PDOS contributions as separate curves on the same plot, they may well lie on top of each other so perfectly that it won't be clear visually that you have to integrate two curves. Commented Dec 9, 2022 at 0:23
• Thanks @PhilHasnip. Just to make clarification for myself, does total PDOS mean the DOS (that is the integrated DOS)? and the atomic DOS means the PDOS (partial density of states)?
– Sak
Commented Dec 9, 2022 at 3:39
• @Sak no, total PDOS means that you add up all the partial densities of states from all the orbitals on all the atoms. If you integrate that, it will typically add up to 97-100% of the total charge, because there is usually some charge which cannot be represented in the sum over atomic orbitals (called "spilling"). Commented Dec 9, 2022 at 11:46