Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
20 changes: 10 additions & 10 deletions src/eko/scale_variations/expanded.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
r"""This module contains the scale variation operator for the expanded scheme (``ModSV=expanded``).
r"""Contains the scale variation operator for the expanded scheme (``ModSV=expanded``).
Comment thread
felixhekhorn marked this conversation as resolved.

The expressions can be obtained using Eqs. (3.33) and (3.38) of :cite:`AbdulKhalek:2019ihb`.
Be aware that corresponding the signs of the ingredients there are a number of differences.
Expand All @@ -15,7 +15,7 @@

@nb.njit(cache=True)
def variation_as1(gamma, L):
r"""Computes the |NLO| anomalous dimension variation.
r"""Compute the |NLO| anomalous dimension variation.

Parameters
----------
Expand All @@ -34,7 +34,7 @@ def variation_as1(gamma, L):

@nb.njit(cache=True)
def variation_as2(gamma, L, beta0, g0e2):
r"""Computes the |NNLO| anomalous dimension variation.
r"""Compute the |NNLO| anomalous dimension variation.

Parameters
----------
Expand All @@ -57,7 +57,7 @@ def variation_as2(gamma, L, beta0, g0e2):

@nb.njit(cache=True)
def variation_as3(gamma, L, beta0, beta1, g0e2, g0e3, g1g0, g0g1):
r"""Computes the |N3LO| anomalous dimension variation.
r"""Compute the |N3LO| anomalous dimension variation.

Parameters
----------
Expand Down Expand Up @@ -118,14 +118,14 @@ def non_singlet_variation(gamma, a_s, order, nf, L):
"""
sv_ker = 1.0
if order[0] >= 2:
sv_ker += a_s * variation_as1(gamma, L)
sv_ker -= a_s * variation_as1(gamma, L)
if order[0] >= 3:
beta0 = beta.beta_qcd_as2(nf)
sv_ker += a_s**2 * variation_as2(gamma, L, beta0, gamma[0] ** 2)
sv_ker -= a_s**2 * variation_as2(gamma, L, beta0, gamma[0] ** 2)
if order[0] >= 4:
beta1 = beta.beta_qcd((3, 0), nf)
g0g1 = gamma[0] * gamma[1]
sv_ker += a_s**3 * variation_as3(
sv_ker -= a_s**3 * variation_as3(
gamma, L, beta0, beta1, gamma[0] ** 2, gamma[0] ** 3, g0g1, g0g1
)
return sv_ker
Expand Down Expand Up @@ -156,18 +156,18 @@ def singlet_variation(gamma, a_s, order, nf, L):
sv_ker = np.eye(2, dtype=np.complex_)
gamma = np.ascontiguousarray(gamma)
if order[0] >= 2:
sv_ker += a_s * variation_as1(gamma, L)
sv_ker -= a_s * variation_as1(gamma, L)
if order[0] >= 3:
beta0 = beta.beta_qcd_as2(nf)
gamma0e2 = gamma[0] @ gamma[0]
sv_ker += a_s**2 * variation_as2(gamma, L, beta0, gamma0e2)
sv_ker -= a_s**2 * variation_as2(gamma, L, beta0, gamma0e2)
if order[0] >= 4:
beta1 = beta.beta_qcd((3, 0), nf)
gamma0e3 = gamma0e2 @ gamma[0]
# here the product is not commutative
g1g0 = gamma[1] @ gamma[0]
g0g1 = gamma[0] @ gamma[1]
sv_ker += a_s**3 * variation_as3(
sv_ker -= a_s**3 * variation_as3(
gamma, L, beta0, beta1, gamma0e2, gamma0e3, g1g0, g0g1
)
return sv_ker
12 changes: 10 additions & 2 deletions tests/eko/test_sv_expanded.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ def scheme_diff(g, k, pto, is_singlet):
)
ker_b = ker * expanded.non_singlet_variation(gns, a1, order, nf, L)
ns_diff = scheme_diff(gns, L, order, False)
np.testing.assert_allclose((ker_a - ker_b) / ker, ns_diff, atol=1e-3)
np.testing.assert_allclose(
(ker_a - ker_b) / ker,
ns_diff,
atol=1e-3,
err_msg=f"L={L},order={order},non-singlet",
)

# Singlet kernels
gs = gamma_singlet(order, n, nf)
Expand All @@ -105,5 +110,8 @@ def scheme_diff(g, k, pto, is_singlet):
ker_b = ker @ expanded.singlet_variation(gs, a1, order, nf, L)
s_diff = scheme_diff(gs, L, order, True)
np.testing.assert_allclose(
(ker_a - ker_b) @ np.linalg.inv(ker), s_diff, atol=5e-3
(ker_a - ker_b) @ np.linalg.inv(ker),
s_diff,
atol=5e-3,
err_msg=f"L={L},order={order},singlet",
)