<div dir="ltr"><div>Hello,</div><div><br></div><div>I would like to calculate the dipole of a slab with periodic boundary conditions along the surface plane and no periodicity perpendicular to the surface (so obviously only the dipole component in the latter direction is well-defined). From the discussion in <a href="https://groups.google.com/forum/#!topic/cp2k/SXhr0b6QGQk">https://groups.google.com/forum/#!topic/cp2k/SXhr0b6QGQk</a> I gather that this should be possible in CP2K using the wavelet poisson solver and "traditional" dipole operator if one is only interested in the component in the aperiodic direction (as I am), or alternatively using the Berry phase method. The latter is not an option for me, as my system absolutely requires smearing to get a converged ground state.</div><div><br></div><div>To test whether this works in principle, I calculated the dipole of a small molecule with known dipole value (ozone, ~0.53 Debye), "pretending" it's a slab (XZ periodicity) and putting it in the center of the box. This seems to more or less reproduce the correct dipole value just fine as long as the reference point is near the molecule (or, equivalently, near the center), but if one sets the reference point near the corners of the box, there are huge "jumps" in the calculated dipole to unrealistic values:</div><div><br></div><p class="separator" style="text-align: center; clear: both;"><img style="margin-left: 1em; margin-right: 1em;" src="cid:998b2200-6759-4e0e-a2b2-050eb1c66856" alt="dipole_reference_point_dependence.png" width="320" height="240"></p><div><br></div><div>I'm just wondering if this is a bug or if I am doing something wrong, since as far as I know, the dipole calculated using the "traditional" operator should never depend on the reference point for a neutral system. In this case, it's obvious what the correct value is and that the other ones should just be disregarded, but if I want to apply this as a general method, it's a bit worrying that it can be so totally off depending on something that shouldn't matter. It's also not clear where the reference point should be in order to produce "good" results (always just the center of the box?).<br></div><div><br></div><div>As an aside, this also happens with e.g. XYZ periodicity instead of XZ and any Poisson solver I tried. Turning off periodicity altogether, on the other hand, fixes the issue, but of course that's not an option once I move on to actual slabs.<br></div><div><br></div><div>A minimal example input file is attached, one just needs to adjust the basis set and potential paths and then vary the reference point to reproduce this. I'm running CP2K version 6.1.<br></div><div><br></div><div>Thank you in advance for any help and suggestions!</div><div><br></div><div>Kind regards</div><div>Shahri<br></div></div>