Hi, I have a FORTRAN code with an array called Chi that I want to run an inverse FT on. I have defined two spaces X and K which each consist of 3 vectors running across my physical verse and inverse space.(adsbygoogle = window.adsbygoogle || []).push({});

My code (If it works??) is extremely slow and inefficient (see below). What is the best way of doing a 3D IFT computationally?

CODE

!Real & Inverse Spaces

do i1 = 1, 2*No_x +1

x_x(i1) = -L/2.d0 + dx*(i1-1)

x_y(i1) = -L/2.d0 + dx*(i1-1)

x_z(i1) = -L/2.d0 + dx*(i1-1)

xi_x(i1) = (i1-(No_k+1))*(2.d0*pi/L)

xi_y(i1) = (i1-(No_k+1))*(2.d0*pi/L)

xi_z(i1) = (i1-(No_k+1))*(2.d0*pi/L)

end do

chi = blablabla

!chi is a function of xi

!3d IFT

do r1 = 1,2*No_x +1

do r2 = 1,2*No_x +1

do r3 = 1,2*No_x +1

chi_ift(r1,r2,r3) = 0

do i1 = 1,2*No_k +1

do i2 = 1,2*No_k +1

do i3 = 1,2*No_k +1

chi_ift(r1,r2,r3) = chi_ift(r1,r2,r3) + chi(i1,i2,i3)*exp(imagi*xi_z(i3)*x_z(r3))

end do

chi_ift(r1,r2,r3) = chi_ift(r1,r2,r3) + chi(i1,i2,i3)*exp(imagi*xi_y(i2)*x_y(r2))

end do

chi_ift(r1,r2,r3) = chi_ift(r1,r2,r3) + chi(i1,i2,i3)*exp(imagi*xi_x(i1)*x_x(r1))

end do

end do

end do

end do

Reply Reply to All Forward More

Click to Reply, Reply all or Forward

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# 3D Fourier Transforms?

Tags:

Have something to add?

**Physics Forums | Science Articles, Homework Help, Discussion**