Indexing bug in Laplace operator
I'm running the following test case on current master:
from nifty import *
s_space = RGSpace([256,256])
FFT = FFTOperator(s_space)
h_space = FFT.target[0]
p_space = PowerSpace(h_space, logarithmic=True, distribution_strategy='not')
t0 = Field(p_space, val=log(0.1/(1+p_space.kindex)**3))
sop = SmoothnessOperator(p_space)
#print t0.val.get_full_data()
print t0.vdot(sop(t0))
#print t0.val.get_full_data()
print t0.vdot(sop(t0))
This produces the output:
0.645594411887
139746.578501
which is definitely incorrect, since the same number should be reported twice.
Things become even weirder. If I remove the commenting "#" from the first print statement, I get:
[ -2.30258509 -4.38202663 -4.94670585 -5.75181152 -6.49001612
-7.17883085 -8.05624052 -8.99425111 -9.93125436 -10.87947582
-11.85503513 -12.85994974 -16.24599361]
2.93684941121
139746.578501
So the print statement changes the result of the next statement?!
Removing the next "#" as well produces:
[ -2.30258509 -4.38202663 -4.94670585 -5.75181152 -6.49001612
-7.17883085 -8.05624052 -8.99425111 -9.93125436 -10.87947582
-11.85503513 -12.85994974 -16.24599361]
2.93684941121
[ -2.30258509 -4.38202663 -4.94670585 -5.75181152 -6.49001612
-7.17883085 -8.05624052 -8.99425111 -9.93125436 -10.87947582
-11.85503513 -12.85994974 -16.24599361]
2.93684941121
First question: can anyone reproduce this, or is it a bug in my local Python installation?
If this is reproducible, it definitely needs to be fixed quickly, but I'm completely at my wits' end ...