6.6. geom with CP2K
Tip
CP2K is highly powerful for clusters in periodic systems, like surface-supported, or zeolite-absorbed systems. However, it is also highly complicated. You’d better have some experience of condensed-phase physics or solid quantum chemistry before reading this section.
To use CP2K with geom
, you need two files: misc/runCP2K.sh
and CP2K.tmp
.
misc/runCP2K.sh
is a script to call CP2K. There is ONLY 1 line that you need to change:
1cp2kcmd="mpirun cp2k.popt"
You need to change it so you can correctly call CP2K on your hardware, like srun -n 192 cp2k.popt
or /opt/cp2k-8.0/cp2k.popt
.
CP2K.tmp
is a CP2K input template. You’d better ONLY change the following parts:
1CHARGE 0
2MULTIPLICITY 1
3! LSD
4! SURFACE_DIPOLE_CORRECTION T
5! SURF_DIP_DIR Z
6BASIS_SET_FILE_NAME BASIS_MOLOPT
7POTENTIAL_FILE_NAME GTH_POTENTIALS
8... omitted ...
9PARAMETER_FILE_NAME dftd3.dat
10... omitted ...
11&CELL
12 A 30.00000000 0.00000000 0.00000000
13 B 0.00000000 30.00000000 0.00000000
14 C 0.00000000 0.00000000 30.00000000
15 PERIODIC XYZ
16 MULTIPLE_UNIT_CELL 1 1 1
17&END CELL
18... omitted ...
19&KIND H
20 BASIS_SET DZVP-MOLOPT-SR-GTH
21 POTENTIAL GTH-PBE-q1
22&END KIND
To sum up, you need to change:
The
CHARGE
andMULTIPLICITY
of the system.If
MULTIPLICITY
is not1
, thenLSD
should be un-commented.For surface-supported systems, un-comment
SURFACE_DIPOLE_CORRECTION T
andSURF_DIP_DIR Z
. Please ensure that the vacuum direction should be Z.The paths and filenames for
BASIS_SET_FILE_NAME
,POTENTIAL_FILE_NAME
, andPARAMETER_FILE_NAME
.The cell constants
A
,B
, andC
.The basis sets for each element,
KIND
.If you understand exactly what you are doing, you can change anywhere.
6.6.1. Example: Graphene oxide-supported Cu8
Tip
The sample input and output files can be found in testfiles/geom/6-gocu8-cp2k
.
Let’s see how 8 \(\text{Cu}\) are supported over the surface of a graphene oxide. The structure of the graphene oxide model is:
1124
2-829.3320055707
3C 0.6432795582 1.4146381445 12.9802103805
4C 1.8638405295 0.7068348736 13.1358213883
5C 3.0803261454 1.4117958723 13.2926182146
6C 4.2826452613 0.7049969815 13.4870725811
7C 5.4908939226 1.4183747968 13.6173292256
8C 6.6945610217 0.7086518738 13.7044774152
9C 7.9024899763 1.4278111301 13.7202904813
10C 9.1068015792 0.7190504163 13.6370502922
11C 10.3144403340 1.4355578787 13.5249758495
12C 11.5141472647 0.7292051997 13.3245409163
13C 12.7285238514 1.4409268334 13.1735625500
14C 13.9454351317 0.7326485987 12.9974247960
15C 15.1770415433 1.4301435475 12.9268878534
16C 16.4093490282 0.7204721712 12.9136194279
17C 0.6527631899 2.8319555916 13.0403244189
18C 1.8691198475 3.5247382130 13.2528534491
19C 3.0871709142 2.8287137498 13.3671638582
20C 4.2802068410 3.5288023773 13.6746472393
21C 5.4929582858 2.8314678050 13.7365915100
22C 6.6924957067 3.5357798292 13.9782707015
23C 7.9043631825 2.8383988195 13.8719868403
24C 9.1216246522 3.5404615840 13.9597571598
25C 10.3210695315 2.8454166260 13.6974578387
26C 11.5429395786 3.5450362446 13.6591436703
27C 12.7356297186 2.8503322354 13.3275571037
28C 13.9651113637 3.5501152720 13.2375295895
29C 15.1851408619 2.8472003599 13.0203390970
30C 16.4208344084 3.5359621542 13.0533771591
31C 0.6441811503 5.6279654088 13.3965857081
32C 1.8728741720 4.9242285617 13.4881166107
33C 3.0318853880 5.5796320552 13.9222434798
34C 4.2649866705 4.9134821550 14.0198081831
35C 5.4335432648 5.5637056006 14.4877076867
36C 6.6808855036 4.9105244991 14.3827642479
37C 7.9080442650 5.5594291871 14.6773251573
38C 9.1266636524 4.9126119226 14.3624572194
39C 10.3842966168 5.5650364964 14.4594029340
40C 11.5549663178 4.9229088327 14.0219032123
41C 12.7947229064 5.6371718819 13.8807376941
42C 13.9748547953 4.9457164036 13.4445846528
43C 15.1953657892 5.6370386229 13.3406252865
44C 16.4313478432 4.9426895690 13.2131835785
45C 0.6543708202 7.0373885448 13.5438567265
46C 1.8064599541 7.7182584078 13.9251444122
47C 2.9229822840 6.9418844917 14.4259195724
48C 4.0618007814 7.6106729179 15.0907651413
49C 5.3621801507 6.8770322789 15.1711001143
50C 6.6108186191 7.5877082532 15.5815224661
51C 7.9279193292 6.8764197120 15.3683430735
52C 9.2242243383 7.5935096830 15.5373883633
53C 10.4876471939 6.8906080702 15.0962810702
54C 11.7728595787 7.6409078920 14.9164998313
55C 12.8462241580 7.0004281339 14.1357675067
56C 14.0017035182 7.7276022730 13.7700768308
57C 15.2040163359 7.0351375742 13.4515730393
58C 16.4229251336 7.7300709199 13.4364821732
59C 0.6397199388 9.8247108977 13.6732061241
60C 1.8406768708 9.1253542496 14.0406383742
61C 2.9135073628 9.8051709406 14.6150938055
62C 4.0484428025 9.1048552407 15.2460375128
63C 5.2987284042 9.8368977331 15.6301937214
64C 6.6211748387 9.0957998585 15.8089307286
65C 7.9318500618 9.8463453784 15.8249141248
66C 9.2646748957 9.1015561413 15.7315438754
67C 10.5397322088 9.8522535100 15.4656183286
68C 11.8139498754 9.1289907885 15.0934109431
69C 12.9303511297 9.8515482792 14.4466388818
70C 14.0225893292 9.1129723112 13.8211288561
71C 15.1994636428 9.8140577255 13.5375901623
72C 16.4361778290 9.1248747195 13.4886746469
73C 0.6156845872 11.2204744941 13.6336774460
74C 1.7707140395 11.9395262563 13.9607604011
75C 2.8382149430 11.2512379588 14.6910231987
76C 4.1016042500 12.0523756371 15.0026016502
77C 5.3556933694 11.3384053295 15.4384304526
78C 6.6492978278 12.0529366184 15.2978289025
79C 7.9567571765 11.3501665124 15.5603995693
80C 9.2159999952 12.0650659421 15.1929597302
81C 10.5355171840 11.3503696266 15.2060145604
82C 11.6838859007 12.0119207895 14.5195180414
83C 12.8397100557 11.2537212968 14.0976615062
84C 13.9516390747 11.9070278478 13.6122930206
85C 15.1878087576 11.2102445326 13.4681476887
86C 16.3951276806 11.9083189243 13.4000184419
87C 0.6163654218 14.0029006812 13.3725361122
88C 1.8060481673 13.3152863013 13.7777899046
89C 3.0337709241 14.0264152856 13.9533725170
90C 4.2038561143 13.3762366275 14.3984184847
91C 5.4666717537 14.0202351728 14.2922343720
92C 6.6795574335 13.3731351172 14.6191869222
93C 7.9122364175 14.0210216781 14.3493476581
94C 9.1574077252 13.3680072124 14.4830244250
95C 10.3314428153 14.0171847622 14.0234357387
96C 11.5648907262 13.3500908525 13.9435509843
97C 12.7232586488 14.0102079913 13.4929671042
98C 13.9514266705 13.3146668780 13.3912841359
99C 15.1581451102 14.0004348888 13.1796863119
100C 16.3991728698 13.3097718039 13.2847133689
101C 0.6249122629 15.4030054815 13.1827403520
102C 1.8539123277 16.0963334400 13.2730559211
103C 3.0498777826 15.4008132820 13.6015954952
104C 4.2750162180 16.0958512571 13.6456022309
105C 5.4732322826 15.3953324436 13.9015892724
106C 6.6920660341 16.0959266602 13.8341013562
107C 7.9025760729 15.3972335614 13.9518732463
108C 9.1045764348 16.1039358511 13.7355726252
109C 10.3156842660 15.4042212839 13.6785267189
110C 11.5080217157 16.1100041005 13.3819984075
111C 12.7231013720 15.4122132076 13.2570323075
112C 13.9366873102 16.1125499161 13.0382306452
113C 15.1674208815 15.4100047690 13.0259311494
114C 16.4018982276 16.1029067889 12.9865164230
115O 3.0685014966 11.8976422961 15.9914973499
116O 5.8997308342 12.0590412352 16.5628583623
117O 8.6648481614 12.1225614836 16.5532521702
118O 11.4887905099 12.0544944852 16.0159560496
119O 4.3325494195 9.4837710397 16.6372574825
120O 7.2474048771 9.4886444434 17.0444487372
121O 10.1426564634 9.4956180826 16.8066317309
122O 12.9071693327 9.5603206129 15.9270516525
123O 3.0611390859 6.9977122659 15.9237447506
124O 5.8373324975 6.8504468255 16.5552492288
125O 8.6593345773 6.8517129583 16.6396185079
126O 11.4886084289 6.9277293990 16.1522635888
The copper atom is:
11
2Cu
3Cu 0 0 0
The input file is:
1lm_dir gocu8 # Save the local minima to this folder.
2num_calcs 50 # Total number of calculations.
3do_coarse_opt yes # no: Do NOT the coarse optimization.
4min_energy_gap 1.E-4 # When two energies differ smaller than
5 # this value, they are treated as identical.
6 # A negative number means do not remove
7 # energetically degenerated ones.
8max_geom_iters 3000 # The maximum number of iterations for local optimization.
9 # If it is less or equal than zero, then the number is unlimited.
10
11components
12 go.xyz 1
13 fix 0 0 0 0 0 0
14 ****
15 cu.xyz 8
16 random 0 0 2 7 7 4
17 ****
18end
19
20commands
21 ./runCP2K.sh $inp$ $out$ $xxx$
22end
In this input file, we fix the graphene oxide at (0
, 0
, 0
) without rotations, and let the copper atoms distribute randomly over a part of graphene oxide.
We have also copied misc/CP2K.tmp
and misc/runCP2K.sh
to the current directory. The cell constants are set to:
1SURFACE_DIPOLE_CORRECTION T
2SURF_DIP_DIR Z
3... omitted ...
4A 17.00000000 0.00000000 0.00000000
5B 0.00000000 16.80000000 0.00000000
6C 0.00000000 0.00000000 30.00000000
Note that we un-comment the surface options for this surface-supported cluster.
Now you can run the global optimization:
$ geom gocu8.inp > gocu8.out
After the optimization, the end of gocu8.out
is
-- Result Report --
Results are energy-increasingly reordered.
Structures of energies within 1.000E-04 are treated as degenerate.
All minima are saved to "gocu8".
-------------------------------------------------------------------
# index Energy NaiveRMSD
-------------------------------------------------------------------
0 24 -1214.21440464 0.00000000
1 8 -1214.19223466 0.39353040
2 17 -1214.17518232 0.67379764
3 23 -1214.16671106 0.99591902
4 7 -1214.15407074 0.93718398
5 25 -1214.14564270 0.99740923
6 12 -1214.14550906 0.83857957
Note that, in the first 4 clusters, the graphene surface are corrupted (some oxygen atoms dissociates from the surface) like gocu8/23.xyz
. The true global minimum is gocu8/7.xyz
. Both are shown below.
6.6.2. Example: (H2S)5@SSZ-13
Tip
The sample input and output files can be found in testfiles/geom/7-h2s5ssz-cp2k
.
We want to study the diffusion of \(\text{H}_2\text{S}\) in zeolite SSZ-13. The structure of SSZ-13 and \(\text{H}_2\text{S}\) are
1108
2SSZ-13
3 O 5.7000232468 7.6303196339 2.6186286767
4 O 5.2045498989 10.1995252965 3.2272552812
5 O 7.6341828896 9.4099723840 2.7745789292
6 O 5.8753034436 9.5497196844 0.7672162010
7 O 7.6375473635 4.2759815544 2.6753670218
8 O 9.5707533006 7.6299616532 2.6176480074
9 O 9.6106668261 5.3414448452 13.6228779840
10 O 7.6185326402 8.7535796994 13.6836873966
11 O 5.6658146587 5.3461814248 13.6160993667
12 O 5.7026893239 -0.2642085908 7.5407946669
13 O 0.7825962064 8.1512328930 7.5378038833
14 O 2.7836661828 11.6286830319 7.5359961843
15 O 2.7363955771 9.3420684719 3.8535391861
16 O 7.6423184053 0.8505970745 3.7730132707
17 O 12.5335364638 9.3415768142 3.8544585628
18 O 12.4624155643 3.6818551888 12.4626958554
19 O 7.6062858624 12.1072824025 12.4587051589
20 O 2.8065149113 3.6894351696 12.2320710199
21 O 2.7322963802 1.4435907562 8.8508132419
22 O 0.8127191930 4.8681935127 8.6967338458
23 O 12.4822455137 1.3976417344 8.7679437480
24 O 5.6527918209 2.5629377561 3.2319866240
25 O 12.0423876809 6.7757052402 3.2233313473
26 O 12.0554980341 6.2591391560 13.0723873245
27 O 5.5916803863 10.4417381114 13.0790389503
28 O 5.1667070765 2.7598543540 13.1500955201
29 O 10.0234139879 2.7573797734 13.0802094325
30 O 9.6173269693 10.4509455156 13.0839569435
31 O 3.1861034312 6.1951039344 13.1391153838
32 O 3.2262073712 6.7771124228 3.2237580685
33 O 9.6209190582 2.5656089905 3.2277416465
34 O 10.0640705757 10.1974856514 3.2288444611
35 O 5.1427255382 2.3096527675 8.0673522413
36 O 12.4246061731 6.5049032168 8.1596286214
37 O 5.2287254916 10.6584161272 8.1499333643
38 O 10.0660760251 10.7260767207 8.1486535093
39 O 2.8490782073 6.5139838953 8.1476193260
40 O 10.0374817601 2.3659377558 8.1472483774
41 O 5.1316112190 5.0641064531 2.8432015310
42 O 10.1446584873 5.0657040841 2.7757616149
43 O 10.1029249905 7.9248177185 13.5271012901
44 O 5.1139616931 7.9307810948 13.5327555244
45 O 7.6221919820 3.6097600857 13.5295025529
46 O 7.6288414056 1.5118665409 7.7615136197
47 O 11.9654721427 9.0151964046 7.6848839357
48 O 3.2451981211 9.0440458535 7.6881718795
49 O 3.3069973094 11.9100887748 3.6976804332
50 O 5.1307773743 0.0649280529 3.6340011283
51 O 0.7969499830 7.5670851250 3.6935855226
52 O 0.7910818700 5.3346368625 12.6820331150
53 O 11.9636291062 1.1105277839 12.6111708865
54 O 3.2392803629 1.1213561083 12.5479345449
55 O 3.3075057508 4.0157430778 8.7760041016
56 O 12.0156624591 3.9738388657 8.6139906116
57 O 7.6320672727 11.5168215978 8.6125370060
58 O 5.8866593170 3.4930627815 0.7891245303
59 O 11.1355336190 6.5074683788 0.7610373808
60 O 9.3801650379 3.4821683317 0.7717307825
61 O 9.3883869933 9.5474036098 0.7666774122
62 O 4.1692472661 6.4488991333 0.7780060769
63 O 5.9556046254 1.6428018426 5.6765493427
64 O 12.6861939240 7.3729754052 5.6887347990
65 O 4.3586450055 10.4595476971 5.6921261702
66 O 2.5801899718 7.3759353889 5.6905185401
67 O 9.3400531831 1.7041165806 5.6889457138
68 O 10.9432024258 10.5171940688 5.6851549584
69 O 12.7365486472 5.5973335861 10.6155686479
70 O 5.8478045129 11.3130579735 10.6124834850
71 O 4.5150336200 2.4391618565 10.6065434296
72 O 9.3801870229 11.2550644389 10.6124530044
73 O 2.4362265224 5.7858392934 10.6232169362
74 O 10.9023169714 2.5612785425 10.6093785249
75 Si 6.0920814665 3.8508163034 2.3648358150
76 Si 10.7202283849 6.5092425635 2.3328070616
77 Si 10.7198656965 6.4925660943 13.9546031759
78 Si 6.0652860896 9.1709124986 13.9647009255
79 Si 6.0809445096 3.8112454238 13.9744263842
80 Si 9.1680499571 3.8090892108 13.9600924915
81 Si 9.1702883031 9.1714808622 13.9670464697
82 Si 4.5450589507 6.4778439590 13.9665556825
83 Si 4.5589301028 6.4970522597 2.3544741665
84 Si 9.1776796571 3.8440220779 2.3459143784
85 Si 9.1743108787 9.1858945424 2.3361918038
86 Si 6.1023939667 1.2912554713 7.2563853198
87 Si 12.8984444715 7.7609462493 7.2559239768
88 Si 3.8937893347 10.4628352540 7.2542014120
89 Si 3.8917972712 10.4639571217 4.1313484718
90 Si 6.1021660505 1.2768708902 4.0983248150
91 Si 12.9264443751 7.7793779850 4.1294213351
92 Si 2.3418034349 7.7806749736 4.1302867232
93 Si 9.1747023738 1.2939288098 4.1186514298
94 Si 11.3852128233 10.4740999990 4.1168223128
95 Si 11.3849847412 10.4645367999 7.2520286806
96 Si 2.3463927644 7.7693527709 7.2545905923
97 Si 9.1641901801 1.3288002236 7.2655864551
98 Si 12.9252078158 5.2179055842 12.1892578243
99 Si 6.0541114995 11.7025286295 12.1775311953
100 Si 12.9318493098 5.2383696707 9.0377621396
101 Si 6.0833435431 11.6953330771 9.0489768990
102 Si 9.1739017270 11.7144997047 9.0639602124
103 Si 2.3459232172 5.2847394268 9.0735577386
104 Si 11.3678806369 2.5575039972 9.0491343651
105 Si 11.3433313927 2.5385553857 12.1747149889
106 Si 9.1561829214 11.6952711342 12.1629072761
107 Si 2.3228901646 5.2436972032 12.1586452445
108 Si 6.0937069986 9.1867058586 2.3360857945
109 Si 3.9151902179 2.5466565165 9.0895664436
110 Si 3.9346333440 2.5195603195 12.1307588181
13
2H2S
3S 0.00000000 0.00000000 -0.08403654
4H 0.00000000 -1.06961052 0.67229231
5H 0.00000000 1.06961052 0.67229231
The input file is:
1lm_dir h2s5-ssz-13 # Save the local minima to this folder.
2num_calcs 50 # Total number of calculations.
3do_coarse_opt yes # no: Do NOT the coarse optimization.
4min_energy_gap 1.E-4 # When two energies differ smaller than
5 # this value, they are treated as identical.
6 # A negative number means do not remove
7 # energetically degenerated ones.
8max_geom_iters 3000 # The maximum number of iterations for local optimization.
9 # If it is less or equal than zero, then the number is unlimited.
10
11components
12 ssz-13.xyz 1
13 fix 0 0 0 0 0 0
14 ****
15 h2s.xyz 5
16 random -2 -3 -4 2 3 4
17 ****
18end
19
20commands
21 ./runCP2K.sh $inp$ $out$ $xxx$
22end
In this input file, we fix SSZ-13 at (0
, 0
, 0
) without rotations, and let \(\text{H}_2\text{S}\) distribute randomly in a box.
We have also copied misc/CP2K.tmp
and misc/runCP2K.sh
to the current directory. The cell constants are set to:
1A 13.67500000 0.00000000 0.00000000
2B -6.83750000 11.84289740 0.00000000
3C 0.00000000 0.00000000 14.76700000
Now you can run the global optimization:
$ geom h2s5-ssz-13.inp > h2s5-ssz-13.out
After the optimization, the end of h2s5-ssz-13.out
is
-- Result Report --
Results are energy-increasingly reordered.
Structures of energies within 1.000E-04 are treated as degenerate.
All minima are saved to "h2s5-ssz-13".
-------------------------------------------------------------------
# index Energy NaiveRMSD
-------------------------------------------------------------------
0 27 -1358.80693816 0.00000000
1 4 -1358.80673445 1.22396041
2 48 -1358.80659506 1.24720115
3 26 -1358.80633823 1.39830933
4 30 -1358.80612440 1.21331541
5 16 -1358.80600754 1.53879815
6 5 -1358.80565466 1.06068612
So the global minimum is h2s5-ssz-13/27.xyz
, which is shown below.