<div dir="ltr">Dear all:<div><br></div><div><div>I have posted here about this problem and have so far not received any replies, but am trying again in case there's anyone out there who has dealt with static dielectric constant/relative permittivity calculations in CP2K.</div><div><br></div><div>I have been struggling for some time with calculating a reasonable static dielectric constant for water at 20 C and atmospheric pressure.  So far I calculate values of <1 where I should be getting ~80 (for both Quickstep and FIST-based CP2K simulations) so there is probably something basic I don't understand about how to deal with the CP2K output.  </div><div><br></div><div>I want to use the expression attached.  It is likely my problem is related to the M term, which I need to calculate from CP2K output.  Here is a small snippet from a "moments.traj" output file (below).  My understanding is that there are three time steps represented here.  I extract the "Debye" lines and use those to calculate a total dipole moment by taking the square root of the sum of the squares of the three components in a "Debye" row.  I then convert everything to SI units.  </div><div><br></div><div><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><span style="color: #000;" class="styled-by-prettify"> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">](</span><span style="color: #000;" class="styled-by-prettify">A</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">U</span><span style="color: #660;" class="styled-by-prettify">.)|</span><span style="color: #000;" class="styled-by-prettify">                  </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">3.333675</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">0.611131</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">1.550260</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">](</span><span style="color: #606;" class="styled-by-prettify">Debye</span><span style="color: #660;" class="styled-by-prettify">)|</span><span style="color: #000;" class="styled-by-prettify">                 </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">8.473356</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">1.553341</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">3.940367</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">]</span><span style="color: #000;" class="styled-by-prettify"> DERIVATIVE</span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: #000;" class="styled-by-prettify">A</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">U</span><span style="color: #660;" class="styled-by-prettify">.)|</span><span style="color: #000;" class="styled-by-prettify">        </span><span style="color: #066;" class="styled-by-prettify">0.000767</span><span style="color: #000;" class="styled-by-prettify">  </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">0.000211</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">0.001268</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">](</span><span style="color: #000;" class="styled-by-prettify">A</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">U</span><span style="color: #660;" class="styled-by-prettify">.)|</span><span style="color: #000;" class="styled-by-prettify">                  </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">3.600074</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">0.921496</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">1.793125</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">](</span><span style="color: #606;" class="styled-by-prettify">Debye</span><span style="color: #660;" class="styled-by-prettify">)|</span><span style="color: #000;" class="styled-by-prettify">                 </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">9.150475</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">2.342208</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">4.557669</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">]</span><span style="color: #000;" class="styled-by-prettify"> DERIVATIVE</span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: #000;" class="styled-by-prettify">A</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">U</span><span style="color: #660;" class="styled-by-prettify">.)|</span><span style="color: #000;" class="styled-by-prettify">        </span><span style="color: #066;" class="styled-by-prettify">0.000754</span><span style="color: #000;" class="styled-by-prettify">  </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">0.000212</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">0.001278</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">](</span><span style="color: #000;" class="styled-by-prettify">A</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">U</span><span style="color: #660;" class="styled-by-prettify">.)|</span><span style="color: #000;" class="styled-by-prettify">                  </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">3.593577</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">0.947832</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">1.795335</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">](</span><span style="color: #606;" class="styled-by-prettify">Debye</span><span style="color: #660;" class="styled-by-prettify">)|</span><span style="color: #000;" class="styled-by-prettify">                 </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">9.133960</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">2.409149</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">4.563287</span><span style="color: #000;" class="styled-by-prettify"><br> MM DIPOLE </span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #000;" class="styled-by-prettify">BERRY PHASE</span><span style="color: #660;" class="styled-by-prettify">]</span><span style="color: #000;" class="styled-by-prettify"> DERIVATIVE</span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: #000;" class="styled-by-prettify">A</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">U</span><span style="color: #660;" class="styled-by-prettify">.)|</span><span style="color: #000;" class="styled-by-prettify">        </span><span style="color: #066;" class="styled-by-prettify">0.001552</span><span style="color: #000;" class="styled-by-prettify">  </span><span style="color: #660;" class="styled-by-prettify">-</span><span style="color: #066;" class="styled-by-prettify">0.000548</span><span style="color: #000;" class="styled-by-prettify">   </span><span style="color: #066;" class="styled-by-prettify">0.000455</span></div></code></div><p class="MsoNormal" style="font-size: 12pt; font-family: Calibri, sans-serif; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); text-size-adjust: auto;"><br></p></div><div>There is a CP2K tutorial that calculates the dielectric constant at this link:</div></div><div><br></div><div>https://www.cp2k.org/exercises:2017_ethz_mmm:monte_carlo_ice<br></div><div><br></div><div>I think my method for calculating M is the same as in the tutorial's "calc_dielectric_constant.py" example.  I have tried running the example to check that the format of its moments output file is the same as what I'm using (I can't tell from the Python code).  I am still trying, but so far haven't been able to run it successfully.  </div><div><br></div><div>The example uses a different expression than I am as far as calculating the dielectric constant and I have tried it as well as my expression.  Neither results in a value ~80.  </div><div><br></div><div>If anyone can provide any information/resources on calculating the M term or on another code I can use to process my existing CP2K output to check my methods, I would be very grateful.  Thank you.</div></div>