From f43d8b55e63792afbfe5eb83c8f20ce742225eba Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Thu, 2 May 2024 14:06:45 +0200 Subject: [PATCH] add a test of fl11/fl2 ratios --- .../coefficient_functions/light/kernels.py | 4 +- tests/yadism/cf/test_nc_kernels.py | 46 +++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/yadism/coefficient_functions/light/kernels.py b/src/yadism/coefficient_functions/light/kernels.py index ef7539dd..71317093 100644 --- a/src/yadism/coefficient_functions/light/kernels.py +++ b/src/yadism/coefficient_functions/light/kernels.py @@ -94,7 +94,7 @@ def generate(esf, nf): quark_fl11 = pcs.QuarkFL11(esf, nf) weights_fl11 = nc_fl11_weights(esf.info.coupling_constants, esf.Q2, nf) ns_fl11 = kernels.Kernel( - weights_fl11["ns"], + weights_fl11["q"], quark_fl11, ) g_fl11 = kernels.Kernel(weights_fl11["g"], gluon_fl11) @@ -203,4 +203,4 @@ def nc_fl11_weights(coupling_constants, Q2, nf, skip_heavylight=False): # NOTE: since here we are implementing the plain coupling # Q1 * Tr[Q2] / nf, we have not decomposed the quark sector # into singlet and non singlet for this class of diagrams - return {"ns": quark_partons, "g": {21: ch_av}} + return {"q": quark_partons, "g": {21: ch_av}} diff --git a/tests/yadism/cf/test_nc_kernels.py b/tests/yadism/cf/test_nc_kernels.py index fb4aa7aa..7113ca5a 100644 --- a/tests/yadism/cf/test_nc_kernels.py +++ b/tests/yadism/cf/test_nc_kernels.py @@ -3,6 +3,7 @@ from eko.matchings import Atlas from yadism import observable_name as on +from yadism.coefficient_functions import coupling_constants as cc from yadism.coefficient_functions.asy import kernels as aker from yadism.coefficient_functions.heavy import kernels as hker from yadism.coefficient_functions.intrinsic import kernels as iker @@ -93,6 +94,51 @@ def test_generate_heavy(): check(ps, w) +def test_nc_fl11_weights(): + # Test the the flavor decomposition of the fl11 diagrams is the same as we get from + # the yadism implementation + th_d = dict( + SIN2TW=0.5, + MZ=80, + CKM="0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152", + ) + obs_d = dict( + projectilePID=11, + PolarizationDIS=0.0, + prDIS="EM", + PropagatorCorrection=0, + NCPositivityCharge=None, + ) + coupl_const = cc.CouplingConstants.from_dict(th_d, obs_d) + + Q2 = 1.0 + mean_e = 0 + mean_e2 = 0 + for nf in range(1, 7): + fl11_weights = lker.nc_fl11_weights(coupl_const, Q2, nf) + fl2_weights = lker.nc_weights(coupl_const, Q2, nf, False) + + # build rations to fl2 + mean_e += coupl_const.electric_charge[nf] + mean_e2 += coupl_const.electric_charge[nf] ** 2 + w3 = mean_e**2 / nf / mean_e2 + w2 = 3 * mean_e / nf + + # test gluon coupling + np.testing.assert_allclose(fl11_weights["g"][21], fl2_weights["g"][21] * w3) + + # test the quark sector + # now need to sum over all the pids + q = 0 + ns = 0 + ps = 0 + for pid, c in fl11_weights["q"].items(): + ns += w2 * fl2_weights["ns"][pid] + ps += (w3 - w2) * fl2_weights["s"][pid] + q += c + np.testing.assert_allclose(ns + ps, q) + + @pytest.mark.skip def test_generate_light_fonll_diff_pc(): esf = MockESF("F2_light", 0.1, 10)