Trying to fix the Hartley convention in ducc0
I have a bit of a philosophical problem and would be happy about your opinion:
Nifty makes heavy use of ducc0
's Hartley transform. Unfortunately this implementation of the transform has the bug (or convention issue) that it computes
Hartley(x) = FFT(x).real + FFT(x).imag
instead of the canonical
Hartley(x) = FFT(x).real - FFT(x).imag
which is mentioned, e.g., at https://en.wikipedia.org/wiki/Hartley_transform.
I would like to fix that at some point, but this could lead to subtle breakage in Nifty (e.g. if you store a Hartley-transformed field with a version of Nifty that uses an old ducc
version and load it again with a Nifty that uses a newer one). Practically all "normal" uses of the Hartley transform will continue to work.
Do you have suggestions how to deal with this?
Alternatives are
- just change the behavior, saying this is a bug fix (which it technically is) and deal with potential breakage as it appears (it shold be minimal)
- change the behaviour and rename
ducc0
toducc1
; this is probably the cleanest approach, but maybe too much trouble for this change - add new function names for the correct Hartley transforms and keep the old ones around for some time
- anything else?