PW dipole correction
I have added a dipole correction for PW mode, as well as a test script for it and a short tutorial.
-
It can be used by adding the keyword dipole_corr_dir to the mode in the calculator (mode=PW(dipole_corr_dir=2)).
-
It works in all three directions, but only for orthorombic cells.
-
The routine has been included in dipole_correction.py and is called in the ReciprocalSpaceHamiltonian class if the above mentioned keyword is given to the calculator.
Up to now all the benchmarks, being a comparison with the dipole correction in fd mode and in dacapo for an assymetric slab and a comparison of the vacuum levels between a cell containing a single and two canceling dipoles, worked great.
However, it seems like the electrostatic potential can not be retrieved when I try to restart a .gpw file, since vHt_q is not written and vHt_g is reset, when the hamiltonian class is initialized.
Tell me if you can find any bugs or inconsistencies and I will try to fix them.
Best wishes, Georg
P.S.: This is my first commit, so please tell me if there is anything I should improve next time.