Calculating band gap in CP2K

Skip to first unread message

Sep 22, 2021, 11:38:51 PMSep 22
to cp2k

I am trying to calculate band gap in CP2K for an electrolyte.
I have the PDOS section in my input script and I get .pdos files for each atom type I have in my system. Then I use Tiziano's script ( to get the PDOS for each element type.

On the internet, I found two ways to find the band gap.
i) Look into one of the .pdos files generated by CP2K and find the energies where the occupation number changes from 2 to 0. Subtract the two energies and convert the result from Hartree to eV.
For example, in the .pdos file I have the following values of energies where the occupation number of the s orbital changes from 2 to 0.

# Projected DOS for atomic kind F5 at iteration step i = 0, E(Fermi) =    -0.047273 a.u.
#     MO Eigenvalue [a.u.]      Occupation                 s                 p                 d
     623         -0.047273        2.000000        0.00025286        0.00408688        0.00012177
     624          0.133668        0.000000        0.00642493        0.02456380        0.00249863
So band gap = 0.133668+ 0.047273 = 0.180941 Ha

ii) Use Tiziano's script for each of the .pdos files, add the pdos values of all the element types (keeping the corresponding energy value same) to get TDOS.
Plot E vs TDOS, and look for the band where TDOS stays at zero.

I am not sure which method to choose to get band gap and I am getting slightly different answers from the two methods. Also, in case of TDOS, how to choose the tolerance below which I can say that the TDOS is zero, to define the band gap? Currently I am using the criterion that all values less than 0.05 % of the maximum will be considered as zero.


Dragon Don

Oct 19, 2021, 7:31:46 AMOct 19
to cp2k
Actually, I have the same question, is there anyone who can give us some suggestions? 

Michiel van Setten

Oct 19, 2021, 8:45:28 AMOct 19

Please consider the difference between the direct and indirect bandgap. What are you looking for? Method one will give you direct ones method two gives indirect gaps as well.

From: <> on behalf of Dragon Don <>
Sent: Tuesday, October 19, 2021 1:31:46 PM
To: cp2k <>
Subject: [CP2K:16089] Re: Calculating band gap in CP2K
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

Krack Matthias (PSI)

Oct 19, 2021, 9:54:25 AMOct 19



I would like to note that, in my opinion, none of the methods listed above is the straightforward way to get Fermi energy and/or band gap from a CP2K run.

The flexible print section for that is the following which works with and without k points. For large systems the MO range can be restricted. The band gap is only printed when the LUMO energy has been calculated which is not the default for instance with OT. In such cases, the keyword ADDED_MOS or an MO range including the LUMO has to be specified.





   &MO on


    MO_RANGE 4 5 # e.g. 4 is the HOMO and 5 is the LUMO


    QS_SCF 0 # request printout only after SCF convergence (default is 1, i.e. after each SCF iteration step)


   &END MO

   . . .


 . . .


. . .






Paul Scherrer Institut
Dr. Matthias Krack
Forschungsstrasse 111
5232 Villigen PSI

Reply all
Reply to author
0 new messages