dipole
The key dipole may be used for calculations of the electronic polarization. The algorithm assumes one electron at each Wannier function center (in a non-magnetic calculation without spin-orbit coupling two electrons at each Wannier function center) and additional charges defined in ioncharge or IONS. The polarization created by the sum of all these dipole terms is calculated. The program then tries to minimize the sum of all terms by adding multiples of the polarization quantum. The final result may or may not be the correct electronic polarization: The general recipe to compute ferroelectric polarization is to compute several systems along the adiabatic path that transforms the centrosymmetric reference system into the ferroelectric state. The centrosymmetric reference system has zero polarization. Multiples of the polarization quantum need to be added to the polarizations obtained for the systems along the adiabatic path such that the evolution of the polarization is smooth along the adiabatic path. Therefore, the polarization obtained by the key dipole from a single calculation of a single system (without considering the adiabatic path) may differ from the correct polarization by a multiple of the polarization quantum.
When you understand very well how the polarization arises in your system, you may use instead the key dipole2. The key dipole2 allows us to obtain the correct value of the ferroelectric polarization without considering the adiabatic path in many cases.