<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.E-MailFormatvorlage20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Dear Jan<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">You are right, the PW92 has been buggy and gave different numbers compared to the libxc version XC_LDA_C_PW which you could use alternatively. After Jürg’s fix for PW92, the stress tensor
 for your system looks fine now within the numerical tolerances, though the debug run might still end with an error message, since the default test criterion of 1.0E-5 for sum of the deviations for all tensor elements is quite tight.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Best<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Matthias<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b>Von:</b> cp...@googlegroups.com <...@googlegroups.com>
<b>Im Auftrag von </b>Jan Elsner<br>
<b>Gesendet:</b> Donnerstag, 30. April 2020 20:06<br>
<b>An:</b> cp2k <...@googlegroups.com><br>
<b>Betreff:</b> Re: [CP2K:13211] CELL Optimization - Energy not decreasing<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Dear Juerg, <o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Ok, cheers for the advice. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Best wishes, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Jan<br>
<br>
On Thursday, April 30, 2020 at 5:24:26 PM UTC+1, jgh wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-left:35.4pt">Hi <br>
<br>
yes, I cam to the same conclusion. The problem seems to be <br>
the value for rs where the different formulas have to be switched. <br>
Changing at line 117 in xc_perdew_wang.fypp the value from <br>
1.0 to 0.5 seems to solve most problems. <br>
<br>
In addition, you might also want to use a reference cell (see CELL_REF) <br>
when optimizing cells. <br>
<br>
I will update the Trunk version of CP2K soon. <br>
<br>
regards <br>
<br>
Juerg Hutter <br>
-------------------------------------------------------------- <br>
Juerg Hutter                         Phone : ++41 44 635 4491 <br>
Institut für Chemie C                FAX   : ++41 44 635 6838 <br>
Universität Zürich                   E-mail: <a href="javascript:" target="_blank">
h...@chem.uzh.ch</a> <br>
Winterthurerstrasse 190 <br>
CH-8057 Zürich, Switzerland <br>
--------------------------------------------------------------- <br>
<br>
-----<a href="javascript:" target="_blank">c...@googlegroups.com</a> wrote: -----
<br>
To: "cp2k" <<a href="javascript:" target="_blank">c...@googlegroups.com</a>> <br>
From: "Jan Elsner" <br>
Sent by: <a href="javascript:" target="_blank">c...@googlegroups.com</a> <br>
Date: 04/30/2020 05:31PM <br>
Subject: Re: [CP2K:13207] CELL Optimization - Energy not decreasing <br>
<br>
Dear all, <br>
<br>
I thought I should post an update on this. <br>
<br>
It seems that there is a problem with using PW92 as the local correlation part of XC functional. When I use VWN instead, the analytical and numerical forces are equal. I attach input and output files for DEBUG runs on a single H20 molecule using optPBE in combination
 with PW92 and VWN. In the case of PW92, there is a mismatch between analytical and numerical forces.
<br>
<br>
I note that the same applies for the some of the other functionals listed here: <a href="https://github.com/cp2k/cp2k/tree/master/data/xc_section" target="_blank">
https://github.com/cp2k/cp2k/tree/master/data/xc_section</a> (at least, I can confirm that optB88 and C09 also give a mismatch between numerical and analytical forces using the settings listed here).
<br>
<br>
Best wishes, <br>
<br>
Jan <br>
<br>
<br>
<br>
<br>
On Friday, April 24, 2020 at 10:43:00 AM UTC+1, Jan Elsner wrote: <br>
Dear Juerg, <br>
<br>
Many thanks for the quick response! Unfortunately, decreasing EPS_SCF (all the way to 1.0E-10) does not solve the problem.
<br>
<br>
I have done a DEBUG run which results in the following error (see end of attached file debug.out): 'Abort: A mismatch between the analytical and the numerical stress tensor has been detected. Check the implementation of the stress tensor'. I'm not entirely
 sure how I should proceed from here / what the problem is exactly - any insight would be very much appreciated.
<br>
<br>
If it helps shed some light on the problem, I also attach a figure showing Total Energy, RMS Gradient and Cell Volume as a function of optimization step (plotted from the original cell.out file I sent). The optimiser seems to overshoot the minimum energy configuration.
<br>
<br>
One other question which comes to mind is whether it's ok to use GTH-PBE or GTH-PADE pseudopotentials with optPBE-vdW?
<br>
<br>
Best wishes, <br>
<br>
Jan <br>
<br>
<br>
<br>
<br>
<br>
On Monday, April 20, 2020 at 10:20:34 AM UTC+1, jgh wrote:Hi <br>
  <br>
I don't know how well a setup as this is tested. However, from <br>
your output I would guess the problem could be related to your <br>
SCF convergence. With the methods you are using you have to set <br>
the convergence criteria much tighter in order to get converged <br>
energy and forces. I would suggest to use at least 1.E-8. <br>
  <br>
The ultimate test would be to do a DEBUG run in order to verify <br>
forces and stress tensor for the setting of options. <br>
  <br>
regards <br>
  <br>
Juerg Hutter <br>
-------------------------------------------------------------- <br>
Juerg Hutter                         Phone : ++41 44 635 4491 <br>
Institut für Chemie C                FAX   : ++41 44 635 6838 <br>
Universität Zürich                   E-mail: <a href="mailto:h...@chem.uzh.ch">
h...@chem.uzh.ch</a> <br>
Winterthurerstrasse 190 <br>
CH-8057 Zürich, Switzerland <br>
--------------------------------------------------------------- <br>
  <br>
<a href="mailto:-----c...@googlegroups.com">-----c...@googlegroups.com</a> wrote: -----
<br>
To: "cp2k" <<a href="mailto:c...@googlegroups.com">c...@googlegroups.com</a>> <br>
From: "Jan Elsner"   <br>
Sent by: <a href="mailto:c...@googlegroups.com">c...@googlegroups.com</a> <br>
Date: 04/18/2020 08:33PM <br>
Subject: [CP2K:13145] CELL Optimization - Energy not decreasing <br>
  <br>
Dear all,   <br>
  <br>
I am trying to run a Cell Optimisation on a periodic molecular crystal (beta-resorcinol: C6H6O2, 4 molecules in unit cell) using K-points and BFGS as optimiser. I am using the vdW-DF-optPBE functional (<a href="https://github.com/cp2k/cp2k/commit/74ef05b96a46523a0daf7da04e75804420b5cd5e" target="_blank">https://github.com/cp2k/cp2k/commit/74ef05b96a46523a0daf7da04e75804420b5cd5e</a>).
 After 83 optimisation steps, my system does converge to the required MOTION thresholds, however from step 7 onwards the total energy increases at every step i.e.:
<br>
  <br>
--------  Informations at step =     7 ------------ <br>
  Optimization Method        =                 BFGS <br>
  Total Energy               =      -280.1489665596 <br>
  Internal Pressure [bar]    =     -2667.4573178334 <br>
  Real energy change         =         0.0001037473 <br>
  Predicted change in energy =        -0.0001063956 <br>
  Scaling factor             =         0.0000000000 <br>
  Step size                  =         0.0124910496 <br>
  Trust radius               =         0.4724315332 <br>
  Decrease in energy         =                   NO <br>
  Used time                  =               60.978 <br>
  <br>
  Convergence check : <br>
  Max. step size             =         0.0124910496 <br>
  Conv. limit for step size  =         0.0010000000 <br>
  Convergence in step size   =                   NO <br>
  RMS step size              =         0.0029192108 <br>
  Conv. limit for RMS step   =         0.0010000000 <br>
  Convergence in RMS step    =                   NO <br>
  Max. gradient              =         0.0034738629 <br>
  Conv. limit for gradients  =         0.0001000000 <br>
  Conv. for gradients        =                   NO <br>
  RMS gradient               =         0.0006857738 <br>
  Conv. limit for RMS grad.  =         0.0001000000 <br>
  Conv. for gradients        =                   NO <br>
  Pressure Deviation [bar]   =     -2668.4705678334 <br>
  Pressure Tolerance [bar]   =       200.0000000000 <br>
  Conv. for  PRESSURE        =                   NO <br>
 --------------------------------------------------- <br>
  <br>
The resulting cell-optimised structure is therefore not a minimum in energy. I've attached the input and output files. Some points which may (or may not) be relevant:
<br>
I did not encounter this problem when using a different functional (PBE + D3 instead of optPBE-vdW as used here), but otherwise identical settings.
<br>
I encountered the same issue (energy increasing at every step) using CUTOFF/REL_CUTOFF = 800/60
<br>
I initially tried to converge CUTOFF and REL_CUTOFF as in the tutorial ( <br>
<a href="https://www.cp2k.org/howto:converging_cutoff" target="_blank">https://www.cp2k.org/howto:converging_cutoff</a>), however my single point calculations did not converge quite as nicely as in the tutorial - instead oscillating with an amplitude of order
 ~ e-4 Ha (I've attached a figure showing this). This is why I use such large CUTOFF/REL_CUTOFF values. I note that this was also the case when I ran PBE + D3 calculations, however in the latter case my cell optimisation did work.  
<br>
  <br>
Any input would be greatly appreciated.   <br>
  <br>
Best wishes,   <br>
  <br>
Jan <br>
  <br>
  <br>
    <br>
  --   <br>
 You received this message because you are subscribed to the Google Groups "cp2k" group.
<br>
 To unsubscribe from this group and stop receiving emails from it, send an email to
<a href="mailto:c...@googlegroups.com">c...@googlegroups.com</a>. <br>
 To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/cp2k/e97788c6-1c43-453d-893e-6b973a977f9d%40googlegroups.com" target="_blank">
https://groups.google.com/d/msgid/cp2k/e97788c6-1c43-453d-893e-6b973a977f9d%40googlegroups.com</a>.
<br>
  <br>
  <br>
[attachment "cell.inp" removed by Jürg Hutter/at/UZH] <br>
[attachment "cell.out" removed by Jürg Hutter/at/UZH] <br>
[attachment "E_vs_cutoff.png" removed by Jürg Hutter/at/UZH] <br>
[attachment "subsys.include" removed by Jürg Hutter/at/UZH] <br>
  <br>
  -- <br>
 You received this message because you are subscribed to the Google Groups "cp2k" group.
<br>
 To unsubscribe from this group and stop receiving emails from it, send an email to
<a href="javascript:" target="_blank">c...@googlegroups.com</a>. <br>
 To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/cp2k/48cb2870-f660-437b-83b2-4a9e54e15b20%40googlegroups.com" target="_blank">
https://groups.google.com/d/msgid/cp2k/48cb2870-f660-437b-83b2-4a9e54e15b20%40googlegroups.com</a>.
<br>
  <br>
<br>
[attachment "pw92.inp" removed by Jürg Hutter/at/UZH] <br>
[attachment "pw92.out" removed by Jürg Hutter/at/UZH] <br>
[attachment "vwn.inp" removed by Jürg Hutter/at/UZH] <br>
[attachment "vwn.out" removed by Jürg Hutter/at/UZH] <o:p></o:p></p>
</blockquote>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt">-- <br>
You received this message because you are subscribed to the Google Groups "cp2k" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to
<a href="mailto:cp2k+unsu...@googlegroups.com">cp2k+unsu...@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/cp2k/b588cc61-36a0-4fe8-a4fa-f97f46625603%40googlegroups.com?utm_medium=email&utm_source=footer">
https://groups.google.com/d/msgid/cp2k/b588cc61-36a0-4fe8-a4fa-f97f46625603%40googlegroups.com</a>.<o:p></o:p></p>
</div>
</body>
</html>