[Pw_forum] fft 3D
Lorenzo Paulatto
lorenzo.paulatto at impmc.upmc.fr
Fri May 17 09:07:46 CEST 2013
On 05/17/2013 05:21 AM, Andrei Malashevich wrote:
> So it looks that aliasing occurs because of these mappings:
> rho%of_g(:,1) = psic(nl(:))
> and
> psic(nl(:)) = rho%of_g(:,1)
>
> (this is what you called re-shuffling of the order of planewaves, right?)
>
> Perhaps, for some reason some of the planewaves got lost when this
> re-shuffling was done.
> So I still have a question whether this is expected behavior of the
> code or not.
>
Yes you are right, I did not think about this. Now I'll try to explain
what's going on.
The cutoff that you specify in input defines the amount of plane waves
that will be used to represent the wavefunctions and the charge, a
certain plane wave is include if its wavevector G is |G|^2 < ecut. This
condition defines a SPHERE, the G inside the sphere are used.
On the other hand, FFT works on a regular grid, i.e. a BOX of n1 x n2 x
n3 points. We take the smallest possible BOX than contains the SPHERE.
In the SPHERE representation, the G are sorted in order of increasing
|G|^2; in the BOX representation they are listed by rows and columns,
i.e. as if the array was rho(nr1,nr2,nr3). The array nl(:) maps from one
order to the other, but it also throws away the G vectors that are in
the BOX but not in the SPHERE, those that are required to perform the
FFT but are outside the specified cutoff. You can verify that psic and
rho%of_g do not have the same dimension.
This is the expected behavior, throwing away the extra waves makes the
FFT inconsistent, but keeping them makes H\psi inconsistent. Of course
for a larger cutoff and a smoother density the difference is smaller.
There are 3 extra levels of complication: the double grid (smooth and
hard) and how you map between the two; the wavefunction grids, each
centered around its k point; the spherical grid, for ion-centered
quantities that depend only on |G|. I'll go more in depth on these
subjects if there is some demand.
hth, bests
--
Dr. Lorenzo Paulatto
IdR @ IMPMC -- CNRS & Université Paris 6
phone:+33 (0)1 44275 084 / skype: paulatz
www: http://www-int.impmc.upmc.fr/~paulatto/
mail: 23-24/4é16 Boîte courrier 115, 4 place Jussieu 75252 Paris Cédex 5
More information about the users
mailing list