Commit 0dd173a4 authored by Philipp Haim's avatar Philipp Haim

Fixes for tests

parent aa2512f9
Pipeline #63843 failed with stages
in 7 minutes and 10 seconds
...@@ -94,11 +94,11 @@ def _log_vol(power_space): ...@@ -94,11 +94,11 @@ def _log_vol(power_space):
return logk_lengths[1:] - logk_lengths[:-1] return logk_lengths[1:] - logk_lengths[:-1]
def _total_fluctuation_realized(samples, space = 0): def _total_fluctuation_realized(samples):
res = 0. res = 0.
for s in samples: for s in samples:
res = res + (s - s.mean())**2 res = res + (s - s.mean())**2
return np.sqrt((res/len(samples)).mean(space)) return np.sqrt((res/len(samples)).mean())
def _stats(op, samples): def _stats(op, samples):
...@@ -490,7 +490,7 @@ class CorrelatedFieldMaker: ...@@ -490,7 +490,7 @@ class CorrelatedFieldMaker:
from ..sugar import from_random from ..sugar import from_random
scm = 1. scm = 1.
for a in self._a: for a in self._a:
op = a.fluctuation_amplitude op = a.fluctuation_amplitude*self._azm.one_over()
res= np.array([op(from_random('normal',op.domain)).to_global_data() res= np.array([op(from_random('normal',op.domain)).to_global_data()
for _ in range(nsamples)]) for _ in range(nsamples)])
scm *= res**2 + 1. scm *= res**2 + 1.
...@@ -513,7 +513,7 @@ class CorrelatedFieldMaker: ...@@ -513,7 +513,7 @@ class CorrelatedFieldMaker:
return self.average_fluctuation(0) return self.average_fluctuation(0)
q = 1. q = 1.
for a in self._a: for a in self._a:
fl = a.fluctuation_amplitude fl = a.fluctuation_amplitude*self._azm.one_over()
q = q*(Adder(full(fl.target, 1.)) @ fl**2) q = q*(Adder(full(fl.target, 1.)) @ fl**2)
return (Adder(full(q.target, -1.)) @ q).sqrt() * self._azm return (Adder(full(q.target, -1.)) @ q).sqrt() * self._azm
...@@ -526,7 +526,7 @@ class CorrelatedFieldMaker: ...@@ -526,7 +526,7 @@ class CorrelatedFieldMaker:
return self.average_fluctuation(0) return self.average_fluctuation(0)
q = 1. q = 1.
for j in range(len(self._a)): for j in range(len(self._a)):
fl = self._a[j].fluctuation_amplitude fl = self._a[j].fluctuation_amplitude*self._azm.one_over()
if j == space: if j == space:
q = q*fl**2 q = q*fl**2
else: else:
...@@ -539,8 +539,8 @@ class CorrelatedFieldMaker: ...@@ -539,8 +539,8 @@ class CorrelatedFieldMaker:
raise NotImplementedError raise NotImplementedError
assert space < len(self._a) assert space < len(self._a)
if len(self._a) == 1: if len(self._a) == 1:
return self._a[0].fluctuation_amplitude*self._azm return self._a[0].fluctuation_amplitude
return self._a[space].fluctuation_amplitude*self._azm return self._a[space].fluctuation_amplitude
@staticmethod @staticmethod
def offset_amplitude_realized(samples): def offset_amplitude_realized(samples):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment