<div dir="ltr"><div>Dear Paolo,<br><br></div>Thank you very much for your quick reply.<br><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div>
<br>
> In real space, the wavefunction is a real vector.<br>
<br>
</div>only for k=0 or if there is inversion symmetry<br></blockquote><div><br></div></div><div>Yes. I'm only considering the case k=0 at this moment. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">

<div><br>
> I want to write some code using 3D fft (forward and backward)<br>
> in Quantum Espresso for general complex vector (stored in 3D<br>
> array)<br>
<br>
</div>I am not sure I understand what you want to do: the 3D FFT in<br>
QE is quite general.</div><span><font color="#888888"><br>
_______________________________________________<br>
<br></font></span></blockquote><div>I tried the following test codes in QE.<br></div><div>That is, I use a 25*25*25 3D FFT mesh. The original 3d array g3d = (1.0_DP, -1.0_DP).<br></div><div>First I do invfft and then fwfft. Finally I don't get the original 3d array, but a 3d array g3dnew<br>

 in which g3dnew(1),g3dnew(2),...,g3dnew(3025)= (1.0_DP, -1.0_DP) <br>while g3dnew(3026),....,g3dnew(15625)=0.0.<br><br></div><div>But if I do fwfft first and then invfft, I can finally get the original 3d array.<br><br>
</div><div>I don't know the reason. I tried to attach my results, but it seems too large to be sent<br></div><div>quickly. So I cancelled it.<br></div><div>
<br></div><div>Thank you very much.<br><br></div><div>===========<br>     open(UNIT=73, FILE='g3d.log',STATUS='replace', FORM='formatted', ACTION='write')<br><br>    g3d = (1.0_DP, -1.0_DP)<br>

    write(73,*), 'g3d: original'<br>    do i=1, dffts%nnr<br>       write(73,101), i, g3d(i)<br>    enddo<br>   <br> <br>    CALL invfft ('Wave', g3d, dffts) !transform potential to real space<br> <br>    write(73,*), 'g3d: after invfft'<br>

    do i=1, dffts%nnr<br>       write(73,101), i, g3d(i)<br>    enddo<br>   <br>    CALL fwfft ('Wave', g3d, dffts) !transform potential to reciprocal space<br>   <br>    write(73,*), 'g3d: after fwfft'<br>

    do i=1, dffts%nnr<br>       write(73,101), i, g3d(i)<br>    enddo<br><br>    close(73)<br>==============<br><br></div><div>Best,<br></div>Fang</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/16 Paolo Giannozzi <span dir="ltr"><<a href="mailto:paolo.giannozzi@uniud.it" target="_blank">paolo.giannozzi@uniud.it</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, 2013-05-15 at 16:45 -0700, Fang Liu wrote:<br>
<br>
> In real space, the wavefunction is a real vector.<br>
<br>
</div>only for k=0 or if there is inversion symmetry<br>
<div class="im"><br>
> I want to write some code using 3D fft (forward and backward)<br>
> in Quantum Espresso for general complex vector (stored in 3D<br>
> array)<br>
<br>
</div>I am not sure I understand what you want to do: the 3D FFT in<br>
QE is quite general.<br>
<span class="HOEnZb"><font color="#888888"><br>
P.<br>
--<br>
 Paolo Giannozzi, Dept. Chemistry&Physics&Environment,<br>
 Univ. Udine, via delle Scienze 208, 33100 Udine, Italy<br>
 Phone <a href="tel:%2B39-0432-558216" value="+390432558216">+39-0432-558216</a>, fax <a href="tel:%2B39-0432-558222" value="+390432558222">+39-0432-558222</a><br>
<br>
_______________________________________________<br>
Pw_forum mailing list<br>
<a href="mailto:Pw_forum@pwscf.org">Pw_forum@pwscf.org</a><br>
<a href="http://pwscf.org/mailman/listinfo/pw_forum" target="_blank">http://pwscf.org/mailman/listinfo/pw_forum</a><br>
</font></span></blockquote></div><br></div>