Commit 4c60d153 authored by ulrich_y's avatar ulrich_y
Browse files

Cache Arbuzov results

parent 9a653397
......@@ -8,6 +8,7 @@ import sys
import json
import re
import bz2
import os
try:
import sympy as sp
import sympy.parsing.latex
......@@ -20,6 +21,16 @@ dilog = pymule.maths.Li2
trilog = pymule.maths.Li3
def zeta(n):
v = [
-0.5,
np.inf,
pymule.maths.zeta2,
pymule.maths.zeta3
]
return v[int(n)]
def Sot(z):
return (
0.5*np.log(1-z)**2*np.log(z) + np.log(1-z)*dilog(1-z)
......@@ -126,8 +137,8 @@ def load0202102():
fLL = dosub(parse(tex.splitlines()[322:327], 1))
gLL = dosub(parse(tex.splitlines()[330:335], 1))
fLLns = f1LL*2/3
gLLns = g1LL*2/3
fLLns = f1LL
gLLns = g1LL
fLLs = dosub(parse(tex.splitlines()[391:394], 1))
gLLs = dosub(parse(tex.splitlines()[396:399], 1))
......@@ -202,47 +213,61 @@ def tostr(args, expr):
)
def loadall():
def loadall(f='arbuzov.json.bz2'):
fnlo, gnlo = load0110047()
(fLL, gLL), (fLLns, gLLns), (fLLs, gLLs) = load0202102()
(fLLb, fNLL), (fLLnsb, fNLLns), (fLLsb, fNLLs), fNLLint = load0205172()
(gNLL, gNLLns, gNLLs, gNLLint), (f3LL, g3LL), (f3LLns, g3LLns), (f3LLs, g3LLs) = load0206036() # nopep8
b = {
"fnlo": tostr(("xe", "z"), fnlo),
"gnlo": tostr(("xe", "z"), gnlo),
"f2LL": tostr(("xe"), fLL.subs(z, 0)),
"f2LLns": tostr(("xe"), fLLns.subs(z, 0)),
"f2LLs": tostr(("xe"), fLLs.subs(z, 0)),
"g2LL": tostr(("xe"), gLL.subs(z, 0)),
"g2LLns": tostr(("xe"), gLLns.subs(z, 0)),
"g2LLs": tostr(("xe"), gLLs.subs(z, 0)),
"f2NLL": tostr(("xe"), fNLL),
"f2NLLns": tostr(("xe"), fNLLns),
"f2NLLs": tostr(("xe"), fNLLs),
"f2NLLint": tostr(("xe"), fNLLint),
"g2NLL": tostr(("xe"), gNLL),
"g2NLLns": tostr(("xe"), gNLLns),
"g2NLLs": tostr(("xe"), gNLLs),
"g2NLLint": tostr(("xe"), gNLLint),
"f3LL": tostr(("xe"), f3LL),
"f3LLns": tostr(("xe"), f3LLns),
"f3LLs": tostr(("xe"), f3LLs),
"g3LL": tostr(("xe"), g3LL),
"g3LLns": tostr(("xe"), g3LLns),
"g3LLs": tostr(("xe"), g3LLs)
"fnlo": tostr(["xe", "z"], fnlo),
"gnlo": tostr(["xe", "z"], gnlo),
"f2LL": tostr(["xe"], fLL.subs(z, 0)),
"f2LLns": tostr(["xe"], fLLns.subs(z, 0)),
"f2LLs": tostr(["xe"], fLLs.subs(z, 0)),
"g2LL": tostr(["xe"], gLL.subs(z, 0)),
"g2LLns": tostr(["xe"], gLLns.subs(z, 0)),
"g2LLs": tostr(["xe"], gLLs.subs(z, 0)),
"f2NLL": tostr(["xe"], fNLL),
"f2NLLns": tostr(["xe"], fNLLns),
"f2NLLs": tostr(["xe"], fNLLs),
"f2NLLint": tostr(["xe"], fNLLint),
"g2NLL": tostr(["xe"], gNLL),
"g2NLLns": tostr(["xe"], gNLLns),
"g2NLLs": tostr(["xe"], gNLLs),
"g2NLLint": tostr(["xe"], gNLLint),
"f3LL": tostr(["xe"], f3LL),
"f3LLns": tostr(["xe"], f3LLns),
"f3LLs": tostr(["xe"], f3LLs),
"g3LL": tostr(["xe"], g3LL),
"g3LLns": tostr(["xe"], g3LLns),
"g3LLs": tostr(["xe"], g3LLs)
}
with bz2.BZ2File('arbuzov.json.bz2', 'w') as fp:
with bz2.BZ2File(f, 'w') as fp:
json.dump(b, fp)
def loadfile(f='arbuzov.json.bz2'):
with bz2.BZ2File(f) as fp:
b = json.load(fp)
for key, value in b.iteritems():
globals()[key] = eval(value)
if __name__ == "__main__":
loadall()
else:
dir_path = os.path.dirname(os.path.realpath(__file__))
loadfile(dir_path + '/arbuzov.json.bz2')
# print "{" + ",\n".join(
# str(i) for i in [fLL2, fNLL, fLLns, fNLLns, fLLs, fNLLs, fNLLint]
# ) + "}"
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