[QE-users] Minimum Image Convention in compute_dipole.f90

Dyer, Brock brdyer at ursinus.edu
Wed Jul 23 15:51:58 CEST 2025


Hi all, I'm currently trying to understand the exact method by which dipoles and quadrupoles are calculated in Quantum ESPRESSO, and while I understand the math for the actual generation of the dipole and quadrupole tensors, I am struggling when it comes to how QE actually performs the charge density summation in the unit cell.

>From what I can tell in compute_dipole.f90, the broad method by which the unit cell is iterated over involves using the linearly-indexed FFT grid (by that I mean the FFT grid indexing from 1-nnr) as the index for the summation loop and the charge density at each point is used to contribute to the final dipole and quadrupole.

What I don't understand is the conversion from the index ir to a 3D i,j,k index, and then the operations in lines 63-67 that seem to convert the i,j,k index to a 3D coordinate. It seems like there is some sort of conversion there between the FFT grid coordinate i,j,k into what looks like a reciprocal space position, however I see the use of the real space lattice vectors at in this, which would seem to indicate that this coordinate is in real space. Further convoluting things is subtracting out the "origin" point r0, which seems to be supplied in real space (see makov_payne.f90 lines 58-68), however immediately after this operation the coordinates are transformed from cartesian coordinates to crystallographic coordinates using the reciprocal space lattice vectors, bg, as a basis. After this the operation r(:) = r(:) - ANINT( r(:) ) is performed, which seems to be the operation described in most papers on the minimum image convention (e.g. Dieters 2013). Then the coordinate is transformed back from crystallographic to cartesian coordinates, except this time the basis for the transformation is the real space lattice vectors at.

I have tried reading through the comment in fft_types.f90 for the function that converts from FFT index to 3D coordinate, however I am unsure of why tau is specified in this comment as it seems that tau are the atomic positions and wouldn't be used in the manner that is described in that comment.

If there are any papers that describe these processes (FFT index to 3D and the specific method for the minimum image convention in QE) or perhaps a set of equations that I could follow, I'd be happy to use them to further my understanding.

Thanks,

Brock Dyer

Materials Theory, Modeling, and Simulation, Oak Ridge National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20250723/74d01612/attachment.html>


More information about the users mailing list