eelregit / pmwd

Differentiable Cosmological Forward Model
BSD 3-Clause "New" or "Revised" License
71 stars 18 forks source link

Add FFT dimensional normalizations and real parameter in linear_modes #24

Closed eelregit closed 11 months ago

eelregit commented 11 months ago

The FFT wrappers, fftfwd and fftinv, of rfftn and irfftn are convenient for dimensional normalizations. It follows one common Fourier transform convention (dx & dk/2pi) so hopefully that's what you are using.

Following this pattern, I also renamed the previous rfftnfreq to fftfreq.

eelregit commented 11 months ago

See https://github.com/google/jax/issues/18405 linear_modes(..., real=True) raise ValueError right now, while linear_modes(..., True) works.