Skip to content

Commit

Permalink
Add void external
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jan 22, 2025
1 parent ec743ca commit 1a77d68
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
18 changes: 9 additions & 9 deletions benchmarks/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ class Sandbox(Runner):
sandbox = True

# select here the external program between LHA, LHAPDF, apfel, pegasus
external = "apfel"
external = "void"
# external = "pegasus"

# select to plot operators
plot_operator = True
# plot_operator = True

rotate_to_evolution_basis = True
# rotate_to_evolution_basis = True

@staticmethod
def generate_operators():
ops = {
"ev_op_iterations": [1],
# "ev_op_max_order": [20],
"mugrid": [[10]],
"mugrid": [[10.0]],
# "debug_skip_singlet": [True],
}
return ops
Expand Down Expand Up @@ -118,12 +118,12 @@ def lha(self):
"FNS": "FFNS",
"NfFF": 4,
"ModEv": "EXA",
"XIF": np.sqrt(2),
"Q0": np.sqrt(2),
"XIF": float(np.sqrt(2)),
"Q0": float(np.sqrt(2)),
"kcThr": 0.0,
"kbThr": np.inf,
"ktThr": np.inf,
"Qref": np.sqrt(2.0),
"Qref": float(np.sqrt(2.0)),
"alphas": 0.35,
}
self.skip_pdfs = lambda _theory: [
Expand All @@ -139,11 +139,11 @@ def lha(self):
]
self.run(
[theory_updates],
[{"mugrid": [100], "debug_skip_singlet": True}],
[{"mugrid": [100.0], "debug_skip_singlet": True}],
["ToyLH"],
)


if __name__ == "__main__":
sand = Sandbox()
sand.doit()
sand.lha()
15 changes: 15 additions & 0 deletions src/ekomark/benchmark/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ def run_external(self, theory, ocard, pdf):
DGLAP result
"""
# pylint:disable=import-error,import-outside-toplevel
if self.external.lower() == "void":
xgrid = ocard["interpolation_xgrid"]
mugrid = ocard["mugrid"]
labels = (
br.evol_basis
if self.rotate_to_evolution_basis
else br.flavor_basis_pids
)
void = {
"target_xgrid": xgrid,
"values": {
mu**2: {pid: [0.0] * len(xgrid) for pid in labels} for mu in mugrid
},
}
return void
if self.external.lower() == "lha":
from .external import LHA_utils

Expand Down

0 comments on commit 1a77d68

Please sign in to comment.