User Tools

Site Tools


exercises:2016_uzh_cmest:path_optimization_neb

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
exercises:2016_uzh_cmest:path_optimization_neb [2016/10/20 17:55] tmuellerexercises:2016_uzh_cmest:path_optimization_neb [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 155: Line 155:
 One notable difference to the previous input files is the specification of the periodic boundary conditions in the ''&POISSON'' section and in the ''&CELL'' (and the increased size of the box -- now 12 Å instead of 10 Å). This is to use a different solver configuration which behaves better in combination with NEB and if the box is big enough it will not change the physics. One notable difference to the previous input files is the specification of the periodic boundary conditions in the ''&POISSON'' section and in the ''&CELL'' (and the increased size of the box -- now 12 Å instead of 10 Å). This is to use a different solver configuration which behaves better in combination with NEB and if the box is big enough it will not change the physics.
  
-To run this simulation, we use a slightly different command which will terminate right away:+To run this simulation, we use a slightly different command which will return right away:
  
 <code> <code>
Line 161: Line 161:
 </code> </code>
  
-in the background, the process is still running, which you can verify by either watching the changes to the output file (exit this command with ''CTRL+c'')+In the background, the process is still running, which you can verify by either watching the changes to the output file (exit this command with ''CTRL+c''using
  
 <code> <code>
Line 173: Line 173:
 </code> </code>
  
-What we did is to replace the CP2K executable ''cp2k.sopt'' with ''cp2k.popt'', which is a parallel version of CP2K. By prefixing the command with ''mpirun -np 8'' we tell it to run it using the MPI system using 8 cores. And finally to have the command continue to run even if you log out, we prefixed everything with ''nohup''. The ampersand ''&'' at the end is to run everything in the background.+We replaced the CP2K executable ''cp2k.sopt'' with ''cp2k.popt'', which is a parallel version of CP2K. By prefixing the command with ''mpirun -np 8'' we tell it to run it using the MPI system using 8 cores. And finally to have the command continue to run even if you log out, we prefixed everything with ''nohup''. The ampersand ''&'' at the end is to run everything in the background
 + 
 +This may take a couple of hours. Continue with the exercises below once the calculation finishes. 
 + 
 +====== Visualize the trajectory and plot the energy curve ====== 
 + 
 +When you take another peek at the input file you used to run the calculation, you will notice that we specified ''NUMBER_OF_REPLICA 8'', which means that CP2K will generate in total 8 beads (3 we specified in the ''&REPLICA'' sections, 5 will be generated automatically by interpolation). 
 + 
 +You should therefore find 8 files named ''ethane_neb_aba-pos-Replica_nr_1-1.xyz''..''ethane_neb_aba-pos-Replica_nr_8-1.xyz'' in your exercise directory, containing the  optimization of each bead. To get the trajectory over the band, we extract the last frame (see the tip below) and write it into a separate file named ''ethane_neb_aba_8r.xyz'': 
 + 
 +<code> 
 +$ for i in {1..8} ; do tail -n 10 "ethane_neb_aba-pos-Replica_nr_${i}-1.xyz" >> ethane_neb_aba_8r.xyz ; done 
 +</code> 
 + 
 +Look at the movement again using VMD. 
 + 
 +<note tip>The anatomy of a XYZ file: 
 + 
 +A XYZ file consists of one or multiple blocks (frames) of the following: 
 + 
 +<code> 
 +        <-- the number of atoms 
 + i =       0, E =      -14.9559722838 <-- some comment, CP2K writes the number of the iteration and the resulting energy here 
 +  C         6.7640435612        6.0000000003        5.9997401503  <-- the atomic symbol and position 
 +  C         5.2359564388        5.9999999997        6.0002598497  <-- .. for the specified number of atoms 
 +  H         4.8332682152        6.0000000001        7.0232923722 
 +  H         4.8330445407        5.1142018851        5.4887808109 
 +  H         4.8330445407        6.8857981148        5.4887808113 
 +  H         7.1667317848        5.9999999999        4.9767076278 
 +  H         7.1669554593        6.8857981149        6.5112191891 
 +  H         7.1669554593        5.1142018852        6.5112191887 
 +</code> 
 + 
 +Extracting the last frame (the optimized geometry in case of a geometry optimization) is therefore simple once you know the number of atoms using the command ''tail'', which can be used to get the last ''N'' lines of a file using the switch ''-n N''
 + 
 +In our case of 8 atoms this is: 
 + 
 +<code> 
 +$ tail -n 10 geo_opt_output.xyz 
 +</code> 
 +</note> 
 + 
 +Since CP2K writes the energy in the comment line of each frame in the XYZ file (see tip above), we can extract the energy values for each bead directly from the newly generated ''ethane_neb_aba_8r.xyz'': 
 + 
 +<code> 
 +awk '/E =/ {i=i+1; printf "%s %16.8f\n", i, $6}' ethane_neb_aba_8r.xyz 
 +</code> 
 + 
 +Create a plot for this energy curve. 
 + 
 +====== Vibrational analysis ====== 
 + 
 +To verify whether the point at the highest energy is actually a transition state, we will be doing a vibrational analysis. 
 + 
 +First identify the bead with the highest energy (see exercise above) and create a new XYZ file named ''ethane_neb_aba_TS.xyz'' with the respective coordinates (extracted from either the correct ''ethane_neb_aba-pos-Replica_nr_N-1.xyz'' file or the ''ethane_neb_aba_8r.xyz''). 
 + 
 +Use the following input file and the same command as above (with different input and output file names of course) to generate the analysis. 
 + 
 +<code - ethane_TS_va.inp> 
 +&GLOBAL 
 +  PROJECT ethane_TS_va 
 +  RUN_TYPE NORMAL_MODES 
 +  PRINT_LEVEL MEDIUM 
 +&END GLOBAL 
 + 
 +&FORCE_EVAL 
 +  METHOD Quickstep              ! Electronic structure method (DFT,...) 
 +  &DFT 
 +    BASIS_SET_FILE_NAME  BASIS_MOLOPT 
 +    POTENTIAL_FILE_NAME  POTENTIAL 
 + 
 +    &POISSON                    ! Solver requested for non periodic calculations 
 +      PERIODIC XYZ 
 +    &END POISSON 
 +    &SCF                        ! Parameters controlling the convergence of the scf. This section should not be changed.  
 +      SCF_GUESS ATOMIC 
 +      EPS_SCF 1.0E-7 
 +      MAX_SCF 300 
 +    &END SCF 
 +    &XC                        ! Parametes needed to compute the electronic exchange potential  
 +      &XC_FUNCTIONAL PBE 
 +      &END XC_FUNCTIONAL 
 +    &END XC 
 +  &END DFT 
 + 
 +  &SUBSYS 
 +    &CELL 
 +      ABC 12. 12. 12. 
 +      PERIODIC XYZ 
 +    &END CELL 
 +    &TOPOLOGY                    ! Section used to center the atomic coordinates in the given box. Useful for big molecules 
 +      &CENTER_COORDINATES 
 +      &END 
 +      COORD_FILE_FORMAT xyz 
 +      COORD_FILE_NAME  ./ethane_neb_aba_TS.xyz 
 +    &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 
 + 
 +&VIBRATIONAL_ANALYSIS 
 +  NPROC_REP 1 
 +  DX 0.01 
 +  FULLY_PERIODIC 
 +  &PRINT 
 +    &MOLDEN_VIB 
 +    &END 
 +    &CARTESIAN_EIGS 
 +    &END 
 +    &PROGRAM_RUN_INFO 
 +      &EACH 
 +        REPLICA_EVAL 1 
 +      &END 
 +    &END 
 +  &END 
 +&END 
 +</code> 
 + 
 +Once this run completes, you should find a file ''ethane_TS_va-VIBRATIONS-1.mol''
 + 
 +Now we are going to use the application //molden// (which you can load using ''module load molden'') to visualize the vibrational modes: 
 + 
 +<code> 
 +$ molden ethane_TS_va-VIBRATIONS-1.mol 
 +</code> 
 + 
 +Click the //Norm. Mode// checkbox in the //Molden Control// window to list all the modes. What is the lowest frequency you get? By clicking on it you can visualize it.  
 + 
 +The presence of a  negative (imaginary) mode means that it is actually a transition state (and not stable). 
 + 
 +Now repeat the same steps presented here for the bead with the lowest energy. What is now the first frequency you get in the list? Is this geometry stable? 
 + 
 +Please note: while you should get only 18 different frequencies you get 21 instead. That means that 3 frequencies are global rotations instead of modes in the molecule and should be ignored when looking for negative frequencies to identify whether a conformer is stable or not.
exercises/2016_uzh_cmest/path_optimization_neb.1476986118.txt.gz · Last modified: 2020/08/21 10:15 (external edit)