User Tools

Site Tools


exercises:2016_uzh_cmest:geometry_optimization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
exercises:2016_uzh_cmest:geometry_optimization [2016/10/12 08:54] – [1. Step: Setting up a calculation] tmuellerexercises:2016_uzh_cmest:geometry_optimization [2016/10/20 15:53] – [1. Step: Single point energy calculation with separate coordinate file] tmueller
Line 62: Line 62:
       MAX_SCF 300       MAX_SCF 300
     &END SCF     &END SCF
-    &XC                        ! Parametes needed to compute the electronic exchange potential +    &XC                        ! Parameters needed to compute the electronic exchange potential 
       &XC_FUNCTIONAL PBE       &XC_FUNCTIONAL PBE
       &END XC_FUNCTIONAL       &END XC_FUNCTIONAL
Line 98: Line 98:
 ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.):              -14.746153797151329 ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.):              -14.746153797151329
 </code> </code>
 +
 +You can also directly open a XYZ file in VMD:
 +
 +<code>
 +$ vmd ethane1.xyz
 +</code>
 +
 +
 +===== 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
 +[...]
 +</code>
 +
 +Note the different ''RUN_TYPE'' and the changed ''PROJECT'' name. The latter is not strictly necessary but recommended, since CP2K automatically creates additional files using this project name as a prefix.
 +
 +After running this, you will have the following files:
 +
 +<code>
 +$ ls ethane1_opt*
 +ethane1_opt-1.restart        ethane1_opt-1.restart.bak-3  ethane1_opt.out          ethane1_opt-RESTART.wfn.bak-1
 +ethane1_opt-1.restart.bak-1  ethane1_opt-BFGS.Hessian     ethane1_opt-pos-1.xyz    ethane1_opt-RESTART.wfn.bak-2
 +ethane1_opt-1.restart.bak-2  ethane1_opt.inp              ethane1_opt-RESTART.wfn  ethane1_opt-RESTART.wfn.bak-3
 +</code>
 +
 +Take a look at the output file, especially the following section (repeated the number of cycles it took to reach convergence):
 +
 +<code>
 + --------  Informations at step =     1 ------------
 +  Optimization Method        =                 BFGS
 +  Total Energy                     -14.9417142787
 +  Real energy change                -0.1955604816
 +  Predicted change in energy =        -0.1885432833
 +  Scaling factor                     0.0000000000
 +  Step size                  =         0.2677976891
 +  Trust radius                       0.4724315332
 +  Decrease in energy                          YES
 +  Used time                  =               19.018
 +
 +  Convergence check :
 +  Max. step size                     0.2677976891
 +  Conv. limit for step size  =         0.0030000000
 +  Convergence in step size                     NO
 +  RMS step size              =         0.1458070233
 +  Conv. limit for RMS step           0.0015000000
 +  Convergence in RMS step    =                   NO
 +  Max. gradient              =         0.0287243359
 +  Conv. limit for gradients  =         0.0004500000
 +  Conv. for gradients        =                   NO
 +  RMS gradient                       0.0180771987
 +  Conv. limit for RMS grad.  =         0.0003000000
 +  Conv. for gradients        =                   NO
 + ---------------------------------------------------
 +</code>
 +
 +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:
 +
 +  * ''Total FORCE_EVAL ( QS ) energy''
 +  * ''Max. gradient'' .. the maximal force (seen over all atoms)
 +  * ''Max. step size'' .. the maximal displacement (seen over all atoms)
 +
 +
 +===== 3. Step: Optimizing the geometry with an alternative geometry =====
 +
 +Now change the used coordinate file to ''ethane2.xyz'' and update the ''PROJECT'' name to not overwrite the results from the previous simulation and run it again.
 +
 +  * Compare the final energy reached for both structures and the total number of optimization steps required
 +  * Open the two output XYZ files (''<PROJECT>-pos-1.xyz'') in VMD and compare them. Is there a difference? What is it?
 +  * 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.
 +
 +<code>
 +&MOTION
 +  &PRINT
 +    &TRAJECTORY
 +      LOG_PRINT_KEY T
 +      FORMAT XYZ
 +      ADD_LAST NUMERIC
 +    &END TRAJECTORY
 +  &END PRINT
 +&END MOTION
 +</code>
 +
 +If you check the output XYZ file now (''<PROJECT>-pos-1.xyz'') and compare it to the input structure, you will notice that the same molecule is now specified multiple times as so-called //frames//. Checking the CP2K output file you will also notice the following entry:
 +
 +<code>
 +[...]
 + Writing TRAJECTORY 1_1 to ethane2_opt_traj-pos-1.xyz
 +[...]
 +</code>
 +
 +Open this new XYZ file again with VMD, choose an appropriate drawing method (//Licorice// or //CPK//), hit the play button and enjoy:
 +
 +{{ vmd_play.png |}}
 +
exercises/2016_uzh_cmest/geometry_optimization.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1