Skip to content

Commit

Permalink
Recover benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jan 13, 2025
1 parent a4f8b37 commit dc3e725
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions benchmarks/eko/benchmark_evol_to_unity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pathlib
from dataclasses import dataclass

import numpy as np
import pytest
Expand All @@ -10,11 +11,17 @@
from eko.io.runcards import OperatorCard, TheoryCard
from eko.matchings import Segment
from eko.quantities.couplings import CouplingsInfo
from eko.runner.legacy import Runner
from eko.runner.parts import _evolve_configs, _managers

# from ekore.matching_conditions.operator_matrix_element import OperatorMatrixElement


@dataclass(frozen=True)
class FakeEKO:
theory_card: TheoryCard
operator_card: OperatorCard


def update_cards(theory: TheoryCard, operator: OperatorCard):
theory.couplings = CouplingsInfo(
alphas=0.35,
Expand Down Expand Up @@ -44,16 +51,12 @@ def test_operator_grid(
):
"""Test that eko_forward @ eko_backward gives ID matrix or zeros."""
update_cards(theory_card, operator_card)
g = Runner(
theory_card=theory_card,
operators_card=operator_card,
path=tmp_path / "eko.tar",
).op_grid
f = FakeEKO(theory_card, operator_card)

seg = Segment(30, 50, 4)
seg_back = Segment(50, 30, 4)
o = Operator(g.config, g.managers, seg)
o_back = Operator(g.config, g.managers, seg_back)
o = Operator(_evolve_configs(f), _managers(f), seg)
o_back = Operator(_evolve_configs(f), _managers(f), seg_back)
o.compute()
o_back.compute()

Expand Down

0 comments on commit dc3e725

Please sign in to comment.