<div dir="ltr"><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);">Hello again, </div><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);"><br></div><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);">in the case that you mean that you are using a different number of QM atoms, a significant energy difference can be expected. The reason is that different molecular models assign different energies to the same atoms/molecules. In particular QM atoms/molecules often have a much lower energy than MM atoms. QM models for instance usually include the electron-nuclei interactions explicitly while MM models do not, therefore you usually cannot compare the total energy of different molecular models even if the system is the same. </div><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);"><br></div><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);">Best wishes,</div><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);">Jadzia</div><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);"><br></div><div class="gmail_default" style="font-size: small; font-family: "trebuchet ms", sans-serif; color: rgb(32, 18, 77);"><br></div><br>On Sunday, September 10, 2017 at 5:24:40 PM UTC+2, jts2...@gmail.com wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Hi, Matt, bother you again. <div><br></div><div>The real problem I want to figure out is, when I set 1-layer QM atoms, the energy is</div><div>Total FORCE_EVAL ( QMMM ) energy (a.u.):           -351.508815087281562</div><div><br></div><div>While I set 2-layer QM-atoms, the energy is </div><div>Total FORCE_EVAL ( QMMM ) energy (a.u.):           -696.366434340290539</div><div><br></div><div>What bother me is that the energy should be almost the same, but the fact is that they differ nearly twice. </div><div>So I want to know if there is some mistake in my understanding, or is there some mistake in my setting ?<br><br>在 2017年9月8日星期五 UTC+8下午5:14:30,Matt W写道:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The line I suggested _is_ the total energy QM + MM + QM-MM<div><br></div><div>If you set print level medium you should see something like</div><div><br></div><div><div> QMMM| Evaluating forces on MM atoms due to the:</div><div> QMMM| - QM/MM Coupling computed collocating the Gaussian Potential Functions.</div><div> QMMM| QM/MM Nuclear Electrostatic Potential :                      -0.210189515</div><div> QMMM| QMMM Total Energy (QM + QMMM electronic + QMMM nuclear):   -694.056114328</div><div> QMMM| MM energy NOT included in the above term! Check for:  FORCE_EVAL ( QMMM )</div><div> QMMM| that includes both QM, QMMM and MM energy terms!</div><div><br></div><div> ENERGY| Total FORCE_EVAL ( QMMM ) energy (a.u.):           -696.223035107415399</div></div><div><br></div><div>Which gives the energy with and without the MM energy - so you can figure out the MM energy.</div><div><br><br>On Friday, September 8, 2017 at 6:45:52 AM UTC+1, <a>jts2...@gmail.com</a> wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, Matt,<div>Thanks for your advice! </div><div><br></div><div>I did as you suggest, then I typed in the command 'grep energy *.out'. But the results said </div><div><br></div><div>QMMM | MM energy NOT included in the above term! Check for: FORCE_EVAL(QMMM) that includes both QM, QMMM and MM energy terms !</div><div><br></div><div>So I still didn't get the MM energy message.</div><div><br></div><div>As far as my understanding, I should add something else in the &MM section, maybe an additional &FORCE_EVAL to output the information of MM region ?</div><div>Or there is something important ignored ?<br><br>在 2017年9月8日星期五 UTC+8上午4:16:40,Matt W写道:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">At each step of a geo_opt run you should see something like<div><br></div><div>ENERGY| Total FORCE_EVAL ( QMMM ) energy (a.u.):           -696.237954025524573<br></div><div><br></div><div>after all the QS output, that gives you the total energy of the system (at least if print_level is medium)<br><br>On Thursday, September 7, 2017 at 6:33:03 PM UTC+1, Jadzia wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I am not sure if the question is really "where the file is" since it will most likely be nowhere. And to be honest I don't know how to write a similar file for the energies for geo_opt as for MD simulations since only in the MD section there seems to be this print option, which might not be used during geo_opt (not sure about it). </div><div><br></div><div>But a workaround might be as follows: One can run cp2k with the -o option to store the output of the geometry optimization in a file, and then one could grep the energy out of that file. </div><div><br></div><br><br>On Thursday, September 7, 2017 at 5:05:04 PM UTC+2, <a>jts2...@gmail.com</a> wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for your suggestion, which works well in a example in official website, but fails in another case.<div><br><div>I run a GEO_OPT simulation using QMMM method,  the original motion.inc is as follows</div><div><div>&MOTION</div><div>  &GEO_OPT</div><div>     OPTIMIZER LBFGS</div><div>  &END</div><div>  &CONSTRAINT</div><div>     &FIXED_ATOMS</div><div>     LIST 1..16</div><div>     EXCLUDE_MM .TRUE.</div><div>     EXCLUDE_QM .FALSE.</div><div>     &END FIXED_ATOMS</div><div>  &END CONSTRAINT</div><div>&END MOTION</div></div><div><br></div><div>Then I added the MD section, they became</div><div><div>&MOTION</div><div>  &GEO_OPT</div><div>     OPTIMIZER LBFGS</div><div>  &END</div><div>  &CONSTRAINT</div><div>     &FIXED_ATOMS</div><div>     LIST 1..16</div><div>     EXCLUDE_MM .TRUE.</div><div>     EXCLUDE_QM .FALSE.</div><div>     &END FIXED_ATOMS</div><div>  &END CONSTRAINT</div><div>  &MD</div><div><span style="white-space:pre">       </span>&PRINT</div><div><span style="white-space:pre">            </span>&ENERGY</div><div><span style="white-space:pre">           </span> FILENAME=total.ener</div><div><span style="white-space:pre">          </span>  &EACH</div><div><span style="white-space:pre">          </span>    GEO_OPT 1</div><div><span style="white-space:pre">               </span>  &END EACH</div><div><span style="white-space:pre">              </span>&END ENERGY</div><div><span style="white-space:pre">       </span>&END PRINT</div><div>  &END MD</div><div>&END MOTION</div></div><div><br></div><div>The strange thing is that there wasn't any file named *total.ener* in the current directory. Where is the question ?</div><div>The &EACH section is not correct ?</div><div><br></div><div>Expect for your kind reply !</div><div><br></div><div><br></div><div><br><div><br>在 2017年9月7日星期四 UTC+8下午12:13:16,Jadzia写道:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>To my understanding if you want to write the total energy to a file for instance for an MD simulation you need to add a section similar to:</div><div><br> &MOTION<br>   &MD<br></div><div><div>    &PRINT</div><div>      &ENERGY</div><div>        FILENAME =cp2k.out.energy</div><div>          &EACH</div>            MD 10<div>          &END EACH</div><div>      &END ENERGY</div><div>    &END PRINT</div><div>  &END MD</div></div><div>&END MOTION</div><div><br></div><div>In this example the energy of every tenth step is written to the file, and is independent of the type of force evaluation (MM, QM, QM/MM, ...). </div><div><br></div><div>Here is the corresponding section in the manual: <a href="https://manual.cp2k.org/trunk/CP2K_INPUT/MOTION/MD/PRINT/ENERGY/EACH.html" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fmanual.cp2k.org%2Ftrunk%2FCP2K_INPUT%2FMOTION%2FMD%2FPRINT%2FENERGY%2FEACH.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEVg-AYx4ZC0HzxkrCtGN_Rf9YYuA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fmanual.cp2k.org%2Ftrunk%2FCP2K_INPUT%2FMOTION%2FMD%2FPRINT%2FENERGY%2FEACH.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEVg-AYx4ZC0HzxkrCtGN_Rf9YYuA';return true;">https://manual.cp2k.<wbr>org/trunk/CP2K_INPUT/MOTION/<wbr>MD/PRINT/ENERGY/EACH.html</a></div><div><br></div><div>Hope this helps,</div><div>Jadzia</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br>On Wednesday, September 6, 2017 at 8:31:10 AM UTC+2, <a>jts2...@gmail.com</a> wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear researchers and developers,<div><br><div>I am not so familiar with CP2K. After I run a QMMM simulation of KCl just as here: <a href="https://www.cp2k.org/exercises:2017_ethz_mmm:qmmm" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.cp2k.org%2Fexercises%3A2017_ethz_mmm%3Aqmmm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGiF0gJ6mRlaGSe7--tVuWgLftgjA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.cp2k.org%2Fexercises%3A2017_ethz_mmm%3Aqmmm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGiF0gJ6mRlaGSe7--tVuWgLftgjA';return true;">https://www.cp2k.org/<wbr>exercises:2017_ethz_mmm:qmmm</a>, I want to know the energy of the whole system not just the energy of the QM region, how to achieve it in the input setting?</div><div><br></div><div>I'll appreciate for your apply !</div></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></blockquote></div>