Ionic contribution to the macroscopic polarization

Problems running VASP: crashes, internal errors, "wrong" results.


Moderators: Global Moderator, Moderator

Locked
Message
Author
User avatar
chengcheng_xiao1
Newbie
Newbie
Posts: 26
Joined: Sun Nov 17, 2019 6:23 pm
Location: London, UK
Contact:

Ionic contribution to the macroscopic polarization

#1 Post by chengcheng_xiao1 » Sat May 22, 2021 10:17 am

I might've spotted a bug in subroutine `POINT_CHARGE_DIPOL` in `dipol.F` which is only used in `pead.F` to calculate the ionic contribution to the macroscopic polarization.

In subroutine `POINT_CHARGE_DIPOL`, the following code:

Code: Select all

!jF: the atoms at the cell boundary (position -0.5) cause a problem since
!    one also had to add a contribution from the equivalent position at the
!    opposite cell boundary (position +0.5) effectively adding up to zero
!    (due to "position + -position") what should be fixed by following code.
!    Such problems only occur for bulk cells. For isolated molecules etc.
!    there are no atoms at the cell boundary, just vacuum :-). It is also no
!    problem for the quadrupole moment (due to "position**2"). If you still
!    fail to get the correct dipole moment play around with parameter TINY
!    which defines the "thickness of the cell boundary region" ...
            IF (ABS(ABS(X)-0.5_q)<TINY/LATT_CUR%ANORM(1)) X=0
            IF (ABS(ABS(Y)-0.5_q)<TINY/LATT_CUR%ANORM(2)) Y=0
            IF (ABS(ABS(Z)-0.5_q)<TINY/LATT_CUR%ANORM(3)) Z=0
essentially average out the position between ions with their periodic image (i.e. + a cell length) if they are sufficiently close (controlled by `TINY`) to the periodic boundary. (Note that the position of the periodic boundary is now defined relative to `POSCEN` which can be changed using `DIPOL` tag. This means one has to use the same `DIPOL` for both centro and non-centrosymmetric calculations.)

The logic here is that if the atom is at the periodic boundary, we should also count its equivalent position and add it to the ionic contribution. However, this is not necessarily true for the polarization calculations since all we need is the difference of polarization between a centrosymmetric phase and a non-centrosymmetric one. If the atom is considered to be "at the periodic boundary" for the centrosymmetric phase and "not at the periodic boundary" for the non-centrosymmetric phase, this procedure will cause problems.

I think these few lines of code have caused a lot of confusion in the community especially because the result of this routine doesn't match a simple manual calculation using $(P_{ion}-P_{DIPOL}) * ZVAL_{ion}$ where $P$ stand for "Position".

I have tried to comment these lines out and the result matches the expected values perfectly.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: Ionic contribution to the macroscopic polarization

#2 Post by andreas.singraber » Tue Oct 12, 2021 3:13 pm

Hello!

First of all: I am very sorry for this very late reply!

Thank you for this very detailed report and your effort to investigate the issue. We are currently discussing whether it is safe to remove the code as you suggested. I will keep you updated..

All the best,
Andreas Singraber

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: Ionic contribution to the macroscopic polarization

#3 Post by andreas.singraber » Fri Oct 22, 2021 8:57 pm

Hi!

I have discussed this with my colleagues and we concluded that the three lines of code should indeed be removed from the computation carried out in pead.F. The changes will be part of the next release version. Thank you again for making us aware!

Best,

Andreas Singraber

User avatar
chengcheng_xiao1
Newbie
Newbie
Posts: 26
Joined: Sun Nov 17, 2019 6:23 pm
Location: London, UK
Contact:

Re: Ionic contribution to the macroscopic polarization

#4 Post by chengcheng_xiao1 » Thu Nov 04, 2021 3:48 pm

You are very much welcome! Glad to be a part of this awesome code! ;)

Locked