Closed Keno closed 5 years ago
I think I've found this. I may have been using the wrong root of unity for the recursion. Writing a test case and validating now.
Yeah, that was the problem. You can't mix and match which root you're calling primitive or everything will break.
I suspect I'm doing something extremely stupid, but I can't figure it out, so I figured I'd open this issue and maybe somebody who knows more about FFTs can help me figure this out. I'm trying to extend this package to FFTs over some finite field π½ (in finite fields, FFTs are also known as the number-theoretic transform NTT). Everything seems to basically go through if I just generalize the Complex cases (code in gist: https://gist.github.com/Keno/51bcc385baed55120e9ed6111c541cba), but the output comes out permuted when compared to the naive summation:
(note that the last three pairs of numbers are reversed). Unfortunately, I can't reproduce this with Complex, so I'm thinking I'm doing something very stupid, but I've wasted several hours on this and been unable to figure it out.
@stevengj as the resident FFT expert and original author of this code, any immediate things that would cause such a problem? @andreasnoack any ideas?