howto:gw
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
howto:gw [2021/04/21 19:58] – jwilhelm | howto:gw [2024/01/03 13:23] – oschuett | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== GW method for computing electronic levels ====== | + | This page has been moved to: https://manual.cp2k.org/trunk/methods/post_hartree_fock/gw.html |
- | + | ||
- | The purpose of this section is to explain how to compute the energy of molecular orbitals/ | + | |
- | + | ||
- | The GW implementation in CP2K is based on the developments described in [[doi> | + | |
- | + | ||
- | In this tutorial, GW values from the GW100 benchmark set [[doi> | + | |
- | + | ||
- | Since the calculations are rather small, please use a single MPI rank for the calculation: | + | |
- | + | ||
- | < | + | |
- | mpirun -n 1 cp2k.popt H2O_GW100.inp | tee cp2k.out | + | |
- | </ | + | |
- | + | ||
- | ===== 1. Reproducing values from the GW100 set ===== | + | |
- | See below the input for a G0W0@PBE calculation of the water molecule in a def2-QZVP basis: A PBE calculation is used for computing the molecular orbitals which can be seen from the keyword " | + | |
- | + | ||
- | The G0W0@PBE HOMO value is not in good agreement with the experimental ionization potential of water (12.62 eV). A possible explanation is that PBE may not be a good starting point for G0W0 calculations for molecules in the gas phase, see e.g. [[doi> | + | |
- | <code - H2O_GW100.inp> | + | |
- | & | + | |
- | METHOD Quickstep | + | |
- | &DFT | + | |
- | BASIS_SET_FILE_NAME BASIS_def2_QZVP_RI_ALL | + | |
- | POTENTIAL_FILE_NAME POTENTIAL | + | |
- | & | + | |
- | CUTOFF 400 | + | |
- | REL_CUTOFF 50 | + | |
- | &END MGRID | + | |
- | &QS | + | |
- | ! all electron calculation since GW100 is all-electron test | + | |
- | METHOD GAPW | + | |
- | &END QS | + | |
- | & | + | |
- | PERIODIC NONE | + | |
- | PSOLVER MT | + | |
- | &END | + | |
- | &SCF | + | |
- | EPS_SCF 1.0E-6 | + | |
- | SCF_GUESS ATOMIC | + | |
- | MAX_SCF 200 | + | |
- | &END SCF | + | |
- | &XC | + | |
- | & | + | |
- | &END XC_FUNCTIONAL | + | |
- | ! GW is part of the WF_CORRELATION section | + | |
- | & | + | |
- | ! RPA is used to compute the density response function | + | |
- | METHOD RI_RPA_GPW | + | |
- | ! Use Obara-Saika integrals instead of GPW integrals | + | |
- | ! since OS is much faster | + | |
- | ERI_METHOD OS | + | |
- | & | + | |
- | ! use 100 quadrature points to perform the | + | |
- | ! frequency integration in GW | + | |
- | RPA_NUM_QUAD_POINTS 100 | + | |
- | ! SIZE_FREQ_INTEG_GROUP is a group size for parallelization and | + | |
- | ! should be increased for large calculations to prevent out of memory. | + | |
- | ! maximum for SIZE_FREQ_INTEG_GROUP is the number of MPI tasks | + | |
- | SIZE_FREQ_INTEG_GROUP 1 | + | |
- | GW | + | |
- | & | + | |
- | ! compute the G0W0@PBE energy of HOMO-9, | + | |
- | ! HOMO-8, ... , HOMO-1, HOMO | + | |
- | | + | |
- | ! compute the G0W0@PBE energy of LUMO, | + | |
- | ! LUMO+1, ... , LUMO+20 | + | |
- | | + | |
- | ! fit a Pade approximant to the correlation self-energy | + | |
- | ! as function of imaginary frequency. this has been done | + | |
- | ! in the GW100 benchmark set and turned out to be reliable | + | |
- | | + | |
- | ! for solving the quasiparticle equation, the Newton method | + | |
- | ! is used as in the GW100 benchmark | + | |
- | | + | |
- | ! use the RI approximation for the exchange part of the self-energy | + | |
- | | + | |
- | &END RI_G0W0 | + | |
- | &END RI_RPA | + | |
- | ! NUMBER_PROC is a group size for parallelization and should | + | |
- | ! be increased for large calculations | + | |
- | NUMBER_PROC 1 | + | |
- | &END | + | |
- | &END XC | + | |
- | &END DFT | + | |
- | & | + | |
- | &CELL | + | |
- | ABC 10.0 10.0 10.0 | + | |
- | PERIODIC NONE | + | |
- | &END CELL | + | |
- | & | + | |
- | O 0.0000 0.0000 0.0000 | + | |
- | H 0.7571 0.0000 0.5861 | + | |
- | H -0.7571 0.0000 0.5861 | + | |
- | &END COORD | + | |
- | & | + | |
- | & | + | |
- | &END | + | |
- | &END TOPOLOGY | + | |
- | &KIND H | + | |
- | ! def2-QZVP is the basis which has been used in the GW100 paper | + | |
- | BASIS_SET def2-QZVP | + | |
- | ! just use a very large RI basis to ensure excellent | + | |
- | ! convergence with respect to the RI basis | + | |
- | RI_AUX_BASIS RI-5Z | + | |
- | POTENTIAL ALL | + | |
- | &END KIND | + | |
- | &KIND O | + | |
- | BASIS_SET def2-QZVP | + | |
- | RI_AUX_BASIS RI-5Z | + | |
- | POTENTIAL ALL | + | |
- | &END KIND | + | |
- | &END SUBSYS | + | |
- | &END FORCE_EVAL | + | |
- | & | + | |
- | RUN_TYPE | + | |
- | PROJECT | + | |
- | PRINT_LEVEL | + | |
- | &END GLOBAL | + | |
- | </ | + | |
- | + | ||
- | ===== 2. Basis set extrapolation ===== | + | |
- | + | ||
- | In this section, the slow basis set convergence of GW calculations is examined. | + | |
- | We compute the G0W0@PBE HOMO and LUMO level of the water molecule with Dunning' | + | |
- | To do so, download the cc basis sets {{exercises:2017_uzh_cp2k-tutorial:cc_basis_h2o.tar ? | + | |
- | < | + | |
- | BASIS_SET_FILE_NAME BASIS_def2_QZVP_RI_ALL | + | |
- | BASIS_SET_FILE_NAME ./BASIS_H2O | + | |
- | </code> | + | |
- | < | + | |
- | &KIND H | + | |
- | BASIS_SET cc-DZVP-all | + | |
- | RI_AUX_BASIS RI-5Z | + | |
- | POTENTIAL ALL | + | |
- | &END KIND | + | |
- | &KIND O | + | |
- | BASIS_SET cc-DZVP-all | + | |
- | RI_AUX_BASIS RI-5Z | + | |
- | POTENTIAL ALL | + | |
- | &END KIND | + | |
- | </ | + | |
- | + | ||
- | Employ the RI-5Z basis set as RI-basis which ensures excellent convergence for the RI basis. | + | |
- | In practice, smaller RI basis sets can be used from the EMSL database (just check the convergence with respect to the RI basis by using smaller and larger RI basis sets). | + | |
- | + | ||
- | The results for the G0W0@PBE HOMO and LUMO from CP2K should be as follows: | + | |
- | + | ||
- | < | + | |
- | Basis set | + | |
- | cc-DZVP | + | |
- | cc-TZVP | + | |
- | cc-QZVP | + | |
- | cc-5ZVP | + | |
- | + | ||
- | Extrapolation using cc-TZVP to cc-5ZVP | + | |
- | with 1/N_card^3 | + | |
- | with 1/N_basis | + | |
- | GW100 -12.05 | + | |
- | </ | + | |
- | + | ||
- | For the extrapolation, | + | |
- | The first scheme employs a linear fit on the HOMO or LUMO values when they are plotted against the inverse cardinal number $N_\text{card}$ of the basis set while the second scheme extrapolates versus the inverse number of basis functions $N_\text{basis}$ which can be computed as sum of the number of occupied orbitals and the number of virtual orbitals as printed in RI_INFO in the output. | + | |
- | You can check the extrapolation from the table above with your tool of choice. | + | |
- | + | ||
- | The basis set extrapolated values from the table above deviate from the values reported in the GW100 paper [[doi> | + | |
- | + | ||
- | Often, the HOMO-LUMO gap is of interest. In this case, augmented basis sets (e.g. from the EMSL database) can offer an alternative for very fast basis set convergence, | + | |
- | ===== 3. Input for large-scale calculations ===== | + | |
- | An exemplary input for a parallel calculation can be found in the supporting information of [[doi> | + | |
- | + | ||
- | ===== 4. Periodic GW calculations ===== | + | |
- | For periodic GW calculations, | + | |
- | + | ||
- | The basis can be found in {{exercises: | + | |
- | + | ||
- | <code - LiH_periodic.inp> | + | |
- | & | + | |
- | METHOD Quickstep | + | |
- | &DFT | + | |
- | BASIS_SET_FILE_NAME ./ | + | |
- | POTENTIAL_FILE_NAME POTENTIAL | + | |
- | & | + | |
- | CUTOFF 600 | + | |
- | REL_CUTOFF 60 | + | |
- | &END MGRID | + | |
- | &QS | + | |
- | METHOD GPW | + | |
- | EPS_DEFAULT 1.0E-15 | + | |
- | EPS_PGF_ORB 1.0E-20 | + | |
- | EPS_FILTER_MATRIX 0.0e0 | + | |
- | &END QS | + | |
- | &SCF | + | |
- | EPS_SCF 1.0E-6 | + | |
- | MAX_SCF 100 | + | |
- | &END SCF | + | |
- | &XC | + | |
- | & | + | |
- | &END XC_FUNCTIONAL | + | |
- | & | + | |
- | METHOD | + | |
- | & | + | |
- | RPA_NUM_QUAD_POINTS | + | |
- | GW | + | |
- | & | + | |
- | | + | |
- | | + | |
- | ! activate the periodic correction | + | |
- | | + | |
- | | + | |
- | | + | |
- | &END RI_G0W0 | + | |
- | ! HF calculation for the exchange part of the self-energy | + | |
- | ! Here, the truncation of the Coulomb operator works | + | |
- | &HF | + | |
- | & | + | |
- | ! for other materials, a smaller EPS_SCHWARZ might be necessary | + | |
- | EPS_SCHWARZ 1.0E-6 | + | |
- | SCREEN_ON_INITIAL_P TRUE | + | |
- | &END | + | |
- | & | + | |
- | POTENTIAL_TYPE TRUNCATED | + | |
- | ! the truncation radius is half the cell size | + | |
- | CUTOFF_RADIUS | + | |
- | T_C_G_DATA t_c_g.dat | + | |
- | &END | + | |
- | & | + | |
- | MAX_MEMORY | + | |
- | &END | + | |
- | &END | + | |
- | &END RI_RPA | + | |
- | NUMBER_PROC | + | |
- | &END | + | |
- | &END XC | + | |
- | &END DFT | + | |
- | & | + | |
- | &CELL | + | |
- | ABC 4.084 4.084 4.084 | + | |
- | &END CELL | + | |
- | & | + | |
- | Li 0 0 0 | + | |
- | Li 2.042 2.042 0 | + | |
- | Li 2.042 0 2.042 | + | |
- | Li 0 2.042 2.042 | + | |
- | H 0 2.042 0 | + | |
- | H 0 0 2.042 | + | |
- | H 2.042 0 0 | + | |
- | H 2.042 2.042 2.042 | + | |
- | &END COORD | + | |
- | &KIND H | + | |
- | BASIS_SET cc-DZVP-GTH | + | |
- | RI_AUX_BASIS_SET | + | |
- | POTENTIAL GTH-PBE-q1 | + | |
- | &END KIND | + | |
- | &KIND Li | + | |
- | BASIS_SET cc-DZVP-GTH | + | |
- | RI_AUX_BASIS_SET | + | |
- | POTENTIAL GTH-PBE-q3 | + | |
- | &END KIND | + | |
- | &END SUBSYS | + | |
- | &END FORCE_EVAL | + | |
- | & | + | |
- | PROJECT | + | |
- | PRINT_LEVEL MEDIUM | + | |
- | RUN_TYPE ENERGY | + | |
- | &END GLOBAL | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ===== 5. Cubic-scaling GW calculations ===== | + | |
- | Cubic-scaling GW calculations could be a more efficient alternative for large systems. See below an exemplary input for one water molecule. Compare the results to the ones from Sec. 1. In general, small deviations (< 0.05 eV) for GW levels can be expected from cubic-scaling GW calculations compared to canonical GW calculations due to additional approximations in cubic-scaling GW. | + | |
- | + | ||
- | Please observe that the input below is much slower than the input for canonical GW. Therefore, it can be beneficial to run it with more MPI tasks. The beneficial scaling of cubic-scaling GW only pays off for large systems where it is more efficient as canonical GW calculations (rule of thumb: cubic-scaling GW can be more efficient for systems with more than 100 atoms if the filter parameters are well set). | + | |
- | + | ||
- | <code - H2O_GW100_cubic_scaling.inp> | + | |
- | & | + | |
- | METHOD Quickstep | + | |
- | &DFT | + | |
- | ! retrieve basis set from the CP2K trunk version | + | |
- | BASIS_SET_FILE_NAME BASIS_def2_QZVP_RI_ALL | + | |
- | POTENTIAL_FILE_NAME POTENTIAL | + | |
- | & | + | |
- | CUTOFF 400 | + | |
- | REL_CUTOFF 50 | + | |
- | &END MGRID | + | |
- | &QS | + | |
- | ! all electron calculation since GW100 is all-electron test | + | |
- | METHOD GAPW | + | |
- | &END QS | + | |
- | & | + | |
- | PERIODIC NONE | + | |
- | PSOLVER MT | + | |
- | &END | + | |
- | &SCF | + | |
- | EPS_SCF 1.0E-6 | + | |
- | SCF_GUESS ATOMIC | + | |
- | MAX_SCF 200 | + | |
- | &END SCF | + | |
- | &XC | + | |
- | & | + | |
- | &END XC_FUNCTIONAL | + | |
- | & | + | |
- | METHOD RI_RPA_GPW | + | |
- | ERI_METHOD OS | + | |
- | ! cubic-scaling GW only works with overlap metric RI | + | |
- | RI OVERLAP | + | |
- | & | + | |
- | ! EPS_FILTER should be tuned for the specific application: | + | |
- | ! the computational cost strongly depends on EPS_FILTER | + | |
- | EPS_FILTER 1.0E-12 | + | |
- | ! EPS_GRID may be tuned since memory is weakly | + | |
- | ! dependent on it | + | |
- | EPS_GRID | + | |
- | &END WFC_GPW | + | |
- | & | + | |
- | ! cubic-scaling GW only works with the minimax grid | + | |
- | ! in imag. time and frequency | + | |
- | MINIMAX | + | |
- | ! If the HOMO-LUMO gap of the system is small, 20 | + | |
- | ! points for the time/ | + | |
- | ! (flag RPA_NUM_QUAD_POINTS). The time and frequency grid | + | |
- | ! are equally large. The maximum grid size is 20. | + | |
- | ! For large-gap systems (as the water molecule), 12 points | + | |
- | ! should be sufficient | + | |
- | RPA_NUM_QUAD_POINTS | + | |
- | ! imaginary time flag enables cubic-scaling RPA or | + | |
- | ! GW calculations | + | |
- | IM_TIME | + | |
- | & | + | |
- | ! EPS_FILTER_IM_TIME should be tuned for the specific | + | |
- | ! application: | + | |
- | ! depends on EPS_FILTER | + | |
- | EPS_FILTER_IM_TIME 1.0E-12 | + | |
- | ! for large systems, increase GROUP_SIZE_3C | + | |
- | ! to prevent out of memory (OOM) | + | |
- | GROUP_SIZE_3C 1 | + | |
- | ! for extremely large systems, increase GROUP_SIZE_P | + | |
- | ! to prevent OOM | + | |
- | ! for very large systems, it is also recommended | + | |
- | ! to use OMP threads to prevent OOM | + | |
- | GROUP_SIZE_P 1 | + | |
- | ! for larger systems, MEMORY_CUT must be increased | + | |
- | ! to prevent out of memory (OOM) | + | |
- | MEMORY_CUT | + | |
- | GW | + | |
- | &END IM_TIME | + | |
- | & | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | &END RI_G0W0 | + | |
- | &END RI_RPA | + | |
- | &END | + | |
- | &END XC | + | |
- | &END DFT | + | |
- | & | + | |
- | &CELL | + | |
- | ABC 10.0 10.0 10.0 | + | |
- | PERIODIC NONE | + | |
- | &END CELL | + | |
- | & | + | |
- | O 0.0000 0.0000 0.0000 | + | |
- | H 0.7571 0.0000 0.5861 | + | |
- | H -0.7571 0.0000 0.5861 | + | |
- | &END COORD | + | |
- | & | + | |
- | & | + | |
- | &END | + | |
- | &END TOPOLOGY | + | |
- | &KIND H | + | |
- | BASIS_SET def2-QZVP | + | |
- | RI_AUX_BASIS RI-5Z | + | |
- | POTENTIAL ALL | + | |
- | &END KIND | + | |
- | &KIND O | + | |
- | BASIS_SET def2-QZVP | + | |
- | RI_AUX_BASIS RI-5Z | + | |
- | POTENTIAL ALL | + | |
- | &END KIND | + | |
- | &END SUBSYS | + | |
- | &END FORCE_EVAL | + | |
- | & | + | |
- | RUN_TYPE | + | |
- | PROJECT | + | |
- | PRINT_LEVEL | + | |
- | &END GLOBAL | + | |
- | </ | + |
howto/gw.txt · Last modified: 2024/01/14 12:15 by oschuett