MatSQ Blog > Quantum-espresso

#26 Correction of Exchange-Correlation Error (3): Hybrid Functional

2019-12-05 16:45:14

In this weekly tip, following the previous weekly tips #24 DFT+U and #25 van der Waals correction, we will learn how to correct GGA errors using hybrid functional.


1. Hybrid Functional

The methods DFT+U and van der Waals correction, which we learned from the previous weekly tip, correct the correlation part of exchange-correlation potential. Meanwhile, the hybrid functional correct the exchange part.

The hybrid functional, such as PBE0, B3LYP, and HSE, was known as the high-accuracy correction method of exchange-correlation energy [1]. It has higher accuracy than the GGA method as it mixes the Fock exchange to the exchange-correlation functional of GGA when describing electronic structure [2]. In this time, the exchange energy approximation of GGA and HF is mixed in a different method according to the hybrid functional method. Unlike the GGA, the hybrid functional has a long-range interaction effect character because the Fock exchange describes the part of the long-range interaction.

The hybrid functional corrects the total energy of materials and serves useful in obtaining the correct electronic structure. In particular, it can almost solve the bandgap underestimation, which is the fundamental error of GGA [3]. GGA always estimates a smaller bandgap than it actually is, while Hartree-Fock always estimates larger than it actually is. Therefore, the hybrid functional that mixes them at an optimal ratio can effectively reduce the bandgap estimation error.


However, the hybrid functional consume a lot of calculation resource than GGA.

In this weekly tip, we will find out the difference between GGA and hybrid functional regarding electronic structure and calculation time through the density of states (DOS).


2. Setting Hybrid Functional in MatSQ

The keyword for hybrid functional can be set at “Scripting option: General.” To use a specific hybrid functional, you should write the desired name of hybrid functional at the “DFT Functional” option in &SYSTEM Namelist. The list of available functional can be retrieved from the Documentation.


3. Precautions When Using Hybrid Functional

1) Input script settings

The calculation with hybrid functional is so complicated that it is not supported in the template mode. Therefore, you should add relevant keywords to the input script in the Manual mode for further calculation settings.

In GGA calculations, the k-point is set to obtain an electronic structure with adequate accuracy while considering efficiency. However, calculation resources are consumed excessively if the GGA k-point setting is applied to exchange energy calculation. Therefore, we should separately set the number of crystal momentum q, which is used for only Hartree-exchange calculation, by adding nqx1, nqx2, and nqx3 keywords under &SYSTEM.


It consumes extremely high memory in hybrid functional DFT to calculate the exchange energy, unlike the general GGA calculation. The memory size of the MatSQ server is set according to the number of cores and the node type option. Therefore, it is recommended to set the 'PPN: 48', 'Node type: High-memory' for hybrid functional calculation. The total memory size is displayed side to the PPN option.

Or you can use the multi-node options. MatSQ provides a server with 48 cores per node. Thus, you should increase the number of nodes if you want to use more than 48 cores. To activate the multi-node options, please contact us by referring to the [Docs] Inquiry section.
The MatSQ credit is consumed in proportion to the number of cores. Therefore, more credit is consumed when using two more nodes than using one node, even it takes the same time. The total consumed amount of the credits according to the number of cores can calculate using the [Docs] Credit Calculator.


2) Optimization and NSCF calculation

When you start to optimize the structure using the hybrid functional using the Quantum Espresso 6.4, the job.stdout file will display this error message.

        forrtl: severe (174): SIGSEGV, segmentation fault occurred


And also, if you start the calculation with the same input using the Quantum Espresso 6.7, you'll see this error message.
     Error in routine setup (1):
     forces for hybrid functionals + US/PAW not implemented


It means that we couldn't perform the structural optimization calculation using the USPP and PAW type pseudopotential. To avoid them, we should use the NC type pseudopotential.

However, the following message will be shown when you performing the DOS calculation using the NC type pseudopotential.
     Error in routine do_projwfc (1):
     Cannot project on zero atomic wavefunctions!


This message is shown because the default NC pseudopotential provided by Materials Square cannot be used for DOS calculation, because it doesn't have atomic wavefunctions information.

And also, the nscf calculation using hybrid functional is not implemented in the Quantum Espresso.


Therefore, the HSE example of this weekly tip was performed as SCF using the structure optimized by USPP PBE and a large k-point grid.



4. Calculation Results

We can find out the change of electronic structure when using the hybrid functional through the DOS of the silicon primitive unit cell.

👉 Check the calculation result

Based on the DOS graph obtained by three functional, the entire shape of the DOS graph did not show a significant change. However, the bandgap was improved.

Check the table below for a summary of the bandgap data, calculation time, and the credits used to obtain that data.

Functional Bandgap Total Calculation Time Total Consumed Credits
LDA 0.4449 00:09:49 $1.43
PBE 0.6106 00:09:31 $1.33
HSE 1.564 01:13:23 $14.15


According to the HSE results, we found out that the hybrid functional can solve the bandgap underestimation problems of PBE and LDA. However, the calculation time increased more than 10 times. In GGA, the calculation time is generally proportional to three squares of the number of atoms, but the calculation time might be increased by more than five squares when using the hybrid functional.

For example, the silicon primitive unit cell, which is the calculation model used in this example, consisted of just two atoms. However, it consumed over 1 hour in obtaining the results when using the hybrid functional.

Therefore, you need to be careful of the consumption of computing resources while hybrid provides better results.

We checked the changed electronic structure when using the hybrid functional as well as the precautions of calculation and increased calculation time. Moreover, the hybrid functional DFT can provide improved results, but it needs to be careful because of the high consumption of computing resources.

In MatSQ, you can apply the hybrid functional at the simple structure to obtain an improved DFT result!


Thank you for your interest in Materials Square weekly tips until now.
We are ending the weekly tip season 1 with this weekly tip as the last one. However, we will come back with more content. Thank you!



[1] Martin, R. M., & Martin, R. M. (2004). Electronic structure: basic theory and practical methods. Cambridge university press.
[2] Paier, J., Marsman, M., Hummer, K., Kresse, G., Gerber, I. C., & Ángyán, J. G. (2006). Screened hybrid density functionals applied to solids. The Journal of chemical physics, 124(15), 154709.
[3] Jain, M., Chelikowsky, J. R., & Louie, S. G. (2011). Reliability of hybrid functionals in predicting band gaps. Physical review letters, 107(21), 216806.