<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div></div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><font size="3" class=""><br class=""></font></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="caret-color: rgb(33, 33, 33); color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;" class="">> In the long run, it might be helpful to include such tests routinely as part of the QE development process.</span><font size="3" class=""><br class=""></font></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-size: 12pt;" class=""><br class=""></span></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><font size="3" class="">The QE </font>developers<font size="3" class=""> team makes big effort to benchmark various functionalities of QE before the release and during the development process. In particular, we have a test suite with many examples which are used to benchmark various codes and various functionalities. For the DFT+Hubbard ortho-atomic forces, I tested everything using finite differences (as described above), I was convinced that all is good, and only then I added tests to the test suite. So we do care a lot about testing and benchmarking, but of course sometimes there maybe be some bugs which were overlooked or which comes for some other reason.</font></div></div></div></blockquote>I see. Perhaps it would be helpful to include this kind of pathintegral test to the test set, and I am happy to help implement it in the test suite.<br class=""><blockquote type="cite" class=""><div class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><font size="3" class=""><br class=""></font></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><font size="3" class="">Greetings,</font></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><font size="3" class="">Iurii</font></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div></div></div></blockquote>Thanks again for looking into this issue,</div><div>Best</div><div>Max</div><div><blockquote type="cite" class=""><div class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class=""><div id="Signature" class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" class=""><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><font size="3" face="'Times New Roman', Times, serif" color="808080" class="">--<br class="">Dr. Iurii TIMROV<br class="">Postdoctoral Researcher<br class=""><font color="808080" class=""><font face="'Times New Roman', Times, serif" class=""></font></font></font></div><font color="808080" class=""></font><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><font size="3" face="'Times New Roman', Times, serif" color="808080" class="">STI - IMX<span class="Apple-converted-space"> </span><font color="808080" class=""><font face="'Times New Roman', Times, serif" class="">- THEOS</font></font></font><font size="3" face="'Times New Roman', Times, serif" color="808080" class=""><span class="Apple-converted-space"> </span>and NCCR - MARVEL<br class=""></font></div><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><font size="3" face="'Times New Roman', Times, serif" color="808080" class=""><font size="3" face="'Times New Roman', Times, serif" color="808080" class="">Swiss Federal Institute of Technology Lausanne (EPFL<font color="808080" class=""><font face="'Times New Roman', Times, serif" class="">)</font></font></font><br class=""></font></div><font color="808080" class=""></font><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><font size="3" face="'Times New Roman', Times, serif" color="808080" class="">CH-1015 Lausanne, Switzerland<br class="">+41 21 69 34 881</font></div><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;" class=""><a href="http://people.epfl.ch/265334" tabindex="0" id="LPNoLP" class="">http://people.epfl.ch/265334</a><br class=""></div></div></div></div></div><hr tabindex="-1" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 872.1875px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>developers <<a href="mailto:developers-bounces@lists.quantum-espresso.org" class="">developers-bounces@lists.quantum-espresso.org</a>> on behalf of Max Amsler <<a href="mailto:amsler.max@gmail.com" class="">amsler.max@gmail.com</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Saturday, September 12, 2020 12:44:33 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>General discussion list for Quantum ESPRESSO developers<br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[QE-developers] Forces are not exact derivatives of the energy for U_projection_type = 'ortho-atomic'</font><div class=""> </div></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="" style="word-wrap: break-word; line-break: after-white-space;"><div class="">Dear all,</div>After extensively testing the recently implemented forces for U_projection_type = 'ortho-atomic’, I have come across several cases where the geometry optimizations would fail: the energy would fluctuate without convergence using BFGS, and even damped dynamics would frequently not converge. Such a behavior usually points to a problem with the forces, which are either not exact or noisy.<div class=""><br class=""></div><div class="">Based on this observation, I decided to perform a routine test: I compute the integral of the forces times displacement along a path in configurational space, and compare it with the energy difference between the initial and final point. If the forces are exact derivatives of the energy, the path integral must be identical to the energy difference (up to machine precision if the step size of the path integral goes to zero). The method is described in sec 3.3, <a href="https://doi.org/10.1016/j.cpc.2020.107415" class="">https://doi.org/10.1016/j.cpc.2020.107415</a>, see also the attachment of the relevant section. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""></div></div><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div class=""></div><div class=""><br class=""></div><div class="">I performed this test for a TiO2 Rutile structure with 6 atoms per cellI, along a path in a random direction with 0.001 Ang step size and with a total of 501 steps. I used 3 different settings: DFT without U, DFT+U with U_projection_type = ‘atomic’ (U=4.7147), and DFT+U with U_projection_type = 'ortho-atomic’ (U=4.7147). In the case of No-U and ‘atomic’, the relative error of the path integral and energy difference is less than1.d-4%, as expected when the forces are correct. But for 'ortho-atomic’ the relative error is a whopping 8%! This indicates that the forces are not the exact derivatives of the energy for U_projection_type = 'ortho-atomic’ (see also plot below, note that the y scale is logarithmic for the last two subplots).</div><div class=""><br class=""></div><div class=""></div></div><div class="" style="word-wrap: break-word; line-break: after-white-space;"><div class=""></div><div class=""><br class=""></div><div class="">It seems that there is a bug in the implementation of the forces for U_projection_type = 'ortho-atomic’, or that some terms have been neglected when computing the derivatives.</div><div class=""><br class=""></div><div class="">In the long run, it might be helpful to include such tests routinely as part of the QE development process.</div><div class=""><br class=""></div><div class="">Best</div><div class="">Max</div></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">developers mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:developers@lists.quantum-espresso.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">developers@lists.quantum-espresso.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://lists.quantum-espresso.org/mailman/listinfo/developers" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.quantum-espresso.org/mailman/listinfo/developers</a></div></blockquote></div><br class=""></div></body></html>