Potential Correctness Issue in NeuralOperators.jl: Mode truncation in SpectralConv excludes negative low-frequency modes

I was looking at the mode truncation logic in NeuralOperators.jl and have a question about correctness.

Link: NeuralOperators.jl/src/transform.jl at 39f8a3c6dc974e711c8de8a8fde804e096098157 · SciML/NeuralOperators.jl · GitHub

It looks like the code currently only keeps the 1:d slice in each dimension. Since standard FFT outputs place negative low-frequency modes at the end of the array, doesn’t this implementation drop those modes?

According to the FNO paper, we should keep the lowest modes from both ends (e.g., 1:k and (end-k+1):end). Is there a specific reason it’s implemented this way, or is this a bug?

I think the correct way to implement the truncation of higher frequency modes would be to apply fftshift, and then keep the center crop x[center-k:center+k].