<p>Dear Thomas,</p><p>Thank you again for your help. I was able to reproduce your zero-field results to approximately the same accuracy with a master version cloned on Friday 22nd May. I presume the remaining small differences are due to build/library differences.</p><p>However, while the zero-field force sum is now well converged, I am not seeing the same behaviour once a finite periodic electric field is applied.</p><p>For example, using</p><p>METHOD GAPW_XC<br />GAPW_ACCURATE_XCINT<br />USE_FINER_GRID T<br />FINE_GRID_FACTOR 2.0</p><p>together with a periodic Berry-phase electric field of intensity 2.5e-4 a.u. along z, the force sum becomes</p><p>FORCES| Sum -6.11045615E-09 7.87254948E-09 2.04962359E-04<br />FORCES| Total atomic force 2.04962360E-04</p><p>So the transverse components remain well converged, but the component along the applied field direction returns to the order of 1e-4 Ha/Bohr. I see similar behaviour when applying the field along other directions. The issue also persists when increasing FINE_GRID_FACTOR from 2 to 8: the force-sum error remains orders of magnitude larger along the field axis (however, all components sum do decrease by ~1 order of magnitude relative to FINE_GRID_FACTOR 2). </p><p>Do you know whether there are additional grid, Berry-phase, or Wannier-related settings that need to be converged for finite-field force calculations? Or is there another setting that should be used together with GAPW_XC and GAPW_ACCURATE_XCINT in the presence of a periodic electric field?</p><p>Please find attached a minimal input (start.inp) /output (output.out) pair that reproduces the issue.</p><p>Thank you again for your help and advice.</p><p>All the best,<br />Kit</p><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Thursday, May 21, 2026 at 10:48:00 AM UTC+1 Kit Joll wrote:<br/></div><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><span dir="auto"></span></div><div><span dir="auto"><div dir="auto"><p>Dear Thomas,</p><p>Many thanks for the very quick and detailed reply! This is extremely helpful, and your diagnosis makes a lot of sense given the behaviour we were seeing.</p><p>I will try compiling the current CP2K master using the new make_cp2k.sh workflow, run the relevant regression tests, and then first reproduce your zero-field force-sum results on the same calcite frame. After that, I will check whether the same settings also resolve the sensitivity we observe in the finite-field response tensors.</p><p>Thank you also for pointing out the PRINT_LEVEL LOW workaround and the relevant GAPW_XC / GAPW_ACCURATE_XCINT settings. I will report back once I have tested these on our side.</p><p>



</p><p>Best wishes,<br>
Kit</p></div></span></div><br><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Wednesday, May 20, 2026 at 9:00:47 PM UTC+1 Thomas Kühne wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="line-break:after-white-space"><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Dear Kit,</p><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Thank you for the detailed report and for the input/output files. I was able to<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">reproduce the force-sum residual for the provided calcite frame:</p><div style="box-sizing:border-box;border:1px solid rgba(255,255,255,0.96);margin:0px;padding:0px;width:721.516px;min-width:0px;overflow:clip;border-radius:12.5px;background-color:rgba(26,28,31,0.08);color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-size:14px;font-variant-ligatures:normal;text-decoration-style:initial;text-decoration-color:initial"><div style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:flex;border-top-left-radius:12.5px;border-top-right-radius:12.5px;font-size:13px;line-height:1.42857;color:rgba(26,28,31,0.494)"><div style="box-sizing:border-box;border:0px solid;margin:0px 0px 0px auto;padding:0px;display:flex"><div style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:flex"><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:contents"></span><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:contents"></span></div></div></div><div dir="ltr" style="box-sizing:border-box;border:0px solid;margin:0px;padding:8px;overflow:auto"><code style="box-sizing:border-box;border:0px solid;margin:0px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-feature-settings:normal;font-size:1em;padding:0px!important;white-space:pre!important;border-radius:0px!important"><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">GPW baseline:</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  Sum F = ( 3.48675295E-05, 1.12518883E-04, -5.39277596E-05 ) Ha/Bohr</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  |Sum F| = 1.29554803E-04 Ha/Bohr</span></span></code></div></div><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">The behavior originate from the XC/grid treatment:</p><div style="box-sizing:border-box;border:1px solid rgba(255,255,255,0.96);margin:0px;padding:0px;width:721.516px;min-width:0px;overflow:clip;border-radius:12.5px;background-color:rgba(26,28,31,0.08);color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-size:14px;font-variant-ligatures:normal;text-decoration-style:initial;text-decoration-color:initial"><div style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:flex;border-top-left-radius:12.5px;border-top-right-radius:12.5px;font-size:13px;line-height:1.42857;color:rgba(26,28,31,0.494)"><div style="box-sizing:border-box;border:0px solid;margin:0px 0px 0px auto;padding:0px;display:flex"><div style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:flex"><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:contents"></span><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:contents"></span></div></div></div><div dir="ltr" style="box-sizing:border-box;border:0px solid;margin:0px;padding:8px;overflow:auto"><code style="box-sizing:border-box;border:0px solid;margin:0px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-feature-settings:normal;font-size:1em;padding:0px!important;white-space:pre!important;border-radius:0px!important"><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">GPW + USE_FINER_GRID T, FINE_GRID_FACTOR 2.0:</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  |Sum F| = 2.26659720E-05 Ha/Bohr</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"></span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">GPW + finer/smoothed XC grid:</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  |Sum F| = 1.10078684E-06 Ha/Bohr</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"></span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">GAPW_XC:</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  |Sum F| = 4.20880179E-05 Ha/Bohr</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"></span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">GAPW_XC + GAPW_ACCURATE_XCINT:</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  |Sum F| = 1.68750841E-07 Ha/Bohr</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"></span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">GAPW + GAPW_ACCURATE_XCINT + USE_FINER_GRID T, FINE_GRID_FACTOR 2.0:</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  |Sum F| = 3.85198029E-08 Ha/Bohr</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"></span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">GAPW_XC + GAPW_ACCURATE_XCINT + USE_FINER_GRID T, FINE_GRID_FACTOR 2.0:</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  |Sum F| = 1.04105369E-08 Ha/Bohr</span></code></div></div><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">This strongly suggests that the residual is dominated by an egg-box/grid-coupling<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">effect in the XC/grid integration rather than by pseudopotentials, basis sets, or<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">SCF noise.</p><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">For this system, the best tested setting was:</p><div style="box-sizing:border-box;border:1px solid rgba(255,255,255,0.96);margin:0px;padding:0px;width:721.516px;min-width:0px;overflow:clip;border-radius:12.5px;background-color:rgba(26,28,31,0.08);color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-size:14px;font-variant-ligatures:normal;text-decoration-style:initial;text-decoration-color:initial"><div style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:flex;border-top-left-radius:12.5px;border-top-right-radius:12.5px;font-size:13px;line-height:1.42857;color:rgba(26,28,31,0.494)"><div style="box-sizing:border-box;border:0px solid;margin:0px 0px 0px auto;padding:0px;display:flex"><div style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:flex"><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:contents"></span><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;display:contents"></span></div></div></div><div dir="ltr" style="box-sizing:border-box;border:0px solid;margin:0px;padding:8px;overflow:auto"><code style="box-sizing:border-box;border:0px solid;margin:0px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-feature-settings:normal;font-size:1em;padding:0px!important;white-space:pre!important;border-radius:0px!important"><span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">&QS</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  EPS_DEFAULT 1.0E-18</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  METHOD GAPW_XC</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  GAPW_ACCURATE_XCINT</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">&END QS</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"></span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">&XC</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  DENSITY_CUTOFF  1.0E-10</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  GRADIENT_CUTOFF 1.0E-10</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  TAU_CUTOFF      1.0E-10</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  &XC_GRID</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">    FINE_GRID_FACTOR 2.0</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">    USE_FINER_GRID T</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  &END XC_GRID</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  &XC_FUNCTIONAL NO_SHORTCUT</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">    &GGA_C_PBE</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">    &END GGA_C_PBE</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">    &GGA_X_RPBE</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">    &END GGA_X_RPBE</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">  &END XC_FUNCTIONAL</span>
<span style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">&END XC</span></code></div></div><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span>METHOD GAPW</span> with the same <span>GAPW_ACCURATE_XCINT</span> and fine XC grid also performs<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">very well, but in this test <span>GAPW_XC</span> was slightly better and should be the less<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">intrusive change relative to the original GPW calculation.</p><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">One practical note: <span>GAPW_ACCURATE_XCINT</span> has been improved recently, so I would<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">recommend testing with a recent CP2K master or a release that includes those<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">changes. Also, for this calcite input current master hit a post-SCF output crash<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">with <span>PRINT_LEVEL MEDIUM</span>; using <span>PRINT_LEVEL LOW</span> while keeping explicit<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px"><span>&FORCES ON</span> avoided that and still printed the force block.</p><p style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px;font-size:14px;color:rgb(26,28,31);font-family:-apple-system,system-ui,"Segoe UI",sans-serif;font-variant-ligatures:normal;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Best wishes,<br style="box-sizing:border-box;border:0px solid;margin:0px;padding:0px">Thomas</p><div></div></div></blockquote></div></blockquote></div>

<p></p>

-- <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+unsubscribe@googlegroups.com">cp2k+unsubscribe@googlegroups.com</a>.<br />
To view this discussion visit <a href="https://groups.google.com/d/msgid/cp2k/5caec0c1-cdad-455b-815f-dd7f993d0230n%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/cp2k/5caec0c1-cdad-455b-815f-dd7f993d0230n%40googlegroups.com</a>.<br />