events:2018_summer_school:converging_cutoff
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
exercises:2018_uol_school:converging_cutoff [2018/05/31 09:38] – mwatkins | exercises:2018_uol_school:converging_cutoff [2018/05/31 13:08] – [Analysis] mwatkins | ||
---|---|---|---|
Line 1: | Line 1: | ||
======Converging the cutoff for a more difficult problem====== | ======Converging the cutoff for a more difficult problem====== | ||
- | The complete set of files for this exercise can be found {{exercises: | + | =====Input |
- | This exercise is similar to the previous one, but uses a setup and system more typical of CP2K usage. We will use a system of 32 H< | + | <note important> |
+ | |||
+ | This exercise is similar to the previous one, but uses a setup and system more typical of CP2K usage. We will use a system of 32 H< | ||
< | < | ||
Line 86: | Line 88: | ||
</ | </ | ||
+ | |||
+ | Compared to the Si example, this is a larger system, we are using the OT optimizer in a good setup for a small to medium insulating system: | ||
+ | |||
+ | < | ||
+ | &SCF | ||
+ | SCF_GUESS RESTART | ||
+ | EPS_SCF 5.e-7 | ||
+ | MAX_SCF 15 | ||
+ | &OT | ||
+ | PRECONDITIONER FULL_ALL | ||
+ | MINIMIZER DIIS | ||
+ | &END OT | ||
+ | & | ||
+ | EPS_SCF 5.0E-7 | ||
+ | MAX_SCF 1 | ||
+ | &END OUTER_SCF | ||
+ | &END SCF | ||
+ | </ | ||
+ | |||
+ | and we are also saving the forces on the atoms | ||
+ | |||
+ | < | ||
+ | |||
+ | &FORCES | ||
+ | &END | ||
+ | &END | ||
+ | </ | ||
+ | |||
+ | We save the forces as for many purposes (MD) converging the forces reasonably is more important than the total energy of the system. | ||
+ | |||
+ | =====Running the system===== | ||
+ | |||
+ | The runcutoff file is a shell script as before to generate the different input files: | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | cutoffs=" | ||
+ | |||
+ | template_file=input_template.inp | ||
+ | input_file=input.inp | ||
+ | |||
+ | rel_cutoff=60 | ||
+ | |||
+ | for ii in $cutoffs ; do | ||
+ | work_dir=cutoff_${ii}Ry | ||
+ | if [ ! -d $work_dir ] ; then | ||
+ | mkdir $work_dir | ||
+ | else | ||
+ | rm -r $work_dir/* | ||
+ | fi | ||
+ | sed -e " | ||
+ | -e " | ||
+ | $template_file > $work_dir/ | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | When you run the shell script you should get a series of directories, | ||
+ | |||
+ | At the end you should have a set of output files that contain the total energy of the system and the forces on each atom. | ||
+ | |||
+ | < | ||
+ | - Extract and plot the total energy of the system as a function of cutoff | ||
+ | - Extract and plot the total force on the system as a function of cutoff (search for 'SUM OF ATOMIC FORCES' | ||
+ | - Extract and plot the force on some chosen atoms from the system as a function of cutoff | ||
+ | </ | ||
+ | |||
+ | =====Analysis===== | ||
+ | |||
+ | What is converged? | ||
+ | |||
+ | Compare the convergence of forces to the default convergence criteria for geometry optimization. | ||
+ | |||
+ | What sets the required cutoff? It is the basis set (which is dictated by the pseudopotentials). You will need to be able to represent the Gaussian with largest exponent well on the realspace grids. Oxygen, being very electronegative (on the right of the period table with many protons) has very contracted 2s states. You can see in the output | ||
+ | |||
+ | < | ||
+ | | ||
+ | |||
+ | Set | ||
+ | |||
+ | 1 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | That there is a Gaussian with an exponent of 10.4 Bohr< | ||
+ | |||
+ | < | ||
+ | Si DZVP-MOLOPT-GTH DZVP-MOLOPT-GTH-q4 | ||
+ | 1 | ||
+ | 2 0 2 6 2 2 1 | ||
+ | 2.693604434572 | ||
+ | 1.359613855428 -0.283798205000 | ||
+ | 0.513245176029 -0.228939692700 -0.276015880000 | ||
+ | 0.326563011394 | ||
+ | 0.139986977410 | ||
+ | 0.068212286977 | ||
+ | </ | ||
+ | |||
+ | we see that the largest exponent is only 2.7 Bohr< | ||
+ | |||
+ | < | ||
+ | If you like, have a look at the BASIS_MOLOPT file (in the data directory, or online [[https:// | ||
+ | </ | ||
+ | |||
+ | The convergence is largely dominated by the calculation of the gradient terms in a GGA functional (compare a simulation with LDA to the PBE used here). The evaluation of these terms on the grids are demanding, and very dependent on the functional. | ||
+ | |||
+ | < | ||
+ | &XC | ||
+ | & | ||
+ | &END XC_FUNCTIONAL | ||
+ | & | ||
+ | ! defaults | ||
+ | XC_SMOOTH_RHO NONE | ||
+ | XC_DERIV PW | ||
+ | &END XC_GRID | ||
+ | &END XC | ||
+ | </ | ||
+ | |||
+ | For BLYP functional some smoothing needs to be applied. The smoothing may also converge forces more rapidly than the default settings, but at the expense of modifying the functional slightly. | ||
+ | |||
+ | < | ||
+ | |||
+ | compare to the previous calculation, | ||
+ | |||
+ | < | ||
+ | &XC | ||
+ | & | ||
+ | &END XC_FUNCTIONAL | ||
+ | & | ||
+ | XC_SMOOTH_RHO NN50 | ||
+ | XC_DERIV NN50_SMOOTH | ||
+ | &END | ||
+ | &END XC | ||
+ | </ | ||
+ | | ||
+ | compare the convergence of LDA and BLYP to PBE. | ||
+ | |||
+ | < | ||
+ | & | ||
+ | &END XC_FUNCTIONAL | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <note tip> | ||
+ | Also change the psuedo potential to the appropriate functional. | ||
+ | < | ||
+ | &KIND O | ||
+ | BASIS_SET DZVP-MOLOPT-SR-GTH-q6 | ||
+ | POTENTIAL GTH-PADE-q6 | ||
+ | &END KIND | ||
+ | </ | ||
+ | PADE is a synonym for LDA. | ||
+ | </ | ||
events/2018_summer_school/converging_cutoff.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1