exercises:2016_uzh_cmest:electronic_structure_dft
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
exercises:2016_uzh_cmest:electronic_structure_dft [2016/10/06 08:23] – created tmueller | exercises:2016_uzh_cmest:electronic_structure_dft [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
In this exercise, you will perform again an electronic structure calculation (of Ethene), but this time using Density Functional Theory and different functionals. | In this exercise, you will perform again an electronic structure calculation (of Ethene), but this time using Density Functional Theory and different functionals. | ||
+ | |||
+ | |||
+ | ===== 1. Step: Running a DFT calculation ===== | ||
+ | |||
+ | Create a new directory for this exercise and create an input input file using the following content: | ||
+ | |||
+ | <code - ethene_LDA.inp > | ||
+ | &GLOBAL | ||
+ | PROJECT ethene | ||
+ | RUN_TYPE ENERGY | ||
+ | PRINT_LEVEL MEDIUM | ||
+ | &END GLOBAL | ||
+ | |||
+ | & | ||
+ | METHOD Quickstep | ||
+ | &DFT | ||
+ | BASIS_SET_FILE_NAME | ||
+ | POTENTIAL_FILE_NAME | ||
+ | |||
+ | & | ||
+ | PERIODIC NONE | ||
+ | PSOLVER | ||
+ | &END POISSON | ||
+ | & | ||
+ | SCF_GUESS ATOMIC | ||
+ | EPS_SCF 1.0E-6 | ||
+ | MAX_SCF 300 | ||
+ | &END SCF | ||
+ | & | ||
+ | & | ||
+ | &END XC_FUNCTIONAL | ||
+ | &END XC | ||
+ | &END DFT | ||
+ | |||
+ | &SUBSYS | ||
+ | &CELL | ||
+ | ABC 10 10 10 | ||
+ | PERIODIC NONE ! Non periodic calculations. That's why the POISSON section is needed | ||
+ | &END CELL | ||
+ | & | ||
+ | & | ||
+ | &END | ||
+ | &END | ||
+ | &COORD | ||
+ | C | ||
+ | C | ||
+ | H | ||
+ | H | ||
+ | H | ||
+ | H | ||
+ | &END COORD | ||
+ | &KIND H | ||
+ | ELEMENT H | ||
+ | BASIS_SET DZVP-GTH-PADE | ||
+ | POTENTIAL GTH-PADE-q1 | ||
+ | &END KIND | ||
+ | &KIND C | ||
+ | ELEMENT C | ||
+ | BASIS_SET DZVP-GTH-PADE | ||
+ | POTENTIAL GTH-PADE-q4 | ||
+ | &END KIND | ||
+ | &END SUBSYS | ||
+ | &END FORCE_EVAL | ||
+ | </ | ||
+ | |||
+ | Comparing this input file to the one from the previous exercise, we notice a couple of things: | ||
+ | |||
+ | * the '' | ||
+ | * the parameter for the '' | ||
+ | * the specifications for the '' | ||
+ | |||
+ | As you have seen in the lecture, one has to select a basis set for doing calculations efficiently. Furthermore we approximate the core electrons of an atom by a common pseudopotential instead of calculating them explicitly, reducing the computational complexity even further. | ||
+ | |||
+ | CP2K comes with a number of files, specifying the respective coefficients. Which one of those files is going to be used to lookup the basis sets/ | ||
+ | In the ''& | ||
+ | |||
+ | The files are located in '' | ||
+ | |||
+ | < | ||
+ | $ cd $CP2K_DATA_DIR | ||
+ | $ less BASIS_SET | ||
+ | $ less POTENTIAL | ||
+ | </ | ||
+ | |||
+ | In the basis sets you will find entries like: | ||
+ | |||
+ | < | ||
+ | [...] | ||
+ | H DZVP-GTH-PADE | ||
+ | 2 | ||
+ | 1 0 0 4 2 | ||
+ | 8.3744350009 | ||
+ | 1.8058681460 | ||
+ | 0.4852531032 | ||
+ | 0.1658235797 | ||
+ | 2 1 1 1 1 | ||
+ | 0.7000000000 | ||
+ | [...] | ||
+ | </ | ||
+ | |||
+ | while the pseudopotentials file contains something like: | ||
+ | |||
+ | < | ||
+ | H GTH-PADE-q1 GTH-LDA-q1 GTH-PADE GTH-LDA | ||
+ | 1 | ||
+ | | ||
+ | 0 | ||
+ | </ | ||
+ | |||
+ | Now return to the previous (exercise) directory ('' | ||
+ | Compare the energy calculated using DFT-LDA ('' | ||
+ | |||
+ | ===== 2. Step: Selecting different functionals ===== | ||
+ | |||
+ | LDA is fast, but seldom very accurate. This is why there are improved functionals and one class are the Generalized Gradient Approximation (**GGA**) functionals. | ||
+ | |||
+ | Two prominent implementations of GGA functionals are: | ||
+ | |||
+ | * Perdew-Burke-Ernzerhof (**PBE**) | ||
+ | * Becke-Lee-Yang-Parr (**BLYP**) | ||
+ | |||
+ | When changing the functional, one usually also has to change the pseudopotential to one optimized for the usage with this functional, while the right basis set is selected based on the selected pseudopotential. | ||
+ | |||
+ | Change the input file given above for LDA to run the same calculation once using PBE and once using BLYP: | ||
+ | |||
+ | - Change the parameter for the '' | ||
+ | - Update the '' | ||
+ | - Set the '' | ||
+ | - Since the so-called //MOLOPT// basis sets are in a separate file, you also have to set the value for the '' | ||
+ | |||
+ | Using the following command you can measure the total time for a simulation in // | ||
+ | |||
+ | < | ||
+ | $ TIME=%E time cp2k.sopt -i ethene_LDA.inp -o ethene_LDA.out | ||
+ | 0:09.34 | ||
+ | </ | ||
+ | |||
+ | Measure the time and the energy for LDA, PBE and BLYP. How do they compare? | ||
+ | |||
+ | |||
+ | ===== 3. Step: Convergence with regard to the basis set ===== | ||
+ | |||
+ | As has been said in the lectures, the methods we are employing here are in principal exact. But to make calculations feasible we have to truncate the number of basis functions. This is why when you make calculations which should give accurate numbers you will have to prove that you have employed a basis set large enough such that the result does not change anymore when going to a larger basis. | ||
+ | |||
+ | Update the input file from the previous for PBE to run the simulation and collect the timings once for the following basis sets (for both kinds): | ||
+ | |||
+ | * SZV-MOLOPT-GTH | ||
+ | * DZVP-MOLOPT-GTH | ||
+ | * TZVP-MOLOPT-GTH | ||
+ | * TZV2P-MOLOPT-GTH | ||
+ | * TZV2PX-MOLOPT-GTH | ||
+ | |||
+ | For each output, look for the '' | ||
+ | |||
+ | Create two plots: | ||
+ | |||
+ | * total energy vs number of independent orbital functions | ||
+ | * time in seconds vs number of independent orbital functions |
exercises/2016_uzh_cmest/electronic_structure_dft.1475742234.txt.gz · Last modified: 2020/08/21 10:15 (external edit)