exercises:2016_uzh_cmest:geometry_optimization
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exercises:2016_uzh_cmest:geometry_optimization [2016/10/12 08:33] – [1. Step: Setting up a calculation] tmueller | exercises:2016_uzh_cmest:geometry_optimization [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
- | ===== 1. Step: Setting up a calculation ===== | + | ===== 1. Step: Single point energy |
In the previous exercises we initially specified all parameters -- pseudopotential and basis set coefficients as well as atom coordinates -- in the input file. Later we used the pseudpotentials and basis sets from a file provided by CP2K. | In the previous exercises we initially specified all parameters -- pseudopotential and basis set coefficients as well as atom coordinates -- in the input file. Later we used the pseudpotentials and basis sets from a file provided by CP2K. | ||
Line 10: | Line 10: | ||
Now we go further and also factor out the atomic structure to make it easier to automate different calculations for the same structure or the same calculation for different structures. The format used for this is the same you will get for trajectories for example. | Now we go further and also factor out the atomic structure to make it easier to automate different calculations for the same structure or the same calculation for different structures. The format used for this is the same you will get for trajectories for example. | ||
- | First create two files: | + | First create two files with (different) coordinates for Ethane C2H8 (do not confuse with Ethene C2H6 from before): |
<code - ethane1.xyz > | <code - ethane1.xyz > | ||
Line 23: | Line 23: | ||
H | H | ||
H | H | ||
- | |||
</ | </ | ||
Line 37: | Line 36: | ||
H | H | ||
H | H | ||
+ | </ | ||
+ | The input file looks almost the same as the one for the previous calculations: | ||
+ | |||
+ | <code - ethane.inp > | ||
+ | &GLOBAL | ||
+ | PROJECT ethane | ||
+ | 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 | ||
+ | COORD_FILE_FORMAT xyz | ||
+ | COORD_FILE_NAME | ||
+ | &END | ||
+ | &KIND H | ||
+ | ELEMENT H | ||
+ | BASIS_SET DZVP-MOLOPT-GTH | ||
+ | POTENTIAL GTH-PBE-q1 | ||
+ | &END KIND | ||
+ | &KIND C | ||
+ | ELEMENT C | ||
+ | BASIS_SET DZVP-MOLOPT-GTH | ||
+ | POTENTIAL GTH-PBE-q4 | ||
+ | &END KIND | ||
+ | &END SUBSYS | ||
+ | &END FORCE_EVAL | ||
</ | </ | ||
+ | and should give the following energy once you run it: | ||
+ | |||
+ | < | ||
+ | ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): | ||
+ | </ | ||
+ | |||
+ | You can also directly open a XYZ file in VMD: | ||
+ | |||
+ | < | ||
+ | $ vmd ethane1.xyz | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 2. Step: Optimizing the geometry ===== | ||
+ | |||
+ | The only thing you have to change to get a geometry optimization instead of a single point energy calculation is the following: | ||
+ | |||
+ | <code - ethane1_opt.inp > | ||
+ | &GLOBAL | ||
+ | PROJECT ethane1_opt | ||
+ | RUN_TYPE GEO_OPT | ||
+ | PRINT_LEVEL MEDIUM | ||
+ | &END GLOBAL | ||
+ | [...] | ||
+ | </ | ||
+ | |||
+ | Note the different '' | ||
+ | |||
+ | After running this, you will have the following files: | ||
+ | |||
+ | < | ||
+ | $ ls ethane1_opt* | ||
+ | ethane1_opt-1.restart | ||
+ | ethane1_opt-1.restart.bak-1 | ||
+ | ethane1_opt-1.restart.bak-2 | ||
+ | </ | ||
+ | |||
+ | Take a look at the output file, especially the following section (repeated the number of cycles it took to reach convergence): | ||
+ | |||
+ | < | ||
+ | | ||
+ | Optimization Method | ||
+ | Total Energy | ||
+ | Real energy change | ||
+ | Predicted change in energy = -0.1885432833 | ||
+ | Scaling factor | ||
+ | Step size = | ||
+ | Trust radius | ||
+ | Decrease in energy | ||
+ | Used time = | ||
+ | |||
+ | Convergence check : | ||
+ | Max. step size | ||
+ | Conv. limit for step size = | ||
+ | Convergence in step size | ||
+ | RMS step size = | ||
+ | Conv. limit for RMS step | ||
+ | Convergence in RMS step = NO | ||
+ | Max. gradient | ||
+ | Conv. limit for gradients | ||
+ | Conv. for gradients | ||
+ | RMS gradient | ||
+ | Conv. limit for RMS grad. = | ||
+ | Conv. for gradients | ||
+ | | ||
+ | </ | ||
+ | |||
+ | For each convergence criterion you see the value which is used to check whether convergence is reached and convergence is only reached if all of them are satisfied simultaneously. | ||
+ | |||
+ | |||
+ | From the output file, extract the following data and generate 3 plots with the values vs the iteration number: | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | |||
+ | ===== 3. Step: Optimizing the geometry with an alternative geometry ===== | ||
+ | |||
+ | Now change the used coordinate file to '' | ||
+ | |||
+ | * Compare the final energy reached for both structures and the total number of optimization steps required | ||
+ | * Open the two output XYZ files (''< | ||
+ | * Which one is likely to be more stable and why? | ||
+ | |||
+ | |||
+ | ===== 4. Step: Visualize the geometry optimization ===== | ||
+ | |||
+ | Append the following section to your input file (does not matter for which structure) and run the simulation again. | ||
+ | |||
+ | < | ||
+ | &MOTION | ||
+ | |||
+ | & | ||
+ | LOG_PRINT_KEY T | ||
+ | FORMAT XYZ | ||
+ | ADD_LAST NUMERIC | ||
+ | &END TRAJECTORY | ||
+ | &END PRINT | ||
+ | &END MOTION | ||
+ | </ | ||
+ | |||
+ | If you check the output XYZ file now (''< | ||
+ | |||
+ | < | ||
+ | [...] | ||
+ | | ||
+ | [...] | ||
+ | </ | ||
+ | |||
+ | Open this new XYZ file again with VMD, choose an appropriate drawing method (// | ||
+ | |||
+ | {{ vmd_play.png |}} | ||
exercises/2016_uzh_cmest/geometry_optimization.1476261194.txt.gz · Last modified: 2020/08/21 10:15 (external edit)