Skip to content

Commit

Permalink
Fix apfel benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed May 22, 2023
1 parent d32d95b commit aded09d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/eko/io/runcards.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def flavored_mugrid(mugrid: list, masses: list, matching_ratios: list):
"""
atlas = default_atlas(masses, matching_ratios)
return [(mu, nf_default(mu**2, atlas)) for mu in mugrid]
return [(float(mu), nf_default(mu**2, atlas)) for mu in mugrid]


# TODO: move to a more suitable place
Expand Down
6 changes: 3 additions & 3 deletions src/ekomark/benchmark/external/apfel_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def compute_apfel_data(

# Run
apf_tabs = {}
for mu in operators["mugrid"]:
apfel.EvolveAPFEL(theory["Q0"], mu)
for mu2 in operators["Q2grid"]:
apfel.EvolveAPFEL(theory["Q0"], np.sqrt(mu2))
print(f"Executing APFEL took {(time.perf_counter() - apf_start)} s")

tab = {}
Expand Down Expand Up @@ -111,7 +111,7 @@ def compute_apfel_data(
evol_pdf = rotate_flavor_to_evolution @ pdfs
tab = dict(zip(evol_basis, evol_pdf))

apf_tabs[mu**2] = tab
apf_tabs[mu2] = tab

ref = {
"target_xgrid": target_xgrid,
Expand Down
8 changes: 5 additions & 3 deletions src/ekomark/benchmark/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import sys

import numpy as np
import pandas as pd
from banana import cfg as banana_cfg
from banana.benchmark.runner import BenchmarkRunner
Expand Down Expand Up @@ -245,10 +246,11 @@ def log(self, theory, _, pdf, me, ext):
flavor_rotation=rotate_to_evolution,
qed=qed,
)
for q2 in q2s:
for (q2, ref_pdfs), (q2a, res) in zip(ext["values"].items(), pdf_grid.items()):
np.testing.assert_allclose(q2, q2a)
log_tab = dfdict.DFdict()
ref_pdfs = ext["values"][q2]
res = pdf_grid[q2]
# ref_pdfs = ext["values"][q2]
# res = pdf_grid[q2]
my_pdfs = res["pdfs"]
my_pdf_errs = res["errors"]

Expand Down

0 comments on commit aded09d

Please sign in to comment.