autodiff icon indicating copy to clipboard operation
autodiff copied to clipboard

[feature request] FFT-based differentiation

Open Roy-Kid opened this issue 4 years ago • 2 comments

Hi, I am using your brilliant work to calculate long-range interaction between atoms and I need to use FFT to transform between real space and reciprocal space. I humbly ask if there is any plan to support FFT differentiation

Roy-Kid avatar Oct 05 '21 06:10 Roy-Kid

Hi @Roy-Kid , thanks for your request. Unfortunately, this is not planned ATM although it would be a very exciting new feature.

allanleal avatar Oct 05 '21 08:10 allanleal

plan to support FFT differentiation

Just out of curiosity, do you really mean FFT differentiation (using a DFT/FFT to approximate a derivative) or are you referring to implementing forward/backward rules for an FFT operator?

From your described use case (going to and from K-space), it sounds like you want the latter. Luckily, implementing a VJP here is easy: the transpose of the FFT operator is just an inverse FFT (it's unitary). So just "backpropagate" through your data with an iFFT (assuming you are interested in reverse-mode differentiation).

smartalecH avatar Mar 03 '22 02:03 smartalecH