[Pw_forum] fft 3D

Andrei Malashevich andrei.malashevich at yale.edu
Fri May 17 05:21:00 CEST 2013


Dear Lorenzo,

Thank you for your response. I must agree that in the end my question has
nothing to do with FFT.

Well, I agree that my example is obviously an example of aliasing. What I
wanted to understand is why it occurred in that particular piece of code
that I quoted. The thing is that discrete Fourier transform is a map. It is
an invertible transformation. Therefore if one takes a square wave on a
discrete mesh of points and performs FFT and then IFFT, one should get back
the original square wave.

Indeed, I tested that if I only uncomment the lines

CALL fwfft ('Dense', psic, dfftp)
CALL invfft ('Dense', psic, dfftp)

I get the linear function back (as in before_fft.eps).

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.

Thanks for your help!

Best regards,
Andrei


On Thu, May 16, 2013 at 4:27 PM, Lorenzo Paulatto <
lorenzo.paulatto at impmc.upmc.fr> wrote:

> On 05/16/2013 08:50 PM, Andrei Malashevich wrote:
>
> > So it looks that by doing FFT and inverse FFT did not return the
> > original function.
> > I understand that my function rho(z) is not realistic and has a huge
> > discontinuity but I thought that it should not really matter for this
> > FFT test.
> > At least when I took a similar function in 1D, and did FFT and inverse
> > FFT in my python script I got my original function back.
> >
>
> The fourier transforms are:
> CALL fwfft ('Dense', psic, dfftp)
> CALL invfft ('Dense', psic, dfftp)
>
>
> The other lines in the code snip you pasted have nothing to do with the
> fourier transform; they are a re-shuffling of the order of the plane waves.
>
> That said, the noise in "after" looks like a typical  example of
> aliasing. Like here: <http://en.wikipedia.org/wiki/File:SquareWave.gif>
>
> 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
>
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20130516/2ebfa512/attachment.html>


More information about the users mailing list