Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix apfel benchmarks #274

Merged
merged 17 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved


# 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
2 changes: 1 addition & 1 deletion src/ekomark/benchmark/external/pegasus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def compute_pegasus_data(theory, operators, skip_pdfs, rotate_to_evolution_basis

# run pegaus
out_tabs = {}
for mu2 in np.array(operators["mugrid"]) ** 2:
for mu2 in operators["Q2grid"]:
tab = {}
for x in target_xgrid:
# last two numbers are the min and max pid to calculate,
Expand Down
8 changes: 5 additions & 3 deletions src/ekomark/benchmark/runner.py
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved
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)
felixhekhorn marked this conversation as resolved.
Show resolved Hide resolved
log_tab = dfdict.DFdict()
ref_pdfs = ext["values"][q2]
res = pdf_grid[q2]
# ref_pdfs = ext["values"][q2]
# res = pdf_grid[q2]
niclaurenti marked this conversation as resolved.
Show resolved Hide resolved
my_pdfs = res["pdfs"]
my_pdf_errs = res["errors"]

Expand Down