# Determining Fermi energy in density functional theory

How is the Fermi energy determined in DFT calculations and how reliable are the obtained values? I know this is affected by the temperature and whether the material is an insulator/semiconductor/metal, but its not clear to me the actual value is calculated.

• I made a small edit, I dont think there is a need to get different answers for different flavors of DFT. I think that will come naturally as people talk about improvements or problems. Oct 14 '20 at 13:59
• @TristanMaxson alright, makes sense. Oct 14 '20 at 14:00
• @Jack The fermi energy in semiconductors is not well defined in DFT. I do think we have a question somewhere on this but I don't have the time to look for it Jan 15 at 19:29

The Fermi energy is defined implicitly, by requiring that the total of the band occupancies $$f$$ is the number of electrons, $$N$$:

$$\sum_{b=0}^{N_b}f_b=N\tag{1}\label{occ}$$

where $$N_b$$ is the number of bands in the calculation. The occupancy is computed from

$$f_b = f\left(\frac{\epsilon_b-E_F}{\sigma}\right)\tag{2}\label{smearing}$$

where $$f$$ is the smearing function (e.g. Gaussian, Fermi-Dirac, Methfessel-Paxton), $$\sigma$$ is the smearing width, $$\epsilon_b$$ is the band eigenvalue, and $$E_F$$ is the Fermi energy. Only the latter of these is unknown.

A simple approach is to use a bisection search. To start with, we need to bracket the true $$E_F$$; as an example, you could try setting $$E_F$$ to the minimum computed Kohn-Sham eigenvalue, and then to the maximum computed Kohn-Sham eigenvalue. There are much better choices of course, but this is a simple approach and it does work (it just takes more steps than a better choice). Once you've bracketed the real answer, you use a standard bisection search to narrow the bracket until you've determined $$E_F$$ to your desired accuracy.

Note that this method also demonstrates why $$E_F$$ is not well-defined for semiconductors or insulators: any value in the band-gap gives the same occupancies (to within machine precision), apart from a small region where the smearing function has pushed some weight into the band-gap.

Usually, it is assumed that the Fermi energy is the energy of the highest occupied electronic state. It is well defined for metals with partially filled bands. For semiconductors and dielectrics, however, there may be a discrepancy between different software packages, since the Fermi energy can correspond to the center of the bandgap at $$\pu{0 K}$$ in the case of an undoped semiconductor or it can be at the top of the valence band. The former convention pins the Fermi energy to the energy of a state which has the occupation probability of $$0.5$$ even at $$T>\pu{0 K}$$.

• But in metals one has to use fractional occupations. Is it even well defined which orbitals are occupied and which are not? Oct 15 '20 at 23:06

This has been answered very well already but just to add a practical note: For semiconductors, Vasp places the Fermi level at the valence band maximum ($$\pm$$ smearing energy) whereas Quantum Espresso or GPAW place it at the center of the gap. If you use another code then it's advisable to double-check what convention/algorithm it uses.

New contributor
Peter Schindler is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.