# CP2K Open Source Molecular Dynamics

### Site Tools

exercises:2017_ethz_mmm:qmmm

# Differences

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

 exercises:2017_ethz_mmm:qmmm [2017/06/02 02:26]dpasserone exercises:2017_ethz_mmm:qmmm [2017/06/02 03:54]dpasserone Both sides previous revision Previous revision 2017/06/02 03:54 dpasserone 2017/06/02 03:43 dpasserone 2017/06/02 03:33 dpasserone 2017/06/02 02:28 dpasserone 2017/06/02 02:26 dpasserone 2017/06/02 02:26 dpasserone 2017/06/02 01:40 dpasserone created Next revision Previous revision 2017/06/02 03:54 dpasserone 2017/06/02 03:43 dpasserone 2017/06/02 03:33 dpasserone 2017/06/02 02:28 dpasserone 2017/06/02 02:26 dpasserone 2017/06/02 02:26 dpasserone 2017/06/02 01:40 dpasserone created Line 1: Line 1: - ====== Validation of a KCl QMMM model (exercise by Matthew Watkins, University college, London) ====== + ====== Validation of a KCl QMMM model ====== - In this exercise you will compute the adsorption energy of acetylene on a intermetallic catalyst. + === (exercise by Matthew Watkins, University college, London) === - This process is important during the production of polyethylene, and the system is described in this paper: [[doi>10.1021%2Fja505936b]]. + In this exercise you will validate the mixed quamtum/classical model for a KCl slab. + The present exercise is referring to the following paper: [[doi>10.1002/jcc.23904]]. - * In the first part of the exercise you will consider the optimized configuration (already in the directory) and study the pure electronic adsorption energy, namely the difference between the total energy of the surface-molecule system and the energy of the molecule alone and surface alone **in the same geometry as the surface-molecule system minimum structure**. This will allow to show the binding pattern of the electronic density. + * You will optimize the geometry of a KCL slab with the same arrangement as the one depicted below - * In the second part, you will optimize the surface and the molecule separately; this will allow to compute the total adsorption energy. + {{ :exercises:2017_ethz_mmm:screen_shot_2017-06-02_at_05.21.07.png?400 |}} + * For simplicity, you will consider three layers. + * You will compare the calculation performed with the full QM, one layer QM and two MM, two layer QM and one MM. + * In particular you will compare the band gaps and the density of states. - {{ :exercises:2017_ethz_mmm:master.img-002.jpg?nolink&600 |}} - ===== 1. Task: Familiarize yourself  ===== + ===== 1. Task: Prepare the input files  ===== - The coordinates of the optimized configuration are provided to you as ''S_M.opt.xyz'' (S stands for "Substrate", M for "Molecule", opt for "optimized"). Visualize the geometry with VMD and familiarize yourself with the system. + The file input.inp contains the partition of the QM and MM regions by specifying the atom index. Check in the ''kcl.xyz'' how the indexes are distributed. The slab orthogonal coordinate is the ''y''. + + *  Make three copies of **input.inp** and call them **qm_1l.inp**, **qm_2l.inp** and **qm.inp**. + * **qm_1l.inp** should have ''PROJECT KCl_1'' and one QM layer. Modify accordingly the MM_INDEX lines by looking first at the ''kcl.xyz'' coordinate files. + * **qm_2l.inp** should have ''PROJECT KCl_2'' and two QM layers. Modify accordingly the MM_INDEX lines by looking first at the ''kcl.xyz'' coordinate files. + * **qm.inp** should have ''PROJECT KCl_QM'' and the full QM treatment. For this, it is sufficient to change ''QMMM'' at the beginning to ''QS''. Change also the input coordinates from kcl.xyz to kcl_opt.xyz: these are the already optimized coordinates for the full QM treatment. In this way you will spare time. + - ===== 2. Task: Bond induced density differences ===== + ===== 2. Task: Run the jobs  ===== - Compute the density difference induced by the adsorption bonding. + - For this you will have to run three separate energy calculations, using the *.ene.inp files. + * Run the jobs by giving the command: ''qsub run -v INP=qm_1l'' and similarly for the other input files. - - combined system  (file ''S_M.opt.xyz'') + * You will also get cube files for hartree potential and electronic density. They can be examined with vmd. - - lone acetylene (file ''M.S_M.xyz'') + * For each job, a ''*pos*xyz'' optimization file is produced, as well as two PDOS files, one for the species 1 (K), the other for the species 2 (Cl). All will be prefixed by the ''PROJECT'' prefix you set in task 1. - - lone slab (file ''S.S_M.xyz'') + - In order to output the electronic densities as cube files, your input file has to contain the following snipped: + ===== 3. Task: Checking the geometry  ===== - + - &DFT + By direct inspection of the last configuration in each file ''*pos*xyz'' (example: **KCl_QM-pos-1.xyz**), check the distance between 1-2, 2-3 layers. What are the differences between the three cases? - &PRINT + - &E_DENSITY_CUBE + - &END E_DENSITY_CUBE + - &END + - &END DFT + - + - + - + - The calculations involving the slab should be run on at least 16 cores with ''qsub run -v INP=prefix''. Check the  ''run'' file for the number of nodes. + - To process the cube files we are going to use the [[tools:cubecruncher | cubecruncher]] tool. It is part of CP2K and is in your exercise directory. - - you@eulerX ~$./cubecruncher.x -i S_M-ELECTRON_DENSITY-1_0.cube -subtract S-ELECTRON_DENSITY-1_0.cube -o tmp.cube - you@eulerX ~$ ./cubecruncher.x -i tmp.cube -subtract M-ELECTRON_DENSITY-1_0.cube -o Delta_ads.cube - + ===== 4. Task: Electronic properties  ===== - The generated cube file is not aligned with the simulation cell. Center the cube file with the cubecruncher.x tool: + - + Extract a smeared dos from the ''pdos'' files, using the python scripts present in the directory. For each case in task 1 the procedure is: - you@eulerX ~$./cubecruncher.x -center geo -i Delta_ads.cube -o Delta_ads-centered.cube + + > python get-smearing-pdos.py KCl_1-PDOS-QMMM-k1-1.pdos + > mv smeared.dat KCl_1.K.dat + > python get-smearing-pdos.py KCl_1-PDOS-QMMM-k2-1.pdos + > mv smeared.dat KCl_1.Cl.dat + > paste KCl_1.K.dat KCl_1.Cl.dat > KCl_1.KCl.dat # all in the same file. The columns are ''ENERGY PDOS_K ENERGY PDOS_Cl '' + Plot the ''.dat'' files using gnuplot. The Fermi energy is set to zero eV. + + > gnuplot + gnuplot> set xrange [-5:10] + gnuplot> plot 'KCl_1.KCl.dat' u 1:($2+$4) w l, plot 'KCl_QM.KCl.dat' u 1:($2+$4) w l, plot 'KCl_2.KCl.dat' u 1:($2+$4) w l + + * **Note the differences you observe** + * Find the value of the band gap in the ''*.out'' files and relate it to what you see in gnuplot. How close is the QMMM to the full QM representation? + - You can visualize the resulting file ''delta_ads-centered.cube'' with VMD. This has been covered in a [[reaction_energy_2017| previous exercise]]. - What you get should look similar to this: - {{ dye_tio_bonding_density.png?300 |}} - ===== 3. Task: Bonding energies ===== + - Compute the binding energy: + - $E_\text{binding}=\sum E_\text{products} - \sum E_\text{reactants}$ + ===== Required Files ===== + When you are dealing with complex job structure, the input can be simplified by splitting it into multiple files. We are going to use separate files for the coordinates, the QM part, the MM part. All these files should reside in the same directory as the main input file. - For this you will need the energy values of three systems: + - - lone acetylene molecule (run geometry optimization, use energy of last step) + The provided files are all in the directory ''/home/psd/Exercise_13''. When you create new input files with different parameters, remember to change the name of the **PROJECT** as well. - - lone slab (you can use the already geometry optimized coordinates from ''S.opt.xyz'' at the end of the exercise) + - - combined system adsorbed (can be reused from previous task) + - + - + - You can not reuse the energy values for the lone sub-systems from the previous task. Since the unbound subsystems might relax into a different geometry, they have to be geometry optimized first. + + + @SET METHOD = QMMM # FIST all classical treatment # QS all quantum treatment - ===== Questions ===== + &GLOBAL - * Sketch briefly the geometry of the molecule **when adsorbed** and **in the gas phase**. + FLUSH_SHOULD_FLUSH - * Report the system energy for the bonded system, lone slab, and lone molecule. + PRINT_LEVEL LOW - * Can you estimate the contribution due to the geometry relaxation? + PROJECT KCl - * Briefly report the bond induced density difference on the system. + RUN_TYPE GEO_OPT + &END GLOBAL - ===== Required Files ===== + &FORCE_EVAL - When you are dealing with big systems and multiple atomic species, the input can be simplified by splitting it into multiple files. We are going to use separate files for the coordinates, the basis-sets, and the pseudo-potentials. All these files should reside in the same directory as the main input file. + METHOD$METHOD + @include QS.inc + @include MM.inc + &QMMM + #this defines the QS cell in the QMMM calc + &CELL + ABC 12.6 15.0 12.6 + PERIODIC XZ + &END CELL + ECOUPL GAUSS # use GEEP method + NOCOMPATIBILITY + USE_GEEP_LIB 6  # use GEEP method + &PERIODIC # apply periodic potential + #in this case QM box = MM box in XZ so turn + #off coupling/recoupling of the QM multipole + &MULTIPOLE OFF + &END + &END PERIODIC + #these are just the ionic radii of K Cl + #but should be treated as parameters in general + #fit to some physical property - + &MM_KIND Cl - The provided files are all in the directory ''/home/psd/Exercise_9''. Change the name of the xyz file accordingly in the input files. + RADIUS 1.67 - + &END MM_KIND + #define the model + &QM_KIND K + MM_INDEX 25..32 41..48 + &END QM_KIND + &QM_KIND Cl + MM_INDEX 17..24 33..40 + &END QM_KIND + &END QMMM + &SUBSYS + #this defines the cell of the whole system + #must be orthorhombic, I think + &CELL + ABC 12.6 100.0 12.6 + &END CELL + &TOPOLOGY + COORD_FILE_NAME kcl.xyz + COORD_FILE_FORMAT XYZ + &GENERATE + &ISOLATED_ATOMS + #ignores bonds dihedrals etc in classical part + LIST 1..48 + &END + &END + &END + &KIND K + ELEMENT K + BASIS_SET DZVP-MOLOPT-SR-GTH + POTENTIAL GTH-PBE-q9 + &END KIND + &KIND Cl + BASIS_SET DZVP-MOLOPT-GTH + POTENTIAL GTH-PBE-q7 + &END + &END SUBSYS + &END FORCE_EVAL - + #should be able to use most motion sections - &FORCE_EVAL + #analytic stress tensor not available, I think - METHOD Quickstep + @include motion.inc + + + and includes as separate files, using the @include macro, for the QS, MM and motion sections + + &DFT &DFT - &PRINT + BASIS_SET_FILE_NAME BASIS_MOLOPT - &E_DENSITY_CUBE + POTENTIAL_FILE_NAME GTH_POTENTIALS - &END E_DENSITY_CUBE + &MGRID - &END + COMMENSURATE - BASIS_SET_FILE_NAME ./BR + CUTOFF 150 - POTENTIAL_FILE_NAME ./GR + &END MGRID &QS &QS - EPS_DEFAULT 1.0E-10 + EPS_DEFAULT 1.0E-12 - METHOD GPW + - EXTRAPOLATION ASPC + - EXTRAPOLATION_ORDER 3 + &END QS &END QS - &MGRID - CUTOFF 400 - NGRIDS 5 - &END &SCF &SCF - MAX_SCF 20 + EPS_SCF 1.0E-06 + MAX_SCF 26 SCF_GUESS RESTART SCF_GUESS RESTART - EPS_SCF 1.0E-5 &OT &OT - PRECONDITIONER  FULL_SINGLE_INVERSE + MINIMIZER CG - MINIMIZER  CG + PRECONDITIONER FULL_SINGLE_INVERSE - &END + ENERGY_GAP 0.001 + &END OT &OUTER_SCF &OUTER_SCF - MAX_SCF 50 + EPS_SCF 1.0E-05 - EPS_SCF 1.0E-5 + &END OUTER_SCF - &END + - &PRINT + - &RESTART + - &EACH + - GEO_OPT 2 + - &END + - ADD_LAST NUMERIC + - FILENAME RESTART + - &END + - &RESTART_HISTORY OFF + - &END + - &END + &END SCF &END SCF &XC &XC Line 130: Line 177: &END XC_FUNCTIONAL &END XC_FUNCTIONAL &END XC &END XC + &PRINT + &MO_CUBES + NLUMO 10 + WRITE_CUBE T + &END MO_CUBES + &V_HARTREE_CUBE + STRIDE 2 2 2 + &END + &END PRINT &END DFT &END DFT - &SUBSYS - &CELL - A [angstrom] 14.08557 0 0 - B [angstrom] 0 12.1985 0 - C [angstrom] 0.000000      0.000000    15.0 - &END CELL - &TOPOLOGY - COORD_FILE_NAME ./S_M.opt.xyz - COORDINATE xyz - &END - &KIND Pd - BASIS_SET DZVP-MOLOPT-SR-GTH-q18 - POTENTIAL GTH-PBE-q18 - &END KIND - &KIND Ga - BASIS_SET DZVP-MOLOPT-SR-GTH-q13 - POTENTIAL GTH-PBE-q13 - &END KIND - &KIND C - BASIS_SET TZV2P-MOLOPT-GTH - POTENTIAL GTH-PBE-q4 - &END KIND - &KIND H - BASIS_SET TZV2P-MOLOPT-GTH - POTENTIAL GTH-PBE-q1 - &END KIND - &END SUBSYS - &END FORCE_EVAL - &GLOBAL - PRINT_LEVEL LOW - PROJECT S_M - RUN_TYPE ENERGY - &END GLOBAL - -