create_power_operator
Hi Theo, while checking volume factors in my code I stumbled over a potential bug in sugar.py create_power_operator. In line 27 the DiagonalOperator should be bare=True (default is False). Else wise the application of such a "PowerOperator" does not match the results as if the code would be run in Nifty 1. Or am I missing something, please correct me if I see something wrong.
Power Spectrum differences
NIFTY_1
x1 = rg_space(200, zerocenter=False, dist=0.1) k1 = x1.get_codomain()
spec1 = (lambda k: 42/(1+k**2)) S1 = power_operator(k1, spec=spec1)
test1 = field(x1, val=3)
result1 = S1.inverse_times(test1)
NIFTy_3
x3 = RGSpace(200, zerocenter=False, distances=0.1) k3 = RGRGTransformation.get_codomain(x3)
spec3 = (lambda k:42/(1+k**2)) S3 = create_power_operator(k3, spec3) FFT3 = FFTOperator(domain=x3, target=k3, domain_dtype=np.float64, target_dtype=np.complex64)
test3 = Field(x3, val=3)
result3 = FFT3.inverse_times(S3.inverse_times(FFT3.times(test3)))