Skip to content

Commit

Permalink
Recover tests/eko/e_o/ome
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jan 10, 2025
1 parent 76778e1 commit cf0bae7
Showing 1 changed file with 17 additions and 90 deletions.
107 changes: 17 additions & 90 deletions tests/eko/evolution_operator/test_ome.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Test ekore.matching_conditions.OperatorMatrixElement
import pathlib

import numpy as np
import pytest

Expand All @@ -15,12 +12,14 @@
)
from eko.io.runcards import OperatorCard, TheoryCard
from eko.io.types import InversionMethod
#from eko.runner import legacy
from eko.runner.parts import _managers, _matching_configs
from ekore.operator_matrix_elements.unpolarized.space_like import (
A_non_singlet,
A_singlet,
)

from .test_init import FakeEKO


def test_build_ome_as():
# test that if as = 0 ome is and identity
Expand Down Expand Up @@ -266,88 +265,17 @@ def test_quad_ker(monkeypatch):
np.testing.assert_allclose(res_ns, 0.0)


# def test_run_integration():
# # setup objs
# theory_card = {
# "alphas": 0.35,
# "PTO": 2,
# "ModEv": "TRN",
# "XIF": 1.0,
# "Qref": np.sqrt(2),
# "nfref": None,
# "Q0": np.sqrt(2),
# "nf0": 4,
# "NfFF": 3,
# "IC": 1,
# "IB": 0,
# "mc": 1.0,
# "mb": 4.75,
# "mt": 173.0,
# "kcThr": 0.0,
# "kbThr": np.inf,
# "ktThr": np.inf,
# "MaxNfPdf": 6,
# "MaxNfAs": 6,
# "HQ": "POLE",
# "ModSV": None,
# }

# operators_card = {
# "mugrid": [(1, 3), (10, 5)],
# "interpolation_xgrid": [0.1, 1.0],
# "interpolation_polynomial_degree": 1,
# "interpolation_is_log": True,
# "debug_skip_singlet": True,
# "debug_skip_non_singlet": False,
# "ev_op_max_order": 1,
# "ev_op_iterations": 1,
# "backward_inversion": None,
# }
# g = OperatorGrid.from_dict(
# theory_card,
# operators_card,
# ThresholdsAtlas.from_dict(theory_card),
# StrongCoupling.from_dict(theory_card),
# InterpolatorDispatcher.from_dict(operators_card),
# )
# o = OperatorMatrixElement(g.config, g.managers, is_backward=False)
# log_grid = np.log(o.int_disp.xgrid_raw)
# res = run_op_integration(
# log_grid=(len(log_grid) - 1, log_grid[-1]),
# int_disp=o.int_disp,
# labels=[(200, 200)],
# is_log=True,
# grid_size=len(log_grid),
# a_s=0.333,
# order=theory_card["PTO"],
# L=0,
# nf=4,
# backward_method=None,
# is_msbar=False,
# )

# # here the last point is a zero, by default
# np.testing.assert_allclose(res[0][(200, 200)], (0.0, 0.0))

# # test that copy ome does not change anything
# o.copy_ome()
# np.testing.assert_allclose(0.0, o.op_members[(100, 100)].value)

"""
class TestOperatorMatrixElement:
def test_labels(self, theory_ffns, operator_card, tmp_path: pathlib.Path):
path = tmp_path / "eko.tar"
def test_labels(self, theory_ffns, operator_card):
for skip_singlet in [True, False]:
for skip_ns in [True, False]:
operator_card.configs.inversion_method = InversionMethod.EXACT
operator_card.debug.skip_singlet = skip_singlet
operator_card.debug.skip_non_singlet = skip_ns
path.unlink(missing_ok=True)
g = legacy.Runner(theory_ffns(3), operator_card, path=path).op_grid
f = FakeEKO(theory_ffns(3), operator_card)
o = OperatorMatrixElement(
g.config,
g.managers,
_matching_configs(f),
_managers(f),
is_backward=True,
q2=None,
nf=None,
Expand Down Expand Up @@ -381,16 +309,16 @@ def test_labels(self, theory_ffns, operator_card, tmp_path: pathlib.Path):
else:
assert lab in labels

def test_compute_n3lo(self, theory_ffns, operator_card, tmp_path):
def test_compute_n3lo(self, theory_ffns, operator_card):
theory_card: TheoryCard = theory_ffns(5)
theory_card.heavy.matching_ratios.c = 1.0
theory_card.heavy.matching_ratios.b = 1.0
theory_card.order = (4, 0)
operator_card.debug.skip_singlet = True
g = legacy.Runner(theory_card, operator_card, path=tmp_path / "eko.tar").op_grid
f = FakeEKO(theory_card, operator_card)
o = OperatorMatrixElement(
g.config,
g.managers,
_matching_configs(f),
_managers(f),
is_backward=True,
q2=theory_card.heavy.masses.b.value**2,
nf=4,
Expand Down Expand Up @@ -419,10 +347,10 @@ def test_compute_lo(self, theory_ffns, operator_card, tmp_path):
theory_card.order = (1, 0)
operator_card.debug.skip_singlet = False
operator_card.debug.skip_non_singlet = False
g = legacy.Runner(theory_card, operator_card, path=tmp_path / "eko.tar").op_grid
f = FakeEKO(theory_card, operator_card)
o = OperatorMatrixElement(
g.config,
g.managers,
_matching_configs(f),
_managers(f),
is_backward=False,
q2=theory_card.heavy.masses.b.value**2,
nf=4,
Expand Down Expand Up @@ -471,10 +399,10 @@ def test_compute_nlo(self, theory_ffns, operator_card: OperatorCard, tmp_path):
operator_card.configs.n_integration_cores = 1
operator_card.debug.skip_singlet = True
operator_card.debug.skip_non_singlet = False
g = legacy.Runner(theory_card, operator_card, path=tmp_path / "eko.tar").op_grid
f = FakeEKO(theory_card, operator_card)
o = OperatorMatrixElement(
g.config,
g.managers,
_matching_configs(f),
_managers(f),
is_backward=False,
q2=theory_card.heavy.masses.b.value**2,
nf=4,
Expand Down Expand Up @@ -502,4 +430,3 @@ def test_compute_nlo(self, theory_ffns, operator_card: OperatorCard, tmp_path):
)
assert o.op_members[(br.matching_hplus_pid, 21)].value.shape == shape
assert o.op_members[(21, br.matching_hplus_pid)].value.shape == shape
"""

0 comments on commit cf0bae7

Please sign in to comment.