def pointwiseSigma(self, points): "Test sigma value per point" m = self.config["G_m"] dimfactor = self.config["G_dimfactor"] outputPath = self.config["TEST_outputPath"] label = "MP" with t_utils.timing() as t: res = list( map(lambda s: (s, self.SigmaEvaluatorInstance.compute(s)), points)) with open(self.path("meta"), "a") as f: self.iwrite( f, "%s::sigma_evaltime(%d) %f" % (label, len(points), t())) with open(self.path("sigma"), "a") as f: self.iwrite(f, "# %s" % label) self.iwrite(f, "s, sigma") for pair in res: self.iwrite(f, "%e, %e" % pair) plt.plot(*list(zip(*res))) plt.savefig(self.path("sigma_plot." + label + ".png"))
def evalPrec(p): answ.append([]) self.cmel.relErr = 2**(-p) for point in range(points): thepoint = minP + (maxP - minP) / points * point with t_utils.timing() as t: res = self.cmel.compute(thepoint, maxP / 1.5, 0.2, 0) answ[p].append((res, t())) answ[p] = sp.array(answ[p]).T self.iwrite(fdata, answ[p])
def evalPrec(p): answ.append([]) self.crsc.relErr = 2**(-p) for point in range(points): thepoint = minS + (maxS - minS) / points * point with t_utils.timing() as t: res = self.crsc.compute(thepoint) answ[p].append(res) answ[p] = sp.array(answ[p]).T self.iwrite(fdata, answ[p])
def evalPrec(p): answ.append([]) self.dmel.absErr = 2**(-p) n = 1 l = 0 while (n - 1) * (n - 2) / 2 + l < points: with t_utils.timing() as t: res = self.dmel.compute(n, l) answ[p].append((res, t())) buf = l l = (buf + 1) % n n += (buf + 1) // n answ[p] = sp.array(answ[p]).T self.iwrite(fdata, answ[p])
def dosum(self, mp): "evaluate sumrule for specific MP" label = mp.__name__ mpEvaluator = evals.TrivialEvaluator(mp) self.SigmaEvaluatorInstance.MPEvaluatorInstance = mpEvaluator self.SumruleEvaluatorInstance.monitor =\ Monitor(self.path("monitor_sr::%s.dat" % label)) with t_utils.timing() as t: sr = self.SumruleEvaluatorInstance.compute() with open(self.path("meta"), "a") as f: self.iwrite(f, "%s::sumrule_evaltime %f" % (label, t())) with open(self.path("sumrule"), "a") as f: self.iwrite(f, "%s::sumrule %f" % (label, sr)) return sr
def doDiscSum(self, mp, psi): "evaluate sumrule for specific MP" label = "disc::"+mp.__name__ self.McolPDiscEvaluatorInstance.MP = mp self.McolPDiscEvaluatorInstance.psiColP = psi with t_utils.timing() as t: sr = self.SumruleDiscEvaluatorInstance.compute() with open(self.path("meta"), "a") as f: self.iwrite(f, "%s::sumrule_evaltime %f" % (label, t())) with open(self.path("sumrule"), "a") as f: self.iwrite(f, "%s::sumrule %f" % (label, sr)) # flush to initial self.McolPDiscEvaluatorInstance.MP = None self.McolPDiscEvaluatorInstance.psiColP = None return sr
def doContSum(self, mp): "evaluate sumrule for specific MP" label = "cont::"+mp.__name__ self.McolPEvaluatorInstance.MP = mp self.SumruleEvaluatorInstance.monitor =\ Monitor(self.path("monitor_sr-%s" % label)) with t_utils.timing() as t: sr = self.SumruleEvaluatorInstance.compute() with open(self.path("meta"), "a") as f: self.iwrite(f, "%s::sumrule_evaltime %f" % (label, t())) with open(self.path("sumrule"), "a") as f: self.iwrite(f, "%s::sumrule %f" % (label, sr)) # flush to initial self.McolPEvaluatorInstance.MP = None self.SumruleEvaluatorInstance.monitor = None return sr