From c14b43e27734a890baaa5af0a3d2bcbbb02d429f Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 11 Jan 2023 12:50:42 +0100 Subject: [PATCH 01/67] Split math of status quo --- benchmarks/eko/benchmark_ad.py | 4 +-- benchmarks/eko/benchmark_evol_to_unity.py | 2 +- benchmarks/performance/harmonics.py | 2 +- doc/source/overview/features.rst | 4 +-- doc/source/theory/Mellin.rst | 12 +++---- src/eko/beta.py | 2 +- src/eko/evolution_operator/__init__.py | 2 +- src/eko/evolution_operator/grid.py | 5 +-- src/eko/gamma.py | 2 +- src/eko/kernels/singlet.py | 2 +- .../anomalous_dimensions/__init__.py | 34 +++++++++---------- .../anomalous_dimensions/aem1.py | 2 +- .../anomalous_dimensions/aem2.py | 2 +- .../anomalous_dimensions/as1.py | 2 +- .../anomalous_dimensions/as1aem1.py | 3 +- .../anomalous_dimensions/as2.py | 3 +- .../anomalous_dimensions/as3.py | 0 .../anomalous_dimensions/as4/__init__.py | 0 .../anomalous_dimensions/as4/ggg.py | 0 .../anomalous_dimensions/as4/ggq.py | 0 .../anomalous_dimensions/as4/gnsm.py | 2 +- .../anomalous_dimensions/as4/gnsp.py | 0 .../anomalous_dimensions/as4/gnsv.py | 0 .../anomalous_dimensions/as4/gps.py | 0 .../anomalous_dimensions/as4/gqg.py | 0 src/{eko => ekore}/harmonics/__init__.py | 0 src/{eko => ekore}/harmonics/constants.py | 0 .../harmonics/f_functions/__init__.py | 0 .../harmonics/f_functions/f11.py | 0 .../harmonics/f_functions/f13.py | 0 .../harmonics/f_functions/f14_f12.py | 0 .../harmonics/f_functions/f16.py | 0 .../harmonics/f_functions/f17.py | 0 .../harmonics/f_functions/f18.py | 0 .../harmonics/f_functions/f19.py | 0 .../harmonics/f_functions/f20.py | 0 .../harmonics/f_functions/f21.py | 0 .../harmonics/f_functions/f9.py | 0 src/{eko => ekore}/harmonics/g_functions.py | 0 src/{eko => ekore}/harmonics/log_functions.py | 0 src/{eko => ekore}/harmonics/polygamma.py | 0 src/{eko => ekore}/harmonics/w1.py | 2 +- src/{eko => ekore}/harmonics/w2.py | 2 +- src/{eko => ekore}/harmonics/w3.py | 12 +++---- src/{eko => ekore}/harmonics/w4.py | 12 +++---- src/{eko => ekore}/harmonics/w5.py | 2 +- .../matching_conditions/__init__.py | 4 +-- src/{eko => ekore}/matching_conditions/as1.py | 2 +- src/{eko => ekore}/matching_conditions/as2.py | 2 +- .../matching_conditions/as3/__init__.py | 4 +-- .../matching_conditions/as3/aHg.py | 4 +-- .../matching_conditions/as3/aHgstfac.py | 2 +- .../matching_conditions/as3/aHq.py | 2 +- .../matching_conditions/as3/agg.py | 4 +-- .../matching_conditions/as3/aggTF2.py | 2 +- .../matching_conditions/as3/agq.py | 2 +- .../matching_conditions/as3/aqg.py | 2 +- .../matching_conditions/as3/aqqNS.py | 2 +- .../matching_conditions/as3/aqqPS.py | 2 +- .../operator_matrix_element.py | 16 ++++----- tests/eko/evolution_operator/test_init.py | 2 +- tests/eko/evolution_operator/test_physical.py | 2 +- tests/eko/kernels/test_ns.py | 2 +- tests/eko/kernels/test_s.py | 2 +- tests/eko/scale_variations/test_expanded.py | 2 +- tests/eko/test_beta.py | 2 +- .../anomalous_dimensions/__init__.py | 0 .../anomalous_dimensions/test_aem1.py | 2 +- .../anomalous_dimensions/test_aem2.py | 4 +-- .../anomalous_dimensions/test_as1.py | 6 ++-- .../anomalous_dimensions/test_as1aem1.py | 4 +-- .../anomalous_dimensions/test_as2.py | 4 +-- .../anomalous_dimensions/test_as3.py | 4 +-- .../anomalous_dimensions/test_as4.py | 4 +-- .../anomalous_dimensions/test_init.py | 6 ++-- tests/{eko => ekore}/harmonics/__init__.py | 0 .../harmonics/test_f_functions.py | 4 +-- .../harmonics/test_g_functions.py | 2 +- tests/{eko => ekore}/harmonics/test_init.py | 2 +- .../harmonics/test_log_functions.py | 2 +- .../harmonics/test_polygamma.py | 2 +- .../matching_conditions/__init__.py | 0 .../matching_conditions/test_init.py | 2 +- .../matching_conditions/test_n3lo.py | 6 ++-- .../matching_conditions/test_nlo.py | 4 +-- .../matching_conditions/test_nnlo.py | 4 +-- .../matching_conditions/test_ome.py | 10 +++--- 87 files changed, 126 insertions(+), 123 deletions(-) rename src/{eko => ekore}/anomalous_dimensions/__init__.py (81%) rename src/{eko => ekore}/anomalous_dimensions/aem1.py (98%) rename src/{eko => ekore}/anomalous_dimensions/aem2.py (99%) rename src/{eko => ekore}/anomalous_dimensions/as1.py (99%) rename src/{eko => ekore}/anomalous_dimensions/as1aem1.py (99%) rename src/{eko => ekore}/anomalous_dimensions/as2.py (99%) rename src/{eko => ekore}/anomalous_dimensions/as3.py (100%) rename src/{eko => ekore}/anomalous_dimensions/as4/__init__.py (100%) rename src/{eko => ekore}/anomalous_dimensions/as4/ggg.py (100%) rename src/{eko => ekore}/anomalous_dimensions/as4/ggq.py (100%) rename src/{eko => ekore}/anomalous_dimensions/as4/gnsm.py (99%) rename src/{eko => ekore}/anomalous_dimensions/as4/gnsp.py (100%) rename src/{eko => ekore}/anomalous_dimensions/as4/gnsv.py (100%) rename src/{eko => ekore}/anomalous_dimensions/as4/gps.py (100%) rename src/{eko => ekore}/anomalous_dimensions/as4/gqg.py (100%) rename src/{eko => ekore}/harmonics/__init__.py (100%) rename src/{eko => ekore}/harmonics/constants.py (100%) rename src/{eko => ekore}/harmonics/f_functions/__init__.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f11.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f13.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f14_f12.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f16.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f17.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f18.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f19.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f20.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f21.py (100%) rename src/{eko => ekore}/harmonics/f_functions/f9.py (100%) rename src/{eko => ekore}/harmonics/g_functions.py (100%) rename src/{eko => ekore}/harmonics/log_functions.py (100%) rename src/{eko => ekore}/harmonics/polygamma.py (100%) rename src/{eko => ekore}/harmonics/w1.py (95%) rename src/{eko => ekore}/harmonics/w2.py (95%) rename src/{eko => ekore}/harmonics/w3.py (93%) rename src/{eko => ekore}/harmonics/w4.py (94%) rename src/{eko => ekore}/harmonics/w5.py (99%) rename src/{eko => ekore}/matching_conditions/__init__.py (98%) rename src/{eko => ekore}/matching_conditions/as1.py (99%) rename src/{eko => ekore}/matching_conditions/as2.py (99%) rename src/{eko => ekore}/matching_conditions/as3/__init__.py (97%) rename src/{eko => ekore}/matching_conditions/as3/aHg.py (99%) rename src/{eko => ekore}/matching_conditions/as3/aHgstfac.py (99%) rename src/{eko => ekore}/matching_conditions/as3/aHq.py (99%) rename src/{eko => ekore}/matching_conditions/as3/agg.py (99%) rename src/{eko => ekore}/matching_conditions/as3/aggTF2.py (99%) rename src/{eko => ekore}/matching_conditions/as3/agq.py (99%) rename src/{eko => ekore}/matching_conditions/as3/aqg.py (99%) rename src/{eko => ekore}/matching_conditions/as3/aqqNS.py (99%) rename src/{eko => ekore}/matching_conditions/as3/aqqPS.py (99%) rename src/{eko => ekore}/matching_conditions/operator_matrix_element.py (95%) rename tests/{eko => ekore}/anomalous_dimensions/__init__.py (100%) rename tests/{eko => ekore}/anomalous_dimensions/test_aem1.py (93%) rename tests/{eko => ekore}/anomalous_dimensions/test_aem2.py (94%) rename tests/{eko => ekore}/anomalous_dimensions/test_as1.py (90%) rename tests/{eko => ekore}/anomalous_dimensions/test_as1aem1.py (95%) rename tests/{eko => ekore}/anomalous_dimensions/test_as2.py (98%) rename tests/{eko => ekore}/anomalous_dimensions/test_as3.py (91%) rename tests/{eko => ekore}/anomalous_dimensions/test_as4.py (98%) rename tests/{eko => ekore}/anomalous_dimensions/test_init.py (95%) rename tests/{eko => ekore}/harmonics/__init__.py (100%) rename tests/{eko => ekore}/harmonics/test_f_functions.py (98%) rename tests/{eko => ekore}/harmonics/test_g_functions.py (98%) rename tests/{eko => ekore}/harmonics/test_init.py (99%) rename tests/{eko => ekore}/harmonics/test_log_functions.py (97%) rename tests/{eko => ekore}/harmonics/test_polygamma.py (99%) rename tests/{eko => ekore}/matching_conditions/__init__.py (100%) rename tests/{eko => ekore}/matching_conditions/test_init.py (98%) rename tests/{eko => ekore}/matching_conditions/test_n3lo.py (98%) rename tests/{eko => ekore}/matching_conditions/test_nlo.py (93%) rename tests/{eko => ekore}/matching_conditions/test_nnlo.py (97%) rename tests/{eko => ekore}/matching_conditions/test_ome.py (97%) diff --git a/benchmarks/eko/benchmark_ad.py b/benchmarks/eko/benchmark_ad.py index cb5c07e66..d7f1baa39 100644 --- a/benchmarks/eko/benchmark_ad.py +++ b/benchmarks/eko/benchmark_ad.py @@ -2,8 +2,8 @@ import numpy as np import pytest -import eko.anomalous_dimensions.as2 as ad_as2 -import eko.harmonics as h +import ekore.anomalous_dimensions.as2 as ad_as2 +import ekore.harmonics as h from eko.constants import CA, CF, TR diff --git a/benchmarks/eko/benchmark_evol_to_unity.py b/benchmarks/eko/benchmark_evol_to_unity.py index 6baf6bfa8..978d11c62 100644 --- a/benchmarks/eko/benchmark_evol_to_unity.py +++ b/benchmarks/eko/benchmark_evol_to_unity.py @@ -11,7 +11,7 @@ from eko.io.runcards import OperatorCard, TheoryCard from eko.runner.legacy import Runner -# from eko.matching_conditions.operator_matrix_element import OperatorMatrixElement +# from ekore.matching_conditions.operator_matrix_element import OperatorMatrixElement def update_cards(theory: TheoryCard, operator: OperatorCard): diff --git a/benchmarks/performance/harmonics.py b/benchmarks/performance/harmonics.py index f803bcda0..e794aafde 100644 --- a/benchmarks/performance/harmonics.py +++ b/benchmarks/performance/harmonics.py @@ -1,6 +1,6 @@ import numpy as np -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from eko.mellin import Path NF = 5 diff --git a/doc/source/overview/features.rst b/doc/source/overview/features.rst index 719bc5d61..3edf80aff 100644 --- a/doc/source/overview/features.rst +++ b/doc/source/overview/features.rst @@ -1,8 +1,8 @@ Features ======== -- perturbation orders: :mod:`LO ` + :mod:`NLO ` - + :mod:`NNLO ` +- perturbation orders: :mod:`LO ` + :mod:`NLO ` + + :mod:`NNLO ` - evolution in an (almost) arbitrary sequence of |FNS| (:class:`~eko.thresholds.ThresholdsAtlas`) - :ref:`theory/pQCD:scale variations` - different :doc:`solutions ` of |DGLAP| differential equation diff --git a/doc/source/theory/Mellin.rst b/doc/source/theory/Mellin.rst index 083f3e9a9..2c160902f 100644 --- a/doc/source/theory/Mellin.rst +++ b/doc/source/theory/Mellin.rst @@ -124,7 +124,7 @@ the Mellin inverse. S_m(N) = \sum\limits_{j=1}^N \frac 1 {j^m} = \frac{(-1)^{m-1}}{(m-1)!} \psi_{m-1}(N+1)+c_m \quad \text{with},\quad c_m = \left\{\begin{array}{ll} \gamma_E, & m=1\\ \zeta(m), & m>1\end{array} \right. - where :math:`\psi_k(N)` is the :math:`k`-th polygamma function (implemented as :meth:`~eko.harmonics.polygamma.cern_polygamma`) + where :math:`\psi_k(N)` is the :math:`k`-th polygamma function (implemented as :meth:`~ekore.harmonics.polygamma.cern_polygamma`) and :math:`\zeta` the Riemann zeta function (using :func:`scipy.special.zeta`). - for the sums :math:`S_{-m}(N)` and m > 0 we use :cite:`Gluck:1989ze`: @@ -149,7 +149,7 @@ the Mellin inverse. which express higher weight sums in terms of simple one :math:`S_{m}, S_{-m}` and some irreducible integrals. The above prescription on the analytical continuation of :math:`\eta` is applied. -The complete list of harmonics sums available in :mod:`eko.harmonics` is: +The complete list of harmonics sums available in :mod:`ekore.harmonics` is: - weight 1: @@ -166,20 +166,20 @@ The complete list of harmonics sums available in :mod:`eko.harmonics` is: .. math:: S_{3}, S_{2,1}, S_{2,-1}, S_{-2,1}, S_{-2,-1}, S_{-3} - these sums relies on the integrals :mod:`eko.harmonics.g_functions` :cite:`MuselliPhD,Blumlein:1998if` + these sums relies on the integrals :mod:`ekore.harmonics.g_functions` :cite:`MuselliPhD,Blumlein:1998if` - weight 4: .. math :: S_{4}, S_{3,1}, S_{2,1,1}, S_{-2,-2}, S_{-3, 1}, S_{-4} - these sums relies on the integrals :mod:`eko.harmonics.g_functions` :cite:`MuselliPhD,Blumlein:1998if` + these sums relies on the integrals :mod:`ekore.harmonics.g_functions` :cite:`MuselliPhD,Blumlein:1998if` - weight 5: .. math :: S_{5}, S_{4,1}, S_{3,1,1}, S_{2,3}, S_{2,2,1}, S_{2,1,1,1}, S_{2,1,-2}, S_{2,-3}, S_{-2,3}, S_{-2,2,1}, S_{-2,1,1,1}, S_{-5} - these sums relies on the integrals :mod:`eko.harmonics.f_functions` :cite:`Blumlein:2009ta` + these sums relies on the integrals :mod:`ekore.harmonics.f_functions` :cite:`Blumlein:2009ta` -We have also implemented a recursive computation of simple harmonics (single index), see :func:`eko.harmonics.polygamma.recursive_harmonic_sum` +We have also implemented a recursive computation of simple harmonics (single index), see :func:`ekore.harmonics.polygamma.recursive_harmonic_sum` diff --git a/src/eko/beta.py b/src/eko/beta.py index f83d013bb..92212bf58 100644 --- a/src/eko/beta.py +++ b/src/eko/beta.py @@ -7,7 +7,7 @@ import numba as nb from . import constants -from .harmonics.constants import zeta3 +from ekore.harmonics.constants import zeta3 @nb.njit(cache=True) diff --git a/src/eko/evolution_operator/__init__.py b/src/eko/evolution_operator/__init__.py index 323b117b4..544fde4cc 100644 --- a/src/eko/evolution_operator/__init__.py +++ b/src/eko/evolution_operator/__init__.py @@ -13,7 +13,7 @@ import numpy as np from scipy import integrate -from .. import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from .. import basis_rotation as br from .. import interpolation, mellin from .. import scale_variations as sv diff --git a/src/eko/evolution_operator/grid.py b/src/eko/evolution_operator/grid.py index 1b55a2072..82e50fe9a 100644 --- a/src/eko/evolution_operator/grid.py +++ b/src/eko/evolution_operator/grid.py @@ -11,10 +11,11 @@ import numpy as np import numpy.typing as npt -from .. import matching_conditions, member +from ekore import matching_conditions +from .. import member from .. import scale_variations as sv from ..io.runcards import Configs, Debug -from ..matching_conditions.operator_matrix_element import OperatorMatrixElement +from ekore.matching_conditions.operator_matrix_element import OperatorMatrixElement from ..thresholds import flavor_shift, is_downward_path from . import Operator, flavors, physical diff --git a/src/eko/gamma.py b/src/eko/gamma.py index cd4e9aa3e..b2c4a857b 100644 --- a/src/eko/gamma.py +++ b/src/eko/gamma.py @@ -5,7 +5,7 @@ """ import numba as nb -from .harmonics.constants import zeta3, zeta4, zeta5 +from ekore.harmonics.constants import zeta3, zeta4, zeta5 @nb.njit(cache=True) diff --git a/src/eko/kernels/singlet.py b/src/eko/kernels/singlet.py index ab3d4dfc8..2bab5d35c 100644 --- a/src/eko/kernels/singlet.py +++ b/src/eko/kernels/singlet.py @@ -3,7 +3,7 @@ import numba as nb import numpy as np -from .. import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from .. import beta from . import as4_evolution_integrals as as4_ei from . import evolution_integrals as ei diff --git a/src/eko/anomalous_dimensions/__init__.py b/src/ekore/anomalous_dimensions/__init__.py similarity index 81% rename from src/eko/anomalous_dimensions/__init__.py rename to src/ekore/anomalous_dimensions/__init__.py index c3a3f8c78..69c9865d7 100644 --- a/src/eko/anomalous_dimensions/__init__.py +++ b/src/ekore/anomalous_dimensions/__init__.py @@ -19,7 +19,7 @@ import numba as nb import numpy as np -from .. import basis_rotation as br +from eko import basis_rotation as br from .. import harmonics from . import aem1, aem2, as1, as1aem1, as2, as3, as4 @@ -53,9 +53,9 @@ def exp_singlet(gamma_S): See Also -------- - eko.anomalous_dimensions.as1.gamma_singlet : :math:`\gamma_{S}^{(0)}(N)` - eko.anomalous_dimensions.as2.gamma_singlet : :math:`\gamma_{S}^{(1)}(N)` - eko.anomalous_dimensions.as3.gamma_singlet : :math:`\gamma_{S}^{(2)}(N)` + ekore.anomalous_dimensions.as1.gamma_singlet : :math:`\gamma_{S}^{(0)}(N)` + ekore.anomalous_dimensions.as2.gamma_singlet : :math:`\gamma_{S}^{(1)}(N)` + ekore.anomalous_dimensions.as3.gamma_singlet : :math:`\gamma_{S}^{(2)}(N)` """ # compute eigenvalues det = np.sqrt( @@ -94,15 +94,15 @@ def gamma_ns(order, mode, n, nf): See Also -------- - eko.anomalous_dimensions.as1.gamma_ns : :math:`\gamma_{ns}^{(0)}(N)` - eko.anomalous_dimensions.as2.gamma_nsp : :math:`\gamma_{ns,+}^{(1)}(N)` - eko.anomalous_dimensions.as2.gamma_nsm : :math:`\gamma_{ns,-}^{(1)}(N)` - eko.anomalous_dimensions.as3.gamma_nsp : :math:`\gamma_{ns,+}^{(2)}(N)` - eko.anomalous_dimensions.as3.gamma_nsm : :math:`\gamma_{ns,-}^{(2)}(N)` - eko.anomalous_dimensions.as3.gamma_nsv : :math:`\gamma_{ns,v}^{(2)}(N)` - eko.anomalous_dimensions.as4.gamma_nsp : :math:`\gamma_{ns,+}^{(3)}(N)` - eko.anomalous_dimensions.as4.gamma_nsm : :math:`\gamma_{ns,-}^{(3)}(N)` - eko.anomalous_dimensions.as4.gamma_nsv : :math:`\gamma_{ns,v}^{(3)}(N)` + ekore.anomalous_dimensions.as1.gamma_ns : :math:`\gamma_{ns}^{(0)}(N)` + ekore.anomalous_dimensions.as2.gamma_nsp : :math:`\gamma_{ns,+}^{(1)}(N)` + ekore.anomalous_dimensions.as2.gamma_nsm : :math:`\gamma_{ns,-}^{(1)}(N)` + ekore.anomalous_dimensions.as3.gamma_nsp : :math:`\gamma_{ns,+}^{(2)}(N)` + ekore.anomalous_dimensions.as3.gamma_nsm : :math:`\gamma_{ns,-}^{(2)}(N)` + ekore.anomalous_dimensions.as3.gamma_nsv : :math:`\gamma_{ns,v}^{(2)}(N)` + ekore.anomalous_dimensions.as4.gamma_nsp : :math:`\gamma_{ns,+}^{(3)}(N)` + ekore.anomalous_dimensions.as4.gamma_nsm : :math:`\gamma_{ns,-}^{(3)}(N)` + ekore.anomalous_dimensions.as4.gamma_nsv : :math:`\gamma_{ns,v}^{(3)}(N)` """ # cache the s-es @@ -172,10 +172,10 @@ def gamma_singlet(order, n, nf): See Also -------- - eko.anomalous_dimensions.as1.gamma_singlet : :math:`\gamma_{S}^{(0)}(N)` - eko.anomalous_dimensions.as2.gamma_singlet : :math:`\gamma_{S}^{(1)}(N)` - eko.anomalous_dimensions.as3.gamma_singlet : :math:`\gamma_{S}^{(2)}(N)` - eko.anomalous_dimensions.as4.gamma_singlet : :math:`\gamma_{S}^{(3)}(N)` + ekore.anomalous_dimensions.as1.gamma_singlet : :math:`\gamma_{S}^{(0)}(N)` + ekore.anomalous_dimensions.as2.gamma_singlet : :math:`\gamma_{S}^{(1)}(N)` + ekore.anomalous_dimensions.as3.gamma_singlet : :math:`\gamma_{S}^{(2)}(N)` + ekore.anomalous_dimensions.as4.gamma_singlet : :math:`\gamma_{S}^{(3)}(N)` """ # cache the s-es diff --git a/src/eko/anomalous_dimensions/aem1.py b/src/ekore/anomalous_dimensions/aem1.py similarity index 98% rename from src/eko/anomalous_dimensions/aem1.py rename to src/ekore/anomalous_dimensions/aem1.py index f272439cb..d26683969 100644 --- a/src/eko/anomalous_dimensions/aem1.py +++ b/src/ekore/anomalous_dimensions/aem1.py @@ -4,7 +4,7 @@ import numba as nb -from .. import constants +from eko import constants from . import as1 diff --git a/src/eko/anomalous_dimensions/aem2.py b/src/ekore/anomalous_dimensions/aem2.py similarity index 99% rename from src/eko/anomalous_dimensions/aem2.py rename to src/ekore/anomalous_dimensions/aem2.py index d2a4940d6..83f40e456 100644 --- a/src/eko/anomalous_dimensions/aem2.py +++ b/src/ekore/anomalous_dimensions/aem2.py @@ -4,7 +4,7 @@ import numba as nb -from .. import constants +from eko import constants from . import as1aem1 diff --git a/src/eko/anomalous_dimensions/as1.py b/src/ekore/anomalous_dimensions/as1.py similarity index 99% rename from src/eko/anomalous_dimensions/as1.py rename to src/ekore/anomalous_dimensions/as1.py index b4e5fd133..28afb3a00 100644 --- a/src/eko/anomalous_dimensions/as1.py +++ b/src/ekore/anomalous_dimensions/as1.py @@ -3,7 +3,7 @@ import numba as nb import numpy as np -from .. import constants +from eko import constants @nb.njit(cache=True) diff --git a/src/eko/anomalous_dimensions/as1aem1.py b/src/ekore/anomalous_dimensions/as1aem1.py similarity index 99% rename from src/eko/anomalous_dimensions/as1aem1.py rename to src/ekore/anomalous_dimensions/as1aem1.py index 85eb25ffa..d2b7ebebc 100644 --- a/src/eko/anomalous_dimensions/as1aem1.py +++ b/src/ekore/anomalous_dimensions/as1aem1.py @@ -4,7 +4,8 @@ import numba as nb -from .. import constants, harmonics +from eko import constants +from .. import harmonics from ..harmonics.constants import zeta2, zeta3 diff --git a/src/eko/anomalous_dimensions/as2.py b/src/ekore/anomalous_dimensions/as2.py similarity index 99% rename from src/eko/anomalous_dimensions/as2.py rename to src/ekore/anomalous_dimensions/as2.py index 03945a495..e51034a5b 100644 --- a/src/eko/anomalous_dimensions/as2.py +++ b/src/ekore/anomalous_dimensions/as2.py @@ -9,7 +9,8 @@ import numba as nb import numpy as np -from .. import constants, harmonics +from eko import constants +from .. import harmonics from ..harmonics.constants import log2, zeta2, zeta3 diff --git a/src/eko/anomalous_dimensions/as3.py b/src/ekore/anomalous_dimensions/as3.py similarity index 100% rename from src/eko/anomalous_dimensions/as3.py rename to src/ekore/anomalous_dimensions/as3.py diff --git a/src/eko/anomalous_dimensions/as4/__init__.py b/src/ekore/anomalous_dimensions/as4/__init__.py similarity index 100% rename from src/eko/anomalous_dimensions/as4/__init__.py rename to src/ekore/anomalous_dimensions/as4/__init__.py diff --git a/src/eko/anomalous_dimensions/as4/ggg.py b/src/ekore/anomalous_dimensions/as4/ggg.py similarity index 100% rename from src/eko/anomalous_dimensions/as4/ggg.py rename to src/ekore/anomalous_dimensions/as4/ggg.py diff --git a/src/eko/anomalous_dimensions/as4/ggq.py b/src/ekore/anomalous_dimensions/as4/ggq.py similarity index 100% rename from src/eko/anomalous_dimensions/as4/ggq.py rename to src/ekore/anomalous_dimensions/as4/ggq.py diff --git a/src/eko/anomalous_dimensions/as4/gnsm.py b/src/ekore/anomalous_dimensions/as4/gnsm.py similarity index 99% rename from src/eko/anomalous_dimensions/as4/gnsm.py rename to src/ekore/anomalous_dimensions/as4/gnsm.py index 691aede24..ae50c68ba 100644 --- a/src/eko/anomalous_dimensions/as4/gnsm.py +++ b/src/ekore/anomalous_dimensions/as4/gnsm.py @@ -3,7 +3,7 @@ """ import numba as nb -from ...constants import CF +from eko.constants import CF from ...harmonics.constants import zeta3 from ...harmonics.log_functions import lm11m1, lm12m1, lm13m1 diff --git a/src/eko/anomalous_dimensions/as4/gnsp.py b/src/ekore/anomalous_dimensions/as4/gnsp.py similarity index 100% rename from src/eko/anomalous_dimensions/as4/gnsp.py rename to src/ekore/anomalous_dimensions/as4/gnsp.py diff --git a/src/eko/anomalous_dimensions/as4/gnsv.py b/src/ekore/anomalous_dimensions/as4/gnsv.py similarity index 100% rename from src/eko/anomalous_dimensions/as4/gnsv.py rename to src/ekore/anomalous_dimensions/as4/gnsv.py diff --git a/src/eko/anomalous_dimensions/as4/gps.py b/src/ekore/anomalous_dimensions/as4/gps.py similarity index 100% rename from src/eko/anomalous_dimensions/as4/gps.py rename to src/ekore/anomalous_dimensions/as4/gps.py diff --git a/src/eko/anomalous_dimensions/as4/gqg.py b/src/ekore/anomalous_dimensions/as4/gqg.py similarity index 100% rename from src/eko/anomalous_dimensions/as4/gqg.py rename to src/ekore/anomalous_dimensions/as4/gqg.py diff --git a/src/eko/harmonics/__init__.py b/src/ekore/harmonics/__init__.py similarity index 100% rename from src/eko/harmonics/__init__.py rename to src/ekore/harmonics/__init__.py diff --git a/src/eko/harmonics/constants.py b/src/ekore/harmonics/constants.py similarity index 100% rename from src/eko/harmonics/constants.py rename to src/ekore/harmonics/constants.py diff --git a/src/eko/harmonics/f_functions/__init__.py b/src/ekore/harmonics/f_functions/__init__.py similarity index 100% rename from src/eko/harmonics/f_functions/__init__.py rename to src/ekore/harmonics/f_functions/__init__.py diff --git a/src/eko/harmonics/f_functions/f11.py b/src/ekore/harmonics/f_functions/f11.py similarity index 100% rename from src/eko/harmonics/f_functions/f11.py rename to src/ekore/harmonics/f_functions/f11.py diff --git a/src/eko/harmonics/f_functions/f13.py b/src/ekore/harmonics/f_functions/f13.py similarity index 100% rename from src/eko/harmonics/f_functions/f13.py rename to src/ekore/harmonics/f_functions/f13.py diff --git a/src/eko/harmonics/f_functions/f14_f12.py b/src/ekore/harmonics/f_functions/f14_f12.py similarity index 100% rename from src/eko/harmonics/f_functions/f14_f12.py rename to src/ekore/harmonics/f_functions/f14_f12.py diff --git a/src/eko/harmonics/f_functions/f16.py b/src/ekore/harmonics/f_functions/f16.py similarity index 100% rename from src/eko/harmonics/f_functions/f16.py rename to src/ekore/harmonics/f_functions/f16.py diff --git a/src/eko/harmonics/f_functions/f17.py b/src/ekore/harmonics/f_functions/f17.py similarity index 100% rename from src/eko/harmonics/f_functions/f17.py rename to src/ekore/harmonics/f_functions/f17.py diff --git a/src/eko/harmonics/f_functions/f18.py b/src/ekore/harmonics/f_functions/f18.py similarity index 100% rename from src/eko/harmonics/f_functions/f18.py rename to src/ekore/harmonics/f_functions/f18.py diff --git a/src/eko/harmonics/f_functions/f19.py b/src/ekore/harmonics/f_functions/f19.py similarity index 100% rename from src/eko/harmonics/f_functions/f19.py rename to src/ekore/harmonics/f_functions/f19.py diff --git a/src/eko/harmonics/f_functions/f20.py b/src/ekore/harmonics/f_functions/f20.py similarity index 100% rename from src/eko/harmonics/f_functions/f20.py rename to src/ekore/harmonics/f_functions/f20.py diff --git a/src/eko/harmonics/f_functions/f21.py b/src/ekore/harmonics/f_functions/f21.py similarity index 100% rename from src/eko/harmonics/f_functions/f21.py rename to src/ekore/harmonics/f_functions/f21.py diff --git a/src/eko/harmonics/f_functions/f9.py b/src/ekore/harmonics/f_functions/f9.py similarity index 100% rename from src/eko/harmonics/f_functions/f9.py rename to src/ekore/harmonics/f_functions/f9.py diff --git a/src/eko/harmonics/g_functions.py b/src/ekore/harmonics/g_functions.py similarity index 100% rename from src/eko/harmonics/g_functions.py rename to src/ekore/harmonics/g_functions.py diff --git a/src/eko/harmonics/log_functions.py b/src/ekore/harmonics/log_functions.py similarity index 100% rename from src/eko/harmonics/log_functions.py rename to src/ekore/harmonics/log_functions.py diff --git a/src/eko/harmonics/polygamma.py b/src/ekore/harmonics/polygamma.py similarity index 100% rename from src/eko/harmonics/polygamma.py rename to src/ekore/harmonics/polygamma.py diff --git a/src/eko/harmonics/w1.py b/src/ekore/harmonics/w1.py similarity index 95% rename from src/eko/harmonics/w1.py rename to src/ekore/harmonics/w1.py index 5d4e5b27c..10f7cc3d4 100644 --- a/src/eko/harmonics/w1.py +++ b/src/ekore/harmonics/w1.py @@ -28,7 +28,7 @@ def S1(N): See Also -------- - eko.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` + ekore.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` """ return cern_polygamma(N + 1.0, 0) + np.euler_gamma diff --git a/src/eko/harmonics/w2.py b/src/ekore/harmonics/w2.py similarity index 95% rename from src/eko/harmonics/w2.py rename to src/ekore/harmonics/w2.py index 9e978f0d4..69c0029eb 100644 --- a/src/eko/harmonics/w2.py +++ b/src/ekore/harmonics/w2.py @@ -28,7 +28,7 @@ def S2(N): See Also -------- - eko.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` + ekore.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` """ return -cern_polygamma(N + 1.0, 1) + zeta2 diff --git a/src/eko/harmonics/w3.py b/src/ekore/harmonics/w3.py similarity index 93% rename from src/eko/harmonics/w3.py rename to src/ekore/harmonics/w3.py index 49e3d5a7e..dcd52428c 100644 --- a/src/eko/harmonics/w3.py +++ b/src/ekore/harmonics/w3.py @@ -29,7 +29,7 @@ def S3(N): See Also -------- - eko.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` + ekore.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` """ return 0.5 * cern_polygamma(N + 1.0, 2) + zeta3 @@ -59,7 +59,7 @@ def Sm3(N, hS3, is_singlet=None): See Also -------- - eko.harmonics.w3.S3 : :math:`S_3(N)` + ekore.harmonics.w3.S3 : :math:`S_3(N)` """ if is_singlet is None: @@ -97,7 +97,7 @@ def S21(N, S1, S2): See Also -------- - eko.harmonics.g_functions.mellin_g18 : :math:`g_18(N)` + ekore.harmonics.g_functions.mellin_g18 : :math:`g_18(N)` """ return -gf.mellin_g18(N, S1, S2) + 2 * zeta3 @@ -129,7 +129,7 @@ def Sm21(N, S1, Sm1, is_singlet=None): See Also -------- - eko.harmonics.g_functions : :math:`g_3(N)` + ekore.harmonics.g_functions : :math:`g_3(N)` """ # Note mellin g3 was integrated following x^(N-1) convention. @@ -170,7 +170,7 @@ def S2m1(N, S2, Sm1, Sm2, is_singlet=None): See Also -------- - eko.harmonics.g_functions.mellin_g4 : :math:`g_4(N)` + ekore.harmonics.g_functions.mellin_g4 : :math:`g_4(N)` """ eta = symmetry_factor(N, is_singlet) @@ -208,7 +208,7 @@ def Sm2m1(N, S1, S2, Sm2): See Also -------- - eko.harmonics.g_functions.mellin_g19 : :math:`g_19(N)` + ekore.harmonics.g_functions.mellin_g19 : :math:`g_19(N)` """ return -gf.mellin_g19(N, S1) + log2 * (S2 - Sm2) - 5 / 8 * zeta3 diff --git a/src/eko/harmonics/w4.py b/src/ekore/harmonics/w4.py similarity index 94% rename from src/eko/harmonics/w4.py rename to src/ekore/harmonics/w4.py index 270e79311..855602ec7 100644 --- a/src/eko/harmonics/w4.py +++ b/src/ekore/harmonics/w4.py @@ -29,7 +29,7 @@ def S4(N): See Also -------- - eko.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` + ekore.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` """ return zeta4 - 1.0 / 6.0 * cern_polygamma(N + 1.0, 3) @@ -102,7 +102,7 @@ def Sm31(N, S1, Sm1, Sm2, is_singlet=None): See Also -------- - eko.harmonics.g_functions.mellin_g6 : :math:`g_6(N)` + ekore.harmonics.g_functions.mellin_g6 : :math:`g_6(N)` """ eta = symmetry_factor(N, is_singlet) @@ -148,7 +148,7 @@ def Sm22(N, S1, S2, Sm2, Sm31, is_singlet=None): See Also -------- - eko.harmonics.g_functions.mellin_g5 : :math:`g_5(N)` + ekore.harmonics.g_functions.mellin_g5 : :math:`g_5(N)` """ eta = symmetry_factor(N, is_singlet) @@ -185,7 +185,7 @@ def Sm211(N, S1, S2, Sm1, is_singlet=None): See Also -------- - eko.harmonics.g_functions.mellin_g8 : :math:`g_8(N)` + ekore.harmonics.g_functions.mellin_g8 : :math:`g_8(N)` """ eta = symmetry_factor(N, is_singlet) @@ -225,7 +225,7 @@ def S211(N, S1, S2, S3): See Also -------- - eko.harmonics.g_functions.mellin_g21 : :math:`g_21(N)` + ekore.harmonics.g_functions.mellin_g21 : :math:`g_21(N)` """ return -gf.mellin_g21(N, S1, S2, S3) + 6 / 5 * zeta2**2 @@ -258,7 +258,7 @@ def S31(N, S1, S2, S3, S4): See Also -------- - eko.harmonics.g_functions.mellin_g22 : :math:`g_22(N)` + ekore.harmonics.g_functions.mellin_g22 : :math:`g_22(N)` """ return ( diff --git a/src/eko/harmonics/w5.py b/src/ekore/harmonics/w5.py similarity index 99% rename from src/eko/harmonics/w5.py rename to src/ekore/harmonics/w5.py index d6a3f91d9..b75f9eebf 100644 --- a/src/eko/harmonics/w5.py +++ b/src/ekore/harmonics/w5.py @@ -29,7 +29,7 @@ def S5(N): See Also -------- - eko.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` + ekore.harmonics.polygamma.cern_polygamma : :math:`\psi_k(N)` """ return zeta5 + 1.0 / 24.0 * cern_polygamma(N + 1.0, 4) diff --git a/src/eko/matching_conditions/__init__.py b/src/ekore/matching_conditions/__init__.py similarity index 98% rename from src/eko/matching_conditions/__init__.py rename to src/ekore/matching_conditions/__init__.py index 32b8cd036..f2eaed8e0 100644 --- a/src/eko/matching_conditions/__init__.py +++ b/src/ekore/matching_conditions/__init__.py @@ -2,8 +2,8 @@ This module defines the matching conditions for the |VFNS| evolution. """ -from .. import basis_rotation as br -from .. import member +from eko import basis_rotation as br +from eko import member class MatchingCondition(member.OperatorBase): diff --git a/src/eko/matching_conditions/as1.py b/src/ekore/matching_conditions/as1.py similarity index 99% rename from src/eko/matching_conditions/as1.py rename to src/ekore/matching_conditions/as1.py index cc74550ca..c373f8091 100644 --- a/src/eko/matching_conditions/as1.py +++ b/src/ekore/matching_conditions/as1.py @@ -9,7 +9,7 @@ import numba as nb import numpy as np -from ..constants import CF +from eko.constants import CF @nb.njit(cache=True) diff --git a/src/eko/matching_conditions/as2.py b/src/ekore/matching_conditions/as2.py similarity index 99% rename from src/eko/matching_conditions/as2.py rename to src/ekore/matching_conditions/as2.py index 7a86d8050..242f1fa5f 100644 --- a/src/eko/matching_conditions/as2.py +++ b/src/ekore/matching_conditions/as2.py @@ -11,7 +11,7 @@ import numba as nb import numpy as np -from .. import constants +from eko import constants from ..harmonics.constants import zeta2, zeta3 from .as1 import A_gg as A_gg_1 from .as1 import A_hg as A_hg_1 diff --git a/src/eko/matching_conditions/as3/__init__.py b/src/ekore/matching_conditions/as3/__init__.py similarity index 97% rename from src/eko/matching_conditions/as3/__init__.py rename to src/ekore/matching_conditions/as3/__init__.py index b414369a5..06feccd38 100644 --- a/src/eko/matching_conditions/as3/__init__.py +++ b/src/ekore/matching_conditions/as3/__init__.py @@ -80,7 +80,7 @@ def A_singlet(n, sx_singlet, sx_non_singlet, nf, L): \end{array}\right) When using the code, please cite the complete list of references - available at the top of this module :mod:`eko.matching_conditions.as3`. + available at the top of this module :mod:`ekore.matching_conditions.as3`. Parameters ---------- @@ -140,7 +140,7 @@ def A_ns(n, sx_all, nf, L): \end{array}\right) When using the code, please cite the complete list of references available - at the top of this module :mod:`eko.matching_conditions.as3`. + at the top of this module :mod:`ekore.matching_conditions.as3`. Parameters ---------- diff --git a/src/eko/matching_conditions/as3/aHg.py b/src/ekore/matching_conditions/as3/aHg.py similarity index 99% rename from src/eko/matching_conditions/as3/aHg.py rename to src/ekore/matching_conditions/as3/aHg.py index b756ab584..c676ce558 100644 --- a/src/eko/matching_conditions/as3/aHg.py +++ b/src/ekore/matching_conditions/as3/aHg.py @@ -11,7 +11,7 @@ def A_Hg(n, sx, nf, L): # pylint: disable=too-many-locals The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. Parameters ---------- @@ -31,7 +31,7 @@ def A_Hg(n, sx, nf, L): # pylint: disable=too-many-locals See Also -------- - A_Hgstfac: eko.matching_conditions.as3.aHgstfac.A_Hgstfac + A_Hgstfac: ekore.matching_conditions.as3.aHgstfac.A_Hgstfac Incomplete part of the |OME|. """ diff --git a/src/eko/matching_conditions/as3/aHgstfac.py b/src/ekore/matching_conditions/as3/aHgstfac.py similarity index 99% rename from src/eko/matching_conditions/as3/aHgstfac.py rename to src/ekore/matching_conditions/as3/aHgstfac.py index 863c46536..4eed1890a 100644 --- a/src/eko/matching_conditions/as3/aHgstfac.py +++ b/src/ekore/matching_conditions/as3/aHgstfac.py @@ -10,7 +10,7 @@ def A_Hgstfac(n, sx, nf): The expression is presented in :cite:`Blumlein:2017wxd` (eq 3.1). When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. The expression contains some unknown parts which are set to 0. However we have included a shift to impose the gluon diff --git a/src/eko/matching_conditions/as3/aHq.py b/src/ekore/matching_conditions/as3/aHq.py similarity index 99% rename from src/eko/matching_conditions/as3/aHq.py rename to src/ekore/matching_conditions/as3/aHq.py index 18a0bb61c..6ea2968ec 100644 --- a/src/eko/matching_conditions/as3/aHq.py +++ b/src/ekore/matching_conditions/as3/aHq.py @@ -10,7 +10,7 @@ def A_Hq(n, sx, nf, L): # pylint: disable=too-many-locals and :cite:`Blumlein:2017wxd` (eq 3.1). When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. The part proportional to :math:`n_f^0` includes non trivial weight-5 harmonics and has been parametrized in Mellin space. diff --git a/src/eko/matching_conditions/as3/agg.py b/src/ekore/matching_conditions/as3/agg.py similarity index 99% rename from src/eko/matching_conditions/as3/agg.py rename to src/ekore/matching_conditions/as3/agg.py index 79debe7c3..b4783d83e 100644 --- a/src/eko/matching_conditions/as3/agg.py +++ b/src/ekore/matching_conditions/as3/agg.py @@ -11,7 +11,7 @@ def A_gg(n, sx, nf, L): # pylint: disable=too-many-locals The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. Parameters ---------- @@ -31,7 +31,7 @@ def A_gg(n, sx, nf, L): # pylint: disable=too-many-locals See Also -------- - A_ggTF2: eko.matching_conditions.as3.aggTF2.A_ggTF2 + A_ggTF2: ekore.matching_conditions.as3.aggTF2.A_ggTF2 Incomplete part proportional to :math:`T_{F}^2`. """ diff --git a/src/eko/matching_conditions/as3/aggTF2.py b/src/ekore/matching_conditions/as3/aggTF2.py similarity index 99% rename from src/eko/matching_conditions/as3/aggTF2.py rename to src/ekore/matching_conditions/as3/aggTF2.py index 5e337c5f0..299006dc6 100644 --- a/src/eko/matching_conditions/as3/aggTF2.py +++ b/src/ekore/matching_conditions/as3/aggTF2.py @@ -10,7 +10,7 @@ def A_ggTF2(n, sx): It contains a binomial factor which is given approximated. When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. Parameters ---------- diff --git a/src/eko/matching_conditions/as3/agq.py b/src/ekore/matching_conditions/as3/agq.py similarity index 99% rename from src/eko/matching_conditions/as3/agq.py rename to src/ekore/matching_conditions/as3/agq.py index 1d874021d..906e08e52 100644 --- a/src/eko/matching_conditions/as3/agq.py +++ b/src/ekore/matching_conditions/as3/agq.py @@ -8,7 +8,7 @@ def A_gq(n, sx, nf, L): # pylint: disable=too-many-locals The expression is presented in :cite:`Ablinger_2014` (eq 6.3). When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. Parameters ---------- diff --git a/src/eko/matching_conditions/as3/aqg.py b/src/ekore/matching_conditions/as3/aqg.py similarity index 99% rename from src/eko/matching_conditions/as3/aqg.py rename to src/ekore/matching_conditions/as3/aqg.py index 33a059eb9..3c2cc36e4 100644 --- a/src/eko/matching_conditions/as3/aqg.py +++ b/src/ekore/matching_conditions/as3/aqg.py @@ -8,7 +8,7 @@ def A_qg(n, sx, nf, L): The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. Parameters ---------- diff --git a/src/eko/matching_conditions/as3/aqqNS.py b/src/ekore/matching_conditions/as3/aqqNS.py similarity index 99% rename from src/eko/matching_conditions/as3/aqqNS.py rename to src/ekore/matching_conditions/as3/aqqNS.py index fdbf9114e..40be9ed69 100644 --- a/src/eko/matching_conditions/as3/aqqNS.py +++ b/src/ekore/matching_conditions/as3/aqqNS.py @@ -9,7 +9,7 @@ def A_qqNS(n, sx, nf, L): :cite:`Ablinger:2014vwa`. It contains some weight 5 harmonics sums. When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. Note the part proportional to nf^0 includes weight = 5 harmonics and has been parametrized in Mellin space. diff --git a/src/eko/matching_conditions/as3/aqqPS.py b/src/ekore/matching_conditions/as3/aqqPS.py similarity index 99% rename from src/eko/matching_conditions/as3/aqqPS.py rename to src/ekore/matching_conditions/as3/aqqPS.py index a0f20af1c..ee8f136cd 100644 --- a/src/eko/matching_conditions/as3/aqqPS.py +++ b/src/ekore/matching_conditions/as3/aqqPS.py @@ -8,7 +8,7 @@ def A_qqPS(n, sx, nf, L): The expression is presented in :cite:`Bierenbaum:2009mv`. When using the code, please cite the complete list of references - available in :mod:`eko.matching_conditions.as3`. + available in :mod:`ekore.matching_conditions.as3`. Parameters ---------- diff --git a/src/eko/matching_conditions/operator_matrix_element.py b/src/ekore/matching_conditions/operator_matrix_element.py similarity index 95% rename from src/eko/matching_conditions/operator_matrix_element.py rename to src/ekore/matching_conditions/operator_matrix_element.py index a8ad60109..c19cc2991 100644 --- a/src/eko/matching_conditions/operator_matrix_element.py +++ b/src/ekore/matching_conditions/operator_matrix_element.py @@ -9,9 +9,9 @@ import numba as nb import numpy as np -from .. import basis_rotation as br +from eko import basis_rotation as br from .. import harmonics -from ..evolution_operator import Operator, QuadKerBase +from eko.evolution_operator import Operator, QuadKerBase from . import as1, as2, as3 logger = logging.getLogger(__name__) @@ -46,10 +46,10 @@ def A_singlet(matching_order, n, sx, nf, L, is_msbar, sx_ns=None): See Also -------- - eko.matching_conditions.nlo.A_singlet_1 : :math:`A^{S,(1)}(N)` - eko.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` - eko.matching_conditions.nlo.A_gh_1 : :math:`A_{gH}^{(1)}(N)` - eko.matching_conditions.nnlo.A_singlet_2 : :math:`A_{S,(2)}(N)` + ekore.matching_conditions.nlo.A_singlet_1 : :math:`A^{S,(1)}(N)` + ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` + ekore.matching_conditions.nlo.A_gh_1 : :math:`A_{gH}^{(1)}(N)` + ekore.matching_conditions.nnlo.A_singlet_2 : :math:`A_{S,(2)}(N)` """ A_s = np.zeros((matching_order[0], 3, 3), np.complex_) if matching_order[0] >= 1: @@ -86,8 +86,8 @@ def A_non_singlet(matching_order, n, sx, nf, L): See Also -------- - eko.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` - eko.matching_conditions.nnlo.A_ns_2 : :math:`A_{qq,H}^{NS,(2)}` + ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` + ekore.matching_conditions.nnlo.A_ns_2 : :math:`A_{qq,H}^{NS,(2)}` """ A_ns = np.zeros((matching_order[0], 2, 2), np.complex_) if matching_order[0] >= 1: diff --git a/tests/eko/evolution_operator/test_init.py b/tests/eko/evolution_operator/test_init.py index dc8ddbd8e..d94ad542c 100644 --- a/tests/eko/evolution_operator/test_init.py +++ b/tests/eko/evolution_operator/test_init.py @@ -4,7 +4,7 @@ import scipy.integrate import eko.runner.legacy -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from eko import basis_rotation as br from eko import interpolation, mellin from eko.evolution_operator import Operator, quad_ker diff --git a/tests/eko/evolution_operator/test_physical.py b/tests/eko/evolution_operator/test_physical.py index a02591d44..d28602aa6 100644 --- a/tests/eko/evolution_operator/test_physical.py +++ b/tests/eko/evolution_operator/test_physical.py @@ -4,7 +4,7 @@ from eko import basis_rotation as br from eko import member from eko.evolution_operator.physical import PhysicalOperator -from eko.matching_conditions import MatchingCondition +from ekore.matching_conditions import MatchingCondition def mkOM(shape): diff --git a/tests/eko/kernels/test_ns.py b/tests/eko/kernels/test_ns.py index 17d4964b8..350122948 100644 --- a/tests/eko/kernels/test_ns.py +++ b/tests/eko/kernels/test_ns.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from eko import beta from eko.kernels import non_singlet as ns diff --git a/tests/eko/kernels/test_s.py b/tests/eko/kernels/test_s.py index ec4d93293..618699e84 100644 --- a/tests/eko/kernels/test_s.py +++ b/tests/eko/kernels/test_s.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from eko.kernels import singlet as s methods = [ diff --git a/tests/eko/scale_variations/test_expanded.py b/tests/eko/scale_variations/test_expanded.py index bce253f9c..01eb80d08 100644 --- a/tests/eko/scale_variations/test_expanded.py +++ b/tests/eko/scale_variations/test_expanded.py @@ -1,7 +1,7 @@ import numpy as np from eko import basis_rotation as br -from eko.anomalous_dimensions import gamma_ns, gamma_singlet +from ekore.anomalous_dimensions import gamma_ns, gamma_singlet from eko.beta import beta_qcd_as2 from eko.kernels import non_singlet, singlet from eko.scale_variations import Modes, expanded, exponentiated diff --git a/tests/eko/test_beta.py b/tests/eko/test_beta.py index 4e2eb814e..fb089bb62 100644 --- a/tests/eko/test_beta.py +++ b/tests/eko/test_beta.py @@ -6,7 +6,7 @@ import pytest from eko import beta -from eko.harmonics.constants import zeta3 +from ekore.harmonics.constants import zeta3 def _flav_test(function): diff --git a/tests/eko/anomalous_dimensions/__init__.py b/tests/ekore/anomalous_dimensions/__init__.py similarity index 100% rename from tests/eko/anomalous_dimensions/__init__.py rename to tests/ekore/anomalous_dimensions/__init__.py diff --git a/tests/eko/anomalous_dimensions/test_aem1.py b/tests/ekore/anomalous_dimensions/test_aem1.py similarity index 93% rename from tests/eko/anomalous_dimensions/test_aem1.py rename to tests/ekore/anomalous_dimensions/test_aem1.py index 70ee30cc5..671cce1cf 100644 --- a/tests/eko/anomalous_dimensions/test_aem1.py +++ b/tests/ekore/anomalous_dimensions/test_aem1.py @@ -1,7 +1,7 @@ # Test LO splitting functions import numpy as np -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad def test_number_conservation(): diff --git a/tests/eko/anomalous_dimensions/test_aem2.py b/tests/ekore/anomalous_dimensions/test_aem2.py similarity index 94% rename from tests/eko/anomalous_dimensions/test_aem2.py rename to tests/ekore/anomalous_dimensions/test_aem2.py index aadbbfc2f..a124add68 100644 --- a/tests/eko/anomalous_dimensions/test_aem2.py +++ b/tests/ekore/anomalous_dimensions/test_aem2.py @@ -1,9 +1,9 @@ # Test O(as1aem1) splitting functions import numpy as np -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from eko import constants -from eko import harmonics as h +from ekore import harmonics as h def test_number_conservation(): diff --git a/tests/eko/anomalous_dimensions/test_as1.py b/tests/ekore/anomalous_dimensions/test_as1.py similarity index 90% rename from tests/eko/anomalous_dimensions/test_as1.py rename to tests/ekore/anomalous_dimensions/test_as1.py index 14fd3d004..5f7f5671b 100644 --- a/tests/eko/anomalous_dimensions/test_as1.py +++ b/tests/ekore/anomalous_dimensions/test_as1.py @@ -1,9 +1,9 @@ # Test LO splitting functions import numpy as np -import eko.anomalous_dimensions.aem1 as ad_aem1 -import eko.anomalous_dimensions.as1 as ad_as1 -from eko import harmonics +import ekore.anomalous_dimensions.aem1 as ad_aem1 +import ekore.anomalous_dimensions.as1 as ad_as1 +from ekore import harmonics NF = 5 diff --git a/tests/eko/anomalous_dimensions/test_as1aem1.py b/tests/ekore/anomalous_dimensions/test_as1aem1.py similarity index 95% rename from tests/eko/anomalous_dimensions/test_as1aem1.py rename to tests/ekore/anomalous_dimensions/test_as1aem1.py index 988bb11f1..c1cd55f82 100644 --- a/tests/eko/anomalous_dimensions/test_as1aem1.py +++ b/tests/ekore/anomalous_dimensions/test_as1aem1.py @@ -2,9 +2,9 @@ import numpy as np import pytest -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from eko import constants -from eko import harmonics as h +from ekore import harmonics as h def test_number_conservation(): diff --git a/tests/eko/anomalous_dimensions/test_as2.py b/tests/ekore/anomalous_dimensions/test_as2.py similarity index 98% rename from tests/eko/anomalous_dimensions/test_as2.py rename to tests/ekore/anomalous_dimensions/test_as2.py index 01d7f2f28..d49a6852f 100644 --- a/tests/eko/anomalous_dimensions/test_as2.py +++ b/tests/ekore/anomalous_dimensions/test_as2.py @@ -1,8 +1,8 @@ # Test NLO anomalous dims import numpy as np -import eko.anomalous_dimensions.as2 as ad_as2 -import eko.harmonics as h +import ekore.anomalous_dimensions.as2 as ad_as2 +import ekore.harmonics as h from eko import constants as const NF = 5 diff --git a/tests/eko/anomalous_dimensions/test_as3.py b/tests/ekore/anomalous_dimensions/test_as3.py similarity index 91% rename from tests/eko/anomalous_dimensions/test_as3.py rename to tests/ekore/anomalous_dimensions/test_as3.py index e0830c4a2..2b01fe2a9 100644 --- a/tests/eko/anomalous_dimensions/test_as3.py +++ b/tests/ekore/anomalous_dimensions/test_as3.py @@ -1,8 +1,8 @@ # Test NNLO anomalous dimensions import numpy as np -import eko.anomalous_dimensions.as3 as ad_as3 -from eko import harmonics as h +import ekore.anomalous_dimensions.as3 as ad_as3 +from ekore import harmonics as h NF = 5 diff --git a/tests/eko/anomalous_dimensions/test_as4.py b/tests/ekore/anomalous_dimensions/test_as4.py similarity index 98% rename from tests/eko/anomalous_dimensions/test_as4.py rename to tests/ekore/anomalous_dimensions/test_as4.py index 95c02f180..2a64df44c 100644 --- a/tests/eko/anomalous_dimensions/test_as4.py +++ b/tests/ekore/anomalous_dimensions/test_as4.py @@ -1,7 +1,7 @@ # Test N3LO anomalous dimensions import numpy as np -from eko.anomalous_dimensions.as4 import ( +from ekore.anomalous_dimensions.as4 import ( gamma_singlet, ggg, ggq, @@ -12,7 +12,7 @@ gqg, ) from eko.constants import CA, CF -from eko.harmonics import compute_cache +from ekore.harmonics import compute_cache NF = 5 diff --git a/tests/eko/anomalous_dimensions/test_init.py b/tests/ekore/anomalous_dimensions/test_init.py similarity index 95% rename from tests/eko/anomalous_dimensions/test_init.py rename to tests/ekore/anomalous_dimensions/test_init.py index a080cdd1b..72ecbf99f 100644 --- a/tests/eko/anomalous_dimensions/test_init.py +++ b/tests/ekore/anomalous_dimensions/test_init.py @@ -4,10 +4,10 @@ import numpy as np from numpy.testing import assert_allclose, assert_almost_equal, assert_raises -from eko import anomalous_dimensions as ad +from ekore import anomalous_dimensions as ad from eko import basis_rotation as br -from eko.anomalous_dimensions import as1 as ad_as1 -from eko.anomalous_dimensions import harmonics +from ekore.anomalous_dimensions import as1 as ad_as1 +from ekore.anomalous_dimensions import harmonics NF = 5 diff --git a/tests/eko/harmonics/__init__.py b/tests/ekore/harmonics/__init__.py similarity index 100% rename from tests/eko/harmonics/__init__.py rename to tests/ekore/harmonics/__init__.py diff --git a/tests/eko/harmonics/test_f_functions.py b/tests/ekore/harmonics/test_f_functions.py similarity index 98% rename from tests/eko/harmonics/test_f_functions.py rename to tests/ekore/harmonics/test_f_functions.py index 943dd7131..89136a9a6 100644 --- a/tests/eko/harmonics/test_f_functions.py +++ b/tests/ekore/harmonics/test_f_functions.py @@ -2,8 +2,8 @@ import numpy as np -from eko import harmonics -from eko.harmonics import w5 +from ekore import harmonics +from ekore.harmonics import w5 zeta2 = harmonics.constants.zeta2 zeta3 = harmonics.constants.zeta3 diff --git a/tests/eko/harmonics/test_g_functions.py b/tests/ekore/harmonics/test_g_functions.py similarity index 98% rename from tests/eko/harmonics/test_g_functions.py rename to tests/ekore/harmonics/test_g_functions.py index 4dc1e758f..dff9964f6 100644 --- a/tests/eko/harmonics/test_g_functions.py +++ b/tests/ekore/harmonics/test_g_functions.py @@ -2,7 +2,7 @@ import numpy as np -from eko.anomalous_dimensions import harmonics as h +from ekore.anomalous_dimensions import harmonics as h zeta3 = h.constants.zeta3 log2 = h.constants.log2 diff --git a/tests/eko/harmonics/test_init.py b/tests/ekore/harmonics/test_init.py similarity index 99% rename from tests/eko/harmonics/test_init.py rename to tests/ekore/harmonics/test_init.py index fbaa4cea4..dc4e39637 100644 --- a/tests/eko/harmonics/test_init.py +++ b/tests/ekore/harmonics/test_init.py @@ -1,6 +1,6 @@ import numpy as np -from eko import harmonics as h +from ekore import harmonics as h def test_spm1(): diff --git a/tests/eko/harmonics/test_log_functions.py b/tests/ekore/harmonics/test_log_functions.py similarity index 97% rename from tests/eko/harmonics/test_log_functions.py rename to tests/ekore/harmonics/test_log_functions.py index e53f13c11..2f3ad4e90 100644 --- a/tests/eko/harmonics/test_log_functions.py +++ b/tests/ekore/harmonics/test_log_functions.py @@ -1,7 +1,7 @@ import numpy as np from scipy.integrate import quad -from eko import harmonics as h +from ekore import harmonics as h def test_lm1pm1(): diff --git a/tests/eko/harmonics/test_polygamma.py b/tests/ekore/harmonics/test_polygamma.py similarity index 99% rename from tests/eko/harmonics/test_polygamma.py rename to tests/ekore/harmonics/test_polygamma.py index a790d3828..7ea4389dd 100644 --- a/tests/eko/harmonics/test_polygamma.py +++ b/tests/ekore/harmonics/test_polygamma.py @@ -1,7 +1,7 @@ import numpy as np import pytest -from eko import harmonics +from ekore import harmonics # until https://github.com/numba/numba/pull/5660 is confirmed # we need to deactivate numba prior running diff --git a/tests/eko/matching_conditions/__init__.py b/tests/ekore/matching_conditions/__init__.py similarity index 100% rename from tests/eko/matching_conditions/__init__.py rename to tests/ekore/matching_conditions/__init__.py diff --git a/tests/eko/matching_conditions/test_init.py b/tests/ekore/matching_conditions/test_init.py similarity index 98% rename from tests/eko/matching_conditions/test_init.py rename to tests/ekore/matching_conditions/test_init.py index ab93c3487..e0378a515 100644 --- a/tests/eko/matching_conditions/test_init.py +++ b/tests/ekore/matching_conditions/test_init.py @@ -3,7 +3,7 @@ from eko import basis_rotation as br from eko import member -from eko.matching_conditions import MatchingCondition +from ekore.matching_conditions import MatchingCondition def mkOM(shape): diff --git a/tests/eko/matching_conditions/test_n3lo.py b/tests/ekore/matching_conditions/test_n3lo.py similarity index 98% rename from tests/eko/matching_conditions/test_n3lo.py rename to tests/ekore/matching_conditions/test_n3lo.py index 377e1b606..56d0b8df9 100644 --- a/tests/eko/matching_conditions/test_n3lo.py +++ b/tests/ekore/matching_conditions/test_n3lo.py @@ -1,9 +1,9 @@ # Test N3LO OME import numpy as np -from eko.harmonics import compute_cache -from eko.matching_conditions import as3 -from eko.matching_conditions.as3 import A_ns, A_qqNS, A_singlet +from ekore.harmonics import compute_cache +from ekore.matching_conditions import as3 +from ekore.matching_conditions.as3 import A_ns, A_qqNS, A_singlet def test_A_3(): diff --git a/tests/eko/matching_conditions/test_nlo.py b/tests/ekore/matching_conditions/test_nlo.py similarity index 93% rename from tests/eko/matching_conditions/test_nlo.py rename to tests/ekore/matching_conditions/test_nlo.py index b7f03cc82..cc5700b30 100644 --- a/tests/eko/matching_conditions/test_nlo.py +++ b/tests/ekore/matching_conditions/test_nlo.py @@ -1,8 +1,8 @@ # Test NLO OME import numpy as np -from eko.harmonics import compute_cache -from eko.matching_conditions.as1 import A_ns, A_singlet +from ekore.harmonics import compute_cache +from ekore.matching_conditions.as1 import A_ns, A_singlet def test_A_1_intrinsic(): diff --git a/tests/eko/matching_conditions/test_nnlo.py b/tests/ekore/matching_conditions/test_nnlo.py similarity index 97% rename from tests/eko/matching_conditions/test_nnlo.py rename to tests/ekore/matching_conditions/test_nnlo.py index aea957e95..98aeddcbe 100644 --- a/tests/eko/matching_conditions/test_nnlo.py +++ b/tests/ekore/matching_conditions/test_nnlo.py @@ -2,8 +2,8 @@ import numpy as np -from eko.harmonics import compute_cache, constants -from eko.matching_conditions.as2 import A_ns, A_qq_ns, A_singlet +from ekore.harmonics import compute_cache, constants +from ekore.matching_conditions.as2 import A_ns, A_qq_ns, A_singlet def test_A_2(): diff --git a/tests/eko/matching_conditions/test_ome.py b/tests/ekore/matching_conditions/test_ome.py similarity index 97% rename from tests/eko/matching_conditions/test_ome.py rename to tests/ekore/matching_conditions/test_ome.py index 2df26a03f..aeb67ddec 100644 --- a/tests/eko/matching_conditions/test_ome.py +++ b/tests/ekore/matching_conditions/test_ome.py @@ -1,14 +1,14 @@ -# Test eko.matching_conditions.OperatorMatrixElement +# Test ekore.matching_conditions.OperatorMatrixElement import pathlib import numpy as np from eko import basis_rotation as br from eko import interpolation, mellin -from eko.harmonics import compute_cache +from ekore.harmonics import compute_cache from eko.io.runcards import OperatorCard, TheoryCard from eko.io.types import InversionMethod -from eko.matching_conditions.operator_matrix_element import ( +from ekore.matching_conditions.operator_matrix_element import ( A_non_singlet, A_singlet, OperatorMatrixElement, @@ -88,12 +88,12 @@ def test_quad_ker(monkeypatch): monkeypatch.setattr(interpolation, "evaluate_Nx", lambda *args: 1) zeros = np.zeros((2, 2)) monkeypatch.setattr( - "eko.matching_conditions.operator_matrix_element.A_non_singlet", + "ekore.matching_conditions.operator_matrix_element.A_non_singlet", lambda *args: np.array([zeros, zeros, zeros]), ) zeros = np.zeros((3, 3)) monkeypatch.setattr( - "eko.matching_conditions.operator_matrix_element.A_singlet", + "ekore.matching_conditions.operator_matrix_element.A_singlet", lambda *args: np.array([zeros, zeros, zeros]), ) for is_log in [True, False]: From 85c2da69f10dc561c4dd3f25e9394296f8b601b9 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 12 Jan 2023 12:53:29 +0100 Subject: [PATCH 02/67] Move ads to new layout --- benchmarks/eko/benchmark_ad.py | 2 +- benchmarks/performance/harmonics.py | 2 +- src/eko/evolution_operator/__init__.py | 2 +- src/ekore/anomalous_dimensions/__init__.py | 144 ---------------- .../unpolarized/__init.py | 0 .../unpolarized/space_like/__init__.py | 156 ++++++++++++++++++ .../{ => unpolarized/space_like}/aem1.py | 0 .../{ => unpolarized/space_like}/aem2.py | 0 .../{ => unpolarized/space_like}/as1.py | 0 .../{ => unpolarized/space_like}/as1aem1.py | 4 +- .../{ => unpolarized/space_like}/as2.py | 4 +- .../{ => unpolarized/space_like}/as3.py | 2 +- .../space_like}/as4/__init__.py | 0 .../{ => unpolarized/space_like}/as4/ggg.py | 2 +- .../{ => unpolarized/space_like}/as4/ggq.py | 2 +- .../{ => unpolarized/space_like}/as4/gnsm.py | 4 +- .../{ => unpolarized/space_like}/as4/gnsp.py | 2 +- .../{ => unpolarized/space_like}/as4/gnsv.py | 0 .../{ => unpolarized/space_like}/as4/gps.py | 0 .../{ => unpolarized/space_like}/as4/gqg.py | 2 +- tests/eko/evolution_operator/test_init.py | 2 +- tests/eko/kernels/test_ns.py | 2 +- tests/eko/scale_variations/test_expanded.py | 2 +- .../unpolarized/__init__.py | 0 .../unpolarized/space_like/__init__.py | 0 .../{ => unpolarized/space_like}/test_aem1.py | 13 +- .../{ => unpolarized/space_like}/test_aem2.py | 2 +- .../{ => unpolarized/space_like}/test_as1.py | 3 +- .../space_like}/test_as1aem1.py | 2 +- .../{ => unpolarized/space_like}/test_as2.py | 2 +- .../{ => unpolarized/space_like}/test_as3.py | 2 +- .../{ => unpolarized/space_like}/test_as4.py | 2 +- .../{ => unpolarized/space_like}/test_init.py | 21 +-- tests/ekore/harmonics/test_g_functions.py | 2 +- 34 files changed, 198 insertions(+), 185 deletions(-) create mode 100644 src/ekore/anomalous_dimensions/unpolarized/__init.py create mode 100644 src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/aem1.py (100%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/aem2.py (100%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as1.py (100%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as1aem1.py (99%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as2.py (99%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as3.py (99%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/__init__.py (100%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/ggg.py (99%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/ggq.py (98%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/gnsm.py (98%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/gnsp.py (98%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/gnsv.py (100%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/gps.py (100%) rename src/ekore/anomalous_dimensions/{ => unpolarized/space_like}/as4/gqg.py (99%) create mode 100644 tests/ekore/anomalous_dimensions/unpolarized/__init__.py create mode 100644 tests/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_aem1.py (57%) rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_aem2.py (95%) rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_as1.py (92%) rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_as1aem1.py (96%) rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_as2.py (98%) rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_as3.py (93%) rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_as4.py (99%) rename tests/ekore/anomalous_dimensions/{ => unpolarized/space_like}/test_init.py (75%) diff --git a/benchmarks/eko/benchmark_ad.py b/benchmarks/eko/benchmark_ad.py index d7f1baa39..08919150e 100644 --- a/benchmarks/eko/benchmark_ad.py +++ b/benchmarks/eko/benchmark_ad.py @@ -2,7 +2,7 @@ import numpy as np import pytest -import ekore.anomalous_dimensions.as2 as ad_as2 +import ekore.anomalous_dimensions.unpolarized.space_like.as2 as ad_as2 import ekore.harmonics as h from eko.constants import CA, CF, TR diff --git a/benchmarks/performance/harmonics.py b/benchmarks/performance/harmonics.py index e794aafde..c0b7c4a95 100644 --- a/benchmarks/performance/harmonics.py +++ b/benchmarks/performance/harmonics.py @@ -1,6 +1,6 @@ import numpy as np -from ekore import anomalous_dimensions as ad +import ekore.anomalous_dimensions.unpolarized.space_like as ad from eko.mellin import Path NF = 5 diff --git a/src/eko/evolution_operator/__init__.py b/src/eko/evolution_operator/__init__.py index 544fde4cc..2b047083f 100644 --- a/src/eko/evolution_operator/__init__.py +++ b/src/eko/evolution_operator/__init__.py @@ -13,7 +13,7 @@ import numpy as np from scipy import integrate -from ekore import anomalous_dimensions as ad +import ekore.anomalous_dimensions.unpolarized.space_like as ad from .. import basis_rotation as br from .. import interpolation, mellin from .. import scale_variations as sv diff --git a/src/ekore/anomalous_dimensions/__init__.py b/src/ekore/anomalous_dimensions/__init__.py index 69c9865d7..47a877c03 100644 --- a/src/ekore/anomalous_dimensions/__init__.py +++ b/src/ekore/anomalous_dimensions/__init__.py @@ -19,10 +19,6 @@ import numba as nb import numpy as np -from eko import basis_rotation as br -from .. import harmonics -from . import aem1, aem2, as1, as1aem1, as2, as3, as4 - @nb.njit(cache=True) def exp_singlet(gamma_S): @@ -50,12 +46,6 @@ def exp_singlet(gamma_S): e_m : numpy.ndarray projector for the negative eigenvalue of the singlet anomalous dimension matrix :math:`\gamma_{S}(N)` - - See Also - -------- - ekore.anomalous_dimensions.as1.gamma_singlet : :math:`\gamma_{S}^{(0)}(N)` - ekore.anomalous_dimensions.as2.gamma_singlet : :math:`\gamma_{S}^{(1)}(N)` - ekore.anomalous_dimensions.as3.gamma_singlet : :math:`\gamma_{S}^{(2)}(N)` """ # compute eigenvalues det = np.sqrt( @@ -70,137 +60,3 @@ def exp_singlet(gamma_S): e_m = -c * (gamma_S - lambda_p * identity) exp = e_m * np.exp(lambda_m) + e_p * np.exp(lambda_p) return exp, lambda_p, lambda_m, e_p, e_m - - -@nb.njit(cache=True) -def gamma_ns(order, mode, n, nf): - r"""Computes the tower of the non-singlet anomalous dimensions - - Parameters - ---------- - order : tuple(int,int) - perturbative orders - mode : 10201 | 10101 | 10200 - sector identifier - n : complex - Mellin variable - nf : int - Number of active flavors - - Returns - ------- - numpy.ndarray - non-singlet anomalous dimensions - - See Also - -------- - ekore.anomalous_dimensions.as1.gamma_ns : :math:`\gamma_{ns}^{(0)}(N)` - ekore.anomalous_dimensions.as2.gamma_nsp : :math:`\gamma_{ns,+}^{(1)}(N)` - ekore.anomalous_dimensions.as2.gamma_nsm : :math:`\gamma_{ns,-}^{(1)}(N)` - ekore.anomalous_dimensions.as3.gamma_nsp : :math:`\gamma_{ns,+}^{(2)}(N)` - ekore.anomalous_dimensions.as3.gamma_nsm : :math:`\gamma_{ns,-}^{(2)}(N)` - ekore.anomalous_dimensions.as3.gamma_nsv : :math:`\gamma_{ns,v}^{(2)}(N)` - ekore.anomalous_dimensions.as4.gamma_nsp : :math:`\gamma_{ns,+}^{(3)}(N)` - ekore.anomalous_dimensions.as4.gamma_nsm : :math:`\gamma_{ns,-}^{(3)}(N)` - ekore.anomalous_dimensions.as4.gamma_nsv : :math:`\gamma_{ns,v}^{(3)}(N)` - - """ - # cache the s-es - if order[0] >= 4: - full_sx_cache = harmonics.compute_cache(n, 5, is_singlet=False) - sx = np.array( - [ - full_sx_cache[0][0], - full_sx_cache[1][0], - full_sx_cache[2][0], - full_sx_cache[3][0], - ] - ) - else: - sx = harmonics.sx(n, max_weight=order[0] + 1) - # now combine - gamma_ns = np.zeros(order[0], np.complex_) - gamma_ns[0] = as1.gamma_ns(n, sx[0]) - # NLO and beyond - if order[0] >= 2: - if mode == 10101: - gamma_ns_1 = as2.gamma_nsp(n, nf, sx) - # To fill the full valence vector in NNLO we need to add gamma_ns^1 explicitly here - elif mode in [10201, 10200]: - gamma_ns_1 = as2.gamma_nsm(n, nf, sx) - else: - raise NotImplementedError("Non-singlet sector is not implemented") - gamma_ns[1] = gamma_ns_1 - # NNLO and beyond - if order[0] >= 3: - if mode == 10101: - gamma_ns_2 = as3.gamma_nsp(n, nf, sx) - elif mode == 10201: - gamma_ns_2 = as3.gamma_nsm(n, nf, sx) - elif mode == 10200: - gamma_ns_2 = as3.gamma_nsv(n, nf, sx) - gamma_ns[2] = gamma_ns_2 - # N3LO - if order[0] >= 4: - if mode == 10101: - gamma_ns_3 = as4.gamma_nsp(n, nf, full_sx_cache) - elif mode == 10201: - gamma_ns_3 = as4.gamma_nsm(n, nf, full_sx_cache) - elif mode == 10200: - gamma_ns_3 = as4.gamma_nsv(n, nf, full_sx_cache) - gamma_ns[3] = gamma_ns_3 - return gamma_ns - - -@nb.njit(cache=True) -def gamma_singlet(order, n, nf): - r"""Computes the tower of the singlet anomalous dimensions matrices - - Parameters - ---------- - order : tuple(int,int) - perturbative orders - n : complex - Mellin variable - nf : int - Number of active flavors - - Returns - ------- - numpy.ndarray - singlet anomalous dimensions matrices - - See Also - -------- - ekore.anomalous_dimensions.as1.gamma_singlet : :math:`\gamma_{S}^{(0)}(N)` - ekore.anomalous_dimensions.as2.gamma_singlet : :math:`\gamma_{S}^{(1)}(N)` - ekore.anomalous_dimensions.as3.gamma_singlet : :math:`\gamma_{S}^{(2)}(N)` - ekore.anomalous_dimensions.as4.gamma_singlet : :math:`\gamma_{S}^{(3)}(N)` - - """ - # cache the s-es - if order[0] >= 4: - full_sx_cache = harmonics.compute_cache(n, 5, is_singlet=False) - sx = np.array( - [ - full_sx_cache[0][0], - full_sx_cache[1][0], - full_sx_cache[2][0], - full_sx_cache[3][0], - ] - ) - elif order[0] >= 3: - # here we need only S1,S2,S3,S4 - sx = harmonics.sx(n, max_weight=order[0] + 1) - else: - sx = harmonics.sx(n, max_weight=order[0]) - - gamma_s = np.zeros((order[0], 2, 2), np.complex_) - gamma_s[0] = as1.gamma_singlet(n, sx[0], nf) - if order[0] >= 2: - gamma_s[1] = as2.gamma_singlet(n, nf, sx) - if order[0] >= 3: - gamma_s[2] = as3.gamma_singlet(n, nf, sx) - if order[0] >= 4: - gamma_s[3] = as4.gamma_singlet(n, nf, full_sx_cache) - return gamma_s diff --git a/src/ekore/anomalous_dimensions/unpolarized/__init.py b/src/ekore/anomalous_dimensions/unpolarized/__init.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py new file mode 100644 index 000000000..134596498 --- /dev/null +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py @@ -0,0 +1,156 @@ +r""" +This module contains the Altarelli-Parisi splitting kernels. + +Normalization is given by + +.. math:: + \mathbf{P}(x) = \sum\limits_{j=0} a_s^{j+1} \mathbf P^{(j)}(x) + +with :math:`a_s = \frac{\alpha_S(\mu^2)}{4\pi}`. +The 3-loop references for the non-singlet :cite:`Moch:2004pa` +and singlet :cite:`Vogt:2004mw` case contain also the lower +order results. The results are also determined in Mellin space in +terms of the anomalous dimensions (note the additional sign!) + +.. math:: + \gamma(N) = - \mathcal{M}[\mathbf{P}(x)](N) +""" + +import numba as nb +import numpy as np + +from .... import harmonics +from . import as1, as2, as3, as4, aem1, aem2 + +@nb.njit(cache=True) +def gamma_ns(order, mode, n, nf): + r"""Computes the tower of the non-singlet anomalous dimensions + + Parameters + ---------- + order : tuple(int,int) + perturbative orders + mode : 10201 | 10101 | 10200 + sector identifier + n : complex + Mellin variable + nf : int + Number of active flavors + + Returns + ------- + numpy.ndarray + non-singlet anomalous dimensions + + See Also + -------- + ekore.anomalous_dimensions.unpolarized.space_like.as1.gamma_ns : :math:`\gamma_{ns}^{(0)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as2.gamma_nsp : :math:`\gamma_{ns,+}^{(1)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as2.gamma_nsm : :math:`\gamma_{ns,-}^{(1)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as3.gamma_nsp : :math:`\gamma_{ns,+}^{(2)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as3.gamma_nsm : :math:`\gamma_{ns,-}^{(2)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as3.gamma_nsv : :math:`\gamma_{ns,v}^{(2)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as4.gamma_nsp : :math:`\gamma_{ns,+}^{(3)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as4.gamma_nsm : :math:`\gamma_{ns,-}^{(3)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as4.gamma_nsv : :math:`\gamma_{ns,v}^{(3)}(N)` + + """ + # cache the s-es + if order[0] >= 4: + full_sx_cache = harmonics.compute_cache(n, 5, is_singlet=False) + sx = np.array( + [ + full_sx_cache[0][0], + full_sx_cache[1][0], + full_sx_cache[2][0], + full_sx_cache[3][0], + ] + ) + else: + sx = harmonics.sx(n, max_weight=order[0] + 1) + # now combine + gamma_ns = np.zeros(order[0], np.complex_) + gamma_ns[0] = as1.gamma_ns(n, sx[0]) + # NLO and beyond + if order[0] >= 2: + if mode == 10101: + gamma_ns_1 = as2.gamma_nsp(n, nf, sx) + # To fill the full valence vector in NNLO we need to add gamma_ns^1 explicitly here + elif mode in [10201, 10200]: + gamma_ns_1 = as2.gamma_nsm(n, nf, sx) + else: + raise NotImplementedError("Non-singlet sector is not implemented") + gamma_ns[1] = gamma_ns_1 + # NNLO and beyond + if order[0] >= 3: + if mode == 10101: + gamma_ns_2 = as3.gamma_nsp(n, nf, sx) + elif mode == 10201: + gamma_ns_2 = as3.gamma_nsm(n, nf, sx) + elif mode == 10200: + gamma_ns_2 = as3.gamma_nsv(n, nf, sx) + gamma_ns[2] = gamma_ns_2 + # N3LO + if order[0] >= 4: + if mode == 10101: + gamma_ns_3 = as4.gamma_nsp(n, nf, full_sx_cache) + elif mode == 10201: + gamma_ns_3 = as4.gamma_nsm(n, nf, full_sx_cache) + elif mode == 10200: + gamma_ns_3 = as4.gamma_nsv(n, nf, full_sx_cache) + gamma_ns[3] = gamma_ns_3 + return gamma_ns + + +@nb.njit(cache=True) +def gamma_singlet(order, n, nf): + r"""Computes the tower of the singlet anomalous dimensions matrices + + Parameters + ---------- + order : tuple(int,int) + perturbative orders + n : complex + Mellin variable + nf : int + Number of active flavors + + Returns + ------- + numpy.ndarray + singlet anomalous dimensions matrices + + See Also + -------- + ekore.anomalous_dimensions.unpolarized.space_like.as1.gamma_singlet : :math:`\gamma_{S}^{(0)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as2.gamma_singlet : :math:`\gamma_{S}^{(1)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as3.gamma_singlet : :math:`\gamma_{S}^{(2)}(N)` + ekore.anomalous_dimensions.unpolarized.space_like.as4.gamma_singlet : :math:`\gamma_{S}^{(3)}(N)` + + """ + # cache the s-es + if order[0] >= 4: + full_sx_cache = harmonics.compute_cache(n, 5, is_singlet=False) + sx = np.array( + [ + full_sx_cache[0][0], + full_sx_cache[1][0], + full_sx_cache[2][0], + full_sx_cache[3][0], + ] + ) + elif order[0] >= 3: + # here we need only S1,S2,S3,S4 + sx = harmonics.sx(n, max_weight=order[0] + 1) + else: + sx = harmonics.sx(n, max_weight=order[0]) + + gamma_s = np.zeros((order[0], 2, 2), np.complex_) + gamma_s[0] = as1.gamma_singlet(n, sx[0], nf) + if order[0] >= 2: + gamma_s[1] = as2.gamma_singlet(n, nf, sx) + if order[0] >= 3: + gamma_s[2] = as3.gamma_singlet(n, nf, sx) + if order[0] >= 4: + gamma_s[3] = as4.gamma_singlet(n, nf, full_sx_cache) + return gamma_s diff --git a/src/ekore/anomalous_dimensions/aem1.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/aem1.py similarity index 100% rename from src/ekore/anomalous_dimensions/aem1.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/aem1.py diff --git a/src/ekore/anomalous_dimensions/aem2.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/aem2.py similarity index 100% rename from src/ekore/anomalous_dimensions/aem2.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/aem2.py diff --git a/src/ekore/anomalous_dimensions/as1.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as1.py similarity index 100% rename from src/ekore/anomalous_dimensions/as1.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as1.py diff --git a/src/ekore/anomalous_dimensions/as1aem1.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as1aem1.py similarity index 99% rename from src/ekore/anomalous_dimensions/as1aem1.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as1aem1.py index d2b7ebebc..e16133a05 100644 --- a/src/ekore/anomalous_dimensions/as1aem1.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as1aem1.py @@ -5,8 +5,8 @@ import numba as nb from eko import constants -from .. import harmonics -from ..harmonics.constants import zeta2, zeta3 +from .... import harmonics +from ....harmonics.constants import zeta2, zeta3 @nb.njit(cache=True) diff --git a/src/ekore/anomalous_dimensions/as2.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as2.py similarity index 99% rename from src/ekore/anomalous_dimensions/as2.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as2.py index e51034a5b..8691a54b2 100644 --- a/src/ekore/anomalous_dimensions/as2.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as2.py @@ -10,8 +10,8 @@ import numpy as np from eko import constants -from .. import harmonics -from ..harmonics.constants import log2, zeta2, zeta3 +from .... import harmonics +from ....harmonics.constants import log2, zeta2, zeta3 @nb.njit(cache=True) diff --git a/src/ekore/anomalous_dimensions/as3.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as3.py similarity index 99% rename from src/ekore/anomalous_dimensions/as3.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as3.py index d1b8171a1..a2387bd08 100644 --- a/src/ekore/anomalous_dimensions/as3.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as3.py @@ -8,7 +8,7 @@ import numba as nb import numpy as np -from ..harmonics.constants import zeta2, zeta3 +from ....harmonics.constants import zeta2, zeta3 @nb.njit(cache=True) diff --git a/src/ekore/anomalous_dimensions/as4/__init__.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/__init__.py similarity index 100% rename from src/ekore/anomalous_dimensions/as4/__init__.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/__init__.py diff --git a/src/ekore/anomalous_dimensions/as4/ggg.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggg.py similarity index 99% rename from src/ekore/anomalous_dimensions/as4/ggg.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggg.py index 8570bb3c6..c627b474f 100644 --- a/src/ekore/anomalous_dimensions/as4/ggg.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggg.py @@ -3,7 +3,7 @@ import numba as nb import numpy as np -from ...harmonics.log_functions import lm11 +from .....harmonics.log_functions import lm11 @nb.njit(cache=True) diff --git a/src/ekore/anomalous_dimensions/as4/ggq.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggq.py similarity index 98% rename from src/ekore/anomalous_dimensions/as4/ggq.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggq.py index eb7d96bc1..4752328dc 100644 --- a/src/ekore/anomalous_dimensions/as4/ggq.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/ggq.py @@ -3,7 +3,7 @@ import numba as nb import numpy as np -from ...harmonics.log_functions import lm13, lm13m1, lm14, lm15 +from .....harmonics.log_functions import lm13, lm13m1, lm14, lm15 @nb.njit(cache=True) diff --git a/src/ekore/anomalous_dimensions/as4/gnsm.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsm.py similarity index 98% rename from src/ekore/anomalous_dimensions/as4/gnsm.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsm.py index ae50c68ba..336d5b568 100644 --- a/src/ekore/anomalous_dimensions/as4/gnsm.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsm.py @@ -4,8 +4,8 @@ import numba as nb from eko.constants import CF -from ...harmonics.constants import zeta3 -from ...harmonics.log_functions import lm11m1, lm12m1, lm13m1 +from .....harmonics.constants import zeta3 +from .....harmonics.log_functions import lm11m1, lm12m1, lm13m1 @nb.njit(cache=True) diff --git a/src/ekore/anomalous_dimensions/as4/gnsp.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsp.py similarity index 98% rename from src/ekore/anomalous_dimensions/as4/gnsp.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsp.py index 1f96efc16..9f5be5c4d 100644 --- a/src/ekore/anomalous_dimensions/as4/gnsp.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsp.py @@ -3,7 +3,7 @@ """ import numba as nb -from ...harmonics.log_functions import lm11m1, lm12m1, lm13m1 +from .....harmonics.log_functions import lm11m1, lm12m1, lm13m1 from .gnsm import gamma_ns_nf3 diff --git a/src/ekore/anomalous_dimensions/as4/gnsv.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsv.py similarity index 100% rename from src/ekore/anomalous_dimensions/as4/gnsv.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gnsv.py diff --git a/src/ekore/anomalous_dimensions/as4/gps.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gps.py similarity index 100% rename from src/ekore/anomalous_dimensions/as4/gps.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gps.py diff --git a/src/ekore/anomalous_dimensions/as4/gqg.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gqg.py similarity index 99% rename from src/ekore/anomalous_dimensions/as4/gqg.py rename to src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gqg.py index f23cfef01..7f146eebc 100644 --- a/src/ekore/anomalous_dimensions/as4/gqg.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/as4/gqg.py @@ -3,7 +3,7 @@ import numba as nb import numpy as np -from ...harmonics.log_functions import lm13, lm13m1, lm14, lm15 +from .....harmonics.log_functions import lm13, lm13m1, lm14, lm15 @nb.njit(cache=True) diff --git a/tests/eko/evolution_operator/test_init.py b/tests/eko/evolution_operator/test_init.py index d94ad542c..a801f5c56 100644 --- a/tests/eko/evolution_operator/test_init.py +++ b/tests/eko/evolution_operator/test_init.py @@ -4,7 +4,7 @@ import scipy.integrate import eko.runner.legacy -from ekore import anomalous_dimensions as ad +import ekore.anomalous_dimensions.unpolarized.space_like as ad from eko import basis_rotation as br from eko import interpolation, mellin from eko.evolution_operator import Operator, quad_ker diff --git a/tests/eko/kernels/test_ns.py b/tests/eko/kernels/test_ns.py index 350122948..9e89492aa 100644 --- a/tests/eko/kernels/test_ns.py +++ b/tests/eko/kernels/test_ns.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from ekore import anomalous_dimensions as ad +import ekore.anomalous_dimensions.unpolarized.space_like as ad from eko import beta from eko.kernels import non_singlet as ns diff --git a/tests/eko/scale_variations/test_expanded.py b/tests/eko/scale_variations/test_expanded.py index 01eb80d08..7c3f37ee3 100644 --- a/tests/eko/scale_variations/test_expanded.py +++ b/tests/eko/scale_variations/test_expanded.py @@ -1,7 +1,7 @@ import numpy as np from eko import basis_rotation as br -from ekore.anomalous_dimensions import gamma_ns, gamma_singlet +from ekore.anomalous_dimensions.unpolarized.space_like import gamma_ns, gamma_singlet from eko.beta import beta_qcd_as2 from eko.kernels import non_singlet, singlet from eko.scale_variations import Modes, expanded, exponentiated diff --git a/tests/ekore/anomalous_dimensions/unpolarized/__init__.py b/tests/ekore/anomalous_dimensions/unpolarized/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/ekore/anomalous_dimensions/test_aem1.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_aem1.py similarity index 57% rename from tests/ekore/anomalous_dimensions/test_aem1.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_aem1.py index 671cce1cf..0cf4d26e1 100644 --- a/tests/ekore/anomalous_dimensions/test_aem1.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_aem1.py @@ -1,22 +1,23 @@ # Test LO splitting functions import numpy as np -from ekore import anomalous_dimensions as ad +import ekore.harmonics as h +import ekore.anomalous_dimensions.unpolarized.space_like as ad_us def test_number_conservation(): # number N = complex(1.0, 0.0) - s1 = ad.harmonics.S1(N) - np.testing.assert_almost_equal(ad.aem1.gamma_ns(N, s1), 0) + s1 = h.S1(N) + np.testing.assert_almost_equal(ad_us.aem1.gamma_ns(N, s1), 0) def test_quark_momentum_conservation(): # quark momentum N = complex(2.0, 0.0) - s1 = ad.harmonics.S1(N) + s1 = h.S1(N) np.testing.assert_almost_equal( - ad.aem1.gamma_ns(N, s1) + ad.aem1.gamma_phq(N), + ad_us.aem1.gamma_ns(N, s1) + ad_us.aem1.gamma_phq(N), 0, ) @@ -26,5 +27,5 @@ def test_photon_momentum_conservation(): N = complex(2.0, 0.0) for NF in range(2, 6 + 1): np.testing.assert_almost_equal( - ad.aem1.gamma_qph(N, NF) + ad.aem1.gamma_phph(NF), 0 + ad_us.aem1.gamma_qph(N, NF) + ad_us.aem1.gamma_phph(NF), 0 ) diff --git a/tests/ekore/anomalous_dimensions/test_aem2.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_aem2.py similarity index 95% rename from tests/ekore/anomalous_dimensions/test_aem2.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_aem2.py index a124add68..0a1ddabde 100644 --- a/tests/ekore/anomalous_dimensions/test_aem2.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_aem2.py @@ -1,7 +1,7 @@ # Test O(as1aem1) splitting functions import numpy as np -from ekore import anomalous_dimensions as ad +import ekore.anomalous_dimensions.unpolarized.space_like as ad from eko import constants from ekore import harmonics as h diff --git a/tests/ekore/anomalous_dimensions/test_as1.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as1.py similarity index 92% rename from tests/ekore/anomalous_dimensions/test_as1.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as1.py index 5f7f5671b..23cd67d50 100644 --- a/tests/ekore/anomalous_dimensions/test_as1.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as1.py @@ -1,8 +1,7 @@ # Test LO splitting functions import numpy as np -import ekore.anomalous_dimensions.aem1 as ad_aem1 -import ekore.anomalous_dimensions.as1 as ad_as1 +import ekore.anomalous_dimensions.unpolarized.space_like.as1 as ad_as1 from ekore import harmonics NF = 5 diff --git a/tests/ekore/anomalous_dimensions/test_as1aem1.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as1aem1.py similarity index 96% rename from tests/ekore/anomalous_dimensions/test_as1aem1.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as1aem1.py index c1cd55f82..ce77d4f3a 100644 --- a/tests/ekore/anomalous_dimensions/test_as1aem1.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as1aem1.py @@ -2,7 +2,7 @@ import numpy as np import pytest -from ekore import anomalous_dimensions as ad +import ekore.anomalous_dimensions.unpolarized.space_like as ad from eko import constants from ekore import harmonics as h diff --git a/tests/ekore/anomalous_dimensions/test_as2.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as2.py similarity index 98% rename from tests/ekore/anomalous_dimensions/test_as2.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as2.py index d49a6852f..a118e0a9a 100644 --- a/tests/ekore/anomalous_dimensions/test_as2.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as2.py @@ -1,7 +1,7 @@ # Test NLO anomalous dims import numpy as np -import ekore.anomalous_dimensions.as2 as ad_as2 +import ekore.anomalous_dimensions.unpolarized.space_like.as2 as ad_as2 import ekore.harmonics as h from eko import constants as const diff --git a/tests/ekore/anomalous_dimensions/test_as3.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as3.py similarity index 93% rename from tests/ekore/anomalous_dimensions/test_as3.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as3.py index 2b01fe2a9..7db2b7c64 100644 --- a/tests/ekore/anomalous_dimensions/test_as3.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as3.py @@ -1,7 +1,7 @@ # Test NNLO anomalous dimensions import numpy as np -import ekore.anomalous_dimensions.as3 as ad_as3 +import ekore.anomalous_dimensions.unpolarized.space_like.as3 as ad_as3 from ekore import harmonics as h NF = 5 diff --git a/tests/ekore/anomalous_dimensions/test_as4.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as4.py similarity index 99% rename from tests/ekore/anomalous_dimensions/test_as4.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as4.py index 2a64df44c..38935ec00 100644 --- a/tests/ekore/anomalous_dimensions/test_as4.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_as4.py @@ -1,7 +1,7 @@ # Test N3LO anomalous dimensions import numpy as np -from ekore.anomalous_dimensions.as4 import ( +from ekore.anomalous_dimensions.unpolarized.space_like.as4 import ( gamma_singlet, ggg, ggq, diff --git a/tests/ekore/anomalous_dimensions/test_init.py b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_init.py similarity index 75% rename from tests/ekore/anomalous_dimensions/test_init.py rename to tests/ekore/anomalous_dimensions/unpolarized/space_like/test_init.py index 72ecbf99f..f36efec04 100644 --- a/tests/ekore/anomalous_dimensions/test_init.py +++ b/tests/ekore/anomalous_dimensions/unpolarized/space_like/test_init.py @@ -6,8 +6,9 @@ from ekore import anomalous_dimensions as ad from eko import basis_rotation as br -from ekore.anomalous_dimensions import as1 as ad_as1 -from ekore.anomalous_dimensions import harmonics +import ekore.anomalous_dimensions.unpolarized.space_like as ad_us +from ekore.anomalous_dimensions.unpolarized.space_like import as1 as ad_as1 +from ekore import harmonics NF = 5 @@ -41,7 +42,7 @@ def test_eigensystem_gamma_singlet_projectors_EV(): # NNLO and N3LO too big numbers, # ignore Runtime Warnings warnings.simplefilter("ignore", RuntimeWarning) - for gamma_S in ad.gamma_singlet(o, N, nf): + for gamma_S in ad_us.gamma_singlet(o, N, nf): _exp, l_p, l_m, e_p, e_m = ad.exp_singlet(gamma_S) # projectors behave as P_a . P_b = delta_ab P_a assert_allclose(np.dot(e_p, e_p), e_p) @@ -56,40 +57,40 @@ def test_gamma_ns(): nf = 3 # LO assert_almost_equal( - ad.gamma_ns((3, 0), br.non_singlet_pids_map["ns+"], 1, nf)[0], 0.0 + ad_us.gamma_ns((3, 0), br.non_singlet_pids_map["ns+"], 1, nf)[0], 0.0 ) # NLO assert_allclose( - ad.gamma_ns((2, 0), br.non_singlet_pids_map["ns-"], 1, nf), + ad_us.gamma_ns((2, 0), br.non_singlet_pids_map["ns-"], 1, nf), np.zeros(2), atol=2e-6, ) # NNLO assert_allclose( - ad.gamma_ns((3, 0), br.non_singlet_pids_map["ns-"], 1, nf), + ad_us.gamma_ns((3, 0), br.non_singlet_pids_map["ns-"], 1, nf), np.zeros(3), atol=2e-4, ) assert_allclose( - ad.gamma_ns((3, 0), br.non_singlet_pids_map["nsV"], 1, nf), + ad_us.gamma_ns((3, 0), br.non_singlet_pids_map["nsV"], 1, nf), np.zeros(3), atol=8e-4, ) # N3LO assert_allclose( - ad.gamma_ns((4, 0), br.non_singlet_pids_map["ns-"], 1, nf), + ad_us.gamma_ns((4, 0), br.non_singlet_pids_map["ns-"], 1, nf), np.zeros(4), atol=2e-4, ) # N3LO valence has a spurious pole, need to add a small shift assert_allclose( - ad.gamma_ns((4, 0), br.non_singlet_pids_map["nsV"], 1 + 1e-6, nf), + ad_us.gamma_ns((4, 0), br.non_singlet_pids_map["nsV"], 1 + 1e-6, nf), np.zeros(4), atol=5e-4, ) assert_raises( AssertionError, assert_allclose, - ad.gamma_ns((4, 0), br.non_singlet_pids_map["ns+"], 1, nf), + ad_us.gamma_ns((4, 0), br.non_singlet_pids_map["ns+"], 1, nf), np.zeros(4), ) diff --git a/tests/ekore/harmonics/test_g_functions.py b/tests/ekore/harmonics/test_g_functions.py index dff9964f6..b6a895e6e 100644 --- a/tests/ekore/harmonics/test_g_functions.py +++ b/tests/ekore/harmonics/test_g_functions.py @@ -2,7 +2,7 @@ import numpy as np -from ekore.anomalous_dimensions import harmonics as h +from ekore import harmonics as h zeta3 = h.constants.zeta3 log2 = h.constants.log2 From 10d22407acb328835e1eb20b34b0e83687625698 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 12 Jan 2023 12:54:46 +0100 Subject: [PATCH 03/67] Add pytest coverage --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f290ce339..79889abbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,6 +133,7 @@ python_functions = ['test_*', 'benchmark_*'] addopts = [ '--cov=eko', '--cov=ekobox', + '--cov=ekore', '--cov-report=html', '--cov-report=xml', '--strict-markers', From bc4a967d51b98052e2dd034b5bd16b54cc3f67b9 Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 16 Jan 2023 13:41:53 +0100 Subject: [PATCH 04/67] adding LO splitting functions --- .../polarized/__init__.py | 0 .../polarized/spacelike/__init__.py | 77 ++++++++++++ .../polarized/spacelike/as1.py | 117 ++++++++++++++++++ 3 files changed, 194 insertions(+) create mode 100644 src/ekore/anomalous_dimensions/polarized/__init__.py create mode 100644 src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py create mode 100644 src/ekore/anomalous_dimensions/polarized/spacelike/as1.py diff --git a/src/ekore/anomalous_dimensions/polarized/__init__.py b/src/ekore/anomalous_dimensions/polarized/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py b/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py new file mode 100644 index 000000000..313b74d47 --- /dev/null +++ b/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py @@ -0,0 +1,77 @@ +r""" +This module contains the polarized spacelike Altarelli-Parisi splitting kernels. + +Normalization is given by + +.. math:: + \mathbf{P}(x) = \sum\limits_{j=0} a_s^{j+1} \mathbf P^{(j)}(x) + +with :math:`a_s = \frac{\alpha_S(\mu^2)}{4\pi}`. +""" + +import numba as nb +import numpy as np + +from .... import harmonics +from . import as1 + + +@nb.njit(cache=True) +def gamma_ns(order, mode, n, nf): + r"""Computes the tower of the non-singlet anomalous dimensions + + Parameters + ---------- + order : tuple(int,int) + perturbative orders + mode : 10201 | 10101 | 10200 + sector identifier + n : complex + Mellin variable + nf : int + Number of active flavors + + Returns + ------- + numpy.ndarray + non-singlet anomalous dimensions + + """ + # cache the s-es + sx = harmonics.sx(n, max_weight=order[0] + 1) + # now combine + gamma_ns = np.zeros(order[0], np.complex_) + gamma_ns[0] = as1.gamma_ns(n, sx[0]) + # NLO and beyond + if order[0] >= 2: + raise NotImplementedError("Polarised beyond LO is not yet implemented") + return gamma_ns + + +@nb.njit(cache=True) +def gamma_singlet(order, n, nf): + r"""Computes the tower of the singlet anomalous dimensions matrices + + Parameters + ---------- + order : tuple(int,int) + perturbative orders + n : complex + Mellin variable + nf : int + Number of active flavors + + Returns + ------- + numpy.ndarray + singlet anomalous dimensions matrices + + """ + # cache the s-es + sx = harmonics.sx(n, max_weight=order[0]) + + gamma_s = np.zeros((order[0], 2, 2), np.complex_) + gamma_s[0] = as1.gamma_singlet(n, sx[0], nf) + if order[0] >= 2: + raise NotImplementedError("Polarised beyond LO is not yet implemented") + return gamma_s diff --git a/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py b/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py new file mode 100644 index 000000000..e95f641a8 --- /dev/null +++ b/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +"""This file contains the leading-order Altarelli-Parisi splitting kernels.""" + +import numba as nb +import numpy as np + +from .....eko import constants +from ...unpolarized.space_like.as1 import gamma_ns + + +@nb.njit(cache=True) +def gamma_pqg(N, nf): + """ + Computes the leading-order polarised quark-gluon anomalous dimension + #require citation + + Parameters + ---------- + N : complex + Mellin moment + nf : int + Number of active flavors + + Returns + ------- + gamma_qg : complex + Leading-order polarised quark-gluon anomalous dimension :math:`\\gamma_{qg}^{(0)}(N)` + """ + gamma = -(N - 1) / N / (N + 1) + result = 2.0 * constants.TR * 2.0 * nf * gamma + return result + + +@nb.njit(cache=True) +def gamma_pgq(N): + """ + Computes the leading-order polarised gluon-quark anomalous dimension + + + Parameters + ---------- + N : complex + Mellin moment + + Returns + ------- + gamma_gq : complex + Leading-order gluon-quark anomalous dimension :math:`\\gamma_{gq}^{(0)}(N)` + """ + gamma = -(N + 2) / N / (N + 1) + result = 2.0 * constants.CF * gamma + return result + + +@nb.njit(cache=True) +def gamma_pgg(N, s1, nf): + """ + Computes the leading-order polarised gluon-gluon anomalous dimension + + + Parameters + ---------- + N : complex + Mellin moment + s1 : complex + harmonic sum :math:`S_{1}` + nf : int + Number of active flavors + + Returns + ------- + gamma_gg : complex + Leading-order gluon-gluon anomalous dimension :math:`\\gamma_{gg}^{(0)}(N)` + """ + gamma = -s1 + 2 / N / (N + 1) + result = constants.CA * (-4.0 * gamma - 11.0 / 3.0) + 4.0 / 3.0 * constants.TR * nf + return result + + +@nb.njit(cache=True) +def gamma_psinglet(N, s1, nf): + r""" + Computes the leading-order polarised singlet anomalous dimension matrix + + .. math:: + \gamma_S^{(0)} = \left(\begin{array}{cc} + \gamma_{qq}^{(0)} & \gamma_{qg}^{(0)}\\ + \gamma_{gq}^{(0)} & \gamma_{gg}^{(0)} + \end{array}\right) + + Parameters + ---------- + N : complex + Mellin moment + s1 : complex + harmonic sum :math:`S_{1}` + nf : int + Number of active flavors + + Returns + ------- + gamma_S_0 : numpy.ndarray + Leading-order singlet anomalous dimension matrix :math:`\gamma_{S}^{(0)}(N)` + + See Also + -------- + gamma_ns : :math:`\gamma_{qq}^{(0)}` + gamma_qg : :math:`\gamma_{qg}^{(0)}` + gamma_gq : :math:`\gamma_{gq}^{(0)}` + gamma_gg : :math:`\gamma_{gg}^{(0)}` + """ + gamma_pqq = gamma_ns(N, s1) + gamma_pS_0 = np.array( + [[gamma_pqq, gamma_pqg(N, nf)], [gamma_pgq(N), gamma_pgg(N, s1, nf)]], + np.complex_, + ) + return gamma_pS_0 From 2ee69ecddcaf121452b40b49887a121112a4d6f5 Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 16 Jan 2023 14:04:37 +0100 Subject: [PATCH 05/67] test added --- .../polarized/spacelike/as1.py | 25 ++++++---------- .../polarized/space_like/test_ad_as1.py | 30 +++++++++++++++++++ 2 files changed, 39 insertions(+), 16 deletions(-) create mode 100755 tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py diff --git a/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py b/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py index e95f641a8..61db792a0 100644 --- a/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py +++ b/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py @@ -4,12 +4,12 @@ import numba as nb import numpy as np -from .....eko import constants +from eko import constants from ...unpolarized.space_like.as1 import gamma_ns @nb.njit(cache=True) -def gamma_pqg(N, nf): +def gamma_qg(N, nf): """ Computes the leading-order polarised quark-gluon anomalous dimension #require citation @@ -32,7 +32,7 @@ def gamma_pqg(N, nf): @nb.njit(cache=True) -def gamma_pgq(N): +def gamma_gq(N): """ Computes the leading-order polarised gluon-quark anomalous dimension @@ -53,7 +53,7 @@ def gamma_pgq(N): @nb.njit(cache=True) -def gamma_pgg(N, s1, nf): +def gamma_gg(N, s1, nf): """ Computes the leading-order polarised gluon-gluon anomalous dimension @@ -78,7 +78,7 @@ def gamma_pgg(N, s1, nf): @nb.njit(cache=True) -def gamma_psinglet(N, s1, nf): +def gamma_singlet(N, s1, nf): r""" Computes the leading-order polarised singlet anomalous dimension matrix @@ -101,17 +101,10 @@ def gamma_psinglet(N, s1, nf): ------- gamma_S_0 : numpy.ndarray Leading-order singlet anomalous dimension matrix :math:`\gamma_{S}^{(0)}(N)` - - See Also - -------- - gamma_ns : :math:`\gamma_{qq}^{(0)}` - gamma_qg : :math:`\gamma_{qg}^{(0)}` - gamma_gq : :math:`\gamma_{gq}^{(0)}` - gamma_gg : :math:`\gamma_{gg}^{(0)}` """ - gamma_pqq = gamma_ns(N, s1) - gamma_pS_0 = np.array( - [[gamma_pqq, gamma_pqg(N, nf)], [gamma_pgq(N), gamma_pgg(N, s1, nf)]], + gamma_qq = gamma_ns(N, s1) + gamma_S_0 = np.array( + [[gamma_qq, gamma_qg(N, nf)], [gamma_gq(N), gamma_gg(N, s1, nf)]], np.complex_, ) - return gamma_pS_0 + return gamma_S_0 diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py new file mode 100755 index 000000000..180605495 --- /dev/null +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py @@ -0,0 +1,30 @@ +# Test LO Polarised splitting functions +import numpy as np +import ekore.anomalous_dimensions.polarized.spacelike.as1 as as1 +from ekore import harmonics + +NF = 5 + + +def test_quark_momentum_conservation(): + # quark momentum + N = complex(2.0, 0.0) + s1 = harmonics.S1(N) + np.testing.assert_almost_equal( + as1.gamma_ns(N, s1) + as1.gamma_gq(N), + 1.7777777777777777, + ) + + +def test_gluon_momentum_conservation(): + # gluon momentum + N = complex(2.0, 0.0) + s1 = harmonics.S1(N) + np.testing.assert_almost_equal( + as1.gamma_qg(N, NF) + as1.gamma_gg(N, s1, NF), 4.666666666666668 + ) + +def test_qg_number_conservation(): + N = complex(1.0, 0.0) + np.testing.assert_almost_equal(as1.gamma_qg(N, NF) , 0) + From 71c7cb250a09837f8cf925b37b5483e2904c0712 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Mon, 16 Jan 2023 14:10:19 +0100 Subject: [PATCH 06/67] adding citation --- doc/source/refs.bib | 13 +++++++++++++ .../polarized/spacelike/__init__.py | 7 +------ .../anomalous_dimensions/polarized/spacelike/as1.py | 6 +++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/doc/source/refs.bib b/doc/source/refs.bib index 2864bb671..636389107 100644 --- a/doc/source/refs.bib +++ b/doc/source/refs.bib @@ -776,3 +776,16 @@ @article{Albino:2000cp pages = "93--102", year = "2001" } + +@article{Gluck:1995yr, + author = "Gluck, M. and Reya, E. and Stratmann, M. and Vogelsang, W.", + title = "{Next-to-leading order radiative parton model analysis of polarized deep inelastic lepton - nucleon scattering}", + eprint = "hep-ph/9508347", + archivePrefix = "arXiv", + reportNumber = "DO-TH-95-13, RAL-TR-95-042", + doi = "10.1103/PhysRevD.53.4775", + journal = "Phys. Rev. D", + volume = "53", + pages = "4775--4786", + year = "1996" +} \ No newline at end of file diff --git a/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py b/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py index 313b74d47..b06568e51 100644 --- a/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py @@ -17,20 +17,15 @@ @nb.njit(cache=True) -def gamma_ns(order, mode, n, nf): +def gamma_ns(order, n): r"""Computes the tower of the non-singlet anomalous dimensions Parameters ---------- order : tuple(int,int) perturbative orders - mode : 10201 | 10101 | 10200 - sector identifier n : complex Mellin variable - nf : int - Number of active flavors - Returns ------- numpy.ndarray diff --git a/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py b/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py index 61db792a0..7ad50b236 100644 --- a/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py +++ b/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py @@ -12,7 +12,7 @@ def gamma_qg(N, nf): """ Computes the leading-order polarised quark-gluon anomalous dimension - #require citation + :cite:`Gluck:1995yr` (eq A.1) Parameters ---------- @@ -35,7 +35,7 @@ def gamma_qg(N, nf): def gamma_gq(N): """ Computes the leading-order polarised gluon-quark anomalous dimension - + :cite:`Gluck:1995yr` (eq A.1) Parameters ---------- @@ -56,7 +56,7 @@ def gamma_gq(N): def gamma_gg(N, s1, nf): """ Computes the leading-order polarised gluon-gluon anomalous dimension - + :cite:`Gluck:1995yr` (eq A.1) Parameters ---------- From a67b776a5b0905bbe48b534fad4ded7d3b1852ef Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Mon, 16 Jan 2023 14:36:10 +0100 Subject: [PATCH 07/67] propagate polarized from op card to op.__init__ --- src/eko/evolution_operator/__init__.py | 17 ++++++++++++++--- src/eko/evolution_operator/grid.py | 1 + src/eko/io/runcards.py | 3 +++ src/ekobox/cards.py | 1 + src/ekomark/data/db.py | 1 + src/ekomark/data/operators.py | 1 + src/ekomark/navigator/navigator.py | 1 + .../{spacelike => space_like}/__init__.py | 0 .../polarized/{spacelike => space_like}/as1.py | 0 tests/eko/evolution_operator/test_init.py | 6 ++++++ .../polarized/space_like/test_ad_as1.py | 2 +- 11 files changed, 29 insertions(+), 4 deletions(-) rename src/ekore/anomalous_dimensions/polarized/{spacelike => space_like}/__init__.py (100%) rename src/ekore/anomalous_dimensions/polarized/{spacelike => space_like}/as1.py (100%) diff --git a/src/eko/evolution_operator/__init__.py b/src/eko/evolution_operator/__init__.py index 2b047083f..d74ba2b63 100644 --- a/src/eko/evolution_operator/__init__.py +++ b/src/eko/evolution_operator/__init__.py @@ -14,6 +14,7 @@ from scipy import integrate import ekore.anomalous_dimensions.unpolarized.space_like as ad +import ekore.anomalous_dimensions.polarized.space_like as ad_polarized from .. import basis_rotation as br from .. import interpolation, mellin from .. import scale_variations as sv @@ -130,6 +131,7 @@ def quad_ker( ev_op_max_order, sv_mode, is_threshold, + is_polarized, ): """Raw evolution kernel inside quad. @@ -168,7 +170,9 @@ def quad_ker( sv_mode: int, `enum.IntEnum` scale variation mode, see `eko.scale_variations.Modes` is_threshold : boolean - is this an itermediate threshold operator? + is this an intermediate threshold operator? + is_polarized : boolean + is polarized evolution ? Returns ------- @@ -182,7 +186,10 @@ def quad_ker( # compute the actual evolution kernel if ker_base.is_singlet: - gamma_singlet = ad.gamma_singlet(order, ker_base.n, nf) + if is_polarized: + gamma_singlet = ad_polarized.gamma_singlet(order, ker_base.n, nf) + else: + gamma_singlet = ad.gamma_singlet(order, ker_base.n, nf) # scale var exponentiated is directly applied on gamma if sv_mode == sv.Modes.exponentiated: gamma_singlet = sv.exponentiated.gamma_variation( @@ -205,7 +212,10 @@ def quad_ker( ) @ np.ascontiguousarray(ker) ker = select_singlet_element(ker, mode0, mode1) else: - gamma_ns = ad.gamma_ns(order, mode0, ker_base.n, nf) + if is_polarized: + gamma_ns = ad_polarized.gamma_ns(order, ker_base.n) + else: + gamma_ns = ad.gamma_ns(order, mode0, ker_base.n, nf) if sv_mode == sv.Modes.exponentiated: gamma_ns = sv.exponentiated.gamma_variation(gamma_ns, order, nf, L) ker = ns.dispatcher( @@ -382,6 +392,7 @@ def quad_ker(self, label, logx, areas): ev_op_max_order=tuple(self.config["ev_op_max_order"]), sv_mode=self.sv_mode, is_threshold=self.is_threshold, + is_polarized=self.config["polarized"] ) def initialize_op_members(self): diff --git a/src/eko/evolution_operator/grid.py b/src/eko/evolution_operator/grid.py index 82e50fe9a..f9e788e79 100644 --- a/src/eko/evolution_operator/grid.py +++ b/src/eko/evolution_operator/grid.py @@ -90,6 +90,7 @@ def __init__( config["n_integration_cores"] = configs.n_integration_cores config["debug_skip_singlet"] = debug.skip_singlet config["debug_skip_non_singlet"] = debug.skip_non_singlet + config["polarized"] = configs.polarized if method not in [ "iterate-exact", diff --git a/src/eko/io/runcards.py b/src/eko/io/runcards.py index 414cb87be..428379872 100644 --- a/src/eko/io/runcards.py +++ b/src/eko/io/runcards.py @@ -88,6 +88,8 @@ class Configs(DictLike): r"""Whether to use polynomials in :math:`\log(x)`. If `false`, polynomials are in :math:`x`. """ + polarized: bool + """If `true` do polarized evolution.""" scvar_method: Optional[ScaleVariationsMethod] """""" inversion_method: Optional[InversionMethod] @@ -326,6 +328,7 @@ def new_operator(self): "interpolation_is_log", "ev_op_iterations", "n_integration_cores", + "polarized", ): new["configs"][k] = old[k] max_order = old["ev_op_max_order"] diff --git a/src/ekobox/cards.py b/src/ekobox/cards.py index 52569909b..81a56ef46 100644 --- a/src/ekobox/cards.py +++ b/src/ekobox/cards.py @@ -38,6 +38,7 @@ scvar_method=None, inversion_method=None, n_integration_cores=0, + polarized=False ), debug=dict( skip_singlet=False, diff --git a/src/ekomark/data/db.py b/src/ekomark/data/db.py index 782dbef30..cdd21b7ba 100644 --- a/src/ekomark/data/db.py +++ b/src/ekomark/data/db.py @@ -22,3 +22,4 @@ class Operator(Base): # pylint: disable=too-few-public-methods ev_op_iterations = Column(Integer) Q2grid = Column(Text) backward_inversion = Column(Text) + polarized=Column(Boolean) diff --git a/src/ekomark/data/operators.py b/src/ekomark/data/operators.py index 4a161c0fd..6a343896c 100644 --- a/src/ekomark/data/operators.py +++ b/src/ekomark/data/operators.py @@ -22,6 +22,7 @@ targetgrid=None, inputpids=None, targetpids=None, + polarized=False, ).items() ) ) diff --git a/src/ekomark/navigator/navigator.py b/src/ekomark/navigator/navigator.py index 48148de16..989450353 100644 --- a/src/ekomark/navigator/navigator.py +++ b/src/ekomark/navigator/navigator.py @@ -81,6 +81,7 @@ def fill_operators(self, op, obj): obj["iters"] = op["ev_op_iterations"] obj["skip_ns"] = op["debug_skip_non_singlet"] obj["skip_s"] = op["debug_skip_singlet"] + obj["polarized"] = op["polarized"] def fill_cache(self, cac, obj): """ diff --git a/src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py similarity index 100% rename from src/ekore/anomalous_dimensions/polarized/spacelike/__init__.py rename to src/ekore/anomalous_dimensions/polarized/space_like/__init__.py diff --git a/src/ekore/anomalous_dimensions/polarized/spacelike/as1.py b/src/ekore/anomalous_dimensions/polarized/space_like/as1.py similarity index 100% rename from src/ekore/anomalous_dimensions/polarized/spacelike/as1.py rename to src/ekore/anomalous_dimensions/polarized/space_like/as1.py diff --git a/tests/eko/evolution_operator/test_init.py b/tests/eko/evolution_operator/test_init.py index a801f5c56..92ff39557 100644 --- a/tests/eko/evolution_operator/test_init.py +++ b/tests/eko/evolution_operator/test_init.py @@ -44,6 +44,7 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False ) np.testing.assert_allclose(res_ns, 0.0) res_s = quad_ker( @@ -64,6 +65,7 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False ) np.testing.assert_allclose(res_s, 1.0) res_s = quad_ker( @@ -84,6 +86,7 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False ) np.testing.assert_allclose(res_s, 0.0) for label in [(br.non_singlet_pids_map["ns+"], 0), (100, 100)]: @@ -106,6 +109,7 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(1, 0), sv_mode=sv, is_threshold=False, + is_polarized=False ) np.testing.assert_allclose(res_sv, 1.0) @@ -128,6 +132,7 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False ) np.testing.assert_allclose(res_ns, 0.0) @@ -342,6 +347,7 @@ def quad_ker_pegasus( 10, 0, False, + False ), epsabs=1e-12, epsrel=1e-5, diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py index 180605495..3700f9c6e 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py @@ -1,6 +1,6 @@ # Test LO Polarised splitting functions import numpy as np -import ekore.anomalous_dimensions.polarized.spacelike.as1 as as1 +import ekore.anomalous_dimensions.polarized.space_like.as1 as as1 from ekore import harmonics NF = 5 From 0af52cc7585a50aa2d68d34e54961b5a4155fef5 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Mon, 16 Jan 2023 14:46:53 +0100 Subject: [PATCH 08/67] fix as1 tests --- .../polarized/space_like/test_ad_as1.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py index 3700f9c6e..22d6b73b3 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py @@ -2,29 +2,30 @@ import numpy as np import ekore.anomalous_dimensions.polarized.space_like.as1 as as1 from ekore import harmonics +from eko import constants NF = 5 -def test_quark_momentum_conservation(): +def test_quark_momentum(): # quark momentum N = complex(2.0, 0.0) s1 = harmonics.S1(N) np.testing.assert_almost_equal( as1.gamma_ns(N, s1) + as1.gamma_gq(N), - 1.7777777777777777, + (4 * constants.CF)/3, ) -def test_gluon_momentum_conservation(): +def test_gluon_momentum(): # gluon momentum N = complex(2.0, 0.0) s1 = harmonics.S1(N) np.testing.assert_almost_equal( - as1.gamma_qg(N, NF) + as1.gamma_gg(N, s1, NF), 4.666666666666668 + as1.gamma_qg(N, NF) + as1.gamma_gg(N, s1, NF), 3 + NF/3 ) -def test_qg_number_conservation(): +def test_qg_helicity_conservation(): N = complex(1.0, 0.0) np.testing.assert_almost_equal(as1.gamma_qg(N, NF) , 0) From 8fd54364a0d73064dc0f4c44edeff4f1e5bf3881 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Mon, 16 Jan 2023 15:00:18 +0100 Subject: [PATCH 09/67] fix init name --- .../anomalous_dimensions/unpolarized/{__init.py => __init__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/ekore/anomalous_dimensions/unpolarized/{__init.py => __init__.py} (100%) diff --git a/src/ekore/anomalous_dimensions/unpolarized/__init.py b/src/ekore/anomalous_dimensions/unpolarized/__init__.py similarity index 100% rename from src/ekore/anomalous_dimensions/unpolarized/__init.py rename to src/ekore/anomalous_dimensions/unpolarized/__init__.py From 4678da77be4f5d32a4e85ff8783cac1bf79ceebc Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Mon, 16 Jan 2023 18:25:52 +0100 Subject: [PATCH 10/67] Start reshuffling OME --- src/eko/evolution_operator/grid.py | 9 +- .../evolution_operator/matching_condition.py} | 4 +- .../operator_matrix_element.py | 97 ++----------------- .../ekore}/__init__.py | 0 .../operator_matrix_elements/__init__.py | 97 +++++++++++++++++++ .../as1.py | 0 .../as2.py | 1 + .../as3/__init__.py | 0 .../as3/aHg.py | 0 .../as3/aHgstfac.py | 0 .../as3/aHq.py | 0 .../as3/agg.py | 0 .../as3/aggTF2.py | 0 .../as3/agq.py | 0 .../as3/aqg.py | 0 .../as3/aqqNS.py | 0 .../as3/aqqPS.py | 0 .../test_matchin_condition.py} | 2 +- .../evolution_operator}/test_ome.py | 15 ++- tests/eko/evolution_operator/test_physical.py | 2 +- .../operator_matrix_elements/__init__.py | 0 .../test_n3lo.py | 4 +- .../test_nlo.py | 2 +- .../test_nnlo.py | 2 +- 24 files changed, 125 insertions(+), 110 deletions(-) rename src/{ekore/matching_conditions/__init__.py => eko/evolution_operator/matching_condition.py} (98%) rename src/{ekore/matching_conditions => eko/evolution_operator}/operator_matrix_element.py (77%) rename {tests/ekore/matching_conditions => src/ekore}/__init__.py (100%) create mode 100644 src/ekore/operator_matrix_elements/__init__.py rename src/ekore/{matching_conditions => operator_matrix_elements}/as1.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as2.py (99%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/__init__.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/aHg.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/aHgstfac.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/aHq.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/agg.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/aggTF2.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/agq.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/aqg.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/aqqNS.py (100%) rename src/ekore/{matching_conditions => operator_matrix_elements}/as3/aqqPS.py (100%) rename tests/{ekore/matching_conditions/test_init.py => eko/evolution_operator/test_matchin_condition.py} (98%) rename tests/{ekore/matching_conditions => eko/evolution_operator}/test_ome.py (98%) create mode 100644 tests/ekore/operator_matrix_elements/__init__.py rename tests/ekore/{matching_conditions => operator_matrix_elements}/test_n3lo.py (98%) rename tests/ekore/{matching_conditions => operator_matrix_elements}/test_nlo.py (95%) rename tests/ekore/{matching_conditions => operator_matrix_elements}/test_nnlo.py (98%) diff --git a/src/eko/evolution_operator/grid.py b/src/eko/evolution_operator/grid.py index 82e50fe9a..f357899d1 100644 --- a/src/eko/evolution_operator/grid.py +++ b/src/eko/evolution_operator/grid.py @@ -11,13 +11,12 @@ import numpy as np import numpy.typing as npt -from ekore import matching_conditions from .. import member from .. import scale_variations as sv from ..io.runcards import Configs, Debug -from ekore.matching_conditions.operator_matrix_element import OperatorMatrixElement from ..thresholds import flavor_shift, is_downward_path -from . import Operator, flavors, physical +from . import Operator, flavors, matching_condition, physical +from .operator_matrix_element import OperatorMatrixElement logger = logging.getLogger(__name__) @@ -245,7 +244,7 @@ def generate(self, q2): # join with the basis rotation, since matching requires c+ (or likewise) if is_downward: - matching = matching_conditions.MatchingCondition.split_ad_to_evol_map( + matching = matching_condition.MatchingCondition.split_ad_to_evol_map( self._matching_operators[op.q2_to], op.nf - 1, op.q2_to, @@ -256,7 +255,7 @@ def generate(self, q2): ) final_op = final_op @ matching @ invrot @ phys_op else: - matching = matching_conditions.MatchingCondition.split_ad_to_evol_map( + matching = matching_condition.MatchingCondition.split_ad_to_evol_map( self._matching_operators[op.q2_to], op.nf, op.q2_to, diff --git a/src/ekore/matching_conditions/__init__.py b/src/eko/evolution_operator/matching_condition.py similarity index 98% rename from src/ekore/matching_conditions/__init__.py rename to src/eko/evolution_operator/matching_condition.py index f2eaed8e0..32b8cd036 100644 --- a/src/ekore/matching_conditions/__init__.py +++ b/src/eko/evolution_operator/matching_condition.py @@ -2,8 +2,8 @@ This module defines the matching conditions for the |VFNS| evolution. """ -from eko import basis_rotation as br -from eko import member +from .. import basis_rotation as br +from .. import member class MatchingCondition(member.OperatorBase): diff --git a/src/ekore/matching_conditions/operator_matrix_element.py b/src/eko/evolution_operator/operator_matrix_element.py similarity index 77% rename from src/ekore/matching_conditions/operator_matrix_element.py rename to src/eko/evolution_operator/operator_matrix_element.py index c19cc2991..652e7dbdc 100644 --- a/src/ekore/matching_conditions/operator_matrix_element.py +++ b/src/eko/evolution_operator/operator_matrix_element.py @@ -9,94 +9,13 @@ import numba as nb import numpy as np -from eko import basis_rotation as br -from .. import harmonics -from eko.evolution_operator import Operator, QuadKerBase -from . import as1, as2, as3 +from ekore import harmonics +from ekore import operator_matrix_elements as ome -logger = logging.getLogger(__name__) - - -@nb.njit(cache=True) -def A_singlet(matching_order, n, sx, nf, L, is_msbar, sx_ns=None): - r""" - Computes the tower of the singlet |OME|. - - Parameters - ---------- - matching_order : tuple(int,int) - perturbative matching_order - n : complex - Mellin variable - sx : list - singlet like harmonic sums cache - nf: int - number of active flavor below threshold - L : float - :math:``\ln(\mu_F^2 / m_h^2)`` - is_msbar: bool - add the |MSbar| contribution - sx_ns : list - non-singlet like harmonic sums cache - - Returns - ------- - A_singlet : numpy.ndarray - singlet |OME| - - See Also - -------- - ekore.matching_conditions.nlo.A_singlet_1 : :math:`A^{S,(1)}(N)` - ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` - ekore.matching_conditions.nlo.A_gh_1 : :math:`A_{gH}^{(1)}(N)` - ekore.matching_conditions.nnlo.A_singlet_2 : :math:`A_{S,(2)}(N)` - """ - A_s = np.zeros((matching_order[0], 3, 3), np.complex_) - if matching_order[0] >= 1: - A_s[0] = as1.A_singlet(n, sx, L) - if matching_order[0] >= 2: - A_s[1] = as2.A_singlet(n, sx, L, is_msbar) - if matching_order[0] >= 3: - A_s[2] = as3.A_singlet(n, sx, sx_ns, nf, L) - return A_s +from .. import basis_rotation as br +from . import Operator, QuadKerBase - -@nb.njit(cache=True) -def A_non_singlet(matching_order, n, sx, nf, L): - r""" - Computes the tower of the non-singlet |OME| - - Parameters - ---------- - matching_order : tuple(int,int) - perturbative matching_order - n : complex - Mellin variable - sx : list - harmonic sums cache - nf: int - number of active flavor below threshold - L : float - :math:``\ln(\mu_F^2 / m_h^2)`` - - Returns - ------- - A_non_singlet : numpy.ndarray - non-singlet |OME| - - See Also - -------- - ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` - ekore.matching_conditions.nnlo.A_ns_2 : :math:`A_{qq,H}^{NS,(2)}` - """ - A_ns = np.zeros((matching_order[0], 2, 2), np.complex_) - if matching_order[0] >= 1: - A_ns[0] = as1.A_ns(n, sx, L) - if matching_order[0] >= 2: - A_ns[1] = as2.A_ns(n, sx, L) - if matching_order[0] >= 3: - A_ns[2] = as3.A_ns(n, sx, nf, L) - return A_ns +logger = logging.getLogger(__name__) @nb.njit(cache=True) @@ -155,7 +74,7 @@ def build_ome(A, matching_order, a_s, backward_method): def quad_ker( u, order, mode0, mode1, is_log, logx, areas, a_s, nf, L, backward_method, is_msbar ): - """ + r""" Raw kernel inside quad Parameters @@ -220,10 +139,10 @@ def quad_ker( # compute the ome if ker_base.is_singlet: indices = {21: 0, 100: 1, 90: 2} - A = A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) + A = ome.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) else: indices = {200: 0, 91: 1} - A = A_non_singlet(order, ker_base.n, sx, nf, L) + A = ome.A_non_singlet(order, ker_base.n, sx, nf, L) # build the expansion in alpha_s depending on the strategy ker = build_ome(A, order, a_s, backward_method) diff --git a/tests/ekore/matching_conditions/__init__.py b/src/ekore/__init__.py similarity index 100% rename from tests/ekore/matching_conditions/__init__.py rename to src/ekore/__init__.py diff --git a/src/ekore/operator_matrix_elements/__init__.py b/src/ekore/operator_matrix_elements/__init__.py new file mode 100644 index 000000000..074079ba9 --- /dev/null +++ b/src/ekore/operator_matrix_elements/__init__.py @@ -0,0 +1,97 @@ +""" +This module defines the |OME| for the non-trivial matching conditions in the +|VFNS| evolution. +""" + +import functools +import logging + +import numba as nb +import numpy as np + +from .. import harmonics +from . import as1, as2, as3 + +logger = logging.getLogger(__name__) + + +@nb.njit(cache=True) +def A_singlet(matching_order, n, sx, nf, L, is_msbar, sx_ns=None): + r""" + Computes the tower of the singlet |OME|. + + Parameters + ---------- + matching_order : tuple(int,int) + perturbative matching_order + n : complex + Mellin variable + sx : list + singlet like harmonic sums cache + nf: int + number of active flavor below threshold + L : float + :math:``\ln(\mu_F^2 / m_h^2)`` + is_msbar: bool + add the |MSbar| contribution + sx_ns : list + non-singlet like harmonic sums cache + + Returns + ------- + A_singlet : numpy.ndarray + singlet |OME| + + See Also + -------- + ekore.matching_conditions.nlo.A_singlet_1 : :math:`A^{S,(1)}(N)` + ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` + ekore.matching_conditions.nlo.A_gh_1 : :math:`A_{gH}^{(1)}(N)` + ekore.matching_conditions.nnlo.A_singlet_2 : :math:`A_{S,(2)}(N)` + """ + A_s = np.zeros((matching_order[0], 3, 3), np.complex_) + if matching_order[0] >= 1: + A_s[0] = as1.A_singlet(n, sx, L) + if matching_order[0] >= 2: + A_s[1] = as2.A_singlet(n, sx, L, is_msbar) + if matching_order[0] >= 3: + A_s[2] = as3.A_singlet(n, sx, sx_ns, nf, L) + return A_s + + +@nb.njit(cache=True) +def A_non_singlet(matching_order, n, sx, nf, L): + r""" + Computes the tower of the non-singlet |OME| + + Parameters + ---------- + matching_order : tuple(int,int) + perturbative matching_order + n : complex + Mellin variable + sx : list + harmonic sums cache + nf: int + number of active flavor below threshold + L : float + :math:``\ln(\mu_F^2 / m_h^2)`` + + Returns + ------- + A_non_singlet : numpy.ndarray + non-singlet |OME| + + See Also + -------- + ekore.matching_conditions.nlo.A_hh_1 : :math:`A_{HH}^{(1)}(N)` + ekore.matching_conditions.nnlo.A_ns_2 : :math:`A_{qq,H}^{NS,(2)}` + """ + A_ns = np.zeros((matching_order[0], 2, 2), np.complex_) + if matching_order[0] >= 1: + A_ns[0] = as1.A_ns(n, sx, L) + if matching_order[0] >= 2: + A_ns[1] = as2.A_ns(n, sx, L) + if matching_order[0] >= 3: + A_ns[2] = as3.A_ns(n, sx, nf, L) + return A_ns diff --git a/src/ekore/matching_conditions/as1.py b/src/ekore/operator_matrix_elements/as1.py similarity index 100% rename from src/ekore/matching_conditions/as1.py rename to src/ekore/operator_matrix_elements/as1.py diff --git a/src/ekore/matching_conditions/as2.py b/src/ekore/operator_matrix_elements/as2.py similarity index 99% rename from src/ekore/matching_conditions/as2.py rename to src/ekore/operator_matrix_elements/as2.py index 242f1fa5f..c496abfc3 100644 --- a/src/ekore/matching_conditions/as2.py +++ b/src/ekore/operator_matrix_elements/as2.py @@ -12,6 +12,7 @@ import numpy as np from eko import constants + from ..harmonics.constants import zeta2, zeta3 from .as1 import A_gg as A_gg_1 from .as1 import A_hg as A_hg_1 diff --git a/src/ekore/matching_conditions/as3/__init__.py b/src/ekore/operator_matrix_elements/as3/__init__.py similarity index 100% rename from src/ekore/matching_conditions/as3/__init__.py rename to src/ekore/operator_matrix_elements/as3/__init__.py diff --git a/src/ekore/matching_conditions/as3/aHg.py b/src/ekore/operator_matrix_elements/as3/aHg.py similarity index 100% rename from src/ekore/matching_conditions/as3/aHg.py rename to src/ekore/operator_matrix_elements/as3/aHg.py diff --git a/src/ekore/matching_conditions/as3/aHgstfac.py b/src/ekore/operator_matrix_elements/as3/aHgstfac.py similarity index 100% rename from src/ekore/matching_conditions/as3/aHgstfac.py rename to src/ekore/operator_matrix_elements/as3/aHgstfac.py diff --git a/src/ekore/matching_conditions/as3/aHq.py b/src/ekore/operator_matrix_elements/as3/aHq.py similarity index 100% rename from src/ekore/matching_conditions/as3/aHq.py rename to src/ekore/operator_matrix_elements/as3/aHq.py diff --git a/src/ekore/matching_conditions/as3/agg.py b/src/ekore/operator_matrix_elements/as3/agg.py similarity index 100% rename from src/ekore/matching_conditions/as3/agg.py rename to src/ekore/operator_matrix_elements/as3/agg.py diff --git a/src/ekore/matching_conditions/as3/aggTF2.py b/src/ekore/operator_matrix_elements/as3/aggTF2.py similarity index 100% rename from src/ekore/matching_conditions/as3/aggTF2.py rename to src/ekore/operator_matrix_elements/as3/aggTF2.py diff --git a/src/ekore/matching_conditions/as3/agq.py b/src/ekore/operator_matrix_elements/as3/agq.py similarity index 100% rename from src/ekore/matching_conditions/as3/agq.py rename to src/ekore/operator_matrix_elements/as3/agq.py diff --git a/src/ekore/matching_conditions/as3/aqg.py b/src/ekore/operator_matrix_elements/as3/aqg.py similarity index 100% rename from src/ekore/matching_conditions/as3/aqg.py rename to src/ekore/operator_matrix_elements/as3/aqg.py diff --git a/src/ekore/matching_conditions/as3/aqqNS.py b/src/ekore/operator_matrix_elements/as3/aqqNS.py similarity index 100% rename from src/ekore/matching_conditions/as3/aqqNS.py rename to src/ekore/operator_matrix_elements/as3/aqqNS.py diff --git a/src/ekore/matching_conditions/as3/aqqPS.py b/src/ekore/operator_matrix_elements/as3/aqqPS.py similarity index 100% rename from src/ekore/matching_conditions/as3/aqqPS.py rename to src/ekore/operator_matrix_elements/as3/aqqPS.py diff --git a/tests/ekore/matching_conditions/test_init.py b/tests/eko/evolution_operator/test_matchin_condition.py similarity index 98% rename from tests/ekore/matching_conditions/test_init.py rename to tests/eko/evolution_operator/test_matchin_condition.py index e0378a515..cf6ddd0f5 100644 --- a/tests/ekore/matching_conditions/test_init.py +++ b/tests/eko/evolution_operator/test_matchin_condition.py @@ -3,7 +3,7 @@ from eko import basis_rotation as br from eko import member -from ekore.matching_conditions import MatchingCondition +from eko.evolution_operator.matching_condition import MatchingCondition def mkOM(shape): diff --git a/tests/ekore/matching_conditions/test_ome.py b/tests/eko/evolution_operator/test_ome.py similarity index 98% rename from tests/ekore/matching_conditions/test_ome.py rename to tests/eko/evolution_operator/test_ome.py index aeb67ddec..8ae19e699 100644 --- a/tests/ekore/matching_conditions/test_ome.py +++ b/tests/eko/evolution_operator/test_ome.py @@ -5,17 +5,16 @@ from eko import basis_rotation as br from eko import interpolation, mellin -from ekore.harmonics import compute_cache -from eko.io.runcards import OperatorCard, TheoryCard -from eko.io.types import InversionMethod -from ekore.matching_conditions.operator_matrix_element import ( - A_non_singlet, - A_singlet, +from eko.evolution_operator.operator_matrix_element import ( OperatorMatrixElement, build_ome, quad_ker, ) +from eko.io.runcards import OperatorCard, TheoryCard +from eko.io.types import InversionMethod from eko.runner import legacy +from ekore.harmonics import compute_cache +from ekore.operator_matrix_elements import A_non_singlet, A_singlet max_weight_dict = {1: 2, 2: 3, 3: 5} @@ -88,12 +87,12 @@ def test_quad_ker(monkeypatch): monkeypatch.setattr(interpolation, "evaluate_Nx", lambda *args: 1) zeros = np.zeros((2, 2)) monkeypatch.setattr( - "ekore.matching_conditions.operator_matrix_element.A_non_singlet", + "ekore.operator_matrix_elements.A_non_singlet", lambda *args: np.array([zeros, zeros, zeros]), ) zeros = np.zeros((3, 3)) monkeypatch.setattr( - "ekore.matching_conditions.operator_matrix_element.A_singlet", + "ekore.operator_matrix_elements.A_singlet", lambda *args: np.array([zeros, zeros, zeros]), ) for is_log in [True, False]: diff --git a/tests/eko/evolution_operator/test_physical.py b/tests/eko/evolution_operator/test_physical.py index d28602aa6..a194f0502 100644 --- a/tests/eko/evolution_operator/test_physical.py +++ b/tests/eko/evolution_operator/test_physical.py @@ -3,8 +3,8 @@ from eko import basis_rotation as br from eko import member +from eko.evolution_operator.matching_condition import MatchingCondition from eko.evolution_operator.physical import PhysicalOperator -from ekore.matching_conditions import MatchingCondition def mkOM(shape): diff --git a/tests/ekore/operator_matrix_elements/__init__.py b/tests/ekore/operator_matrix_elements/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/ekore/matching_conditions/test_n3lo.py b/tests/ekore/operator_matrix_elements/test_n3lo.py similarity index 98% rename from tests/ekore/matching_conditions/test_n3lo.py rename to tests/ekore/operator_matrix_elements/test_n3lo.py index 56d0b8df9..dbbb190b1 100644 --- a/tests/ekore/matching_conditions/test_n3lo.py +++ b/tests/ekore/operator_matrix_elements/test_n3lo.py @@ -2,8 +2,8 @@ import numpy as np from ekore.harmonics import compute_cache -from ekore.matching_conditions import as3 -from ekore.matching_conditions.as3 import A_ns, A_qqNS, A_singlet +from ekore.operator_matrix_elements import as3 +from ekore.operator_matrix_elements.as3 import A_ns, A_qqNS, A_singlet def test_A_3(): diff --git a/tests/ekore/matching_conditions/test_nlo.py b/tests/ekore/operator_matrix_elements/test_nlo.py similarity index 95% rename from tests/ekore/matching_conditions/test_nlo.py rename to tests/ekore/operator_matrix_elements/test_nlo.py index cc5700b30..2fdbd76dc 100644 --- a/tests/ekore/matching_conditions/test_nlo.py +++ b/tests/ekore/operator_matrix_elements/test_nlo.py @@ -2,7 +2,7 @@ import numpy as np from ekore.harmonics import compute_cache -from ekore.matching_conditions.as1 import A_ns, A_singlet +from ekore.operator_matrix_elements.as1 import A_ns, A_singlet def test_A_1_intrinsic(): diff --git a/tests/ekore/matching_conditions/test_nnlo.py b/tests/ekore/operator_matrix_elements/test_nnlo.py similarity index 98% rename from tests/ekore/matching_conditions/test_nnlo.py rename to tests/ekore/operator_matrix_elements/test_nnlo.py index 98aeddcbe..2572b2cbf 100644 --- a/tests/ekore/matching_conditions/test_nnlo.py +++ b/tests/ekore/operator_matrix_elements/test_nnlo.py @@ -3,7 +3,7 @@ import numpy as np from ekore.harmonics import compute_cache, constants -from ekore.matching_conditions.as2 import A_ns, A_qq_ns, A_singlet +from ekore.operator_matrix_elements.as2 import A_ns, A_qq_ns, A_singlet def test_A_2(): From 694a239ee94e69c700ccd681132fab510933d813 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Mon, 16 Jan 2023 18:29:51 +0100 Subject: [PATCH 11/67] Move ad benchmark --- benchmarks/{eko => ekore}/benchmark_ad.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename benchmarks/{eko => ekore}/benchmark_ad.py (100%) diff --git a/benchmarks/eko/benchmark_ad.py b/benchmarks/ekore/benchmark_ad.py similarity index 100% rename from benchmarks/eko/benchmark_ad.py rename to benchmarks/ekore/benchmark_ad.py From ec04696f971d0776773ad7d8131b28bd61ffd58c Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Tue, 17 Jan 2023 17:04:11 +0100 Subject: [PATCH 12/67] Move OME --- src/eko/evolution_operator/operator_matrix_element.py | 6 +++--- src/ekore/operator_matrix_elements/unpolarized/__init__.py | 0 .../{ => unpolarized/space_like}/__init__.py | 6 ------ .../{ => unpolarized/space_like}/as1.py | 0 .../{ => unpolarized/space_like}/as2.py | 2 +- .../{ => unpolarized/space_like}/as3/__init__.py | 0 .../{ => unpolarized/space_like}/as3/aHg.py | 0 .../{ => unpolarized/space_like}/as3/aHgstfac.py | 0 .../{ => unpolarized/space_like}/as3/aHq.py | 0 .../{ => unpolarized/space_like}/as3/agg.py | 0 .../{ => unpolarized/space_like}/as3/aggTF2.py | 0 .../{ => unpolarized/space_like}/as3/agq.py | 0 .../{ => unpolarized/space_like}/as3/aqg.py | 0 .../{ => unpolarized/space_like}/as3/aqqNS.py | 0 .../{ => unpolarized/space_like}/as3/aqqPS.py | 0 tests/eko/evolution_operator/test_ome.py | 6 +++--- .../ekore/operator_matrix_elements/unpolarized/__init__.py | 0 .../unpolarized/space_like/__init__.py | 0 .../{ => unpolarized/space_like}/test_n3lo.py | 4 ++-- .../{ => unpolarized/space_like}/test_nlo.py | 2 +- .../{ => unpolarized/space_like}/test_nnlo.py | 2 +- 21 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 src/ekore/operator_matrix_elements/unpolarized/__init__.py rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/__init__.py (96%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as1.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as2.py (99%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/__init__.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/aHg.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/aHgstfac.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/aHq.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/agg.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/aggTF2.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/agq.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/aqg.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/aqqNS.py (100%) rename src/ekore/operator_matrix_elements/{ => unpolarized/space_like}/as3/aqqPS.py (100%) create mode 100644 tests/ekore/operator_matrix_elements/unpolarized/__init__.py create mode 100644 tests/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py rename tests/ekore/operator_matrix_elements/{ => unpolarized/space_like}/test_n3lo.py (97%) rename tests/ekore/operator_matrix_elements/{ => unpolarized/space_like}/test_nlo.py (94%) rename tests/ekore/operator_matrix_elements/{ => unpolarized/space_like}/test_nnlo.py (98%) diff --git a/src/eko/evolution_operator/operator_matrix_element.py b/src/eko/evolution_operator/operator_matrix_element.py index 652e7dbdc..6d8bfb8bb 100644 --- a/src/eko/evolution_operator/operator_matrix_element.py +++ b/src/eko/evolution_operator/operator_matrix_element.py @@ -10,7 +10,7 @@ import numpy as np from ekore import harmonics -from ekore import operator_matrix_elements as ome +import ekore.operator_matrix_elements.unpolarized.space_like as ome_us from .. import basis_rotation as br from . import Operator, QuadKerBase @@ -139,10 +139,10 @@ def quad_ker( # compute the ome if ker_base.is_singlet: indices = {21: 0, 100: 1, 90: 2} - A = ome.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) + A = ome_us.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) else: indices = {200: 0, 91: 1} - A = ome.A_non_singlet(order, ker_base.n, sx, nf, L) + A = ome_us.A_non_singlet(order, ker_base.n, sx, nf, L) # build the expansion in alpha_s depending on the strategy ker = build_ome(A, order, a_s, backward_method) diff --git a/src/ekore/operator_matrix_elements/unpolarized/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/ekore/operator_matrix_elements/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py similarity index 96% rename from src/ekore/operator_matrix_elements/__init__.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py index 074079ba9..a1d2f8ec6 100644 --- a/src/ekore/operator_matrix_elements/__init__.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py @@ -3,17 +3,11 @@ |VFNS| evolution. """ -import functools -import logging - import numba as nb import numpy as np -from .. import harmonics from . import as1, as2, as3 -logger = logging.getLogger(__name__) - @nb.njit(cache=True) def A_singlet(matching_order, n, sx, nf, L, is_msbar, sx_ns=None): diff --git a/src/ekore/operator_matrix_elements/as1.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as1.py similarity index 100% rename from src/ekore/operator_matrix_elements/as1.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as1.py diff --git a/src/ekore/operator_matrix_elements/as2.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as2.py similarity index 99% rename from src/ekore/operator_matrix_elements/as2.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as2.py index c496abfc3..2197fbfd9 100644 --- a/src/ekore/operator_matrix_elements/as2.py +++ b/src/ekore/operator_matrix_elements/unpolarized/space_like/as2.py @@ -13,7 +13,7 @@ from eko import constants -from ..harmonics.constants import zeta2, zeta3 +from ....harmonics.constants import zeta2, zeta3 from .as1 import A_gg as A_gg_1 from .as1 import A_hg as A_hg_1 diff --git a/src/ekore/operator_matrix_elements/as3/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/__init__.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/__init__.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/__init__.py diff --git a/src/ekore/operator_matrix_elements/as3/aHg.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHg.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/aHg.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHg.py diff --git a/src/ekore/operator_matrix_elements/as3/aHgstfac.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHgstfac.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/aHgstfac.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHgstfac.py diff --git a/src/ekore/operator_matrix_elements/as3/aHq.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHq.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/aHq.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aHq.py diff --git a/src/ekore/operator_matrix_elements/as3/agg.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agg.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/agg.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agg.py diff --git a/src/ekore/operator_matrix_elements/as3/aggTF2.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aggTF2.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/aggTF2.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aggTF2.py diff --git a/src/ekore/operator_matrix_elements/as3/agq.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agq.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/agq.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/agq.py diff --git a/src/ekore/operator_matrix_elements/as3/aqg.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqg.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/aqg.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqg.py diff --git a/src/ekore/operator_matrix_elements/as3/aqqNS.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqNS.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/aqqNS.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqNS.py diff --git a/src/ekore/operator_matrix_elements/as3/aqqPS.py b/src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqPS.py similarity index 100% rename from src/ekore/operator_matrix_elements/as3/aqqPS.py rename to src/ekore/operator_matrix_elements/unpolarized/space_like/as3/aqqPS.py diff --git a/tests/eko/evolution_operator/test_ome.py b/tests/eko/evolution_operator/test_ome.py index 8ae19e699..64824b85d 100644 --- a/tests/eko/evolution_operator/test_ome.py +++ b/tests/eko/evolution_operator/test_ome.py @@ -14,7 +14,7 @@ from eko.io.types import InversionMethod from eko.runner import legacy from ekore.harmonics import compute_cache -from ekore.operator_matrix_elements import A_non_singlet, A_singlet +from ekore.operator_matrix_elements.unpolarized.space_like import A_non_singlet, A_singlet max_weight_dict = {1: 2, 2: 3, 3: 5} @@ -87,12 +87,12 @@ def test_quad_ker(monkeypatch): monkeypatch.setattr(interpolation, "evaluate_Nx", lambda *args: 1) zeros = np.zeros((2, 2)) monkeypatch.setattr( - "ekore.operator_matrix_elements.A_non_singlet", + "ekore.operator_matrix_elements.unpolarized.space_like.A_non_singlet", lambda *args: np.array([zeros, zeros, zeros]), ) zeros = np.zeros((3, 3)) monkeypatch.setattr( - "ekore.operator_matrix_elements.A_singlet", + "ekore.operator_matrix_elements.unpolarized.space_like.A_singlet", lambda *args: np.array([zeros, zeros, zeros]), ) for is_log in [True, False]: diff --git a/tests/ekore/operator_matrix_elements/unpolarized/__init__.py b/tests/ekore/operator_matrix_elements/unpolarized/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py b/tests/ekore/operator_matrix_elements/unpolarized/space_like/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/ekore/operator_matrix_elements/test_n3lo.py b/tests/ekore/operator_matrix_elements/unpolarized/space_like/test_n3lo.py similarity index 97% rename from tests/ekore/operator_matrix_elements/test_n3lo.py rename to tests/ekore/operator_matrix_elements/unpolarized/space_like/test_n3lo.py index dbbb190b1..eed992f3d 100644 --- a/tests/ekore/operator_matrix_elements/test_n3lo.py +++ b/tests/ekore/operator_matrix_elements/unpolarized/space_like/test_n3lo.py @@ -2,8 +2,8 @@ import numpy as np from ekore.harmonics import compute_cache -from ekore.operator_matrix_elements import as3 -from ekore.operator_matrix_elements.as3 import A_ns, A_qqNS, A_singlet +from ekore.operator_matrix_elements.unpolarized.space_like import as3 +from ekore.operator_matrix_elements.unpolarized.space_like.as3 import A_ns, A_qqNS, A_singlet def test_A_3(): diff --git a/tests/ekore/operator_matrix_elements/test_nlo.py b/tests/ekore/operator_matrix_elements/unpolarized/space_like/test_nlo.py similarity index 94% rename from tests/ekore/operator_matrix_elements/test_nlo.py rename to tests/ekore/operator_matrix_elements/unpolarized/space_like/test_nlo.py index 2fdbd76dc..953d797c7 100644 --- a/tests/ekore/operator_matrix_elements/test_nlo.py +++ b/tests/ekore/operator_matrix_elements/unpolarized/space_like/test_nlo.py @@ -2,7 +2,7 @@ import numpy as np from ekore.harmonics import compute_cache -from ekore.operator_matrix_elements.as1 import A_ns, A_singlet +from ekore.operator_matrix_elements.unpolarized.space_like.as1 import A_ns, A_singlet def test_A_1_intrinsic(): diff --git a/tests/ekore/operator_matrix_elements/test_nnlo.py b/tests/ekore/operator_matrix_elements/unpolarized/space_like/test_nnlo.py similarity index 98% rename from tests/ekore/operator_matrix_elements/test_nnlo.py rename to tests/ekore/operator_matrix_elements/unpolarized/space_like/test_nnlo.py index 2572b2cbf..648568d1c 100644 --- a/tests/ekore/operator_matrix_elements/test_nnlo.py +++ b/tests/ekore/operator_matrix_elements/unpolarized/space_like/test_nnlo.py @@ -3,7 +3,7 @@ import numpy as np from ekore.harmonics import compute_cache, constants -from ekore.operator_matrix_elements.as2 import A_ns, A_qq_ns, A_singlet +from ekore.operator_matrix_elements.unpolarized.space_like.as2 import A_ns, A_qq_ns, A_singlet def test_A_2(): From febd41515bf048dcce56fc9d7d898012f281e8ee Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Tue, 17 Jan 2023 17:10:57 +0100 Subject: [PATCH 13/67] Add missing init file --- src/ekore/operator_matrix_elements/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/ekore/operator_matrix_elements/__init__.py diff --git a/src/ekore/operator_matrix_elements/__init__.py b/src/ekore/operator_matrix_elements/__init__.py new file mode 100644 index 000000000..e69de29bb From bb6af22675ab83c28f79aa1d9853dd9a63ffb375 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Mon, 16 Jan 2023 14:36:10 +0100 Subject: [PATCH 14/67] propagate polarized and time-like from op card to op.__init__ --- src/eko/evolution_operator/__init__.py | 38 +++++++++++++++++-- src/eko/evolution_operator/grid.py | 2 + src/eko/io/runcards.py | 5 +++ src/ekobox/cards.py | 2 + src/ekomark/data/db.py | 2 + src/ekomark/data/operators.py | 2 + src/ekomark/navigator/navigator.py | 2 + .../polarized/__init__.py | 0 .../polarized/space_like/__init__.py | 21 ++++++++++ .../polarized/time_like/__init__.py | 21 ++++++++++ .../unpolarized/space_like/__init__.py | 6 +-- .../unpolarized/time_like/__init__.py | 21 ++++++++++ tests/eko/evolution_operator/test_init.py | 12 ++++++ 13 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 src/ekore/anomalous_dimensions/polarized/__init__.py create mode 100644 src/ekore/anomalous_dimensions/polarized/space_like/__init__.py create mode 100644 src/ekore/anomalous_dimensions/polarized/time_like/__init__.py create mode 100644 src/ekore/anomalous_dimensions/unpolarized/time_like/__init__.py diff --git a/src/eko/evolution_operator/__init__.py b/src/eko/evolution_operator/__init__.py index 2b047083f..5e90ddbfc 100644 --- a/src/eko/evolution_operator/__init__.py +++ b/src/eko/evolution_operator/__init__.py @@ -13,7 +13,11 @@ import numpy as np from scipy import integrate -import ekore.anomalous_dimensions.unpolarized.space_like as ad +import ekore.anomalous_dimensions.polarized.space_like as ad_ps +import ekore.anomalous_dimensions.polarized.time_like as ad_pt +import ekore.anomalous_dimensions.unpolarized.space_like as ad_us +import ekore.anomalous_dimensions.unpolarized.time_like as ad_ut + from .. import basis_rotation as br from .. import interpolation, mellin from .. import scale_variations as sv @@ -130,6 +134,8 @@ def quad_ker( ev_op_max_order, sv_mode, is_threshold, + is_polarized, + is_time_like, ): """Raw evolution kernel inside quad. @@ -168,7 +174,11 @@ def quad_ker( sv_mode: int, `enum.IntEnum` scale variation mode, see `eko.scale_variations.Modes` is_threshold : boolean - is this an itermediate threshold operator? + is this an intermediate threshold operator? + is_polarized : boolean + is polarized evolution ? + is_time_like : boolean + is time-like evolution ? Returns ------- @@ -182,7 +192,16 @@ def quad_ker( # compute the actual evolution kernel if ker_base.is_singlet: - gamma_singlet = ad.gamma_singlet(order, ker_base.n, nf) + if is_polarized: + if is_time_like: + gamma_singlet = ad_pt.gamma_singlet(order, ker_base.n, nf) + else: + gamma_singlet = ad_ps.gamma_singlet(order, ker_base.n, nf) + else: + if is_time_like: + gamma_singlet = ad_ut.gamma_singlet(order, ker_base.n, nf) + else: + gamma_singlet = ad_us.gamma_singlet(order, ker_base.n, nf) # scale var exponentiated is directly applied on gamma if sv_mode == sv.Modes.exponentiated: gamma_singlet = sv.exponentiated.gamma_variation( @@ -205,7 +224,16 @@ def quad_ker( ) @ np.ascontiguousarray(ker) ker = select_singlet_element(ker, mode0, mode1) else: - gamma_ns = ad.gamma_ns(order, mode0, ker_base.n, nf) + if is_polarized: + if is_time_like: + gamma_ns = ad_pt.gamma_ns(order, mode0, ker_base.n, nf) + else: + gamma_ns = ad_ps.gamma_ns(order, mode0, ker_base.n, nf) + else: + if is_time_like: + gamma_ns = ad_ut.gamma_ns(order, mode0, ker_base.n, nf) + else: + gamma_ns = ad_us.gamma_ns(order, mode0, ker_base.n, nf) if sv_mode == sv.Modes.exponentiated: gamma_ns = sv.exponentiated.gamma_variation(gamma_ns, order, nf, L) ker = ns.dispatcher( @@ -382,6 +410,8 @@ def quad_ker(self, label, logx, areas): ev_op_max_order=tuple(self.config["ev_op_max_order"]), sv_mode=self.sv_mode, is_threshold=self.is_threshold, + is_polarized=self.config["polarized"], + is_time_like=self.config["time_like"], ) def initialize_op_members(self): diff --git a/src/eko/evolution_operator/grid.py b/src/eko/evolution_operator/grid.py index f357899d1..270d434a8 100644 --- a/src/eko/evolution_operator/grid.py +++ b/src/eko/evolution_operator/grid.py @@ -89,6 +89,8 @@ def __init__( config["n_integration_cores"] = configs.n_integration_cores config["debug_skip_singlet"] = debug.skip_singlet config["debug_skip_non_singlet"] = debug.skip_non_singlet + config["polarized"] = configs.polarized + config["time_like"] = configs.time_like if method not in [ "iterate-exact", diff --git a/src/eko/io/runcards.py b/src/eko/io/runcards.py index 414cb87be..941078f8f 100644 --- a/src/eko/io/runcards.py +++ b/src/eko/io/runcards.py @@ -88,6 +88,10 @@ class Configs(DictLike): r"""Whether to use polynomials in :math:`\log(x)`. If `false`, polynomials are in :math:`x`. """ + polarized: bool + """If `true` do polarized evolution.""" + time_like: bool + """If `true` do time-like evolution.""" scvar_method: Optional[ScaleVariationsMethod] """""" inversion_method: Optional[InversionMethod] @@ -326,6 +330,7 @@ def new_operator(self): "interpolation_is_log", "ev_op_iterations", "n_integration_cores", + "polarized", ): new["configs"][k] = old[k] max_order = old["ev_op_max_order"] diff --git a/src/ekobox/cards.py b/src/ekobox/cards.py index 52569909b..231dc7266 100644 --- a/src/ekobox/cards.py +++ b/src/ekobox/cards.py @@ -38,6 +38,8 @@ scvar_method=None, inversion_method=None, n_integration_cores=0, + polarized=False, + time_like=False, ), debug=dict( skip_singlet=False, diff --git a/src/ekomark/data/db.py b/src/ekomark/data/db.py index 782dbef30..a9fe0fd9f 100644 --- a/src/ekomark/data/db.py +++ b/src/ekomark/data/db.py @@ -22,3 +22,5 @@ class Operator(Base): # pylint: disable=too-few-public-methods ev_op_iterations = Column(Integer) Q2grid = Column(Text) backward_inversion = Column(Text) + polarized = Column(Boolean) + time_like = Column(Boolean) diff --git a/src/ekomark/data/operators.py b/src/ekomark/data/operators.py index 4a161c0fd..bf19cb465 100644 --- a/src/ekomark/data/operators.py +++ b/src/ekomark/data/operators.py @@ -22,6 +22,8 @@ targetgrid=None, inputpids=None, targetpids=None, + polarized=False, + time_like=False, ).items() ) ) diff --git a/src/ekomark/navigator/navigator.py b/src/ekomark/navigator/navigator.py index 48148de16..137ecca64 100644 --- a/src/ekomark/navigator/navigator.py +++ b/src/ekomark/navigator/navigator.py @@ -81,6 +81,8 @@ def fill_operators(self, op, obj): obj["iters"] = op["ev_op_iterations"] obj["skip_ns"] = op["debug_skip_non_singlet"] obj["skip_s"] = op["debug_skip_singlet"] + obj["pol"] = op["polarized"] + obj["time"] = op["time_like"] def fill_cache(self, cac, obj): """ diff --git a/src/ekore/anomalous_dimensions/polarized/__init__.py b/src/ekore/anomalous_dimensions/polarized/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py new file mode 100644 index 000000000..1b64ab235 --- /dev/null +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -0,0 +1,21 @@ +r"""The polarized, space-like Altarelli-Parisi splitting kernels. + +Normalization is given by + +.. math:: + \mathbf{P}(x) = \sum\limits_{j=0} a_s^{j+1} \mathbf P^{(j)}(x) + +with :math:`a_s = \frac{\alpha_S(\mu^2)}{4\pi}`. +""" + +import numba as nb + + +@nb.njit(cache=True) +def gamma_ns(_order, _mode, _n, _nf): + raise NotImplementedError("Polarised, space-like is not yet implemented") + + +@nb.njit(cache=True) +def gamma_singlet(_order, _n, _nf): + raise NotImplementedError("Polarised, space-like is not yet implemented") diff --git a/src/ekore/anomalous_dimensions/polarized/time_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/time_like/__init__.py new file mode 100644 index 000000000..74aa85770 --- /dev/null +++ b/src/ekore/anomalous_dimensions/polarized/time_like/__init__.py @@ -0,0 +1,21 @@ +r"""The polarized, time-like Altarelli-Parisi splitting kernels. + +Normalization is given by + +.. math:: + \mathbf{P}(x) = \sum\limits_{j=0} a_s^{j+1} \mathbf P^{(j)}(x) + +with :math:`a_s = \frac{\alpha_S(\mu^2)}{4\pi}`. +""" + +import numba as nb + + +@nb.njit(cache=True) +def gamma_ns(_order, _mode, _n, _nf): + raise NotImplementedError("Polarised, time-like is not yet implemented") + + +@nb.njit(cache=True) +def gamma_singlet(_order, _n, _nf): + raise NotImplementedError("Polarised, time-like is not yet implemented") diff --git a/src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py index 134596498..dc4ad9dbf 100644 --- a/src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/unpolarized/space_like/__init__.py @@ -1,5 +1,4 @@ -r""" -This module contains the Altarelli-Parisi splitting kernels. +r"""The unpolarized, space-like Altarelli-Parisi splitting kernels. Normalization is given by @@ -20,7 +19,8 @@ import numpy as np from .... import harmonics -from . import as1, as2, as3, as4, aem1, aem2 +from . import aem1, aem2, as1, as2, as3, as4 + @nb.njit(cache=True) def gamma_ns(order, mode, n, nf): diff --git a/src/ekore/anomalous_dimensions/unpolarized/time_like/__init__.py b/src/ekore/anomalous_dimensions/unpolarized/time_like/__init__.py new file mode 100644 index 000000000..7d353c93e --- /dev/null +++ b/src/ekore/anomalous_dimensions/unpolarized/time_like/__init__.py @@ -0,0 +1,21 @@ +r"""The unpolarized, time-like Altarelli-Parisi splitting kernels. + +Normalization is given by + +.. math:: + \mathbf{P}(x) = \sum\limits_{j=0} a_s^{j+1} \mathbf P^{(j)}(x) + +with :math:`a_s = \frac{\alpha_S(\mu^2)}{4\pi}`. +""" + +import numba as nb + + +@nb.njit(cache=True) +def gamma_ns(_order, _mode, _n, _nf): + raise NotImplementedError("Polarised is not yet implemented") + + +@nb.njit(cache=True) +def gamma_singlet(_order, _n, _nf): + raise NotImplementedError("Polarised is not yet implemented") diff --git a/tests/eko/evolution_operator/test_init.py b/tests/eko/evolution_operator/test_init.py index a801f5c56..e7c883a05 100644 --- a/tests/eko/evolution_operator/test_init.py +++ b/tests/eko/evolution_operator/test_init.py @@ -44,6 +44,8 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_ns, 0.0) res_s = quad_ker( @@ -64,6 +66,8 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_s, 1.0) res_s = quad_ker( @@ -84,6 +88,8 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_s, 0.0) for label in [(br.non_singlet_pids_map["ns+"], 0), (100, 100)]: @@ -106,6 +112,8 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(1, 0), sv_mode=sv, is_threshold=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_sv, 1.0) @@ -128,6 +136,8 @@ def test_quad_ker(monkeypatch): ev_op_max_order=(0, 0), sv_mode=1, is_threshold=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_ns, 0.0) @@ -342,6 +352,8 @@ def quad_ker_pegasus( 10, 0, False, + False, + False, ), epsabs=1e-12, epsrel=1e-5, From 3db8696cebcaf2ea8210d33fcb309e8b035cb0ce Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Tue, 17 Jan 2023 18:10:38 +0100 Subject: [PATCH 15/67] Add switch for OME --- .../operator_matrix_element.py | 141 +++++++++++------- .../polarized/__init__.py | 0 .../polarized/space_like/__init__.py | 13 ++ .../polarized/time_like/__init__.py | 13 ++ .../unpolarized/time_like/__init__.py | 13 ++ tests/eko/evolution_operator/test_ome.py | 17 ++- 6 files changed, 143 insertions(+), 54 deletions(-) create mode 100644 src/ekore/operator_matrix_elements/polarized/__init__.py create mode 100644 src/ekore/operator_matrix_elements/polarized/space_like/__init__.py create mode 100644 src/ekore/operator_matrix_elements/polarized/time_like/__init__.py create mode 100644 src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py diff --git a/src/eko/evolution_operator/operator_matrix_element.py b/src/eko/evolution_operator/operator_matrix_element.py index 6d8bfb8bb..e8012f6a4 100644 --- a/src/eko/evolution_operator/operator_matrix_element.py +++ b/src/eko/evolution_operator/operator_matrix_element.py @@ -1,7 +1,4 @@ -""" -This module defines the |OME| for the non-trivial matching conditions in the -|VFNS| evolution. -""" +"""The |OME| for the non-trivial matching conditions in the |VFNS| evolution.""" import functools import logging @@ -9,8 +6,11 @@ import numba as nb import numpy as np -from ekore import harmonics +import ekore.operator_matrix_elements.polarized.space_like as ome_ps +import ekore.operator_matrix_elements.polarized.time_like as ome_pt import ekore.operator_matrix_elements.unpolarized.space_like as ome_us +import ekore.operator_matrix_elements.unpolarized.time_like as ome_ut +from ekore import harmonics from .. import basis_rotation as br from . import Operator, QuadKerBase @@ -20,24 +20,23 @@ @nb.njit(cache=True) def build_ome(A, matching_order, a_s, backward_method): - r""" - Construct the matching expansion in :math:`a_s` with the appropriate method. + r"""Construct the matching expansion in :math:`a_s` with the appropriate method. Parameters ---------- - A : numpy.ndarray - list of |OME| - matching_order : tuple(int,int) - perturbation matching order - a_s : float - strong coupling, needed only for the exact inverse - backward_method : ["exact", "expanded" or ""] - empty or method for inverting the matching condition (exact or expanded) + A : numpy.ndarray + list of |OME| + matching_order : tuple(int,int) + perturbation matching order + a_s : float + strong coupling, needed only for the exact inverse + backward_method : ["exact", "expanded" or ""] + empty or method for inverting the matching condition (exact or expanded) Returns ------- - ome : numpy.ndarray - matching operator matrix + ome : numpy.ndarray + matching operator matrix """ # to get the inverse one can use this FORM snippet # Symbol a; @@ -72,41 +71,58 @@ def build_ome(A, matching_order, a_s, backward_method): @nb.njit(cache=True) def quad_ker( - u, order, mode0, mode1, is_log, logx, areas, a_s, nf, L, backward_method, is_msbar + u, + order, + mode0, + mode1, + is_log, + logx, + areas, + a_s, + nf, + L, + backward_method, + is_msbar, + is_polarized, + is_time_like, ): - r""" - Raw kernel inside quad + r"""Raw kernel inside quad. Parameters ---------- - u : float - quad argument - order : tuple(int,int) - perturbation matching order - mode0 : int - pid for first element in the singlet sector - mode1 : int - pid for second element in the singlet sector - is_log : boolean - logarithmic interpolation - logx : float - Mellin inversion point - areas : tuple - basis function configuration - a_s : float - strong coupling, needed only for the exact inverse - nf: int - number of active flavor below threshold - L : float - :math:``\ln(\mu_F^2 / m_h^2)`` - backward_method : ["exact", "expanded" or ""] - empty or method for inverting the matching condition (exact or expanded) - is_msbar: bool - add the |MSbar| contribution + u : float + quad argument + order : tuple(int,int) + perturbation matching order + mode0 : int + pid for first element in the singlet sector + mode1 : int + pid for second element in the singlet sector + is_log : boolean + logarithmic interpolation + logx : float + Mellin inversion point + areas : tuple + basis function configuration + a_s : float + strong coupling, needed only for the exact inverse + nf: int + number of active flavor below threshold + L : float + :math:``\ln(\mu_F^2 / m_h^2)`` + backward_method : ["exact", "expanded" or ""] + empty or method for inverting the matching condition (exact or expanded) + is_msbar: bool + add the |MSbar| contribution + is_polarized : boolean + is polarized evolution ? + is_time_like : boolean + is time-like evolution ? + Returns ------- - ker : float - evaluated integration kernel + ker : float + evaluated integration kernel """ ker_base = QuadKerBase(u, is_log, logx, mode0) integrand = ker_base.integrand(areas) @@ -139,10 +155,28 @@ def quad_ker( # compute the ome if ker_base.is_singlet: indices = {21: 0, 100: 1, 90: 2} - A = ome_us.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) + if is_polarized: + if is_time_like: + A = ome_pt.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) + else: + A = ome_ps.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) + else: + if is_time_like: + A = ome_ut.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) + else: + A = ome_us.A_singlet(order, ker_base.n, sx, nf, L, is_msbar, sx_ns) else: indices = {200: 0, 91: 1} - A = ome_us.A_non_singlet(order, ker_base.n, sx, nf, L) + if is_polarized: + if is_time_like: + A = ome_us.A_non_singlet(order, ker_base.n, sx, nf, L) + else: + A = ome_us.A_non_singlet(order, ker_base.n, sx, nf, L) + else: + if is_time_like: + A = ome_us.A_non_singlet(order, ker_base.n, sx, nf, L) + else: + A = ome_us.A_non_singlet(order, ker_base.n, sx, nf, L) # build the expansion in alpha_s depending on the strategy ker = build_ome(A, order, a_s, backward_method) @@ -206,14 +240,13 @@ def __init__(self, config, managers, nf, q2, is_backward, L, is_msbar): @property def labels(self): - """Computes the necessary sector labels to compute. + """Necessary sector labels to compute. Returns ------- list(str) sector labels """ - labels = [] # non-singlet labels if self.config["debug_skip_non_singlet"]: @@ -247,7 +280,7 @@ def labels(self): return labels def quad_ker(self, label, logx, areas): - """Partially initialized integrand function. + """Return partially initialized integrand function. Parameters ---------- @@ -276,11 +309,13 @@ def quad_ker(self, label, logx, areas): L=self.L, backward_method=self.backward_method, is_msbar=self.is_msbar, + is_polarized=self.config["polarized"], + is_time_like=self.config["time_like"], ) @property def a_s(self): - """Returns the computed values for :math:`a_s`. + """Compute values for :math:`a_s`. Note that here you need to use :math:`a_s^{n_f+1}` """ @@ -288,7 +323,7 @@ def a_s(self): return sc.a_s(self.mur2_shift(self.q2_from), self.q2_from, nf_to=self.nf + 1) def compute(self): - """Compute the actual operators (i.e. run the integrations)""" + """Compute the actual operators (i.e. run the integrations).""" self.initialize_op_members() # At LO you don't need anything else diff --git a/src/ekore/operator_matrix_elements/polarized/__init__.py b/src/ekore/operator_matrix_elements/polarized/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py b/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py new file mode 100644 index 000000000..2dab4db48 --- /dev/null +++ b/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py @@ -0,0 +1,13 @@ +r"""The polarized, space-like |OME|.""" + +import numba as nb + + +@nb.njit(cache=True) +def A_non_singlet(_matching_order, _n, _sx, _nf, _L): + raise NotImplementedError("Polarised, space-like is not yet implemented") + + +@nb.njit(cache=True) +def A_non_singlet(_order, _n, _sx, _nf, _L): + raise NotImplementedError("Polarised, space-like is not yet implemented") diff --git a/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py b/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py new file mode 100644 index 000000000..c5232eff3 --- /dev/null +++ b/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py @@ -0,0 +1,13 @@ +r"""The polarized, time-like |OME|.""" + +import numba as nb + + +@nb.njit(cache=True) +def A_non_singlet(_matching_order, _n, _sx, _nf, _L): + raise NotImplementedError("Polarised, time-like is not yet implemented") + + +@nb.njit(cache=True) +def A_non_singlet(_order, _n, _sx, _nf, _L): + raise NotImplementedError("Polarised, time-like is not yet implemented") diff --git a/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py new file mode 100644 index 000000000..2d3107dce --- /dev/null +++ b/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py @@ -0,0 +1,13 @@ +r"""The polarized, time-like |OME|.""" + +import numba as nb + + +@nb.njit(cache=True) +def A_non_singlet(_matching_order, _n, _sx, _nf, _L): + raise NotImplementedError("Time-like is not yet implemented") + + +@nb.njit(cache=True) +def A_non_singlet(_order, _n, _sx, _nf, _L): + raise NotImplementedError("Time-like is not yet implemented") diff --git a/tests/eko/evolution_operator/test_ome.py b/tests/eko/evolution_operator/test_ome.py index 64824b85d..0d33d071d 100644 --- a/tests/eko/evolution_operator/test_ome.py +++ b/tests/eko/evolution_operator/test_ome.py @@ -14,7 +14,10 @@ from eko.io.types import InversionMethod from eko.runner import legacy from ekore.harmonics import compute_cache -from ekore.operator_matrix_elements.unpolarized.space_like import A_non_singlet, A_singlet +from ekore.operator_matrix_elements.unpolarized.space_like import ( + A_non_singlet, + A_singlet, +) max_weight_dict = {1: 2, 2: 3, 3: 5} @@ -109,6 +112,8 @@ def test_quad_ker(monkeypatch): nf=3, L=0.0, is_msbar=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_ns, 1.0) res_s = quad_ker( @@ -124,6 +129,8 @@ def test_quad_ker(monkeypatch): nf=3, L=0.0, is_msbar=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_s, 1.0) res_s = quad_ker( @@ -139,6 +146,8 @@ def test_quad_ker(monkeypatch): nf=3, L=0.0, is_msbar=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_s, 0.0) @@ -158,6 +167,8 @@ def test_quad_ker(monkeypatch): nf=3, L=0.0, is_msbar=False, + is_polarized=False, + is_time_like=False, ) if label[-1] == label[-2]: np.testing.assert_allclose(res_ns, 1.0) @@ -191,6 +202,8 @@ def test_quad_ker(monkeypatch): nf=3, L=0.0, is_msbar=False, + is_polarized=False, + is_time_like=False, ) if label[-1] == label[-2]: np.testing.assert_allclose(res_ns, 1.0) @@ -211,6 +224,8 @@ def test_quad_ker(monkeypatch): nf=3, L=0.0, is_msbar=False, + is_polarized=False, + is_time_like=False, ) np.testing.assert_allclose(res_ns, 0.0) From 7a74ddbfdfff5b485de3aec20d7f1fbcd33b6c29 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Tue, 17 Jan 2023 18:15:57 +0100 Subject: [PATCH 16/67] Fix function names --- .../operator_matrix_elements/polarized/space_like/__init__.py | 2 +- .../operator_matrix_elements/polarized/time_like/__init__.py | 2 +- .../operator_matrix_elements/unpolarized/time_like/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py b/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py index 2dab4db48..5d5f771f7 100644 --- a/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py +++ b/src/ekore/operator_matrix_elements/polarized/space_like/__init__.py @@ -9,5 +9,5 @@ def A_non_singlet(_matching_order, _n, _sx, _nf, _L): @nb.njit(cache=True) -def A_non_singlet(_order, _n, _sx, _nf, _L): +def A_singlet(_matching_order, _n, _sx, _nf, _L, _is_msbar, _sx_ns=None): raise NotImplementedError("Polarised, space-like is not yet implemented") diff --git a/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py b/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py index c5232eff3..81b9f3de8 100644 --- a/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py +++ b/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py @@ -9,5 +9,5 @@ def A_non_singlet(_matching_order, _n, _sx, _nf, _L): @nb.njit(cache=True) -def A_non_singlet(_order, _n, _sx, _nf, _L): +def A_singlet(_matching_order, _n, _sx, _nf, _L, _is_msbar, _sx_ns=None): raise NotImplementedError("Polarised, time-like is not yet implemented") diff --git a/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py b/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py index 2d3107dce..53c68e8d6 100644 --- a/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py +++ b/src/ekore/operator_matrix_elements/unpolarized/time_like/__init__.py @@ -9,5 +9,5 @@ def A_non_singlet(_matching_order, _n, _sx, _nf, _L): @nb.njit(cache=True) -def A_non_singlet(_order, _n, _sx, _nf, _L): +def A_singlet(_matching_order, _n, _sx, _nf, _L, _is_msbar, _sx_ns=None): raise NotImplementedError("Time-like is not yet implemented") From 8e7f153536b047a5be6a870ec8f33fc9b56d8653 Mon Sep 17 00:00:00 2001 From: aschaus Date: Wed, 25 Jan 2023 01:16:17 +0100 Subject: [PATCH 17/67] NLO polarized AD implemented --- doc/source/refs.bib | 11 + .../polarized/space_like/__init__.py | 28 +- .../polarized/space_like/as1.py | 10 +- .../polarized/space_like/as2.py | 252 ++++++++++++++++++ 4 files changed, 290 insertions(+), 11 deletions(-) create mode 100644 src/ekore/anomalous_dimensions/polarized/space_like/as2.py diff --git a/doc/source/refs.bib b/doc/source/refs.bib index 636389107..6bc794268 100644 --- a/doc/source/refs.bib +++ b/doc/source/refs.bib @@ -788,4 +788,15 @@ @article{Gluck:1995yr volume = "53", pages = "4775--4786", year = "1996" +} + +@article{Floratos:1981hs, + author = "Floratos, E. G. and Kounnas, C. and Lacaze, R.", + title = "{Higher Order QCD Effects in Inclusive Annihilation and Deep Inelastic Scattering}", + reportNumber = "LPTENS-81-3", + doi = "10.1016/0550-3213(81)90434-X", + journal = "Nucl. Phys. B", + volume = "192", + pages = "417--462", + year = "1981" } \ No newline at end of file diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py index b06568e51..33347d562 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -13,19 +13,24 @@ import numpy as np from .... import harmonics -from . import as1 +from . import as1, as2 @nb.njit(cache=True) -def gamma_ns(order, n): +def gamma_ns(order,mode, n, nf): r"""Computes the tower of the non-singlet anomalous dimensions Parameters ---------- order : tuple(int,int) perturbative orders + mode : 10201 | 10101 | 10200 + sector identifier n : complex Mellin variable + nf : int + Number of active flavors + Returns ------- numpy.ndarray @@ -39,7 +44,16 @@ def gamma_ns(order, n): gamma_ns[0] = as1.gamma_ns(n, sx[0]) # NLO and beyond if order[0] >= 2: - raise NotImplementedError("Polarised beyond LO is not yet implemented") + if mode == 10101: + gamma_ns_1 = as2.gamma_nsp(n, nf, sx) + # To fill the full valence vector in NNLO we need to add gamma_ns^1 explicitly here + elif mode in [10201, 10200]: + gamma_ns_1 = as2.gamma_nsm(n, nf, sx) + else: + raise NotImplementedError("Non-singlet sector is not implemented") + gamma_ns[1] = gamma_ns_1 + if order[0] >= 3: + raise NotImplementedError("Polarised beyond NLO is not yet implemented") return gamma_ns @@ -67,6 +81,8 @@ def gamma_singlet(order, n, nf): gamma_s = np.zeros((order[0], 2, 2), np.complex_) gamma_s[0] = as1.gamma_singlet(n, sx[0], nf) - if order[0] >= 2: - raise NotImplementedError("Polarised beyond LO is not yet implemented") - return gamma_s + if order[0] >=2: + gamma_s[1] = as2.gamma_singlet(n, sx, nf) + if order[0] >= 3: + raise NotImplementedError("Polarised beyond NLO is not yet implemented") + return gamma_s \ No newline at end of file diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as1.py b/src/ekore/anomalous_dimensions/polarized/space_like/as1.py index 7ad50b236..d36d7ec95 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as1.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as1.py @@ -11,7 +11,7 @@ @nb.njit(cache=True) def gamma_qg(N, nf): """ - Computes the leading-order polarised quark-gluon anomalous dimension + Computes the leading-order polarized quark-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1) Parameters @@ -24,7 +24,7 @@ def gamma_qg(N, nf): Returns ------- gamma_qg : complex - Leading-order polarised quark-gluon anomalous dimension :math:`\\gamma_{qg}^{(0)}(N)` + Leading-order polarized quark-gluon anomalous dimension :math:`\\gamma_{qg}^{(0)}(N)` """ gamma = -(N - 1) / N / (N + 1) result = 2.0 * constants.TR * 2.0 * nf * gamma @@ -34,7 +34,7 @@ def gamma_qg(N, nf): @nb.njit(cache=True) def gamma_gq(N): """ - Computes the leading-order polarised gluon-quark anomalous dimension + Computes the leading-order polarized gluon-quark anomalous dimension :cite:`Gluck:1995yr` (eq A.1) Parameters @@ -55,7 +55,7 @@ def gamma_gq(N): @nb.njit(cache=True) def gamma_gg(N, s1, nf): """ - Computes the leading-order polarised gluon-gluon anomalous dimension + Computes the leading-order polarized gluon-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1) Parameters @@ -80,7 +80,7 @@ def gamma_gg(N, s1, nf): @nb.njit(cache=True) def gamma_singlet(N, s1, nf): r""" - Computes the leading-order polarised singlet anomalous dimension matrix + Computes the leading-order polarized singlet anomalous dimension matrix .. math:: \gamma_S^{(0)} = \left(\begin{array}{cc} diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py new file mode 100644 index 000000000..060c25475 --- /dev/null +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py @@ -0,0 +1,252 @@ +# -- coding: utf-8 -- +"""This file contains the next-leading-order Altarelli-Parisi splitting kernels.""" + +import numba as nb +import numpy as np + +from eko import constants +from .... import harmonics +from ....harmonics.constants import log2, zeta2, zeta3 + +from scipy.special import digamma + + +@nb.njit(cache=True) +def gamma_nsm(n, nf, sx): + """ + Computes the |NLO| polarized valence-like non-singlet anomalous dimension. + + :Floratos:1981hs (eq B.18) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` + + Returns + ------- + gamma_nsm : complex + |nLO| valence-like non-singlet anomalous dimension + :math:`\\gamma_{ns,-}^{(1)}(n)` + """ + S1 = sx[0] + S2 = sx[1] + # Here, Sp refers to S' ("s-prime") (german: "s-strich" or in Pegasus language: SSTR) + # of :cite:`Gluck:1989ze` and NOT to the Spence function a.k.a. dilogarithm + Sp1p = harmonics.S1(n / 2) + Sp2p = harmonics.S2(n / 2) + Sp3p = harmonics.S3(n / 2) + Sp1m = harmonics.S1((n - 1) / 2) + Sp2m = harmonics.S2((n - 1) / 2) + Sp3m = harmonics.S3((n - 1) / 2) + g3n = harmonics.g_functions.mellin_g3(n, S1) + # fmt: off + gqq1m_cfca = 16*g3n - (144 + n*(1 + n)*(156 + n*(340 + n*(655 + 51*n*(2 + n)))))/(18.*np.power(n,3)*np.power(1 + n,3)) + (-14.666666666666666 + 8/n - 8/(1 + n))*S2 - (4*Sp2m)/(n + np.power(n,2)) + S1*(29.77777777777778 + 16/np.power(n,2) - 16*S2 + 8*Sp2m) + 2*Sp3m + 10*zeta3 + zeta2*(16*S1 - 16*Sp1m - (16*(1 + n*log2))/n) # pylint: disable=line-too-long + gqq1m_cfcf = 32*g3n - (8 + n*(32 + n*(40 + 3*n*(3 + n)*(3 + np.power(n,2)))))/(2.*np.power(n,3)*np.power(1 + n,3)) + (12 - 8/n + 8/(1 + n))*S2 + S1*(40/np.power(n,2) - 8/np.power(1 + n,2) + 16*S2 - 16*Sp2p) + (8*Sp2p)/(n + np.power(n,2)) - 4*Sp3p - 20*zeta3 + zeta2*(-32*S1 + 32*Sp1p + 32*(-(1/n) + log2)) + gqq1m_cfnf = (-12 + n*(20 + n*(47 + 3*n*(2 + n))))/(9.*np.power(n,2)*np.power(1 + n,2)) - (40*S1)/9. + (8*S2)/3. # pylint: disable=line-too-long + # fmt: on + result = constants.CF * ( + (constants.CA * gqq1m_cfca) + + (constants.CF * gqq1m_cfcf) + + (2.0 * constants.TR * nf * gqq1m_cfnf) + ) + return result + + +def gamma_nsp(n, nf, sx): + """ + Computes the |NLO| polarized singlet-like non-singlet anomalous dimension. + + :Floratos:1981hs (eq B.18) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` + + Returns + ------- + gamma_nsp : complex + |nLO| singlet-like non-singlet anomalous dimension + :math:`\\gamma_{ns,+}^{(1)}(n)` + """ + S1 = sx[0] + S2 = sx[1] + Sp1p = harmonics.S1(n / 2) + Sp2p = harmonics.S2(n / 2) + Sp3p = harmonics.S3(n / 2) + Sp1m = harmonics.S1((n - 1) / 2) + Sp2m = harmonics.S2((n - 1) / 2) + Sp3m = harmonics.S3((n - 1) / 2) + g3n = harmonics.g_functions.mellin_g3(n, S1) + # fmt: off + gqq1p_cfca = -16*g3n + (132 - n*(340 + n*(655 + 51*n*(2 + n))))/(18.*np.power(n,2)*np.power(1 + n,2)) + (-14.666666666666666 + 8/n - 8/(1 + n))*S2 - (4*Sp2p)/(n + np.power(n,2)) + S1*(29.77777777777778 - 16/np.power(n,2) - 16*S2 + 8*Sp2p) + 2*Sp3p + 10*zeta3 + zeta2*(16*S1 - 16*Sp1p + 16*(1/n - log2)) # pylint: disable=line-too-long + gqq1p_cfcf = -32*g3n + (24 - n*(-32 + 3*n*(-8 + n*(3 + n)*(3 + np.power(n,2)))))/(2.*np.power(n,3)*np.power(1 + n,3)) + (12 - 8/n + 8/(1 + n))*S2 + S1*(-24/np.power(n,2) - 8/np.power(1 + n,2) + 16*S2 - 16*Sp2m) + (8*Sp2m)/(n + np.power(n,2)) - 4*Sp3m - 20*zeta3 + zeta2*(-32*S1 + 32*Sp1m + 32*(1/n + log2)) # pylint: disable=line-too-long + gqq1p_cfnf = (-12 + n*(20 + n*(47 + 3*n*(2 + n))))/(9.*np.power(n,2)*np.power(1 + n,2)) - (40*S1)/9. + (8*S2)/3. # pylint: disable=line-too-long + # fmt: on + result = constants.CF * ( + (constants.CA * gqq1p_cfca) + + (constants.CF * gqq1p_cfcf) + + (2.0 * constants.TR * nf * gqq1p_cfnf) + ) + return result + + +@nb.njit(cache=True) +def gamma_ps(n, nf): + """ + Computes the |NLO| polarized pure-singlet quark-quark anomalous dimension. + + :cite:`Gluck:1995yr` (eq A.3) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + number of active flavors + + Returns + ------- + gamma_ps : complex + |nLO| pure-singlet quark-quark anomalous dimension + :math:`\\gamma_{ps}^{(1)}(n)` + """ + # fmt: off + gqqps1_nfcf = (2* (n+2)*(1 + 2*n + np.power(n , 3)))/ (np.power(1 + n,3)*np.power(n,3)) # pylint: disable=line-too-long + # fmt: on + result = 4.0 * constants.TR * nf * constants.CF * gqqps1_nfcf + return result + + +@nb.njit(cache=True) +def gamma_qg(n, nf, sx): + """ + Computes the |NLO| polarized quark-gluon singlet anomalous dimension. + + :cite:`Gluck:1995yr` (eq A.4) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` + + Returns + ------- + gamma_qg : complex + |nLO| quark-gluon singlet anomalous dimension + :math:`\\gamma_{qg}^{(1)}(n)` + """ + S1 = sx[0] + S2 = sx[1] + Sp2m = harmonics.S2((n - 1) / 2) + # fmt: off + gqg1_nfca =((np.power(S1,2)-S2+Sp2m)*(n-1)/(n*(n+1))-4*S1/(n*np.power(1+n,2))- (-2-7*n+3*np.power(n,2)-4*np.power(n,3)+np.power(n,4)+np.power(n,5))/(np.power(n,3)*np.power(1+n,3)) )*(2.0) # pylint: disable=line-too-long + gqg1_nfcf = ((-np.power(S1,2)+S2+2*S1/n)*(n-1)/(n*(n+1))-(n-1)*(1+3.5*n+4*np.power(n,2)+5*np.power(n,3)+2.5*np.power(n,4))/(np.power(n,3)*np.power(1+n, 3))+4*(n-1)/(np.power(n,2)*np.power(1+n,2))*2) # pylint: disable=line-too-long + # fmt: on + result = ( + 4.0 * constants.TR * nf * (constants.CA * gqg1_nfca + constants.CF * gqg1_nfcf) + ) + return result + + +@nb.njit(cache=True) +def gamma_gq(n, nf, sx): + """ + Computes the |NLO| polarized gluon-quark singlet anomalous dimension. + + :cite:`Gluck:1995yr` (eq A.5) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` + + Returns + ------- + gamma_gq : complex + |nLO| gluon-quark singlet anomalous dimension + :math:`\\gamma_{gq}^{(1)}(n)` + """ + S1 = sx[0] + S2 = sx[1] + Sp2m = harmonics.S2((n - 1) / 2) + # fmt: off + ggq1_cfcf = ((np.power(S1,2)+S2)*(n+2))/(n*(n+1))-(2* S1 * (n+2) * (1 + 3* n)) / (n * np.power(1+n,2))-((n+2)* (2+ 15*n+ 8*np.power(n,2)-12.* np.power(n,3) - 9.* np.power(n,4)))/(np.power(n,3) * np.power(1+n,3)) + 8* (n+2)/(np.power(n,2)* np.power(1+n, 2))# pylint: disable=line-too-long + ggq1_cfca =(-np.power(S1,2)-S2 + Sp2m)*(n+2)/(n*(n+1))+ S1*(12+ 22* n+ 11* np.power(n,2))/(3* np.power(n,2)*(n+1))-(36+ 72* n+41* np.power(n,2)+ 254* np.power(n,3)+271* np.power(n,4)+76 *np.power(n,5))/(9* np.power(n,3)* np.power(1+n,3)) # pylint: disable=line-too-long + ggq1_cfnf = 4*((- S1 * (n+2) )/ (3* n *(n+1)) + ((n+2) * (2+ 5* n))/ (9* n * np.power(1+n, 2) )) # pylint: disable=line-too-long + # fmt: on + result = constants.CF * ( + (constants.CA * ggq1_cfca) + + (constants.CF * ggq1_cfcf) + + (4.0 * constants.TR * nf * ggq1_cfnf) + ) + return result + + +@nb.njit(cache=True) +def gamma_gg(n, nf, sx): + """ + Computes the |NLO| polarized gluon-gluon singlet anomalous dimension. + + :cite:`Gluck:1995yr` (eq A.6) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` + + Returns + ------- + gamma_gq : complex + |nLO| gluon-quark singlet anomalous dimension + :math:`\\gamma_{gq}^{(1)}(n)` + """ + S1 = sx[0] + Sp2m = harmonics.S2((n - 1) / 2) + Sp3m = harmonics.S3((n - 1) / 2) + g3n = harmonics.g_functions.mellin_g3(n, S1) + SSCHLM = ( -5 / 8 * zeta3 + (zeta2 / 2) * (digamma((n + 1) / 2) - digamma(n / 2)) - S1 / (np.power(n, 2)) + - g3n) + """SSCHLM redefined since I haven't located the expression for the diagamma part and needed to make sure it is correct, I assume approximation is used originally """ + ggg1_caca = (-4 * S1 * Sp2m- Sp3m+ 8 * SSCHLM + 8 * Sp2m / (n * (n + 1))+ 2.0* S1* (72+ 144 * n+ 67 * np.power(n, 2)+ 134 * np.power(n, 3)+ 67 * np.power(n, 4) )/ (9 * np.power(n, 2) * np.power(n + 1, 2)) - (144 + 258 * n+ 7 * np.power(n, 2) + 698 * np.power(n, 3) + 469 * np.power(n, 4)+ 144 * np.power(n, 5) + 48 * np.power(n, 6) )/ (9 * np.power(n, 3) * np.power(1 + n, 3)) ) * (0.5) # pylint: disable=line-too-long + ggg1_canf = ( -5 * S1 / 9 + (-3 + 13 * n + 16 * np.power(n, 2) + 6 * np.power(n, 3) + 3 * np.power(n, 4)) / (9 * np.power(n, 2) * np.power(1 + n, 2)) ) * 4 # pylint: disable=line-too-long + ggg1_cfnf = (4+ 2 * n - 8 * np.power(n, 2)+ np.power(n, 3)+ 5 * np.power(n, 4)+ 3 * np.power(n, 5)+ + np.power(n, 6)) / (np.power(n, 3) * np.power(1 + n, 3)) # pylint: disable=line-too-long + # fmt: on + result = 4 * ( + constants.CA * constants.CA * ggg1_caca + + constants.TR * nf * (constants.CA * ggg1_canf + constants.CF * ggg1_cfnf) + ) + + return result + + +@nb.njit(cache=True) +def gamma_singlet(n, nf, sx): + gamma_qq = gamma_nsp(n, nf, sx) + gamma_ps(n, nf) + gamma_S_0 = np.array( + [[gamma_qq, gamma_qg(n, nf, sx)], [gamma_gq(n, nf, sx), gamma_gg(n, nf, sx)]], + np.complex_, + ) + return gamma_S_0 From 22430dd66c6ec70eb6f0137b0051c2f1affa7a54 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Wed, 25 Jan 2023 13:26:18 +0100 Subject: [PATCH 18/67] fix docstrings and prepare to NNLO --- .../polarized/space_like/__init__.py | 80 ++++++++++++++--- .../polarized/space_like/as1.py | 85 +++++++++---------- .../polarized/space_like/test_ad_as1.py | 13 +-- 3 files changed, 117 insertions(+), 61 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py index 33347d562..908519b72 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -13,12 +13,60 @@ import numpy as np from .... import harmonics -from . import as1, as2 +from . import as1, as2, as3 + + +def compute_cache(n, pto, is_singlet): + """Compute the harmonic cache for polarized anomalous dimension. + + Parameters + ---------- + n : complex + Mellin variable + pto : int + perturbative order + is_singlet: bool + True for singlet like quantities + + Returns + ------- + list + harmonics cache + + """ + max_weight = pto if pto != 3 else 4 + cache = harmonics.sx(n, max_weight, is_singlet) + # TODO: fix this cache to contain all the harmonics needed + # if pto == 1: + # return [harmonics.S1(n)] + # if pto == 2: + # sx = harmonics.sx(n, max_weight=2) + # cache = [sx[0], [sx[1]]] + # if is_singlet: + # # S1, S2, Sm21 + # Sm1 = harmonics.Sm1(n, cache[0], is_singlet) + # Sm21 = harmonics.Sm21(n, cache[0], Sm1, is_singlet) + # cache.append([0, Sm21]) + # if pto == 3: + # if is_singlet: + # # S1, S2, S3, Sm21, S4 + # sx = harmonics.sx(n, max_weight=4) + # Sm1 = harmonics.Sm1(n, sx[0], is_singlet) + # Sm21 = harmonics.Sm21(n, sx[0], Sm1, is_singlet) + # cache = [sx[0], [sx[1], 0], [sx[2], Sm21], sx[3]] + # else: + # # TODO: this ordering will not be good when calling nsm,nsp... + # # S1, S2,Sm2, S3, Sm21, Sm3 + # sx = harmonics.sx(n, max_weight=3) + # smx = harmonics.smx(n, 3, is_singlet) + # Sm21 = harmonics.Sm21(n, sx[0], smx[0], is_singlet) + # cache = [sx[0], [sx[1], smx[1]], [sx[2], Sm21, smx[2]]] + return cache @nb.njit(cache=True) -def gamma_ns(order,mode, n, nf): - r"""Computes the tower of the non-singlet anomalous dimensions +def gamma_ns(order, mode, n, nf): + r"""Compute the tower of the non-singlet anomalous dimensions. Parameters ---------- @@ -38,7 +86,7 @@ def gamma_ns(order,mode, n, nf): """ # cache the s-es - sx = harmonics.sx(n, max_weight=order[0] + 1) + sx = compute_cache(n, order + 1, False) # now combine gamma_ns = np.zeros(order[0], np.complex_) gamma_ns[0] = as1.gamma_ns(n, sx[0]) @@ -53,13 +101,21 @@ def gamma_ns(order,mode, n, nf): raise NotImplementedError("Non-singlet sector is not implemented") gamma_ns[1] = gamma_ns_1 if order[0] >= 3: - raise NotImplementedError("Polarised beyond NLO is not yet implemented") + if mode == 10101: + gamma_ns_2 = as3.gamma_nsp(n, nf, sx) + elif mode == 10201: + gamma_ns_2 = as3.gamma_nsm(n, nf, sx) + elif mode == 10200: + gamma_ns_2 = as3.gamma_nsv(n, nf, sx) + gamma_ns[2] = gamma_ns_2 + if order[0] >= 4: + raise NotImplementedError("Polarized beyond NNLO is not yet implemented") return gamma_ns @nb.njit(cache=True) def gamma_singlet(order, n, nf): - r"""Computes the tower of the singlet anomalous dimensions matrices + r"""Compute the tower of the singlet anomalous dimensions matrices. Parameters ---------- @@ -77,12 +133,14 @@ def gamma_singlet(order, n, nf): """ # cache the s-es - sx = harmonics.sx(n, max_weight=order[0]) + sx = compute_cache(n, order + 1, True) gamma_s = np.zeros((order[0], 2, 2), np.complex_) gamma_s[0] = as1.gamma_singlet(n, sx[0], nf) - if order[0] >=2: - gamma_s[1] = as2.gamma_singlet(n, sx, nf) + if order[0] >= 2: + gamma_s[1] = as2.gamma_singlet(n, nf, sx) if order[0] >= 3: - raise NotImplementedError("Polarised beyond NLO is not yet implemented") - return gamma_s \ No newline at end of file + gamma_s[2] = as3.gamma_singlet(n, nf, sx) + if order[0] >= 4: + raise NotImplementedError("Polarized beyond NNLO is not yet implemented") + return gamma_s diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as1.py b/src/ekore/anomalous_dimensions/polarized/space_like/as1.py index d36d7ec95..3d8c8fab0 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as1.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as1.py @@ -1,30 +1,29 @@ -# -*- coding: utf-8 -*- -"""This file contains the leading-order Altarelli-Parisi splitting kernels.""" +"""This file contains the |LO| Altarelli-Parisi splitting kernels.""" import numba as nb import numpy as np from eko import constants + from ...unpolarized.space_like.as1 import gamma_ns @nb.njit(cache=True) def gamma_qg(N, nf): - """ - Computes the leading-order polarized quark-gluon anomalous dimension - :cite:`Gluck:1995yr` (eq A.1) + """Compute the |LO| polarized quark-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1). Parameters ---------- - N : complex - Mellin moment - nf : int - Number of active flavors + N : complex + Mellin moment + nf : int + Number of active flavors Returns ------- - gamma_qg : complex - Leading-order polarized quark-gluon anomalous dimension :math:`\\gamma_{qg}^{(0)}(N)` + complex + |LO| polarized quark-gluon anomalous dimension :math:`\\gamma_{qg}^{(0)}(N)` + """ gamma = -(N - 1) / N / (N + 1) result = 2.0 * constants.TR * 2.0 * nf * gamma @@ -33,19 +32,18 @@ def gamma_qg(N, nf): @nb.njit(cache=True) def gamma_gq(N): - """ - Computes the leading-order polarized gluon-quark anomalous dimension - :cite:`Gluck:1995yr` (eq A.1) + """Compute the |LO| polarized gluon-quark anomalous dimension :cite:`Gluck:1995yr` (eq A.1). Parameters ---------- - N : complex - Mellin moment + N : complex + Mellin moment Returns ------- - gamma_gq : complex - Leading-order gluon-quark anomalous dimension :math:`\\gamma_{gq}^{(0)}(N)` + complex + |LO| gluon-quark anomalous dimension :math:`\\gamma_{gq}^{(0)}(N)` + """ gamma = -(N + 2) / N / (N + 1) result = 2.0 * constants.CF * gamma @@ -54,23 +52,22 @@ def gamma_gq(N): @nb.njit(cache=True) def gamma_gg(N, s1, nf): - """ - Computes the leading-order polarized gluon-gluon anomalous dimension - :cite:`Gluck:1995yr` (eq A.1) + """Compute the |LO| polarized gluon-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1). Parameters ---------- - N : complex - Mellin moment - s1 : complex - harmonic sum :math:`S_{1}` - nf : int - Number of active flavors + N : complex + Mellin moment + s1 : complex + harmonic sum :math:`S_{1}` + nf : int + Number of active flavors Returns ------- - gamma_gg : complex - Leading-order gluon-gluon anomalous dimension :math:`\\gamma_{gg}^{(0)}(N)` + complex + |LO| gluon-gluon anomalous dimension :math:`\\gamma_{gg}^{(0)}(N)` + """ gamma = -s1 + 2 / N / (N + 1) result = constants.CA * (-4.0 * gamma - 11.0 / 3.0) + 4.0 / 3.0 * constants.TR * nf @@ -79,8 +76,7 @@ def gamma_gg(N, s1, nf): @nb.njit(cache=True) def gamma_singlet(N, s1, nf): - r""" - Computes the leading-order polarized singlet anomalous dimension matrix + r"""Compute the |LO| polarized singlet anomalous dimension matrix. .. math:: \gamma_S^{(0)} = \left(\begin{array}{cc} @@ -88,19 +84,20 @@ def gamma_singlet(N, s1, nf): \gamma_{gq}^{(0)} & \gamma_{gg}^{(0)} \end{array}\right) - Parameters - ---------- - N : complex - Mellin moment - s1 : complex - harmonic sum :math:`S_{1}` - nf : int - Number of active flavors - - Returns - ------- - gamma_S_0 : numpy.ndarray - Leading-order singlet anomalous dimension matrix :math:`\gamma_{S}^{(0)}(N)` + Parameters + ---------- + N : complex + Mellin moment + s1 : complex + harmonic sum :math:`S_{1}` + nf : int + Number of active flavors + + Returns + ------- + numpy.ndarray + |LO| singlet anomalous dimension matrix :math:`\gamma_{S}^{(0)}(N)` + """ gamma_qq = gamma_ns(N, s1) gamma_S_0 = np.array( diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py index 22d6b73b3..42fee408b 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as1.py @@ -1,8 +1,9 @@ -# Test LO Polarised splitting functions +# Test LO Polarized splitting functions import numpy as np + import ekore.anomalous_dimensions.polarized.space_like.as1 as as1 -from ekore import harmonics from eko import constants +from ekore import harmonics NF = 5 @@ -13,7 +14,7 @@ def test_quark_momentum(): s1 = harmonics.S1(N) np.testing.assert_almost_equal( as1.gamma_ns(N, s1) + as1.gamma_gq(N), - (4 * constants.CF)/3, + (4 * constants.CF) / 3, ) @@ -22,10 +23,10 @@ def test_gluon_momentum(): N = complex(2.0, 0.0) s1 = harmonics.S1(N) np.testing.assert_almost_equal( - as1.gamma_qg(N, NF) + as1.gamma_gg(N, s1, NF), 3 + NF/3 + as1.gamma_qg(N, NF) + as1.gamma_gg(N, s1, NF), 3 + NF / 3 ) + def test_qg_helicity_conservation(): N = complex(1.0, 0.0) - np.testing.assert_almost_equal(as1.gamma_qg(N, NF) , 0) - + np.testing.assert_almost_equal(as1.gamma_qg(N, NF), 0) From a37d3d4b902fa0981d20bd34940a277814244f20 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Wed, 25 Jan 2023 13:27:02 +0100 Subject: [PATCH 19/67] some fixes in NLO ad --- .../polarized/space_like/as2.py | 326 +++++++++--------- .../polarized/space_like/test_ad_as2.py | 13 + 2 files changed, 178 insertions(+), 161 deletions(-) create mode 100755 tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py index 060c25475..6fd6cfdea 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py @@ -5,157 +5,81 @@ import numpy as np from eko import constants -from .... import harmonics -from ....harmonics.constants import log2, zeta2, zeta3 - -from scipy.special import digamma - - -@nb.njit(cache=True) -def gamma_nsm(n, nf, sx): - """ - Computes the |NLO| polarized valence-like non-singlet anomalous dimension. - - :Floratos:1981hs (eq B.18) - - Parameters - ---------- - n : complex - Mellin moment - nf : int - number of active flavors - sx : numpy.ndarray - List of harmonic sums: :math:`S_{1},S_{2}` - - Returns - ------- - gamma_nsm : complex - |nLO| valence-like non-singlet anomalous dimension - :math:`\\gamma_{ns,-}^{(1)}(n)` - """ - S1 = sx[0] - S2 = sx[1] - # Here, Sp refers to S' ("s-prime") (german: "s-strich" or in Pegasus language: SSTR) - # of :cite:`Gluck:1989ze` and NOT to the Spence function a.k.a. dilogarithm - Sp1p = harmonics.S1(n / 2) - Sp2p = harmonics.S2(n / 2) - Sp3p = harmonics.S3(n / 2) - Sp1m = harmonics.S1((n - 1) / 2) - Sp2m = harmonics.S2((n - 1) / 2) - Sp3m = harmonics.S3((n - 1) / 2) - g3n = harmonics.g_functions.mellin_g3(n, S1) - # fmt: off - gqq1m_cfca = 16*g3n - (144 + n*(1 + n)*(156 + n*(340 + n*(655 + 51*n*(2 + n)))))/(18.*np.power(n,3)*np.power(1 + n,3)) + (-14.666666666666666 + 8/n - 8/(1 + n))*S2 - (4*Sp2m)/(n + np.power(n,2)) + S1*(29.77777777777778 + 16/np.power(n,2) - 16*S2 + 8*Sp2m) + 2*Sp3m + 10*zeta3 + zeta2*(16*S1 - 16*Sp1m - (16*(1 + n*log2))/n) # pylint: disable=line-too-long - gqq1m_cfcf = 32*g3n - (8 + n*(32 + n*(40 + 3*n*(3 + n)*(3 + np.power(n,2)))))/(2.*np.power(n,3)*np.power(1 + n,3)) + (12 - 8/n + 8/(1 + n))*S2 + S1*(40/np.power(n,2) - 8/np.power(1 + n,2) + 16*S2 - 16*Sp2p) + (8*Sp2p)/(n + np.power(n,2)) - 4*Sp3p - 20*zeta3 + zeta2*(-32*S1 + 32*Sp1p + 32*(-(1/n) + log2)) - gqq1m_cfnf = (-12 + n*(20 + n*(47 + 3*n*(2 + n))))/(9.*np.power(n,2)*np.power(1 + n,2)) - (40*S1)/9. + (8*S2)/3. # pylint: disable=line-too-long - # fmt: on - result = constants.CF * ( - (constants.CA * gqq1m_cfca) - + (constants.CF * gqq1m_cfcf) - + (2.0 * constants.TR * nf * gqq1m_cfnf) - ) - return result - -def gamma_nsp(n, nf, sx): - """ - Computes the |NLO| polarized singlet-like non-singlet anomalous dimension. - - :Floratos:1981hs (eq B.18) - - Parameters - ---------- - n : complex - Mellin moment - nf : int - number of active flavors - sx : numpy.ndarray - List of harmonic sums: :math:`S_{1},S_{2}` +from .... import harmonics +from ....harmonics.constants import zeta3 - Returns - ------- - gamma_nsp : complex - |nLO| singlet-like non-singlet anomalous dimension - :math:`\\gamma_{ns,+}^{(1)}(n)` - """ - S1 = sx[0] - S2 = sx[1] - Sp1p = harmonics.S1(n / 2) - Sp2p = harmonics.S2(n / 2) - Sp3p = harmonics.S3(n / 2) - Sp1m = harmonics.S1((n - 1) / 2) - Sp2m = harmonics.S2((n - 1) / 2) - Sp3m = harmonics.S3((n - 1) / 2) - g3n = harmonics.g_functions.mellin_g3(n, S1) - # fmt: off - gqq1p_cfca = -16*g3n + (132 - n*(340 + n*(655 + 51*n*(2 + n))))/(18.*np.power(n,2)*np.power(1 + n,2)) + (-14.666666666666666 + 8/n - 8/(1 + n))*S2 - (4*Sp2p)/(n + np.power(n,2)) + S1*(29.77777777777778 - 16/np.power(n,2) - 16*S2 + 8*Sp2p) + 2*Sp3p + 10*zeta3 + zeta2*(16*S1 - 16*Sp1p + 16*(1/n - log2)) # pylint: disable=line-too-long - gqq1p_cfcf = -32*g3n + (24 - n*(-32 + 3*n*(-8 + n*(3 + n)*(3 + np.power(n,2)))))/(2.*np.power(n,3)*np.power(1 + n,3)) + (12 - 8/n + 8/(1 + n))*S2 + S1*(-24/np.power(n,2) - 8/np.power(1 + n,2) + 16*S2 - 16*Sp2m) + (8*Sp2m)/(n + np.power(n,2)) - 4*Sp3m - 20*zeta3 + zeta2*(-32*S1 + 32*Sp1m + 32*(1/n + log2)) # pylint: disable=line-too-long - gqq1p_cfnf = (-12 + n*(20 + n*(47 + 3*n*(2 + n))))/(9.*np.power(n,2)*np.power(1 + n,2)) - (40*S1)/9. + (8*S2)/3. # pylint: disable=line-too-long - # fmt: on - result = constants.CF * ( - (constants.CA * gqq1p_cfca) - + (constants.CF * gqq1p_cfcf) - + (2.0 * constants.TR * nf * gqq1p_cfnf) - ) - return result +# Non Singlet sector is swapped +from ...unpolarized.space_like.as3 import gamma_nsm as gamma_nsp +from ...unpolarized.space_like.as3 import gamma_nsp as gamma_nsm @nb.njit(cache=True) def gamma_ps(n, nf): - """ - Computes the |NLO| polarized pure-singlet quark-quark anomalous dimension. - - :cite:`Gluck:1995yr` (eq A.3) + """Compute the |NLO| polarized pure-singlet quark-quark anomalous dimension :cite:`Gluck:1995yr` (eq A.3). Parameters ---------- - n : complex - Mellin moment - nf : int - number of active flavors + n : complex + Mellin moment + nf : int + number of active flavors Returns ------- - gamma_ps : complex - |nLO| pure-singlet quark-quark anomalous dimension - :math:`\\gamma_{ps}^{(1)}(n)` + complex + |NLO| pure-singlet quark-quark anomalous dimension :math:`\\gamma_{ps}^{(1)}(n)` + """ - # fmt: off - gqqps1_nfcf = (2* (n+2)*(1 + 2*n + np.power(n , 3)))/ (np.power(1 + n,3)*np.power(n,3)) # pylint: disable=line-too-long - # fmt: on + gqqps1_nfcf = (2 * (n + 2) * (1 + 2 * n + np.power(n, 3))) / ( + np.power(1 + n, 3) * np.power(n, 3) + ) result = 4.0 * constants.TR * nf * constants.CF * gqqps1_nfcf return result @nb.njit(cache=True) def gamma_qg(n, nf, sx): - """ - Computes the |NLO| polarized quark-gluon singlet anomalous dimension. - - :cite:`Gluck:1995yr` (eq A.4) + """Compute the |NLO| polarized quark-gluon singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.4). Parameters ---------- - n : complex - Mellin moment - nf : int - number of active flavors - sx : numpy.ndarray - List of harmonic sums: :math:`S_{1},S_{2}` + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` Returns ------- - gamma_qg : complex - |nLO| quark-gluon singlet anomalous dimension - :math:`\\gamma_{qg}^{(1)}(n)` + complex + |NLO| quark-gluon singlet anomalous dimension :math:`\\gamma_{qg}^{(1)}(n)` + """ S1 = sx[0] S2 = sx[1] Sp2m = harmonics.S2((n - 1) / 2) - # fmt: off - gqg1_nfca =((np.power(S1,2)-S2+Sp2m)*(n-1)/(n*(n+1))-4*S1/(n*np.power(1+n,2))- (-2-7*n+3*np.power(n,2)-4*np.power(n,3)+np.power(n,4)+np.power(n,5))/(np.power(n,3)*np.power(1+n,3)) )*(2.0) # pylint: disable=line-too-long - gqg1_nfcf = ((-np.power(S1,2)+S2+2*S1/n)*(n-1)/(n*(n+1))-(n-1)*(1+3.5*n+4*np.power(n,2)+5*np.power(n,3)+2.5*np.power(n,4))/(np.power(n,3)*np.power(1+n, 3))+4*(n-1)/(np.power(n,2)*np.power(1+n,2))*2) # pylint: disable=line-too-long - # fmt: on + gqg1_nfca = ( + (np.power(S1, 2) - S2 + Sp2m) * (n - 1) / (n * (n + 1)) + - 4 * S1 / (n * np.power(1 + n, 2)) + - ( + -2 + - 7 * n + + 3 * np.power(n, 2) + - 4 * np.power(n, 3) + + np.power(n, 4) + + np.power(n, 5) + ) + / (np.power(n, 3) * np.power(1 + n, 3)) + ) * (2.0) + gqg1_nfcf = ( + (-np.power(S1, 2) + S2 + 2 * S1 / n) * (n - 1) / (n * (n + 1)) + - (n - 1) + * (1 + 3.5 * n + 4 * np.power(n, 2) + 5 * np.power(n, 3) + 2.5 * np.power(n, 4)) + / (np.power(n, 3) * np.power(1 + n, 3)) + + 4 * (n - 1) / (np.power(n, 2) * np.power(1 + n, 2)) * 2 + ) result = ( 4.0 * constants.TR * nf * (constants.CA * gqg1_nfca + constants.CF * gqg1_nfcf) ) @@ -164,34 +88,59 @@ def gamma_qg(n, nf, sx): @nb.njit(cache=True) def gamma_gq(n, nf, sx): - """ - Computes the |NLO| polarized gluon-quark singlet anomalous dimension. - - :cite:`Gluck:1995yr` (eq A.5) + """Compute the |NLO| polarized gluon-quark singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.5). Parameters ---------- - n : complex - Mellin moment - nf : int - number of active flavors - sx : numpy.ndarray - List of harmonic sums: :math:`S_{1},S_{2}` + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` Returns ------- - gamma_gq : complex - |nLO| gluon-quark singlet anomalous dimension - :math:`\\gamma_{gq}^{(1)}(n)` + complex + |NLO| gluon-quark singlet anomalous dimension :math:`\\gamma_{gq}^{(1)}(n)` + """ S1 = sx[0] S2 = sx[1] Sp2m = harmonics.S2((n - 1) / 2) - # fmt: off - ggq1_cfcf = ((np.power(S1,2)+S2)*(n+2))/(n*(n+1))-(2* S1 * (n+2) * (1 + 3* n)) / (n * np.power(1+n,2))-((n+2)* (2+ 15*n+ 8*np.power(n,2)-12.* np.power(n,3) - 9.* np.power(n,4)))/(np.power(n,3) * np.power(1+n,3)) + 8* (n+2)/(np.power(n,2)* np.power(1+n, 2))# pylint: disable=line-too-long - ggq1_cfca =(-np.power(S1,2)-S2 + Sp2m)*(n+2)/(n*(n+1))+ S1*(12+ 22* n+ 11* np.power(n,2))/(3* np.power(n,2)*(n+1))-(36+ 72* n+41* np.power(n,2)+ 254* np.power(n,3)+271* np.power(n,4)+76 *np.power(n,5))/(9* np.power(n,3)* np.power(1+n,3)) # pylint: disable=line-too-long - ggq1_cfnf = 4*((- S1 * (n+2) )/ (3* n *(n+1)) + ((n+2) * (2+ 5* n))/ (9* n * np.power(1+n, 2) )) # pylint: disable=line-too-long - # fmt: on + ggq1_cfcf = ( + ((np.power(S1, 2) + S2) * (n + 2)) / (n * (n + 1)) + - (2 * S1 * (n + 2) * (1 + 3 * n)) / (n * np.power(1 + n, 2)) + - ( + (n + 2) + * ( + 2 + + 15 * n + + 8 * np.power(n, 2) + - 12.0 * np.power(n, 3) + - 9.0 * np.power(n, 4) + ) + ) + / (np.power(n, 3) * np.power(1 + n, 3)) + + 8 * (n + 2) / (np.power(n, 2) * np.power(1 + n, 2)) + ) + ggq1_cfca = ( + (-np.power(S1, 2) - S2 + Sp2m) * (n + 2) / (n * (n + 1)) + + S1 * (12 + 22 * n + 11 * np.power(n, 2)) / (3 * np.power(n, 2) * (n + 1)) + - ( + 36 + + 72 * n + + 41 * np.power(n, 2) + + 254 * np.power(n, 3) + + 271 * np.power(n, 4) + + 76 * np.power(n, 5) + ) + / (9 * np.power(n, 3) * np.power(1 + n, 3)) + ) + ggq1_cfnf = 4 * ( + (-S1 * (n + 2)) / (3 * n * (n + 1)) + + ((n + 2) * (2 + 5 * n)) / (9 * n * np.power(1 + n, 2)) + ) result = constants.CF * ( (constants.CA * ggq1_cfca) + (constants.CF * ggq1_cfcf) @@ -202,37 +151,69 @@ def gamma_gq(n, nf, sx): @nb.njit(cache=True) def gamma_gg(n, nf, sx): - """ - Computes the |NLO| polarized gluon-gluon singlet anomalous dimension. - - :cite:`Gluck:1995yr` (eq A.6) + """Compute the |NLO| polarized gluon-gluon singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.6). Parameters ---------- - n : complex - Mellin moment - nf : int - number of active flavors - sx : numpy.ndarray - List of harmonic sums: :math:`S_{1},S_{2}` + n : complex + Mellin moment + nf : int + number of active flavors + sx : numpy.ndarray + List of harmonic sums: :math:`S_{1},S_{2}` Returns ------- - gamma_gq : complex - |nLO| gluon-quark singlet anomalous dimension - :math:`\\gamma_{gq}^{(1)}(n)` + complex + |NLO| gluon-quark singlet anomalous dimension :math:`\\gamma_{gq}^{(1)}(n)` + """ S1 = sx[0] Sp2m = harmonics.S2((n - 1) / 2) Sp3m = harmonics.S3((n - 1) / 2) - g3n = harmonics.g_functions.mellin_g3(n, S1) - SSCHLM = ( -5 / 8 * zeta3 + (zeta2 / 2) * (digamma((n + 1) / 2) - digamma(n / 2)) - S1 / (np.power(n, 2)) - - g3n) - """SSCHLM redefined since I haven't located the expression for the diagamma part and needed to make sure it is correct, I assume approximation is used originally """ - ggg1_caca = (-4 * S1 * Sp2m- Sp3m+ 8 * SSCHLM + 8 * Sp2m / (n * (n + 1))+ 2.0* S1* (72+ 144 * n+ 67 * np.power(n, 2)+ 134 * np.power(n, 3)+ 67 * np.power(n, 4) )/ (9 * np.power(n, 2) * np.power(n + 1, 2)) - (144 + 258 * n+ 7 * np.power(n, 2) + 698 * np.power(n, 3) + 469 * np.power(n, 4)+ 144 * np.power(n, 5) + 48 * np.power(n, 6) )/ (9 * np.power(n, 3) * np.power(1 + n, 3)) ) * (0.5) # pylint: disable=line-too-long - ggg1_canf = ( -5 * S1 / 9 + (-3 + 13 * n + 16 * np.power(n, 2) + 6 * np.power(n, 3) + 3 * np.power(n, 4)) / (9 * np.power(n, 2) * np.power(1 + n, 2)) ) * 4 # pylint: disable=line-too-long - ggg1_cfnf = (4+ 2 * n - 8 * np.power(n, 2)+ np.power(n, 3)+ 5 * np.power(n, 4)+ 3 * np.power(n, 5)+ - np.power(n, 6)) / (np.power(n, 3) * np.power(1 + n, 3)) # pylint: disable=line-too-long + Sm1 = harmonics.Sm1(n, S1, True) + Sm21 = harmonics.Sm21(n, S1, Sm1, True) + SSCHLM = -S1 / n**2 - 5 * zeta3 / 4 - Sm21 + ggg1_caca = ( + -4 * S1 * Sp2m + - Sp3m + + 8 * SSCHLM + + 8 * Sp2m / (n * (n + 1)) + + 2.0 + * S1 + * ( + 72 + + 144 * n + + 67 * np.power(n, 2) + + 134 * np.power(n, 3) + + 67 * np.power(n, 4) + ) + / (9 * np.power(n, 2) * np.power(n + 1, 2)) + - ( + 144 + + 258 * n + + 7 * np.power(n, 2) + + 698 * np.power(n, 3) + + 469 * np.power(n, 4) + + 144 * np.power(n, 5) + + 48 * np.power(n, 6) + ) + / (9 * np.power(n, 3) * np.power(1 + n, 3)) + ) * (0.5) + ggg1_canf = ( + -5 * S1 / 9 + + (-3 + 13 * n + 16 * np.power(n, 2) + 6 * np.power(n, 3) + 3 * np.power(n, 4)) + / (9 * np.power(n, 2) * np.power(1 + n, 2)) + ) * 4 + ggg1_cfnf = ( + 4 + + 2 * n + - 8 * np.power(n, 2) + + np.power(n, 3) + + 5 * np.power(n, 4) + + 3 * np.power(n, 5) + + np.power(n, 6) + ) / (np.power(n, 3) * np.power(1 + n, 3)) # fmt: on result = 4 * ( constants.CA * constants.CA * ggg1_caca @@ -244,6 +225,29 @@ def gamma_gg(n, nf, sx): @nb.njit(cache=True) def gamma_singlet(n, nf, sx): + r"""Compute the |NLO| polarized singlet anomalous dimension matrix. + + .. math:: + \gamma_S^{(1)} = \left(\begin{array}{cc} + \gamma_{qq}^{(1)} & \gamma_{qg}^{(1)}\\ + \gamma_{gq}^{(1)} & \gamma_{gg}^{(1)} + \end{array}\right) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx: list + harmonics cache + + Returns + ------- + numpy.ndarray + |NLO| singlet anomalous dimension matrix :math:`\gamma_{S}^{(1)}(N)` + + """ gamma_qq = gamma_nsp(n, nf, sx) + gamma_ps(n, nf) gamma_S_0 = np.array( [[gamma_qq, gamma_qg(n, nf, sx)], [gamma_gq(n, nf, sx), gamma_gg(n, nf, sx)]], diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py new file mode 100755 index 000000000..65ef437d9 --- /dev/null +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py @@ -0,0 +1,13 @@ +# Test LO Polarized splitting functions +import numpy as np + +import ekore.anomalous_dimensions.polarized.space_like.as2 as as2 +from ekore import harmonics + +nf = 5 + + +def test_qg_helicity_conservation(): + N = complex(1.0, 0.0) + sx = harmonics.sx(N, max_weight=4) + np.testing.assert_almost_equal(as2.gamma_qg(N, nf, sx), 0) From 5d0c0448f09dde07495857109aa3ceee289d2ee5 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Wed, 25 Jan 2023 13:29:16 +0100 Subject: [PATCH 20/67] add NNLO ads --- .../polarized/space_like/as3.py | 432 ++++++++++++++++++ .../polarized/space_like/test_ad_as3.py | 32 ++ 2 files changed, 464 insertions(+) create mode 100644 src/ekore/anomalous_dimensions/polarized/space_like/as3.py create mode 100755 tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as3.py b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py new file mode 100644 index 000000000..d93d670a4 --- /dev/null +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py @@ -0,0 +1,432 @@ +"""This file contains the |NNLO| polarized Altarelli-Parisi splitting kernels.""" + +import numba as nb +import numpy as np + +from .... import harmonics +from ....harmonics.constants import zeta2 + +# Non Singlet sector is swapped +from ...unpolarized.space_like.as3 import gamma_nsm as gamma_nsp +from ...unpolarized.space_like.as3 import gamma_nsp as gamma_nsm + + +@nb.njit(cache=True) +def gamma_gg(N, nf, sx): + """Compute the parametrized |NNLO| gluon-gluon polarized anomalous dimension. + + Implement Eq. (4.12) of :cite:`Moch:2014sna`. + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx : np.ndarray + List of harmonic sums: :math:`S_{1},S_{2},S_{3},S_{4}` + + Returns + ------- + complex + |NNLO| gluon-gluon anomalous dimension :math:`\\gamma_{gg}^{(2)}(N)` + + """ + S1 = sx[0] + S2 = sx[1] + E1 = S1 / N**2 + (-zeta2 + S2) / N + gg_nf0 = ( + +4427.76 + - 12292 * E1 + + 12096 / N**5 + - 22665.0 / N**4 + + 21804 / N**3 + - 23091 / N**2 + + 33631.5 / N + - 7002 / (1 + N) ** 4 + - 1726 / (1 + N) ** 3 + - 13247 / (1 + N) ** 2 + - 39925 / (1 + N) + + 13447 / (2 + N) + - 4576 / (3 + N) + - 2643.52 * S1 + + (9446 * S1) / N + - (13247 * S1) / (1 + N) + ) + gg_nf1 = ( + -528.536 + - 7932 * E1 + - 6128 / (9 * N**5) + + 2146.79 / N**4 + - 3754.4 / N**3 + + 3524 / N**2 + - 1585.67 / N + - 786.0 / (1 + N) ** 4 + + 1226.2 / (1 + N) ** 3 + - 6746 / (1 + N) ** 2 + + 2648.6 / (1 + N) + - 2160.8 / (2 + N) + + 1251.7 / (3 + N) + + 412.172 * S1 + + (7041.7 * S1) / N + - (6746 * S1) / (1 + N) + ) + gg_nf2 = ( + 6.4607 + - 16.944 * E1 + + 7.0854 / N**4 + - 13.358 / N**3 + + 13.29 / N**2 + - 18.3838 / N + + 31.528 / (1 + N) ** 3 + + 32.905 / (1 + N) + - 18.3 / (2 + N) + + 2.637 / (3 + N) + + (16 * S1) / 9 + + (0.21 * S1) / N + ) + return gg_nf0 + gg_nf1 * nf + gg_nf2 * nf**2 + + +@nb.njit(cache=True) +def gamma_qg(N, nf, sx): + """Compute the parametrized |NNLO| quark-gluon polarized anomalous dimension. + + Implement Eq. (4.10) of :cite:`Moch:2014sna`. + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx : np.ndarray + List of harmonic sums: :math:`S_{1},S_{2},S_{3},S_{4}` + + Returns + ------- + complex + |NNLO| quark-gluon anomalous dimension :math:`\\gamma_{qg}^{(2)}(N)` + + """ + S1, S2, S3, S4 = sx + B3 = (-(S1**3) - 3 * S1 * S2 - 2 * S3) / N + B4 = (S1**4 + 6 * S1**2 * S2 + 3 * S2**2 + 8 * S1 * S3 + 6 * S4) / N + E1 = S1 / N**2 + (-zeta2 + S2) / N + qg_nf1 = ( + -5.3 * B3 + + 3.784 * B4 + + 825.4 * E1 + - 1208 / N**5 + + 2313.84 / N**4 + - 1789.6 / N**3 + + 1461.2 / N**2 + - 2972.4 / N + + 439.8 / (1 + N) ** 4 + + 2290.6 / (1 + N) ** 3 + + 4672 / (1 + N) + - 1221.6 / (2 + N) + - 18 / (3 + N) + - (278.32 * S1) / N + - (90.26 * S1**2) / N + - (90.26 * S2) / N + ) + qg_nf2 = ( + 0.7374 * B3 + - 47.3 * E1 + + 128 / (3 * N**5) + - 184.434 / N**4 + + 393.92 / N**3 + - 526.3 / N**2 + + 499.65 / N + - 61.116 / (1 + N) ** 4 + + 358.2 / (1 + N) ** 3 + - 432.18 / (1 + N) + - 141.63 / (2 + N) + - 11.34 / (3 + N) + + (6.256 * S1) / N + + (7.32 * S1**2) / N + + (7.32 * S2) / N + ) + return qg_nf1 * nf + qg_nf2 * nf**2 + + +@nb.njit(cache=True) +def gamma_gq(N, nf, sx): + """Compute the parametrized |NNLO| gluon-quark polarized anomalous dimension. + + Implement Eq. (4.11) of :cite:`Moch:2014sna`. + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx : np.ndarray + List of harmonic sums: :math:`S_{1},S_{2},S_{3},S_{4}` + + Returns + ------- + complex + |NNLO| gluon-quark anomalous dimension :math:`\\gamma_{gq}^{(2)}(N)` + + """ + S1, S2, S3, S4 = sx + B3 = (-(S1**3) - 3 * S1 * S2 - 2 * S3) / N + B4 = (S1**4 + 6 * S1**2 * S2 + 3 * S2**2 + 8 * S1 * S3 + 6 * S4) / N + E1 = S1 / N**2 + (-zeta2 + S2) / N + gq_nf0 = ( + 59.3 * B3 + + 5.143 * B4 + - 1424.8 * E1 + + 92096 / (27 * N**5) + - 5328.02 / N**4 + + 4280 / N**3 + - 4046.6 / N**2 + + 6159 / N + - 1050.6 / (1 + N) ** 4 + - 1701.4 / (1 + N) ** 3 + - 3825.9 / (1 + N) + + 1942.0 / (2 + N) + - 742.1 / (3 + N) + - (1843.7 * S1) / N + + (451.55 * S1**2) / N + + (451.55 * S2) / N + ) + gq_nf1 = ( + -4.963 * B3 + - 16.18 * E1 + - 1024 / (9 * N**5) + + 236.323 / N**4 + - 404.92 / N**3 + + 308.98 / N**2 + - 301.07 / N + + 180.138 / (1 + N) ** 4 + - 253.06 / (1 + N) ** 3 + - 296 / (1 + N) + + 406.13 / (2 + N) + - 101.62 / (3 + N) + + (171.78 * S1) / N + - (47.86 * S1**2) / N + - (47.86 * S2) / N + ) + gq_nf2 = ( + -(64 / (9 * N)) + - 32 / (9 * (1 + N) ** 3) + - 32 / (27 * (1 + N) ** 2) + + 160 / (27 * (1 + N)) + - (128 * S1) / (27 * N) + - (32 * S1) / (9 * (1 + N) ** 2) + - (32 * S1) / (27 * (1 + N)) + + (32 * S1**2) / (9 * N) + - (16 * S1**2) / (9 * (1 + N)) + + (32 * S2) / (9 * N) + - (16 * S2) / (9 * (1 + N)) + ) + return gq_nf0 + gq_nf1 * nf + gq_nf2 * nf**2 + + +@nb.njit(cache=True) +def gamma_ps(N, nf, sx): + """Compute the parametrized |NNLO| pure-singlet quark-quark polarized anomalous dimension. + + Implement Eq. (4.9) of :cite:`Moch:2014sna`. + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx : np.ndarray + List of harmonic sums: :math:`S_{1},S_{2},S_{3},S_{4}` + + Returns + ------- + complex + |NNLO| pure-singlet quark-quark anomalous dimension :math:`\\gamma_{ps}^{(2)}(N)` + + """ + S1, S2, S3, _ = sx + B3 = (-(S1**3) - 3 * S1 * S2 - 2 * S3) / N + B31 = ( + -((1 / (1 + N) + S1) ** 3) + - 3 * (1 / (1 + N) + S1) * (1 / (1 + N) ** 2 + S2) + - 2 * (1 / (1 + N) ** 3 + S3) + ) / (1 + N) + E1 = S1 / N**2 + (-zeta2 + S2) / N + E11 = (1 / (1 + N) + S1) / (1 + N) ** 2 + (1 / (1 + N) ** 2 - zeta2 + S2) / (1 + N) + ps_nf1 = ( + 1 + / 9 + * ( + -58.869 * B3 + + 58.869 * B31 + + 2093.13 * E1 + - 2093.13 * E11 + - 2752 / N**5 + + 4909.67 / N**4 + - 6634.8 / N**3 + + 6651.0 / N**2 + - 12263.4 / N + + 2752 / (1 + N) ** 5 + - 508.669 / (1 + N) ** 4 + + 13160.0 / (1 + N) ** 3 + - 8493.84 / (1 + N) ** 2 + + 26820.0 / (1 + N) + - 4401.0 / (2 + N) ** 4 + - 6298.2 / (2 + N) ** 3 + - 20629.8 / (2 + N) + + 7579.89 / (3 + N) + - 1506.69 / (4 + N) + + (1842.84 * S1) / N + + (226.98 * S1) / (1 + N) ** 2 + - (1842.84 * S1) / (1 + N) + - (113.49 * S1**2) / N + + (113.49 * S1**2) / (1 + N) + - (113.49 * S2) / N + + (113.49 * S2) / (1 + N) + ) + ) + ps_nf2 = ( + 1 + / 9 + * ( + -(63.4014 / N**4) + + 239.166 / N**3 + - 409.338 / N**2 + + 442.17 / N + + 107.968 / (1 + N) ** 4 + - 79.389 / (1 + N) ** 3 + + 494.991 / (1 + N) ** 2 + - 719.1 / (1 + N) + - 44.5662 / (2 + N) ** 4 + - 191.826 / (2 + N) ** 3 + + 238.167 / (2 + N) + + 34.1784 / (3 + N) + + 4.5846 / (4 + N) + - (85.653 * S1) / N + - (32.049 * S1) / (1 + N) ** 2 + + (85.653 * S1) / (1 + N) + + (16.0245 * S1**2) / N + - (16.0245 * S1**2) / (1 + N) + + (16.0245 * S2) / N + - (16.0245 * S2) / (1 + N) + ) + ) + return ps_nf1 * nf + ps_nf2 * nf**2 + + +@nb.njit(cache=True) +def gamma_nss(N, nf, sx): + """ + Compute the |NNLO| sea-like polarized non-singlet anomalous dimension. + + Implement Eq. (24) of :cite:`Moch:2015usa`. + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx : np.ndarray + List of harmonic sums: :math:`S_{1},S_{2},S_{3},S_{4}` + + Returns + ------- + gamma_nsv : complex + |NNLO| valence non-singlet anomalous dimension + :math:`\\gamma_{ns,s}^{(2)}(N)` + """ + S1 = sx[0] + S3 = sx[2] + Sm1, Sm2, Sm3 = harmonics.smx(N, sx, True) + Sm21 = harmonics.Sm3(N, S1, Sm1, True) + nss_nf1 = ( + 40 + / 9 + * ( + 1 / N**2 + + ( + -(2 / N**2) + - 12 / (N**4 * (1 + N) ** 4) + - 42 / (N**3 * (1 + N) ** 3) + - 14 / (N**2 * (1 + N) ** 2) + + 8 / (N * (1 + N)) + ) + * S1 + + (4 / (N**2 * (1 + N) ** 2) + 6 / (N * (1 + N))) * S3 + + ( + -(4 / N**2) + + 8 / (N**3 * (1 + N) ** 3) + + 20 / (N**2 * (1 + N) ** 2) + + 8 / (N * (1 + N)) + ) + * Sm2 + + (32 * Sm21) / (N * (1 + N)) + + (8 / (N**2 * (1 + N) ** 2) - 20 / (N * (1 + N))) * Sm3 + + (-(16 / (N**2 * (1 + N) ** 2)) + 8 / (N * (1 + N))) + * (S1 * Sm2 - Sm21 + Sm3) + ) + ) + return nss_nf1 * nf + + +@nb.njit(cache=True) +def gamma_nsv(N, nf, sx): + """ + Compute the |NNLO| valence polarized non-singlet anomalous dimension. + + Implement Eq. (23) of :cite:`Moch:2015usa`. + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx : list + harmonics cache + + Returns + ------- + gamma_nsv : complex + |NNLO| valence non-singlet anomalous dimension + :math:`\\gamma_{ns,v}^{(2)}(N)` + """ + return gamma_nsm(N, nf, sx) + gamma_nss(N, nf, sx) + + +@nb.njit(cache=True) +def gamma_singlet(N, nf, sx): + r"""Compute the |NNLO| polarized singlet anomalous dimension matrix. + + .. math:: + \gamma_S^{(1)} = \left(\begin{array}{cc} + \gamma_{qq}^{(2)} & \gamma_{qg}^{(2)}\\ + \gamma_{gq}^{(2)} & \gamma_{gg}^{(2)} + \end{array}\right) + + Parameters + ---------- + n : complex + Mellin moment + nf : int + Number of active flavors + sx: list + harmonics cache + + Returns + ------- + numpy.ndarray + |NNLO| singlet anomalous dimension matrix :math:`\gamma_{S}^{(2)}(N)` + + """ + gamma_qq = gamma_nsp(N, nf, sx) + gamma_ps(N, nf, sx) + gamma_S_0 = np.array( + [[gamma_qq, gamma_qg(N, nf, sx)], [gamma_gq(N, nf, sx), gamma_gg(N, nf, sx)]], + np.complex_, + ) + return gamma_S_0 diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py new file mode 100755 index 000000000..3a1b8f86e --- /dev/null +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py @@ -0,0 +1,32 @@ +# Test LO Polarized splitting functions +import numpy as np + +import ekore.anomalous_dimensions.polarized.space_like.as3 as as3 +from ekore import harmonics + +nf = 5 + + +# def test_quark_momentum(): +# # quark momentum +# N = complex(2.0, 0.0) +# sx = harmonics.sx(N, max_weight=4) +# np.testing.assert_almost_equal( +# as3.gamma_ns(N, nf, sx) + as3.gamma_gq(N), +# (4 * constants.CF)/3, +# ) + + +def test_gluon_momentum(): + # gluon momentum + N = complex(2.0, 0.0) + sx = harmonics.sx(N, max_weight=4) + np.testing.assert_allclose( + as3.gamma_qg(N, nf, sx) + as3.gamma_gg(N, nf, sx), -9.26335, rtol=7e-4 + ) + + +def test_qg_helicity_conservation(): + N = complex(1.0, 0.0) + sx = harmonics.sx(N, max_weight=4) + np.testing.assert_almost_equal(as3.gamma_qg(N, nf, sx), -0.00294317) From 54f69cea7dd6a7fab0cbc421c2133a44b90cc501 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Wed, 25 Jan 2023 13:30:05 +0100 Subject: [PATCH 21/67] extend references --- doc/source/refs.bib | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/source/refs.bib b/doc/source/refs.bib index 6bc794268..15fe80b7b 100644 --- a/doc/source/refs.bib +++ b/doc/source/refs.bib @@ -799,4 +799,32 @@ @article{Floratos:1981hs volume = "192", pages = "417--462", year = "1981" +} + +@article{Moch:2015usa, + author = "Moch, S. and Vermaseren, J. A. M. and Vogt, A.", + title = "{On \ensuremath{\gamma}5 in higher-order QCD calculations and the NNLO evolution of the polarized valence distribution}", + eprint = "1506.04517", + archivePrefix = "arXiv", + primaryClass = "hep-ph", + reportNumber = "DESY-15-061, NIKHEF-15-018, LTH-1042", + doi = "10.1016/j.physletb.2015.07.027", + journal = "Phys. Lett. B", + volume = "748", + pages = "432--438", + year = "2015" +} + +@article{Moch:2014sna, + author = "Moch, S. and Vermaseren, J. A. M. and Vogt, A.", + title = "{The Three-Loop Splitting Functions in QCD: The Helicity-Dependent Case}", + eprint = "1409.5131", + archivePrefix = "arXiv", + primaryClass = "hep-ph", + reportNumber = "DESY-14-157, NIKHEF-14-033, LTH-1023", + doi = "10.1016/j.nuclphysb.2014.10.016", + journal = "Nucl. Phys. B", + volume = "889", + pages = "351--400", + year = "2014" } \ No newline at end of file From 7f4d394d3bbe2ccdcd728fd33e5269259b18ba04 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Wed, 25 Jan 2023 13:33:07 +0100 Subject: [PATCH 22/67] fix typo --- src/ekore/anomalous_dimensions/polarized/space_like/as3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as3.py b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py index d93d670a4..6dab3f024 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as3.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py @@ -343,7 +343,7 @@ def gamma_nss(N, nf, sx): S1 = sx[0] S3 = sx[2] Sm1, Sm2, Sm3 = harmonics.smx(N, sx, True) - Sm21 = harmonics.Sm3(N, S1, Sm1, True) + Sm21 = harmonics.Sm21(N, S1, Sm1, True) nss_nf1 = ( 40 / 9 From 5dda210c1774bea1418b0eca4c03ebe4608b6989 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Wed, 25 Jan 2023 13:42:59 +0100 Subject: [PATCH 23/67] another small fix --- .../anomalous_dimensions/polarized/space_like/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py index 908519b72..635774531 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -1,5 +1,4 @@ -r""" -This module contains the polarized spacelike Altarelli-Parisi splitting kernels. +r"""This module contains the polarized spacelike Altarelli-Parisi splitting kernels. Normalization is given by @@ -35,7 +34,7 @@ def compute_cache(n, pto, is_singlet): """ max_weight = pto if pto != 3 else 4 - cache = harmonics.sx(n, max_weight, is_singlet) + cache = harmonics.sx(n, max_weight) # TODO: fix this cache to contain all the harmonics needed # if pto == 1: # return [harmonics.S1(n)] From 112608934a46bde7d5541a113784bdf3e0f0f0f7 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 26 Jan 2023 16:26:40 +0100 Subject: [PATCH 24/67] Fix runcard translation --- src/eko/io/runcards.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/eko/io/runcards.py b/src/eko/io/runcards.py index 941078f8f..4b41ea1f9 100644 --- a/src/eko/io/runcards.py +++ b/src/eko/io/runcards.py @@ -331,6 +331,7 @@ def new_operator(self): "ev_op_iterations", "n_integration_cores", "polarized", + "time_like", ): new["configs"][k] = old[k] max_order = old["ev_op_max_order"] From ad9394f422503df2fa0a82fafae5cfe5b7fff24b Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 26 Jan 2023 17:49:34 +0100 Subject: [PATCH 25/67] Init benchmarks --- benchmarks/apfel_bench.py | 17 ++++++++++++++--- src/eko/evolution_operator/grid.py | 2 ++ src/ekomark/benchmark/external/apfel_utils.py | 1 + .../polarized/space_like/__init__.py | 6 +++--- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/benchmarks/apfel_bench.py b/benchmarks/apfel_bench.py index ca1ca6dc8..cb8344ae5 100644 --- a/benchmarks/apfel_bench.py +++ b/benchmarks/apfel_bench.py @@ -158,6 +158,16 @@ def benchmark_plain(self, pto): cartesian_product(th), operators.build(operators.apfel_config), ["ToyLH"] ) + def benchmark_plain_pol(self, pto): + """Plain configuration""" + + th = self.ffns_theory.copy() + th.update({"PTO": [pto]}) + th["ModEv"] = ["EXA"] # TODO for the time one is sufficient + op = operators.apfel_config.copy() + op["polarized"] = [True] + self.run(cartesian_product(th), operators.build(op), ["ToyLH"]) + def benchmark_sv(self, pto, svmode): """Scale Variation""" @@ -189,10 +199,11 @@ def benchmark_sv(self, pto, svmode): if __name__ == "__main__": - obj = BenchmarkVFNS() - # obj = BenchmarkFFNS() + # obj = BenchmarkVFNS() + obj = BenchmarkFFNS() + obj.benchmark_plain_pol(0) # obj.benchmark_plain(2) - obj.benchmark_sv(2, "exponentiated") + # obj.benchmark_sv(2, "exponentiated") # obj.benchmark_kthr(2) # obj.benchmark_msbar(2) diff --git a/src/eko/evolution_operator/grid.py b/src/eko/evolution_operator/grid.py index 270d434a8..d76f7f7b5 100644 --- a/src/eko/evolution_operator/grid.py +++ b/src/eko/evolution_operator/grid.py @@ -106,6 +106,8 @@ def __init__( if order == (1, 0) and method != "iterate-exact": logger.warning("Evolution: In LO we use the exact solution always!") + logger.info(("P" if configs.polarized else "Unp") + "olarized evolution") + self.config = config self.q2_grid = mu2grid self.managers = dict( diff --git a/src/ekomark/benchmark/external/apfel_utils.py b/src/ekomark/benchmark/external/apfel_utils.py index 0fb2303c4..8b871b89e 100644 --- a/src/ekomark/benchmark/external/apfel_utils.py +++ b/src/ekomark/benchmark/external/apfel_utils.py @@ -66,6 +66,7 @@ def compute_apfel_data( # apfel.SetGridParameters(3, 50, 3, 8e-1) # init evolution + apfel.SetPolarizedEvolution(operators["polarized"]) apfel.InitializeAPFEL() print(f"Loading APFEL took {(time.perf_counter() - apf_start)} s") diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py index 635774531..a26910cc5 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -1,4 +1,4 @@ -r"""This module contains the polarized spacelike Altarelli-Parisi splitting kernels. +r"""The polarized, space-like Altarelli-Parisi splitting kernels. Normalization is given by @@ -85,7 +85,7 @@ def gamma_ns(order, mode, n, nf): """ # cache the s-es - sx = compute_cache(n, order + 1, False) + sx = compute_cache(n, order[0] + 1, False) # now combine gamma_ns = np.zeros(order[0], np.complex_) gamma_ns[0] = as1.gamma_ns(n, sx[0]) @@ -132,7 +132,7 @@ def gamma_singlet(order, n, nf): """ # cache the s-es - sx = compute_cache(n, order + 1, True) + sx = compute_cache(n, order[0] + 1, True) gamma_s = np.zeros((order[0], 2, 2), np.complex_) gamma_s[0] = as1.gamma_singlet(n, sx[0], nf) From 3e453ee7325bada572f85c95a717954f35117d69 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 27 Jan 2023 10:33:43 +0100 Subject: [PATCH 26/67] fix numba bug --- .../polarized/space_like/__init__.py | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py index a26910cc5..61e8530f6 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -15,6 +15,7 @@ from . import as1, as2, as3 +@nb.njit(cache=True) def compute_cache(n, pto, is_singlet): """Compute the harmonic cache for polarized anomalous dimension. @@ -35,31 +36,6 @@ def compute_cache(n, pto, is_singlet): """ max_weight = pto if pto != 3 else 4 cache = harmonics.sx(n, max_weight) - # TODO: fix this cache to contain all the harmonics needed - # if pto == 1: - # return [harmonics.S1(n)] - # if pto == 2: - # sx = harmonics.sx(n, max_weight=2) - # cache = [sx[0], [sx[1]]] - # if is_singlet: - # # S1, S2, Sm21 - # Sm1 = harmonics.Sm1(n, cache[0], is_singlet) - # Sm21 = harmonics.Sm21(n, cache[0], Sm1, is_singlet) - # cache.append([0, Sm21]) - # if pto == 3: - # if is_singlet: - # # S1, S2, S3, Sm21, S4 - # sx = harmonics.sx(n, max_weight=4) - # Sm1 = harmonics.Sm1(n, sx[0], is_singlet) - # Sm21 = harmonics.Sm21(n, sx[0], Sm1, is_singlet) - # cache = [sx[0], [sx[1], 0], [sx[2], Sm21], sx[3]] - # else: - # # TODO: this ordering will not be good when calling nsm,nsp... - # # S1, S2,Sm2, S3, Sm21, Sm3 - # sx = harmonics.sx(n, max_weight=3) - # smx = harmonics.smx(n, 3, is_singlet) - # Sm21 = harmonics.Sm21(n, sx[0], smx[0], is_singlet) - # cache = [sx[0], [sx[1], smx[1]], [sx[2], Sm21, smx[2]]] return cache From 5d283fb6df7fa535adcec6cbd37e4afb149025f1 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 27 Jan 2023 11:05:21 +0100 Subject: [PATCH 27/67] guess a minus sign explicitly from Vogt convention. Will this be correct? --- .../anomalous_dimensions/polarized/space_like/as3.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as3.py b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py index 6dab3f024..f3966dc3e 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as3.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py @@ -85,7 +85,7 @@ def gamma_gg(N, nf, sx): + (16 * S1) / 9 + (0.21 * S1) / N ) - return gg_nf0 + gg_nf1 * nf + gg_nf2 * nf**2 + return -(gg_nf0 + gg_nf1 * nf + gg_nf2 * nf**2) @nb.njit(cache=True) @@ -148,7 +148,7 @@ def gamma_qg(N, nf, sx): + (7.32 * S1**2) / N + (7.32 * S2) / N ) - return qg_nf1 * nf + qg_nf2 * nf**2 + return -(qg_nf1 * nf + qg_nf2 * nf**2) @nb.njit(cache=True) @@ -224,7 +224,7 @@ def gamma_gq(N, nf, sx): + (32 * S2) / (9 * N) - (16 * S2) / (9 * (1 + N)) ) - return gq_nf0 + gq_nf1 * nf + gq_nf2 * nf**2 + return -(gq_nf0 + gq_nf1 * nf + gq_nf2 * nf**2) @nb.njit(cache=True) @@ -315,7 +315,7 @@ def gamma_ps(N, nf, sx): - (16.0245 * S2) / (1 + N) ) ) - return ps_nf1 * nf + ps_nf2 * nf**2 + return -(ps_nf1 * nf + ps_nf2 * nf**2) @nb.njit(cache=True) @@ -371,7 +371,7 @@ def gamma_nss(N, nf, sx): * (S1 * Sm2 - Sm21 + Sm3) ) ) - return nss_nf1 * nf + return -(nss_nf1 * nf) @nb.njit(cache=True) From 4f5f0e5ff7636c77c1efa513b58638d0c37097dc Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 27 Jan 2023 11:30:40 +0100 Subject: [PATCH 28/67] fix mius sign also in tests --- .../anomalous_dimensions/polarized/space_like/test_ad_as3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py index 3a1b8f86e..2b7d559c8 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py @@ -22,11 +22,11 @@ def test_gluon_momentum(): N = complex(2.0, 0.0) sx = harmonics.sx(N, max_weight=4) np.testing.assert_allclose( - as3.gamma_qg(N, nf, sx) + as3.gamma_gg(N, nf, sx), -9.26335, rtol=7e-4 + as3.gamma_qg(N, nf, sx) + as3.gamma_gg(N, nf, sx), 9.26335, rtol=7e-4 ) def test_qg_helicity_conservation(): N = complex(1.0, 0.0) sx = harmonics.sx(N, max_weight=4) - np.testing.assert_almost_equal(as3.gamma_qg(N, nf, sx), -0.00294317) + np.testing.assert_almost_equal(as3.gamma_qg(N, nf, sx), 0.00294317) From 8ab2d51d6b398668bb6ffb35d1cc8e7d21422382 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Tue, 31 Jan 2023 09:49:40 +0100 Subject: [PATCH 29/67] adding pegasus polarized LO bench --- benchmarks/pegasus_bench.py | 16 ++++++++-- .../benchmark/external/pegasus_utils.py | 32 +++++++++++++------ 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/benchmarks/pegasus_bench.py b/benchmarks/pegasus_bench.py index 3e6e907c8..672ac0086 100644 --- a/benchmarks/pegasus_bench.py +++ b/benchmarks/pegasus_bench.py @@ -125,6 +125,15 @@ def benchmark_plain(self, pto): cartesian_product(th), operators.build(operators.pegasus_config), ["ToyLH"] ) + def benchmark_plain_pol(self, pto): + """Plain polarized configuration""" + + th = self.ffns_theory.copy() + th.update({"PTO": [pto]}) + op = operators.pegasus_config.copy() + op["polarized"] = [True] + self.run(cartesian_product(th), operators.build(op), ["ToyLH_polarized"]) + def benchmark_sv(self, pto, svmode): """Scale Variation""" @@ -143,9 +152,10 @@ def benchmark_sv(self, pto, svmode): if __name__ == "__main__": - obj = BenchmarkVFNS() - # obj = BenchmarkFFNS() + # obj = BenchmarkVFNS() + obj = BenchmarkFFNS() + obj.benchmark_plain_pol(0) # obj.benchmark_plain(1) - obj.benchmark_sv(2, "exponentiated") + # obj.benchmark_sv(2, "exponentiated") # vfns.benchmark_sv() diff --git a/src/ekomark/benchmark/external/pegasus_utils.py b/src/ekomark/benchmark/external/pegasus_utils.py index b6abaf7e2..d3b0f28ac 100644 --- a/src/ekomark/benchmark/external/pegasus_utils.py +++ b/src/ekomark/benchmark/external/pegasus_utils.py @@ -47,16 +47,28 @@ def compute_pegasus_data(theory, operators, skip_pdfs, rotate_to_evolution_basis if theory["Q0"] != theory["Qref"]: raise ValueError("Initial scale Q0 must be equal to Qref in Pegasus.") - pegasus.initevol( - imodev, theory["PTO"], ivfns, nf, theory["fact_to_ren_scale_ratio"] ** 2 - ) - pegasus.initinp( - theory["alphas"], - theory["Qref"] ** 2, - (theory["kcThr"] * theory["mc"]) ** 2, - (theory["kbThr"] * theory["mb"]) ** 2, - (theory["ktThr"] * theory["mt"]) ** 2, - ) + if operators["polarized"]: + pegasus.initpol( + imodev, theory["PTO"], ivfns, nf, theory["fact_to_ren_scale_ratio"] ** 2 + ) + pegasus.initpinp( + theory["alphas"], + theory["Qref"] ** 2, + (theory["kcThr"] * theory["mc"]) ** 2, + (theory["kbThr"] * theory["mb"]) ** 2, + (theory["ktThr"] * theory["mt"]) ** 2, + ) + else: + pegasus.initevol( + imodev, theory["PTO"], ivfns, nf, theory["fact_to_ren_scale_ratio"] ** 2 + ) + pegasus.initinp( + theory["alphas"], + theory["Qref"] ** 2, + (theory["kcThr"] * theory["mc"]) ** 2, + (theory["kbThr"] * theory["mb"]) ** 2, + (theory["ktThr"] * theory["mt"]) ** 2, + ) # better return always the flavor basis and then rotate # if rotate_to_evolution_basis: From 6cf3ca193ce85225018085c34e86dff099a7e5c9 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Tue, 31 Jan 2023 09:57:15 +0100 Subject: [PATCH 30/67] refactor NLO polarized ad and more tests --- .../polarized/space_like/as2.py | 157 +++++++----------- .../polarized/space_like/test_ad_as2.py | 44 ++++- 2 files changed, 99 insertions(+), 102 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py index 6fd6cfdea..cfba356c7 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py @@ -1,13 +1,12 @@ -# -- coding: utf-8 -- -"""This file contains the next-leading-order Altarelli-Parisi splitting kernels.""" +"""The next-leading-order Altarelli-Parisi splitting kernels.""" import numba as nb import numpy as np -from eko import constants +from eko.constants import CA, CF, TR from .... import harmonics -from ....harmonics.constants import zeta3 +from ....harmonics.constants import zeta2, zeta3 # Non Singlet sector is swapped from ...unpolarized.space_like.as3 import gamma_nsm as gamma_nsp @@ -16,7 +15,7 @@ @nb.njit(cache=True) def gamma_ps(n, nf): - """Compute the |NLO| polarized pure-singlet quark-quark anomalous dimension :cite:`Gluck:1995yr` (eq A.3). + r"""Compute the |NLO| polarized pure-singlet quark-quark anomalous dimension :cite:`Gluck:1995yr` (eq A.3). Parameters ---------- @@ -31,16 +30,14 @@ def gamma_ps(n, nf): |NLO| pure-singlet quark-quark anomalous dimension :math:`\\gamma_{ps}^{(1)}(n)` """ - gqqps1_nfcf = (2 * (n + 2) * (1 + 2 * n + np.power(n, 3))) / ( - np.power(1 + n, 3) * np.power(n, 3) - ) - result = 4.0 * constants.TR * nf * constants.CF * gqqps1_nfcf + gqqps1_nfcf = (2 * (n + 2) * (1 + 2 * n + n**3)) / ((1 + n) ** 3 * n**3) + result = 4.0 * TR * nf * CF * gqqps1_nfcf return result @nb.njit(cache=True) def gamma_qg(n, nf, sx): - """Compute the |NLO| polarized quark-gluon singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.4). + r"""Compute the |NLO| polarized quark-gluon singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.4). Parameters ---------- @@ -61,34 +58,25 @@ def gamma_qg(n, nf, sx): S2 = sx[1] Sp2m = harmonics.S2((n - 1) / 2) gqg1_nfca = ( - (np.power(S1, 2) - S2 + Sp2m) * (n - 1) / (n * (n + 1)) - - 4 * S1 / (n * np.power(1 + n, 2)) - - ( - -2 - - 7 * n - + 3 * np.power(n, 2) - - 4 * np.power(n, 3) - + np.power(n, 4) - + np.power(n, 5) - ) - / (np.power(n, 3) * np.power(1 + n, 3)) - ) * (2.0) + (S1**2 - S2 + Sp2m) * (n - 1) / (n * (n + 1)) + - 4 * S1 / (n * (1 + n) ** 2) + - (-2 - 7 * n + 3 * n**2 - 4 * n**3 + n**4 + n**5) + / (n**3 * (1 + n) ** 3) + ) * 2.0 gqg1_nfcf = ( - (-np.power(S1, 2) + S2 + 2 * S1 / n) * (n - 1) / (n * (n + 1)) + (-(S1**2) + S2 + 2 * S1 / n) * (n - 1) / (n * (n + 1)) - (n - 1) - * (1 + 3.5 * n + 4 * np.power(n, 2) + 5 * np.power(n, 3) + 2.5 * np.power(n, 4)) - / (np.power(n, 3) * np.power(1 + n, 3)) - + 4 * (n - 1) / (np.power(n, 2) * np.power(1 + n, 2)) * 2 - ) - result = ( - 4.0 * constants.TR * nf * (constants.CA * gqg1_nfca + constants.CF * gqg1_nfcf) - ) + * (1 + 3.5 * n + 4 * n**2 + 5 * n**3 + 2.5 * n**4) + / (n**3 * (1 + n) ** 3) + + 4 * (n - 1) / (n**2 * (1 + n) ** 2) + ) * 2 + result = 4.0 * TR * nf * (CA * gqg1_nfca + CF * gqg1_nfcf) return result @nb.njit(cache=True) def gamma_gq(n, nf, sx): - """Compute the |NLO| polarized gluon-quark singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.5). + r"""Compute the |NLO| polarized gluon-quark singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.5). Parameters ---------- @@ -109,49 +97,28 @@ def gamma_gq(n, nf, sx): S2 = sx[1] Sp2m = harmonics.S2((n - 1) / 2) ggq1_cfcf = ( - ((np.power(S1, 2) + S2) * (n + 2)) / (n * (n + 1)) - - (2 * S1 * (n + 2) * (1 + 3 * n)) / (n * np.power(1 + n, 2)) - - ( - (n + 2) - * ( - 2 - + 15 * n - + 8 * np.power(n, 2) - - 12.0 * np.power(n, 3) - - 9.0 * np.power(n, 4) - ) - ) - / (np.power(n, 3) * np.power(1 + n, 3)) - + 8 * (n + 2) / (np.power(n, 2) * np.power(1 + n, 2)) + (2 * (S1**2 + S2) * (n + 2)) / (n * (n + 1)) + - (2 * S1 * (n + 2) * (1 + 3 * n)) / (n * (1 + n) ** 2) + - ((n + 2) * (2 + 15 * n + 8 * n**2 - 12.0 * n**3 - 9.0 * n**4)) + / (n**3 * (1 + n) ** 3) + + 8 * (n + 2) / (n**2 * (1 + n) ** 2) + ) * 0.5 + ggq1_cfca = -( + -(-(S1**2) - S2 + Sp2m) * (n + 2) / (n * (n + 1)) + - S1 * (12 + 22 * n + 11 * n**2) / (3 * n**2 * (n + 1)) + + (36 + 72 * n + 41 * n**2 + 254 * n**3 + 271 * n**4 + 76 * n**5) + / (9 * n**3 * (1 + n) ** 3) ) - ggq1_cfca = ( - (-np.power(S1, 2) - S2 + Sp2m) * (n + 2) / (n * (n + 1)) - + S1 * (12 + 22 * n + 11 * np.power(n, 2)) / (3 * np.power(n, 2) * (n + 1)) - - ( - 36 - + 72 * n - + 41 * np.power(n, 2) - + 254 * np.power(n, 3) - + 271 * np.power(n, 4) - + 76 * np.power(n, 5) - ) - / (9 * np.power(n, 3) * np.power(1 + n, 3)) - ) - ggq1_cfnf = 4 * ( - (-S1 * (n + 2)) / (3 * n * (n + 1)) - + ((n + 2) * (2 + 5 * n)) / (9 * n * np.power(1 + n, 2)) - ) - result = constants.CF * ( - (constants.CA * ggq1_cfca) - + (constants.CF * ggq1_cfcf) - + (4.0 * constants.TR * nf * ggq1_cfnf) + ggq1_cfnf = (-S1 * (n + 2)) / (3 * n * (n + 1)) + ((n + 2) * (2 + 5 * n)) / ( + 9 * n * (1 + n) ** 2 ) + result = 4 * CF * (CA * ggq1_cfca + CF * ggq1_cfcf + 4.0 * TR * nf * ggq1_cfnf) return result @nb.njit(cache=True) def gamma_gg(n, nf, sx): - """Compute the |NLO| polarized gluon-gluon singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.6). + r"""Compute the |NLO| polarized gluon-gluon singlet anomalous dimension :cite:`Gluck:1995yr` (eq A.6). Parameters ---------- @@ -169,11 +136,16 @@ def gamma_gg(n, nf, sx): """ S1 = sx[0] + Sp1m = harmonics.S1((n - 1) / 2) Sp2m = harmonics.S2((n - 1) / 2) Sp3m = harmonics.S3((n - 1) / 2) - Sm1 = harmonics.Sm1(n, S1, True) - Sm21 = harmonics.Sm21(n, S1, Sm1, True) - SSCHLM = -S1 / n**2 - 5 * zeta3 / 4 - Sm21 + S1h = harmonics.S1(n / 2) + SSCHLM = ( + zeta2 / 2 * (+Sp1m - S1h + 2 / n) + - S1 / n**2 + - harmonics.g_functions.mellin_g3(n, S1) + - 5 * zeta3 / 8 + ) ggg1_caca = ( -4 * S1 * Sp2m - Sp3m @@ -181,45 +153,28 @@ def gamma_gg(n, nf, sx): + 8 * Sp2m / (n * (n + 1)) + 2.0 * S1 - * ( - 72 - + 144 * n - + 67 * np.power(n, 2) - + 134 * np.power(n, 3) - + 67 * np.power(n, 4) - ) - / (9 * np.power(n, 2) * np.power(n + 1, 2)) + * (72 + 144 * n + 67 * n**2 + 134 * n**3 + 67 * n**4) + / (9 * n**2 * (n + 1) ** 2) - ( 144 + 258 * n - + 7 * np.power(n, 2) - + 698 * np.power(n, 3) - + 469 * np.power(n, 4) - + 144 * np.power(n, 5) - + 48 * np.power(n, 6) + + 7 * n**2 + + 698 * n**3 + + 469 * n**4 + + 144 * n**5 + + 48 * n**6 ) - / (9 * np.power(n, 3) * np.power(1 + n, 3)) - ) * (0.5) + / (9 * n**3 * (1 + n) ** 3) + ) * 0.5 ggg1_canf = ( -5 * S1 / 9 - + (-3 + 13 * n + 16 * np.power(n, 2) + 6 * np.power(n, 3) + 3 * np.power(n, 4)) - / (9 * np.power(n, 2) * np.power(1 + n, 2)) + + (-3 + 13 * n + 16 * n**2 + 6 * n**3 + 3 * n**4) + / (9 * n**2 * (1 + n) ** 2) ) * 4 - ggg1_cfnf = ( - 4 - + 2 * n - - 8 * np.power(n, 2) - + np.power(n, 3) - + 5 * np.power(n, 4) - + 3 * np.power(n, 5) - + np.power(n, 6) - ) / (np.power(n, 3) * np.power(1 + n, 3)) - # fmt: on - result = 4 * ( - constants.CA * constants.CA * ggg1_caca - + constants.TR * nf * (constants.CA * ggg1_canf + constants.CF * ggg1_cfnf) + ggg1_cfnf = (4 + 2 * n - 8 * n**2 + n**3 + 5 * n**4 + 3 * n**5 + n**6) / ( + n**3 * (1 + n) ** 3 ) - + result = 4 * (CA**2 * ggg1_caca + TR * nf * (CA * ggg1_canf + CF * ggg1_cfnf)) return result diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py index 65ef437d9..cc7034c96 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py @@ -1,7 +1,8 @@ -# Test LO Polarized splitting functions +# Test NLO Polarized splitting functions import numpy as np import ekore.anomalous_dimensions.polarized.space_like.as2 as as2 +from eko.constants import CA, CF, TR from ekore import harmonics nf = 5 @@ -11,3 +12,44 @@ def test_qg_helicity_conservation(): N = complex(1.0, 0.0) sx = harmonics.sx(N, max_weight=4) np.testing.assert_almost_equal(as2.gamma_qg(N, nf, sx), 0) + + +def test_ps_momentum(): + N = complex(2.0, 0.0) + np.testing.assert_allclose(-as2.gamma_ps(N, nf), -4.0 * TR * nf * CF * 13 / 27) + + +def test_qg_momentum(): + N = complex(2.0, 0.0) + sx = harmonics.sx(N, 2) + np.testing.assert_allclose( + -as2.gamma_qg(N, nf, sx), + 4 + * nf + * (0.574074 * CF - 2 * CA * (-7 / 18 + 1 / 6 * (5 - np.pi**2 / 3))) + * TR, + ) + + +def test_gq_momentum(): + N = complex(2.0, 0.0) + sx = harmonics.sx(N, 2) + np.testing.assert_allclose( + -as2.gamma_gq(N, nf, sx), + 4 + * ( + -2.074074074074074 * CF**2 + + CA * CF * (29 / 54 - 2 / 3 * (1 / 2 - np.pi**2 / 3)) + + (4 * CF * nf * TR) / 27 + ), + ) + + +def test_gg_momentum(): + N = complex(2.0, 0.0) + sx = harmonics.sx(N, 2) + np.testing.assert_almost_equal( + -as2.gamma_gg(N, nf, sx), + 4 + * (-1.7537256813471833 * CA**2 + ((29 * CA) / 27 - (28 * CF) / 27) * nf * TR), + ) From 47d4025b65d577b63453e3ae32493585335f2b8e Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Tue, 31 Jan 2023 11:43:55 +0100 Subject: [PATCH 31/67] make NLO benchmark passing --- src/ekore/anomalous_dimensions/polarized/space_like/as2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py index cfba356c7..b7b4c8955 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py @@ -9,8 +9,8 @@ from ....harmonics.constants import zeta2, zeta3 # Non Singlet sector is swapped -from ...unpolarized.space_like.as3 import gamma_nsm as gamma_nsp -from ...unpolarized.space_like.as3 import gamma_nsp as gamma_nsm +from ...unpolarized.space_like.as2 import gamma_nsm as gamma_nsp +from ...unpolarized.space_like.as2 import gamma_nsp as gamma_nsm @nb.njit(cache=True) From 4ac28df434b8eaac832407c58f264428826a2249 Mon Sep 17 00:00:00 2001 From: aschaus Date: Tue, 31 Jan 2023 14:09:54 +0100 Subject: [PATCH 32/67] Lha polarized data --- .../benchmark/external/LHA_polarized.yaml | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/ekomark/benchmark/external/LHA_polarized.yaml diff --git a/src/ekomark/benchmark/external/LHA_polarized.yaml b/src/ekomark/benchmark/external/LHA_polarized.yaml new file mode 100644 index 000000000..bdbdc22df --- /dev/null +++ b/src/ekomark/benchmark/external/LHA_polarized.yaml @@ -0,0 +1,93 @@ +#:cite:`Dittmar:2005ed` +table16: # LO + part1: # mu_f^2 = mu_{f,0}^2 (=2) + u_v: [1.6366e-5,8.2024e-5,4.1110e-4,2.0604e-3,1.0326e-2,5.1723e-2,2.4582e-1,3.6473e-1,2.5008e-1,8.4769e-2,4.4680e-3] + d_v: [ 6.2946e-6,3.1548e-5,1.5811e-4,7.9245e-4,3.9716e-3,1.9886e-2,9.1636e-2,1.1370e-1,5.7710e-2,1.1990e-2,2.1365e-4] + L_m: [7.9433e-5,1.5849e-4,3.1621e-4,6.3052e-4,1.2501e-3,2.3412e-3,2.3972e-3,5.7388e-4,6.3457e-5,1.9651e-6,9.689e-10] + L_p: [1.5887e-3,3.1698e-3,6.3241e-3,1.2610e-2,2.5003e-2,4.6825e-2,4.7943e-2,1.1478e-2,1.2691e-3,3.9301e-5,1.9378e-8] + s_p: [-3.9716e-4,-7.9244e-4,-1.5810e-3,-3.1526e-3,-6.2507e-3,-1.1706e-2,-1.1986e-2,-2.8694e-3,-3.1729e-4,-9.8254e-6,-4.8444e-9] + c_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] + b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] + g: [4.7434e-4,1.5000e-3,4.7432e-3,1.4993e-2,4.7197e-2,1.4265e-1,2.8009e-1,1.3808e-1,3.3146e-2,3.0496e-3,1.4230e-5] + + part2: # FFNS at mu_f^2 = 1e4 + u_v: [4.8350e-5,2.3504e-4,1.1220e-3,5.1990e-3,2.2900e-2,9.1489e-2,2.6494e-1,2.2668e-1,9.7647e-2,1.9545e-2,4.1768e-4] + d_v: [1.8556e-5,9.0090e-5,4.2916e-4,1.9818e-3,8.6763e-3,3.4200e-2,9.1898e-2,6.2946e-2,1.9652e-2,2.3809e-3,1.7059e-5] + L_m: [1.0385e-4,2.0700e-4,4.1147e-4,8.0948e-4,1.5309e-3,2.4502e-3,1.5309e-3,2.1104e-4,1.4789e-5,2.7279e-7,5.494e-11] + L_p: [3.5124e-3,7.7716e-3,1.6007e-2,2.8757e-2,4.0166e-2,3.3928e-2,8.5427e-3,6.6698e-4,-1.8850e-5,-4.1807e-6,-7.6712e-9] + s_p: [-1.2370e-3,-2.8508e-3,-5.9463e-3,-1.0331e-2,-1.2428e-2,-4.7126e-3,3.3830e-3,7.2173e-4,8.3371e-5,3.4543e-6,4.1103e-9] + c_p: [-7.1774e-4,-1.8158e-3,-3.8889e-3,-6.2836e-3,-4.7739e-3,7.5385e-3,1.1037e-2,1.7769e-3,1.5732e-4,4.8183e-6,4.3850e-9] + b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] + g: [1.4116e-2,4.2163e-2,1.0922e-1,2.4069e-1,4.2181e-1,4.9485e-1,2.0503e-1,3.3980e-2,4.3802e-3,2.6355e-4,9.8421e-7] + + part3: # ZM-VFNS at mu_f^2 = 1e4 + u_v: [4.9026e-5,2.3818e-4,1.1359e-3,5.2567e-3,2.3109e-2,9.2035e-2,2.6478e-1,2.2495e-1,9.6318e-2,1.9147e-2,4.0430e-4] + d_v: [1.8815e-5,9.1286e-5,4.3445e-4,2.0035e-3,8.7537e-3,3.4391e-2,9.1762e-2,6.2376e-2,1.9353e-2,2.3281e-3,1.6480e-5] + L_m: [1.0422e-4,2.0774e-4,4.1289e-4,8.1206e-4,1.5345e-3,2.4501e-3,1.5206e-3,2.0811e-4,1.4496e-5,2.6556e-7,5.285e-11] + L_p: [3.5315e-3,7.8108e-3,1.6070e-2,2.8811e-2,4.0125e-2,3.3804e-2,8.5181e-3,6.6195e-4,-1.8549e-5,-4.0936e-6,-7.4351e-9] + s_p: [-1.2447e-3,-2.8667e-3,-5.9705e-3,-1.0345e-2,-1.2390e-2,-4.6512e-3,3.3438e-3,7.0957e-4,8.1756e-5,3.3746e-6,3.9818e-9] + c_p: [-7.2356e-4,-1.8280e-3,-3.9060e-3,-6.2849e-3,-4.7174e-3,7.5994e-3,1.0947e-2,1.7501e-3,1.5424e-4,4.7024e-6,4.2460e-9] + b_p: [-6.2276e-4,-1.5301e-3,-3.1196e-3,-4.5871e-3,-2.4822e-3,6.4665e-3,6.5223e-3,9.2045e-4,7.8577e-5,2.4901e-6,2.6319e-9] + g: [1.3726e-2,4.1011e-2,1.0615e-1,2.3343e-1,4.0743e-1,4.7445e-1,1.9402e-1,3.1960e-2,4.1226e-3,2.4888e-4,9.2939e-7] + + +table15: # NLO FFNS at mu_f^2 = 1e4 + part1: # mu_r^2 = mu_f^2 + u_v: [6.7336e-5,3.1280e-4,1.4180e-3,6.2085e-3,2.5741e-2,9.6288e-2,2.5843e-1,2.1248e-1,8.9180e-2,1.7300e-2,3.4726e-4] + d_v: [-2.5747e-5,-1.1938e-4,-5.3982e-4,-2.3546e-3,-9.7004e-3,-3.5778e-2,-8.9093e-2,-5.8641e-2,-1.7817e-2,-2.0885e-3,-1.4028e-5] + L_m: [-1.1434e-4,-2.3497e-4,-4.8579e-4,-9.8473e-4,-1.8276e-3,-2.6427e-3,-1.4593e-3,-1.9269e-4,-1.3125e-5,-2.3388e-7,-4.407e-11] + L_p: [-5.2002e-3,-1.0725e-2,-1.9994e-2,-3.1788e-2,-3.8222e-2,-2.6437e-2,-7.5546e-3,-1.2210e-3,-9.1573e-5,-1.9691e-6,-4.247e-9] + s_p: [-2.0528e-3,-4.2774e-3,-7.8594e-3,-1.1749e-2,-1.1427e-2,-1.2328e-3,3.4258e-3,3.5155e-4,1.9823e-5,1.8480e-7,-1.903e-9] + c_p: [-1.5034e-3,-3.1845e-3,-5.6970e-3,-7.5376e-3,-3.6138e-3,1.0869e-2,1.0639e-2,1.3138e-3,8.5435e-5,1.3541e-6,-1.683e-9] + g: [2.6955e-2,6.5928e-2,1.4414e-1,2.7537e-1,4.3388e-1,4.8281e-1,2.0096e-1,3.4126e-2,4.5803e-3,2.9526e-4,1.2520e-6] + part2: # mu_r^2 = 2mu_f^2 + u_v: [6.1781e-5,2.8974e-4,1.3281e-3,5.8891e-3,2.4777e-2,9.4371e-2,2.6008e-1,2.1837e-1,9.3169e-2,1.8423e-2,3.8293e-4] + d_v: [-2.3641e-5,-1.1068e-4,-5.0612e-4,-2.2361e-3,-9.3502e-3,-3.5129e-2,-8.9915e-2,-6.0497e-2,-1.8699e-2,-2.2357e-3,-1.5559e-5] + L_m: [-1.1137e-4,-2.2755e-4,-4.6740e-4,-9.4412e-4,-1.7632e-3,-2.6087e-3,-1.4923e-3,-2.0143e-4,-1.3954e-5,-2.5360e-7,-4.952e-11] + L_p: [-4.6947e-3,-9.8528e-3,-1.8799e-2,-3.0787e-2,-3.8610e-2,-2.8767e-2,-8.3806e-3,-1.2157e-3,-7.9331e-5,-1.0062e-6,-1.955e-9] + s_p: [-1.8092e-3,-3.8580e-3,-7.2908e-3,-1.1292e-2,-1.1658e-2,-2.3430e-3,3.1932e-3,3.9810e-4,3.0091e-5,7.6483e-7,-7.298e-10] + c_p: [-1.2695e-3,-2.7838e-3,-5.1629e-3,-7.1363e-3,-3.9083e-3,9.7922e-3,1.0585e-2,1.4042e-3,9.9849e-5,2.0328e-6,-4.822e-10] + g: [2.2530e-2,5.7272e-2,1.2975e-1,2.5644e-1,4.1725e-1,4.7804e-1,2.0495e-1,3.5366e-2,4.7690e-3,3.0796e-4,1.3247e-6] + part3: # mu_r^2 = 1/2 mu_f^2 + u_v: [7.4443e-5,3.4143e-4,1.5256e-3,6.5726e-3,2.6766e-2,9.8073e-2,2.5628e-1,2.0709e-1,8.5835e-2,1.6405e-2,3.2011e-4] + d_v: [-2.8435e-5,-1.3016e-4,-5.8002e-4,-2.4891e-3,-1.0070e-2,-3.6370e-2,-8.8133e-2,-5.6988e-2,-1.7089e-2,-1.9723e-3,-1.2870e-5] + L_m: [-1.1815e-4,-2.4482e-4,-5.1085e-4,-1.0409e-3,-1.9171e-3,-2.6942e-3,-1.4304e-3,-1.8541e-4,-1.2463e-5,-2.1859e-7,-4.000e-11] + L_p: [-5.7829e-3,-1.1668e-2,-2.1193e-2,-3.2697e-2,-3.7730e-2,-2.4056e-2,-6.9572e-3,-1.3308e-3,-1.1920e-4,-3.6817e-6,-8.173e-9] + s_p: [-2.3341e-3,-4.7305e-3,-8.4295e-3,-1.2166e-2,-1.1160e-2,-1.2354e-4,3.5561e-3,2.5993e-4,2.6972e-6,-7.4795e-7,-3.886e-9] + c_p: [-1.7739e-3,-3.6168e-3,-6.2295e-3,-7.8952e-3,-3.2890e-3,1.1929e-2,1.0604e-2,1.1855e-3,6.4995e-5,3.4496e-7,-3.686e-9] + g: [3.2071e-2,7.5123e-2,1.5788e-1,2.9079e-1,4.4380e-1,4.8272e-1,1.9831e-1,3.3524e-2,4.5044e-3,2.9100e-4,1.2230e-6] + + +table16: # NLO ZM-VFNS at mu_f^2 = 1e4 + part1: # mu_r^2 = mu_f^2 + u_v: [6.8787e-5,3.1881e-4,1.4413e-3,6.2902e-3,2.5980e-2,9.6750e-2,2.5807e-1,2.1104e-1,8.8199e-2,1.7027e-2,3.3898e-4] + d_v: [2.6297e-5,1.2165e-4,5.4856e-4,2.3849e-3,9.7872e-3,3.5935e-2,8.8905e-2,5.8186e-2,1.7601e-2,2.0531e-3,1.3676e-5] + L_m: [1.1496e-4,2.3638e-4,4.8893e-4,9.9100e-4,1.8364e-3,2.6452e-3,1.4509e-3,1.9054e-4,1.2924e-5,2.2921e-7,4.284e-11] + L_p: [5.2176e-3,1.0770e-2,2.0077e-2,3.1883e-2,3.8224e-2,2.6306e-2,7.4778e-3,1.2026e-3,8.9668e-5,1.9243e-6,4.260e-9] + s_p: [-2.0592e-3,-4.2953e-3,-7.8934e-3,-1.1785e-2,-1.1416e-2,-1.1774e-3,3.4207e-3,3.4999e-4,1.9771e-5,1.8384e-7,-1.916e-9] + c_p: [-1.5076e-3,-3.1979e-3,-5.7228e-3,-7.5596e-3,-3.5879e-3,1.0917e-2,1.0591e-2,1.3015e-3,8.4378e-5,1.3298e-6,-1.701e-9] + b_p: [-1.2411e-3,-2.4951e-3,-4.1488e-3,-4.8420e-3,-1.1723e-3,8.1196e-3,6.1480e-3,7.2795e-4,5.2125e-5,1.2157e-6,-7.492e-11] + g: [2.5681e-2,6.3021e-2,1.3809e-1,2.6411e-1,4.1601e-1,4.6178e-1,1.9143e-1,3.2621e-2,4.4207e-3,2.8887e-4,1.2435e-6] + part2: # mu_r^2 = 2mu_f^2 + u_v: [6.2819e-5,2.9408e-4,1.3450e-3,5.9485e-3,2.4951e-2,9.4706e-2,2.5982e-1,2.1732e-1,9.2445e-2,1.8219e-2,3.7653e-4] + d_v: [2.4035e-5,1.1232e-4,5.1245e-4,2.2582e-3,9.4134e-3,3.5243e-2,8.9780e-2,6.0165e-2,1.8539e-2,2.2090e-3,1.5285e-5] + L_m: [1.1180e-4,2.2855e-4,4.6965e-4,9.4866e-4,1.7698e-3,2.6108e-3,1.4862e-3,1.9984e-4,1.3804e-5,2.5004e-7,4.855e-11] + L_p: [4.6896e-3,9.8538e-3,1.8815e-2,3.0816e-2,3.8618e-2,2.8761e-2,8.3807e-3,1.2086e-3,7.8411e-5,9.8927e-7,2.005e-9] + s_p: [-1.8050e-3,-3.8554e-3,-7.2936e-3,-1.1297e-2,-1.1654e-2,-2.3471e-3,3.1615e-3,3.9371e-4,2.9799e-5,7.5552e-7,-7.599e-10] + c_p: [-1.2637e-3,-2.7780e-3,-5.1597e-3,-7.1323e-3,-3.8925e-3,9.7827e-3,1.0522e-2,1.3919e-3,9.8805e-5,2.0057e-6,-5.171e-10] + b_p: [-1.0544e-3,-2.2077e-3,-3.8359e-3,-4.7404e-3,-1.5608e-3,7.5188e-3,6.1973e-3,7.6929e-4,5.7333e-5,1.4438e-6,3.809e-10] + g: [2.1305e-2,5.4411e-2,1.2368e-1,2.4503e-1,3.9912e-1,4.5698e-1,1.9561e-1,3.3906e-2,4.6166e-3,3.0231e-4,1.3232e-6] + part3: # mu_r^2 = 1/2 mu_f^2 + u_v: [7.6699e-5,3.5067e-4,1.5611e-3,6.6957e-3,2.7125e-2,9.8758e-2,2.5572e-1,2.0497e-1,8.4404e-2,1.6013e-2,3.0848e-4] + d_v: [2.9289e-5,1.3364e-4,5.9329e-4,2.5346e-3,1.0200e-2,3.6602e-2,8.7847e-2,5.6318e-2,1.6775e-2,1.9215e-3,1.2377e-5] + L_m: [1.1912e-4,2.4707e-4,5.1593e-4,1.0509e-3,1.9310e-3,2.6980e-3,1.4179e-3,1.8228e-4,1.2174e-5,2.1196e-7,3.829e-11] + L_p: [5.8548e-3,1.1806e-2,2.1406e-2,3.2903e-2,3.7698e-2,2.3675e-2,6.7523e-3,1.2965e-3,1.1604e-4,3.6047e-6,8.129e-9] + s_p: [-2.3667e-3,-4.7934e-3,-8.5248e-3,-1.2252e-2,-1.1127e-2,5.1386e-5,3.5944e-3,2.6142e-4,2.8309e-6,-7.4260e-7,-3.873e-9] + c_p: [-1.8030e-3,-3.6731e-3,-6.3125e-3,-7.9608e-3,-3.2334e-3,1.2092e-2,1.0578e-2,1.1713e-3,6.3682e-5,3.1714e-7,-3.681e-9] + b_p: [-1.4521e-3,-2.7846e-3,-4.4072e-3,-4.8402e-3,-7.5827e-4,8.6053e-3,6.0904e-3,6.8941e-4,4.7009e-5,9.6419e-7,-6.816e-10] + g: [3.1009e-2,7.2690e-2,1.5274e-1,2.8097e-1,4.2756e-1,4.6241e-1,1.8838e-1,3.1884e-2,4.3221e-3,2.8268e-4,1.2009e-6] + + + + + From c1c9de5387dc61496a29f30b74e08d0020f1f96a Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Tue, 31 Jan 2023 18:49:07 +0100 Subject: [PATCH 33/67] make NNLO bench working --- .../polarized/space_like/as3.py | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as3.py b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py index f3966dc3e..9ba7c32db 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as3.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as3.py @@ -1,4 +1,4 @@ -"""This file contains the |NNLO| polarized Altarelli-Parisi splitting kernels.""" +"""The |NNLO| polarized Altarelli-Parisi splitting kernels.""" import numba as nb import numpy as np @@ -13,7 +13,7 @@ @nb.njit(cache=True) def gamma_gg(N, nf, sx): - """Compute the parametrized |NNLO| gluon-gluon polarized anomalous dimension. + r"""Compute the parametrized |NNLO| gluon-gluon polarized anomalous dimension. Implement Eq. (4.12) of :cite:`Moch:2014sna`. @@ -90,7 +90,7 @@ def gamma_gg(N, nf, sx): @nb.njit(cache=True) def gamma_qg(N, nf, sx): - """Compute the parametrized |NNLO| quark-gluon polarized anomalous dimension. + r"""Compute the parametrized |NNLO| quark-gluon polarized anomalous dimension. Implement Eq. (4.10) of :cite:`Moch:2014sna`. @@ -153,7 +153,7 @@ def gamma_qg(N, nf, sx): @nb.njit(cache=True) def gamma_gq(N, nf, sx): - """Compute the parametrized |NNLO| gluon-quark polarized anomalous dimension. + r"""Compute the parametrized |NNLO| gluon-quark polarized anomalous dimension. Implement Eq. (4.11) of :cite:`Moch:2014sna`. @@ -229,7 +229,7 @@ def gamma_gq(N, nf, sx): @nb.njit(cache=True) def gamma_ps(N, nf, sx): - """Compute the parametrized |NNLO| pure-singlet quark-quark polarized anomalous dimension. + r"""Compute the parametrized |NNLO| pure-singlet quark-quark polarized anomalous dimension. Implement Eq. (4.9) of :cite:`Moch:2014sna`. @@ -320,30 +320,30 @@ def gamma_ps(N, nf, sx): @nb.njit(cache=True) def gamma_nss(N, nf, sx): - """ - Compute the |NNLO| sea-like polarized non-singlet anomalous dimension. + r"""Compute the |NNLO| sea-like polarized non-singlet anomalous dimension. Implement Eq. (24) of :cite:`Moch:2015usa`. Parameters ---------- - n : complex - Mellin moment - nf : int - Number of active flavors - sx : np.ndarray - List of harmonic sums: :math:`S_{1},S_{2},S_{3},S_{4}` + n : complex + Mellin moment + nf : int + Number of active flavors + sx : np.ndarray + List of harmonic sums: :math:`S_{1},S_{2},S_{3},S_{4}` Returns ------- - gamma_nsv : complex - |NNLO| valence non-singlet anomalous dimension - :math:`\\gamma_{ns,s}^{(2)}(N)` + complex + |NNLO| valence non-singlet anomalous dimension + :math:`\\gamma_{ns,s}^{(2)}(N)` + """ S1 = sx[0] S3 = sx[2] - Sm1, Sm2, Sm3 = harmonics.smx(N, sx, True) - Sm21 = harmonics.Sm21(N, S1, Sm1, True) + Sm1, Sm2, Sm3, _ = harmonics.smx(N, sx, False) + Sm21 = harmonics.Sm21(N, S1, Sm1, False) nss_nf1 = ( 40 / 9 @@ -376,25 +376,25 @@ def gamma_nss(N, nf, sx): @nb.njit(cache=True) def gamma_nsv(N, nf, sx): - """ - Compute the |NNLO| valence polarized non-singlet anomalous dimension. + r"""Compute the |NNLO| valence polarized non-singlet anomalous dimension. Implement Eq. (23) of :cite:`Moch:2015usa`. Parameters ---------- - n : complex - Mellin moment - nf : int - Number of active flavors - sx : list - harmonics cache + n : complex + Mellin moment + nf : int + Number of active flavors + sx : list + harmonics cache Returns ------- - gamma_nsv : complex - |NNLO| valence non-singlet anomalous dimension - :math:`\\gamma_{ns,v}^{(2)}(N)` + complex + |NNLO| valence non-singlet anomalous dimension + :math:`\\gamma_{ns,v}^{(2)}(N)` + """ return gamma_nsm(N, nf, sx) + gamma_nss(N, nf, sx) From eaa8c11ce9b290a93010c03c173351ea17f2f4e7 Mon Sep 17 00:00:00 2001 From: aschaus Date: Tue, 31 Jan 2023 19:41:10 +0100 Subject: [PATCH 34/67] incorporates Polarized --- .../benchmark/external/LHA_polarized.yaml | 4 +-- src/ekomark/benchmark/external/LHA_utils.py | 27 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/ekomark/benchmark/external/LHA_polarized.yaml b/src/ekomark/benchmark/external/LHA_polarized.yaml index bdbdc22df..80bb97327 100644 --- a/src/ekomark/benchmark/external/LHA_polarized.yaml +++ b/src/ekomark/benchmark/external/LHA_polarized.yaml @@ -31,7 +31,7 @@ table16: # LO g: [1.3726e-2,4.1011e-2,1.0615e-1,2.3343e-1,4.0743e-1,4.7445e-1,1.9402e-1,3.1960e-2,4.1226e-3,2.4888e-4,9.2939e-7] -table15: # NLO FFNS at mu_f^2 = 1e4 +table17: # NLO FFNS at mu_f^2 = 1e4 part1: # mu_r^2 = mu_f^2 u_v: [6.7336e-5,3.1280e-4,1.4180e-3,6.2085e-3,2.5741e-2,9.6288e-2,2.5843e-1,2.1248e-1,8.9180e-2,1.7300e-2,3.4726e-4] d_v: [-2.5747e-5,-1.1938e-4,-5.3982e-4,-2.3546e-3,-9.7004e-3,-3.5778e-2,-8.9093e-2,-5.8641e-2,-1.7817e-2,-2.0885e-3,-1.4028e-5] @@ -58,7 +58,7 @@ table15: # NLO FFNS at mu_f^2 = 1e4 g: [3.2071e-2,7.5123e-2,1.5788e-1,2.9079e-1,4.4380e-1,4.8272e-1,1.9831e-1,3.3524e-2,4.5044e-3,2.9100e-4,1.2230e-6] -table16: # NLO ZM-VFNS at mu_f^2 = 1e4 +table18: # NLO ZM-VFNS at mu_f^2 = 1e4 part1: # mu_r^2 = mu_f^2 u_v: [6.8787e-5,3.1881e-4,1.4413e-3,6.2902e-3,2.5980e-2,9.6750e-2,2.5807e-1,2.1104e-1,8.8199e-2,1.7027e-2,3.3898e-4] d_v: [2.6297e-5,1.2165e-4,5.4856e-4,2.3849e-3,9.7872e-3,3.5935e-2,8.8905e-2,5.8186e-2,1.7601e-2,2.0531e-3,1.3676e-5] diff --git a/src/ekomark/benchmark/external/LHA_utils.py b/src/ekomark/benchmark/external/LHA_utils.py index b9a000ae6..406931cfe 100644 --- a/src/ekomark/benchmark/external/LHA_utils.py +++ b/src/ekomark/benchmark/external/LHA_utils.py @@ -133,12 +133,18 @@ def compute_LHA_data( Q2grid = operators["Q2grid"] if not np.allclose(Q2grid, [1e4]): raise ValueError("Q2grid has to be [1e4]") + order = theory["PTO"] + # select which data + if operators["polarized"] == True and order <= 1: + yaml_file = "LHA_polarized.yaml" + elif operators["polarized"] == True and order > 1: + raise ValueError("LHA tables beyond NLO do not exist") + elif operators["polarized"] == False: + yaml_file = "LHA.yaml" # load data - with open(here / "LHA.yaml", encoding="utf-8") as o: + with open(here / yaml_file, encoding="utf-8") as o: data = yaml.safe_load(o) - fns = theory["FNS"] - order = theory["PTO"] xif = (theory["fact_to_ren_scale_ratio"]) ** 2 if order == 0 and xif != 1.0: raise ValueError("LO LHA tables with scale variations are not available") @@ -153,7 +159,7 @@ def compute_LHA_data( part = 2 else: part = 1 - + # Not adding if polarised and if order NNLO restriction here since above returns exception already if fns == "FFNS": if order == 0: table = 2 @@ -185,9 +191,10 @@ def compute_LHA_data( return ref -def save_initial_scale_plots_to_pdf(path): +# used pol as argument since what the rest of the operator card says wouldn't matter for the purpose of making figures +def save_initial_scale_plots_to_pdf(path, is_pol): """ - Plots all PDFs at the inital scale. + Plots all PDFs at the inital scale . The reference values are given in Table 2 part 1 of :cite:`Giele:2002hx`. @@ -198,9 +205,15 @@ def save_initial_scale_plots_to_pdf(path): ---------- path : str output path + is_pol : bool + polarized pdf data """ # load data - with open(here / "LHA.yaml", encoding="utf-8") as o: + if bool(is_pol) == False: + yaml_file = "LHA.yaml" + else: + yaml_file = "LHA_polarized.yaml" + with open(here / yaml_file, encoding="utf-8") as o: data = yaml.safe_load(o) LHA_init_grid_ref = data["table2"]["part1"] with PdfPages(path) as pp: From 3864dbf62f6105fb769c707bf951475a34cb3280 Mon Sep 17 00:00:00 2001 From: aschaus Date: Tue, 31 Jan 2023 20:36:53 +0100 Subject: [PATCH 35/67] Minor bug to be fixed --- benchmarks/lha_paper_bench.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/benchmarks/lha_paper_bench.py b/benchmarks/lha_paper_bench.py index 9914ca3c1..a15d080cf 100644 --- a/benchmarks/lha_paper_bench.py +++ b/benchmarks/lha_paper_bench.py @@ -3,9 +3,11 @@ """ import numpy as np from banana import register +from banana.data import cartesian_product from eko.interpolation import lambertgrid from ekomark.benchmark.runner import Runner +from ekomark.data import operators register(__file__) @@ -59,6 +61,15 @@ def plain_theory(self, pto): th.update({"PTO": pto}) return [th] + def plain_pol_theory(self, pto): + """Generate plain polarized theories at given PTO""" + + th = self.theory.copy() + th.update({"PTO": [pto]}) + op = operators.lhapdf_config.copy() + op["polarized"] = [True] + self.run(cartesian_product(th), operators.build(op), ["ToyLH_polarized"]) + def sv_theories(self, pto): """Generate scale variation theories. @@ -122,6 +133,10 @@ def benchmark_plain(self, pto): """Run plain configuration.""" self.run_lha(self.plain_theory(pto)) + def benchmark_pol(self, pto): + """Run plain configuration.""" + self.run_lha(self.plain_pol_theory(pto)) + def benchmark_sv(self, pto): """Run scale variations.""" self.run_lha(self.sv_theories(pto)) @@ -223,7 +238,7 @@ def benchmark_sv(self, pto): obj = BenchmarkVFNS() # obj = BenchmarkFFNS() - obj.benchmark_plain(0) + obj.benchmark_pol(1) # obj.benchmark_sv(2) # # VFNS benchmarks with LHA settings From 1798bd2fdbf3df5f6e74aa53d0b6a543fcbf1bba Mon Sep 17 00:00:00 2001 From: aschaus Date: Wed, 1 Feb 2023 14:29:12 +0100 Subject: [PATCH 36/67] error to fix --- benchmarks/lha_paper_bench.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/lha_paper_bench.py b/benchmarks/lha_paper_bench.py index a15d080cf..f241d3e47 100644 --- a/benchmarks/lha_paper_bench.py +++ b/benchmarks/lha_paper_bench.py @@ -238,7 +238,7 @@ def benchmark_sv(self, pto): obj = BenchmarkVFNS() # obj = BenchmarkFFNS() - obj.benchmark_pol(1) + obj.benchmark_pol(0) # obj.benchmark_sv(2) # # VFNS benchmarks with LHA settings From 2ffce745ad1ca3591604aa0cee77540ae38188d0 Mon Sep 17 00:00:00 2001 From: aschaus Date: Wed, 1 Feb 2023 15:23:07 +0100 Subject: [PATCH 37/67] data table retrieval fixed --- src/ekomark/benchmark/external/LHA_utils.py | 37 ++++++++++++++------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/ekomark/benchmark/external/LHA_utils.py b/src/ekomark/benchmark/external/LHA_utils.py index 406931cfe..3e27edaf4 100644 --- a/src/ekomark/benchmark/external/LHA_utils.py +++ b/src/ekomark/benchmark/external/LHA_utils.py @@ -129,17 +129,17 @@ def compute_LHA_data( ref : dict output containing: target_xgrid, values """ - + Polarized= operators["polarized"] Q2grid = operators["Q2grid"] if not np.allclose(Q2grid, [1e4]): raise ValueError("Q2grid has to be [1e4]") order = theory["PTO"] # select which data - if operators["polarized"] == True and order <= 1: + if Polarized == True and order <= 1: yaml_file = "LHA_polarized.yaml" - elif operators["polarized"] == True and order > 1: - raise ValueError("LHA tables beyond NLO do not exist") - elif operators["polarized"] == False: + elif Polarized == True and order > 1: + raise ValueError("LHA tables beyond NLO do not exist for Polarized Case") + elif Polarized == False: yaml_file = "LHA.yaml" # load data with open(here / yaml_file, encoding="utf-8") as o: @@ -159,22 +159,33 @@ def compute_LHA_data( part = 2 else: part = 1 - # Not adding if polarised and if order NNLO restriction here since above returns exception already if fns == "FFNS": if order == 0: - table = 2 part = 2 + if Polarized == False: + table = 2 + else: + table = 16 elif order == 1: - table = 3 + if Polarized == False: + table = 3 + else: + table = 17 elif order == 2: is_ffns_nnlo = True table = 14 elif fns == "ZM-VFNS": if order == 0: - table = 2 part = 3 + if Polarized == False: + table = 2 + else: + table = 16 elif order == 1: - table = 4 + if Polarized == False: + table = 4 + else: + table = 18 elif order == 2: table = 15 @@ -211,11 +222,13 @@ def save_initial_scale_plots_to_pdf(path, is_pol): # load data if bool(is_pol) == False: yaml_file = "LHA.yaml" + table= "table2" else: yaml_file = "LHA_polarized.yaml" + table= "table16" with open(here / yaml_file, encoding="utf-8") as o: data = yaml.safe_load(o) - LHA_init_grid_ref = data["table2"]["part1"] + LHA_init_grid_ref = data[table]["part1"] with PdfPages(path) as pp: # iterate all raw labels for j, label in enumerate(raw_label_list): @@ -233,4 +246,4 @@ def save_initial_scale_plots_to_pdf(path, is_pol): ) pp.savefig() plt.close(fig) - print(f"Initial scale pdf plots written to {path}") + print(f"Initial scale pdf plots written to {path}") \ No newline at end of file From b27a63f90bba5443571e0b8bb55c8d5418be9850 Mon Sep 17 00:00:00 2001 From: aschaus Date: Fri, 3 Feb 2023 13:09:03 +0100 Subject: [PATCH 38/67] Benchmark pol works, pre-commit issue --- benchmarks/lha_paper_bench.py | 64 ++++++++++++++----- .../benchmark/external/LHA_polarized.yaml | 36 +++++------ src/ekomark/benchmark/external/LHA_utils.py | 37 ++++++----- 3 files changed, 88 insertions(+), 49 deletions(-) diff --git a/benchmarks/lha_paper_bench.py b/benchmarks/lha_paper_bench.py index f241d3e47..8c6221e6a 100644 --- a/benchmarks/lha_paper_bench.py +++ b/benchmarks/lha_paper_bench.py @@ -61,15 +61,6 @@ def plain_theory(self, pto): th.update({"PTO": pto}) return [th] - def plain_pol_theory(self, pto): - """Generate plain polarized theories at given PTO""" - - th = self.theory.copy() - th.update({"PTO": [pto]}) - op = operators.lhapdf_config.copy() - op["polarized"] = [True] - self.run(cartesian_product(th), operators.build(op), ["ToyLH_polarized"]) - def sv_theories(self, pto): """Generate scale variation theories. @@ -133,10 +124,6 @@ def benchmark_plain(self, pto): """Run plain configuration.""" self.run_lha(self.plain_theory(pto)) - def benchmark_pol(self, pto): - """Run plain configuration.""" - self.run_lha(self.plain_pol_theory(pto)) - def benchmark_sv(self, pto): """Run scale variations.""" self.run_lha(self.sv_theories(pto)) @@ -232,13 +219,58 @@ def benchmark_sv(self, pto): self.run_lha([low, high]) +class BenchmarkFFNS_polarized(BenchmarkFFNS): + def run_lha(self, theory_updates): + """Enforce operator grid and PDF. + + Parameters + ---------- + theory_updates : list(dict) + theory updates + """ + self.run( + theory_updates, + [ + { + "Q2grid": [1e4], + "ev_op_iterations": 10, + "interpolation_xgrid": lambertgrid(60).tolist(), + "polarized": True, + } + ], + ["ToyLH_polarized"], + ) + + +class BenchmarkVFNS_polarized(BenchmarkVFNS): + def run_lha(self, theory_updates): + """Enforce operator grid and PDF. + + Parameters + ---------- + theory_updates : list(dict) + theory updates + """ + self.run( + theory_updates, + [ + { + "Q2grid": [1e4], + "ev_op_iterations": 10, + "interpolation_xgrid": lambertgrid(60).tolist(), + "polarized": True, + } + ], + ["ToyLH_polarized"], + ) + + if __name__ == "__main__": # Benchmark to LHA - obj = BenchmarkVFNS() + obj = BenchmarkFFNS_polarized() # obj = BenchmarkFFNS() - - obj.benchmark_pol(0) + obj.benchmark_plain(0) # obj.benchmark_sv(2) # # VFNS benchmarks with LHA settings diff --git a/src/ekomark/benchmark/external/LHA_polarized.yaml b/src/ekomark/benchmark/external/LHA_polarized.yaml index 80bb97327..92c22a7e8 100644 --- a/src/ekomark/benchmark/external/LHA_polarized.yaml +++ b/src/ekomark/benchmark/external/LHA_polarized.yaml @@ -2,9 +2,9 @@ table16: # LO part1: # mu_f^2 = mu_{f,0}^2 (=2) u_v: [1.6366e-5,8.2024e-5,4.1110e-4,2.0604e-3,1.0326e-2,5.1723e-2,2.4582e-1,3.6473e-1,2.5008e-1,8.4769e-2,4.4680e-3] - d_v: [ 6.2946e-6,3.1548e-5,1.5811e-4,7.9245e-4,3.9716e-3,1.9886e-2,9.1636e-2,1.1370e-1,5.7710e-2,1.1990e-2,2.1365e-4] - L_m: [7.9433e-5,1.5849e-4,3.1621e-4,6.3052e-4,1.2501e-3,2.3412e-3,2.3972e-3,5.7388e-4,6.3457e-5,1.9651e-6,9.689e-10] - L_p: [1.5887e-3,3.1698e-3,6.3241e-3,1.2610e-2,2.5003e-2,4.6825e-2,4.7943e-2,1.1478e-2,1.2691e-3,3.9301e-5,1.9378e-8] + d_v: [-6.2946e-6,-3.1548e-5,-1.5811e-4,-7.9245e-4,-3.9716e-3,-1.9886e-2,-9.1636e-2,-1.1370e-1,-5.7710e-2,-1.1990e-2,-2.1365e-4] + L_m: [-7.9433e-5,-1.5849e-4,-3.1621e-4,-6.3052e-4,-1.2501e-3,-2.3412e-3,-2.3972e-3,-5.7388e-4,-6.3457e-5,-1.9651e-6,-9.689e-10] + L_p: [-1.5887e-3,-3.1698e-3,-6.3241e-3,-1.2610e-2,-2.5003e-2,-4.6825e-2,-4.7943e-2,-1.1478e-2,-1.2691e-3,-3.9301e-5,-1.9378e-8] s_p: [-3.9716e-4,-7.9244e-4,-1.5810e-3,-3.1526e-3,-6.2507e-3,-1.1706e-2,-1.1986e-2,-2.8694e-3,-3.1729e-4,-9.8254e-6,-4.8444e-9] c_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] @@ -12,9 +12,9 @@ table16: # LO part2: # FFNS at mu_f^2 = 1e4 u_v: [4.8350e-5,2.3504e-4,1.1220e-3,5.1990e-3,2.2900e-2,9.1489e-2,2.6494e-1,2.2668e-1,9.7647e-2,1.9545e-2,4.1768e-4] - d_v: [1.8556e-5,9.0090e-5,4.2916e-4,1.9818e-3,8.6763e-3,3.4200e-2,9.1898e-2,6.2946e-2,1.9652e-2,2.3809e-3,1.7059e-5] - L_m: [1.0385e-4,2.0700e-4,4.1147e-4,8.0948e-4,1.5309e-3,2.4502e-3,1.5309e-3,2.1104e-4,1.4789e-5,2.7279e-7,5.494e-11] - L_p: [3.5124e-3,7.7716e-3,1.6007e-2,2.8757e-2,4.0166e-2,3.3928e-2,8.5427e-3,6.6698e-4,-1.8850e-5,-4.1807e-6,-7.6712e-9] + d_v: [-1.8556e-5,-9.0090e-5,-4.2916e-4,-1.9818e-3,-8.6763e-3,-3.4200e-2,-9.1898e-2,-6.2946e-2,-1.9652e-2,-2.3809e-3,-1.7059e-5] + L_m: [-1.0385e-4,-2.0700e-4,-4.1147e-4,-8.0948e-4,-1.5309e-3,2.4502e-3,-1.5309e-3,-2.1104e-4,-1.4789e-5,-2.7279e-7,-5.494e-11] + L_p: [-3.5124e-3,-7.7716e-3,-1.6007e-2,-2.8757e-2,-4.0166e-2,-3.3928e-2,-8.5427e-3,-6.6698e-4,1.8850e-5,4.1807e-6,7.6712e-9] s_p: [-1.2370e-3,-2.8508e-3,-5.9463e-3,-1.0331e-2,-1.2428e-2,-4.7126e-3,3.3830e-3,7.2173e-4,8.3371e-5,3.4543e-6,4.1103e-9] c_p: [-7.1774e-4,-1.8158e-3,-3.8889e-3,-6.2836e-3,-4.7739e-3,7.5385e-3,1.1037e-2,1.7769e-3,1.5732e-4,4.8183e-6,4.3850e-9] b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] @@ -22,9 +22,9 @@ table16: # LO part3: # ZM-VFNS at mu_f^2 = 1e4 u_v: [4.9026e-5,2.3818e-4,1.1359e-3,5.2567e-3,2.3109e-2,9.2035e-2,2.6478e-1,2.2495e-1,9.6318e-2,1.9147e-2,4.0430e-4] - d_v: [1.8815e-5,9.1286e-5,4.3445e-4,2.0035e-3,8.7537e-3,3.4391e-2,9.1762e-2,6.2376e-2,1.9353e-2,2.3281e-3,1.6480e-5] - L_m: [1.0422e-4,2.0774e-4,4.1289e-4,8.1206e-4,1.5345e-3,2.4501e-3,1.5206e-3,2.0811e-4,1.4496e-5,2.6556e-7,5.285e-11] - L_p: [3.5315e-3,7.8108e-3,1.6070e-2,2.8811e-2,4.0125e-2,3.3804e-2,8.5181e-3,6.6195e-4,-1.8549e-5,-4.0936e-6,-7.4351e-9] + d_v: [-1.8815e-5,-9.1286e-5,-4.3445e-4,-2.0035e-3,-8.7537e-3,-3.4391e-2,-9.1762e-2,-6.2376e-2,-1.9353e-2,-2.3281e-3,-1.6480e-5] + L_m: [-1.0422e-4,-2.0774e-4,-4.1289e-4,-8.1206e-4,-1.5345e-3,-2.4501e-3,-1.5206e-3,-2.0811e-4,-1.4496e-5,-2.6556e-7,-5.285e-11] + L_p: [-3.5315e-3,-7.8108e-3,-1.6070e-2,-2.8811e-2,-4.0125e-2,-3.3804e-2,-8.5181e-3,-6.6195e-4,1.8549e-5,4.0936e-6,7.4351e-9] s_p: [-1.2447e-3,-2.8667e-3,-5.9705e-3,-1.0345e-2,-1.2390e-2,-4.6512e-3,3.3438e-3,7.0957e-4,8.1756e-5,3.3746e-6,3.9818e-9] c_p: [-7.2356e-4,-1.8280e-3,-3.9060e-3,-6.2849e-3,-4.7174e-3,7.5994e-3,1.0947e-2,1.7501e-3,1.5424e-4,4.7024e-6,4.2460e-9] b_p: [-6.2276e-4,-1.5301e-3,-3.1196e-3,-4.5871e-3,-2.4822e-3,6.4665e-3,6.5223e-3,9.2045e-4,7.8577e-5,2.4901e-6,2.6319e-9] @@ -61,27 +61,27 @@ table17: # NLO FFNS at mu_f^2 = 1e4 table18: # NLO ZM-VFNS at mu_f^2 = 1e4 part1: # mu_r^2 = mu_f^2 u_v: [6.8787e-5,3.1881e-4,1.4413e-3,6.2902e-3,2.5980e-2,9.6750e-2,2.5807e-1,2.1104e-1,8.8199e-2,1.7027e-2,3.3898e-4] - d_v: [2.6297e-5,1.2165e-4,5.4856e-4,2.3849e-3,9.7872e-3,3.5935e-2,8.8905e-2,5.8186e-2,1.7601e-2,2.0531e-3,1.3676e-5] - L_m: [1.1496e-4,2.3638e-4,4.8893e-4,9.9100e-4,1.8364e-3,2.6452e-3,1.4509e-3,1.9054e-4,1.2924e-5,2.2921e-7,4.284e-11] - L_p: [5.2176e-3,1.0770e-2,2.0077e-2,3.1883e-2,3.8224e-2,2.6306e-2,7.4778e-3,1.2026e-3,8.9668e-5,1.9243e-6,4.260e-9] + d_v: [-2.6297e-5,-1.2165e-4,-5.4856e-4,-2.3849e-3,-9.7872e-3,-3.5935e-2,-8.8905e-2,-5.8186e-2,-1.7601e-2,-2.0531e-3,-1.3676e-5] + L_m: [-1.1496e-4,-2.3638e-4,-4.8893e-4,-9.9100e-4,-1.8364e-3,-2.6452e-3,-1.4509e-3,-1.9054e-4,-1.2924e-5,-2.2921e-7,-4.284e-11] + L_p: [-5.2176e-3,-1.0770e-2,-2.0077e-2,-3.1883e-2,-3.8224e-2,-2.6306e-2,-7.4778e-3,-1.2026e-3,-8.9668e-5,-1.9243e-6,-4.260e-9] s_p: [-2.0592e-3,-4.2953e-3,-7.8934e-3,-1.1785e-2,-1.1416e-2,-1.1774e-3,3.4207e-3,3.4999e-4,1.9771e-5,1.8384e-7,-1.916e-9] c_p: [-1.5076e-3,-3.1979e-3,-5.7228e-3,-7.5596e-3,-3.5879e-3,1.0917e-2,1.0591e-2,1.3015e-3,8.4378e-5,1.3298e-6,-1.701e-9] b_p: [-1.2411e-3,-2.4951e-3,-4.1488e-3,-4.8420e-3,-1.1723e-3,8.1196e-3,6.1480e-3,7.2795e-4,5.2125e-5,1.2157e-6,-7.492e-11] g: [2.5681e-2,6.3021e-2,1.3809e-1,2.6411e-1,4.1601e-1,4.6178e-1,1.9143e-1,3.2621e-2,4.4207e-3,2.8887e-4,1.2435e-6] part2: # mu_r^2 = 2mu_f^2 u_v: [6.2819e-5,2.9408e-4,1.3450e-3,5.9485e-3,2.4951e-2,9.4706e-2,2.5982e-1,2.1732e-1,9.2445e-2,1.8219e-2,3.7653e-4] - d_v: [2.4035e-5,1.1232e-4,5.1245e-4,2.2582e-3,9.4134e-3,3.5243e-2,8.9780e-2,6.0165e-2,1.8539e-2,2.2090e-3,1.5285e-5] - L_m: [1.1180e-4,2.2855e-4,4.6965e-4,9.4866e-4,1.7698e-3,2.6108e-3,1.4862e-3,1.9984e-4,1.3804e-5,2.5004e-7,4.855e-11] - L_p: [4.6896e-3,9.8538e-3,1.8815e-2,3.0816e-2,3.8618e-2,2.8761e-2,8.3807e-3,1.2086e-3,7.8411e-5,9.8927e-7,2.005e-9] + d_v: [-2.4035e-5,-1.1232e-4,-5.1245e-4,-2.2582e-3,-9.4134e-3,-3.5243e-2,-8.9780e-2,-6.0165e-2,-1.8539e-2,-2.2090e-3,-1.5285e-5] + L_m: [-1.1180e-4,-2.2855e-4,-4.6965e-4,-9.4866e-4,-1.7698e-3,-2.6108e-3,-1.4862e-3,-1.9984e-4,-1.3804e-5,-2.5004e-7,-4.855e-11] + L_p: [-4.6896e-3,-9.8538e-3,-1.8815e-2,-3.0816e-2,-3.8618e-2,-2.8761e-2,-8.3807e-3,-1.2086e-3,-7.8411e-5,-9.8927e-7,-2.005e-9] s_p: [-1.8050e-3,-3.8554e-3,-7.2936e-3,-1.1297e-2,-1.1654e-2,-2.3471e-3,3.1615e-3,3.9371e-4,2.9799e-5,7.5552e-7,-7.599e-10] c_p: [-1.2637e-3,-2.7780e-3,-5.1597e-3,-7.1323e-3,-3.8925e-3,9.7827e-3,1.0522e-2,1.3919e-3,9.8805e-5,2.0057e-6,-5.171e-10] b_p: [-1.0544e-3,-2.2077e-3,-3.8359e-3,-4.7404e-3,-1.5608e-3,7.5188e-3,6.1973e-3,7.6929e-4,5.7333e-5,1.4438e-6,3.809e-10] g: [2.1305e-2,5.4411e-2,1.2368e-1,2.4503e-1,3.9912e-1,4.5698e-1,1.9561e-1,3.3906e-2,4.6166e-3,3.0231e-4,1.3232e-6] part3: # mu_r^2 = 1/2 mu_f^2 u_v: [7.6699e-5,3.5067e-4,1.5611e-3,6.6957e-3,2.7125e-2,9.8758e-2,2.5572e-1,2.0497e-1,8.4404e-2,1.6013e-2,3.0848e-4] - d_v: [2.9289e-5,1.3364e-4,5.9329e-4,2.5346e-3,1.0200e-2,3.6602e-2,8.7847e-2,5.6318e-2,1.6775e-2,1.9215e-3,1.2377e-5] - L_m: [1.1912e-4,2.4707e-4,5.1593e-4,1.0509e-3,1.9310e-3,2.6980e-3,1.4179e-3,1.8228e-4,1.2174e-5,2.1196e-7,3.829e-11] - L_p: [5.8548e-3,1.1806e-2,2.1406e-2,3.2903e-2,3.7698e-2,2.3675e-2,6.7523e-3,1.2965e-3,1.1604e-4,3.6047e-6,8.129e-9] + d_v: [-2.9289e-5,-1.3364e-4,-5.9329e-4,-2.5346e-3,-1.0200e-2,-3.6602e-2,-8.7847e-2,-5.6318e-2,-1.6775e-2,-1.9215e-3,-1.2377e-5] + L_m: [-1.1912e-4,-2.4707e-4,-5.1593e-4,-1.0509e-3,-1.9310e-3,-2.6980e-3,-1.4179e-3,-1.8228e-4,-1.2174e-5,-2.1196e-7,-3.829e-11] + L_p: [-5.8548e-3,-1.1806e-2,-2.1406e-2,-3.2903e-2,-3.7698e-2,-2.3675e-2,-6.7523e-3,-1.2965e-3,-1.1604e-4,-3.6047e-6,-8.129e-9] s_p: [-2.3667e-3,-4.7934e-3,-8.5248e-3,-1.2252e-2,-1.1127e-2,5.1386e-5,3.5944e-3,2.6142e-4,2.8309e-6,-7.4260e-7,-3.873e-9] c_p: [-1.8030e-3,-3.6731e-3,-6.3125e-3,-7.9608e-3,-3.2334e-3,1.2092e-2,1.0578e-2,1.1713e-3,6.3682e-5,3.1714e-7,-3.681e-9] b_p: [-1.4521e-3,-2.7846e-3,-4.4072e-3,-4.8402e-3,-7.5827e-4,8.6053e-3,6.0904e-3,6.8941e-4,4.7009e-5,9.6419e-7,-6.816e-10] diff --git a/src/ekomark/benchmark/external/LHA_utils.py b/src/ekomark/benchmark/external/LHA_utils.py index 3e27edaf4..5b6817d66 100644 --- a/src/ekomark/benchmark/external/LHA_utils.py +++ b/src/ekomark/benchmark/external/LHA_utils.py @@ -1,6 +1,7 @@ """ Implementation of :cite:`Giele:2002hx` and :cite:`Dittmar:2005ed` (NNLO) """ +from functools import partialmethod import pathlib import numpy as np @@ -95,11 +96,16 @@ def rotate_data(raw, is_ffns_nnlo=False, rotate_to_evolution_basis=False): # s_v = c_v count twice to_evolution[3, 4] = -2 to_evolution[3, -4] = 2 - + # if is_pol_nlo: + # label_list = np.delete(label_list, -2) + # to_flavor= np.array(to_flavor) + # # change the rotation matrix + # b_line = ([0, 0, 0, 0, 0, 0, 1 / 2, 0]) + # indices = np.where(np.all(to_flavor == b_line, axis=1))[0] + # to_flavor = np.delete(to_flavor, indices, axis=0) for l in label_list: inp.append(raw[l]) inp = np.array(inp) - flav_pdfs = np.dot(to_flavor, inp) # additional rotation to evolution basis if necessary @@ -129,15 +135,15 @@ def compute_LHA_data( ref : dict output containing: target_xgrid, values """ - Polarized= operators["polarized"] + Polarized = operators["polarized"] Q2grid = operators["Q2grid"] if not np.allclose(Q2grid, [1e4]): raise ValueError("Q2grid has to be [1e4]") order = theory["PTO"] # select which data - if Polarized == True and order <= 1: + if Polarized and order <= 1: yaml_file = "LHA_polarized.yaml" - elif Polarized == True and order > 1: + elif Polarized and order > 1: raise ValueError("LHA tables beyond NLO do not exist for Polarized Case") elif Polarized == False: yaml_file = "LHA.yaml" @@ -151,6 +157,7 @@ def compute_LHA_data( table = None part = None is_ffns_nnlo = False + # is_pol_nlo= False # Switching at the intermediate point. if xif > np.sqrt(2): @@ -162,14 +169,15 @@ def compute_LHA_data( if fns == "FFNS": if order == 0: part = 2 - if Polarized == False: + if Polarized == False: table = 2 else: table = 16 elif order == 1: - if Polarized == False: + if Polarized == False: table = 3 - else: + else: + # is_pol_nlo=True table = 17 elif order == 2: is_ffns_nnlo = True @@ -177,12 +185,12 @@ def compute_LHA_data( elif fns == "ZM-VFNS": if order == 0: part = 3 - if Polarized == False: + if Polarized == False: table = 2 else: table = 16 elif order == 1: - if Polarized == False: + if Polarized == False: table = 4 else: table = 18 @@ -202,12 +210,11 @@ def compute_LHA_data( return ref -# used pol as argument since what the rest of the operator card says wouldn't matter for the purpose of making figures def save_initial_scale_plots_to_pdf(path, is_pol): """ Plots all PDFs at the inital scale . - The reference values are given in Table 2 part 1 of :cite:`Giele:2002hx`. + The reference values are given in Table 2 part 1 or Table 16 part 1 (Polarized) :cite:`Giele:2002hx`. This excercise was usfull in order to detect the missing 2 in the definition of :math:`L_+ = 2(\\bar u + \\bar d)` @@ -222,10 +229,10 @@ def save_initial_scale_plots_to_pdf(path, is_pol): # load data if bool(is_pol) == False: yaml_file = "LHA.yaml" - table= "table2" + table = "table2" else: yaml_file = "LHA_polarized.yaml" - table= "table16" + table = "table16" with open(here / yaml_file, encoding="utf-8") as o: data = yaml.safe_load(o) LHA_init_grid_ref = data[table]["part1"] @@ -246,4 +253,4 @@ def save_initial_scale_plots_to_pdf(path, is_pol): ) pp.savefig() plt.close(fig) - print(f"Initial scale pdf plots written to {path}") \ No newline at end of file + print(f"Initial scale pdf plots written to {path}") From 64f19b3c022bd04ab63ee3174cdf4ed331ffdd16 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 3 Feb 2023 15:13:19 +0100 Subject: [PATCH 39/67] last fix on LHA pol table --- benchmarks/apfel_bench.py | 2 +- benchmarks/lha_paper_bench.py | 2 +- benchmarks/pegasus_bench.py | 8 ++++---- .../benchmark/external/LHA_polarized.yaml | 20 +++++++++---------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/benchmarks/apfel_bench.py b/benchmarks/apfel_bench.py index cb8344ae5..ee1a39bd4 100644 --- a/benchmarks/apfel_bench.py +++ b/benchmarks/apfel_bench.py @@ -202,7 +202,7 @@ def benchmark_sv(self, pto, svmode): # obj = BenchmarkVFNS() obj = BenchmarkFFNS() - obj.benchmark_plain_pol(0) + obj.benchmark_plain_pol(2) # obj.benchmark_plain(2) # obj.benchmark_sv(2, "exponentiated") # obj.benchmark_kthr(2) diff --git a/benchmarks/lha_paper_bench.py b/benchmarks/lha_paper_bench.py index 8c6221e6a..5f112a9a3 100644 --- a/benchmarks/lha_paper_bench.py +++ b/benchmarks/lha_paper_bench.py @@ -270,7 +270,7 @@ def run_lha(self, theory_updates): # Benchmark to LHA obj = BenchmarkFFNS_polarized() # obj = BenchmarkFFNS() - obj.benchmark_plain(0) + obj.benchmark_plain(1) # obj.benchmark_sv(2) # # VFNS benchmarks with LHA settings diff --git a/benchmarks/pegasus_bench.py b/benchmarks/pegasus_bench.py index 672ac0086..e3152148a 100644 --- a/benchmarks/pegasus_bench.py +++ b/benchmarks/pegasus_bench.py @@ -61,12 +61,12 @@ class BenchmarkVFNS(PegasusBenchmark): "nfref": 3, "nf0": 3, } - zm_theory = tolist(zm_theory) + vfns_theory = tolist(zm_theory) def benchmark_plain(self, pto): """Plain configuration""" - th = self.zm_theory.copy() + th = self.vfns_theory.copy() th.update( { "PTO": [pto], @@ -79,7 +79,7 @@ def benchmark_plain(self, pto): def benchmark_sv(self, pto, svmode): """Scale Variation""" - th = self.zm_theory.copy() + th = self.vfns_theory.copy() th.update( { "PTO": [pto], @@ -154,7 +154,7 @@ def benchmark_sv(self, pto, svmode): # obj = BenchmarkVFNS() obj = BenchmarkFFNS() - obj.benchmark_plain_pol(0) + obj.benchmark_plain_pol(1) # obj.benchmark_plain(1) # obj.benchmark_sv(2, "exponentiated") diff --git a/src/ekomark/benchmark/external/LHA_polarized.yaml b/src/ekomark/benchmark/external/LHA_polarized.yaml index 92c22a7e8..48b863132 100644 --- a/src/ekomark/benchmark/external/LHA_polarized.yaml +++ b/src/ekomark/benchmark/external/LHA_polarized.yaml @@ -15,11 +15,11 @@ table16: # LO d_v: [-1.8556e-5,-9.0090e-5,-4.2916e-4,-1.9818e-3,-8.6763e-3,-3.4200e-2,-9.1898e-2,-6.2946e-2,-1.9652e-2,-2.3809e-3,-1.7059e-5] L_m: [-1.0385e-4,-2.0700e-4,-4.1147e-4,-8.0948e-4,-1.5309e-3,2.4502e-3,-1.5309e-3,-2.1104e-4,-1.4789e-5,-2.7279e-7,-5.494e-11] L_p: [-3.5124e-3,-7.7716e-3,-1.6007e-2,-2.8757e-2,-4.0166e-2,-3.3928e-2,-8.5427e-3,-6.6698e-4,1.8850e-5,4.1807e-6,7.6712e-9] - s_p: [-1.2370e-3,-2.8508e-3,-5.9463e-3,-1.0331e-2,-1.2428e-2,-4.7126e-3,3.3830e-3,7.2173e-4,8.3371e-5,3.4543e-6,4.1103e-9] + s_p: [-1.2370e-3,-2.8508e-3,-5.9463e-3,-1.0331e-2,-1.2428e-2,-4.7126e-3,3.3830e-3,7.2173e-4,8.3371e-5,3.4543e-6,4.1103e-9] c_p: [-7.1774e-4,-1.8158e-3,-3.8889e-3,-6.2836e-3,-4.7739e-3,7.5385e-3,1.1037e-2,1.7769e-3,1.5732e-4,4.8183e-6,4.3850e-9] b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] g: [1.4116e-2,4.2163e-2,1.0922e-1,2.4069e-1,4.2181e-1,4.9485e-1,2.0503e-1,3.3980e-2,4.3802e-3,2.6355e-4,9.8421e-7] - + part3: # ZM-VFNS at mu_f^2 = 1e4 u_v: [4.9026e-5,2.3818e-4,1.1359e-3,5.2567e-3,2.3109e-2,9.2035e-2,2.6478e-1,2.2495e-1,9.6318e-2,1.9147e-2,4.0430e-4] d_v: [-1.8815e-5,-9.1286e-5,-4.3445e-4,-2.0035e-3,-8.7537e-3,-3.4391e-2,-9.1762e-2,-6.2376e-2,-1.9353e-2,-2.3281e-3,-1.6480e-5] @@ -37,8 +37,9 @@ table17: # NLO FFNS at mu_f^2 = 1e4 d_v: [-2.5747e-5,-1.1938e-4,-5.3982e-4,-2.3546e-3,-9.7004e-3,-3.5778e-2,-8.9093e-2,-5.8641e-2,-1.7817e-2,-2.0885e-3,-1.4028e-5] L_m: [-1.1434e-4,-2.3497e-4,-4.8579e-4,-9.8473e-4,-1.8276e-3,-2.6427e-3,-1.4593e-3,-1.9269e-4,-1.3125e-5,-2.3388e-7,-4.407e-11] L_p: [-5.2002e-3,-1.0725e-2,-1.9994e-2,-3.1788e-2,-3.8222e-2,-2.6437e-2,-7.5546e-3,-1.2210e-3,-9.1573e-5,-1.9691e-6,-4.247e-9] - s_p: [-2.0528e-3,-4.2774e-3,-7.8594e-3,-1.1749e-2,-1.1427e-2,-1.2328e-3,3.4258e-3,3.5155e-4,1.9823e-5,1.8480e-7,-1.903e-9] + s_p: [-2.0528e-3,-4.2774e-3,-7.8594e-3,-1.1749e-2,-1.1427e-2,-1.2328e-3,3.4258e-3,3.5155e-4,1.9823e-5,1.8480e-7,-1.903e-9] c_p: [-1.5034e-3,-3.1845e-3,-5.6970e-3,-7.5376e-3,-3.6138e-3,1.0869e-2,1.0639e-2,1.3138e-3,8.5435e-5,1.3541e-6,-1.683e-9] + b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] g: [2.6955e-2,6.5928e-2,1.4414e-1,2.7537e-1,4.3388e-1,4.8281e-1,2.0096e-1,3.4126e-2,4.5803e-3,2.9526e-4,1.2520e-6] part2: # mu_r^2 = 2mu_f^2 u_v: [6.1781e-5,2.8974e-4,1.3281e-3,5.8891e-3,2.4777e-2,9.4371e-2,2.6008e-1,2.1837e-1,9.3169e-2,1.8423e-2,3.8293e-4] @@ -47,14 +48,16 @@ table17: # NLO FFNS at mu_f^2 = 1e4 L_p: [-4.6947e-3,-9.8528e-3,-1.8799e-2,-3.0787e-2,-3.8610e-2,-2.8767e-2,-8.3806e-3,-1.2157e-3,-7.9331e-5,-1.0062e-6,-1.955e-9] s_p: [-1.8092e-3,-3.8580e-3,-7.2908e-3,-1.1292e-2,-1.1658e-2,-2.3430e-3,3.1932e-3,3.9810e-4,3.0091e-5,7.6483e-7,-7.298e-10] c_p: [-1.2695e-3,-2.7838e-3,-5.1629e-3,-7.1363e-3,-3.9083e-3,9.7922e-3,1.0585e-2,1.4042e-3,9.9849e-5,2.0328e-6,-4.822e-10] + b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] g: [2.2530e-2,5.7272e-2,1.2975e-1,2.5644e-1,4.1725e-1,4.7804e-1,2.0495e-1,3.5366e-2,4.7690e-3,3.0796e-4,1.3247e-6] part3: # mu_r^2 = 1/2 mu_f^2 u_v: [7.4443e-5,3.4143e-4,1.5256e-3,6.5726e-3,2.6766e-2,9.8073e-2,2.5628e-1,2.0709e-1,8.5835e-2,1.6405e-2,3.2011e-4] d_v: [-2.8435e-5,-1.3016e-4,-5.8002e-4,-2.4891e-3,-1.0070e-2,-3.6370e-2,-8.8133e-2,-5.6988e-2,-1.7089e-2,-1.9723e-3,-1.2870e-5] - L_m: [-1.1815e-4,-2.4482e-4,-5.1085e-4,-1.0409e-3,-1.9171e-3,-2.6942e-3,-1.4304e-3,-1.8541e-4,-1.2463e-5,-2.1859e-7,-4.000e-11] + L_m: [-1.1815e-4,-2.4482e-4,-5.1085e-4,-1.0409e-3,-1.9171e-3,-2.6942e-3,-1.4304e-3,-1.8541e-4,-1.2463e-5,-2.1859e-7,-4.000e-11] L_p: [-5.7829e-3,-1.1668e-2,-2.1193e-2,-3.2697e-2,-3.7730e-2,-2.4056e-2,-6.9572e-3,-1.3308e-3,-1.1920e-4,-3.6817e-6,-8.173e-9] s_p: [-2.3341e-3,-4.7305e-3,-8.4295e-3,-1.2166e-2,-1.1160e-2,-1.2354e-4,3.5561e-3,2.5993e-4,2.6972e-6,-7.4795e-7,-3.886e-9] - c_p: [-1.7739e-3,-3.6168e-3,-6.2295e-3,-7.8952e-3,-3.2890e-3,1.1929e-2,1.0604e-2,1.1855e-3,6.4995e-5,3.4496e-7,-3.686e-9] + c_p: [-1.7739e-3,-3.6168e-3,-6.2295e-3,-7.8952e-3,-3.2890e-3,1.1929e-2,1.0604e-2,1.1855e-3,6.4995e-5,3.4496e-7,-3.686e-9] + b_p: [0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0,0.0000e+0] g: [3.2071e-2,7.5123e-2,1.5788e-1,2.9079e-1,4.4380e-1,4.8272e-1,1.9831e-1,3.3524e-2,4.5044e-3,2.9100e-4,1.2230e-6] @@ -83,11 +86,6 @@ table18: # NLO ZM-VFNS at mu_f^2 = 1e4 L_m: [-1.1912e-4,-2.4707e-4,-5.1593e-4,-1.0509e-3,-1.9310e-3,-2.6980e-3,-1.4179e-3,-1.8228e-4,-1.2174e-5,-2.1196e-7,-3.829e-11] L_p: [-5.8548e-3,-1.1806e-2,-2.1406e-2,-3.2903e-2,-3.7698e-2,-2.3675e-2,-6.7523e-3,-1.2965e-3,-1.1604e-4,-3.6047e-6,-8.129e-9] s_p: [-2.3667e-3,-4.7934e-3,-8.5248e-3,-1.2252e-2,-1.1127e-2,5.1386e-5,3.5944e-3,2.6142e-4,2.8309e-6,-7.4260e-7,-3.873e-9] - c_p: [-1.8030e-3,-3.6731e-3,-6.3125e-3,-7.9608e-3,-3.2334e-3,1.2092e-2,1.0578e-2,1.1713e-3,6.3682e-5,3.1714e-7,-3.681e-9] + c_p: [-1.8030e-3,-3.6731e-3,-6.3125e-3,-7.9608e-3,-3.2334e-3,1.2092e-2,1.0578e-2,1.1713e-3,6.3682e-5,3.1714e-7,-3.681e-9] b_p: [-1.4521e-3,-2.7846e-3,-4.4072e-3,-4.8402e-3,-7.5827e-4,8.6053e-3,6.0904e-3,6.8941e-4,4.7009e-5,9.6419e-7,-6.816e-10] g: [3.1009e-2,7.2690e-2,1.5274e-1,2.8097e-1,4.2756e-1,4.6241e-1,1.8838e-1,3.1884e-2,4.3221e-3,2.8268e-4,1.2009e-6] - - - - - From f758c2570151a4b144ba61928f24032ed066ab0f Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 3 Feb 2023 15:15:38 +0100 Subject: [PATCH 40/67] pre-commit ad files --- .../anomalous_dimensions/polarized/space_like/__init__.py | 4 +--- .../anomalous_dimensions/polarized/space_like/as1.py | 8 ++++---- .../anomalous_dimensions/polarized/space_like/as2.py | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py index 61e8530f6..d649f0afe 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -16,7 +16,7 @@ @nb.njit(cache=True) -def compute_cache(n, pto, is_singlet): +def compute_cache(n, pto): """Compute the harmonic cache for polarized anomalous dimension. Parameters @@ -25,8 +25,6 @@ def compute_cache(n, pto, is_singlet): Mellin variable pto : int perturbative order - is_singlet: bool - True for singlet like quantities Returns ------- diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as1.py b/src/ekore/anomalous_dimensions/polarized/space_like/as1.py index 3d8c8fab0..c3d84c1ed 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as1.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as1.py @@ -1,4 +1,4 @@ -"""This file contains the |LO| Altarelli-Parisi splitting kernels.""" +"""The |LO| Altarelli-Parisi splitting kernels.""" import numba as nb import numpy as np @@ -10,7 +10,7 @@ @nb.njit(cache=True) def gamma_qg(N, nf): - """Compute the |LO| polarized quark-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1). + r"""Compute the |LO| polarized quark-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1). Parameters ---------- @@ -32,7 +32,7 @@ def gamma_qg(N, nf): @nb.njit(cache=True) def gamma_gq(N): - """Compute the |LO| polarized gluon-quark anomalous dimension :cite:`Gluck:1995yr` (eq A.1). + r"""Compute the |LO| polarized gluon-quark anomalous dimension :cite:`Gluck:1995yr` (eq A.1). Parameters ---------- @@ -52,7 +52,7 @@ def gamma_gq(N): @nb.njit(cache=True) def gamma_gg(N, s1, nf): - """Compute the |LO| polarized gluon-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1). + r"""Compute the |LO| polarized gluon-gluon anomalous dimension :cite:`Gluck:1995yr` (eq A.1). Parameters ---------- diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py index b7b4c8955..2b63a2dc3 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/as2.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/as2.py @@ -1,4 +1,4 @@ -"""The next-leading-order Altarelli-Parisi splitting kernels.""" +"""The |NLO| Altarelli-Parisi splitting kernels.""" import numba as nb import numpy as np From 8c3c7546005223218634ec0694012ce0e40e2dec Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 3 Feb 2023 15:28:50 +0100 Subject: [PATCH 41/67] test ns sea ad3 --- .../polarized/space_like/test_ad_as3.py | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py index 2b7d559c8..e08518864 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py @@ -1,4 +1,4 @@ -# Test LO Polarized splitting functions +# Test NNLO Polarized splitting functions import numpy as np import ekore.anomalous_dimensions.polarized.space_like.as3 as as3 @@ -7,16 +7,6 @@ nf = 5 -# def test_quark_momentum(): -# # quark momentum -# N = complex(2.0, 0.0) -# sx = harmonics.sx(N, max_weight=4) -# np.testing.assert_almost_equal( -# as3.gamma_ns(N, nf, sx) + as3.gamma_gq(N), -# (4 * constants.CF)/3, -# ) - - def test_gluon_momentum(): # gluon momentum N = complex(2.0, 0.0) @@ -30,3 +20,17 @@ def test_qg_helicity_conservation(): N = complex(1.0, 0.0) sx = harmonics.sx(N, max_weight=4) np.testing.assert_almost_equal(as3.gamma_qg(N, nf, sx), 0.00294317) + + +def test_ns_sea(): + ref_moments = [ + -220 / 3, + -103175 / 34992, + -4653353 / 5467500, + -7063530941 / 17425497600, + -218695344199 / 911421315000, + ] + for i, mom in enumerate(ref_moments): + N = 1 + 2 * i + sx = harmonics.sx(N, max_weight=4) + np.testing.assert_allclose(-as3.gamma_nss(N, nf, sx), mom * nf, rtol=7e-7) From b6d34fee7e0ebdfc3c02683bb02946b3c64c4ca2 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 3 Feb 2023 15:31:34 +0100 Subject: [PATCH 42/67] fix typo --- .../anomalous_dimensions/polarized/space_like/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py index d649f0afe..ccd70e2d1 100644 --- a/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py +++ b/src/ekore/anomalous_dimensions/polarized/space_like/__init__.py @@ -59,7 +59,7 @@ def gamma_ns(order, mode, n, nf): """ # cache the s-es - sx = compute_cache(n, order[0] + 1, False) + sx = compute_cache(n, order[0] + 1) # now combine gamma_ns = np.zeros(order[0], np.complex_) gamma_ns[0] = as1.gamma_ns(n, sx[0]) @@ -106,7 +106,7 @@ def gamma_singlet(order, n, nf): """ # cache the s-es - sx = compute_cache(n, order[0] + 1, True) + sx = compute_cache(n, order[0] + 1) gamma_s = np.zeros((order[0], 2, 2), np.complex_) gamma_s[0] = as1.gamma_singlet(n, sx[0], nf) From ce02fffd57ff47f46864b0b1595d6d78a2661a56 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 3 Feb 2023 17:26:08 +0100 Subject: [PATCH 43/67] some cleaning --- benchmarks/lha_paper_bench.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/benchmarks/lha_paper_bench.py b/benchmarks/lha_paper_bench.py index 5f112a9a3..f87e75210 100644 --- a/benchmarks/lha_paper_bench.py +++ b/benchmarks/lha_paper_bench.py @@ -242,29 +242,6 @@ def run_lha(self, theory_updates): ) -class BenchmarkVFNS_polarized(BenchmarkVFNS): - def run_lha(self, theory_updates): - """Enforce operator grid and PDF. - - Parameters - ---------- - theory_updates : list(dict) - theory updates - """ - self.run( - theory_updates, - [ - { - "Q2grid": [1e4], - "ev_op_iterations": 10, - "interpolation_xgrid": lambertgrid(60).tolist(), - "polarized": True, - } - ], - ["ToyLH_polarized"], - ) - - if __name__ == "__main__": # Benchmark to LHA From 5de82cb9ff07e1da661c0e0b1af8f8991ac66f00 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 3 Feb 2023 17:29:19 +0100 Subject: [PATCH 44/67] some cleaning 2 --- src/ekomark/benchmark/external/LHA_utils.py | 104 ++++++++------------ 1 file changed, 39 insertions(+), 65 deletions(-) diff --git a/src/ekomark/benchmark/external/LHA_utils.py b/src/ekomark/benchmark/external/LHA_utils.py index 5b6817d66..1f58505f1 100644 --- a/src/ekomark/benchmark/external/LHA_utils.py +++ b/src/ekomark/benchmark/external/LHA_utils.py @@ -1,7 +1,4 @@ -""" -Implementation of :cite:`Giele:2002hx` and :cite:`Dittmar:2005ed` (NNLO) -""" -from functools import partialmethod +"""Implementation of :cite:`Giele:2002hx` and :cite:`Dittmar:2005ed` (NNLO and polarized).""" import pathlib import numpy as np @@ -55,23 +52,22 @@ # rotate basis def rotate_data(raw, is_ffns_nnlo=False, rotate_to_evolution_basis=False): - """ - Rotate data either to flavor space or evolution space (from LHA space) - which is yet an other basis. + """Rotate data either to flavor space or evolution space (from LHA space) which is yet an other basis. Parameters ---------- - raw : dict - data - is_ffns_nnlo : bool - special table for NNLO FFNS - rotate_to_evolution_basis : bool - to evolution basis? + raw : dict + data + is_ffns_nnlo : bool + special table for NNLO FFNS + rotate_to_evolution_basis : bool + to evolution basis? Returns ------- - dict - rotated data + dict + rotated data + """ inp = [] label_list = raw_label_list @@ -96,13 +92,6 @@ def rotate_data(raw, is_ffns_nnlo=False, rotate_to_evolution_basis=False): # s_v = c_v count twice to_evolution[3, 4] = -2 to_evolution[3, -4] = 2 - # if is_pol_nlo: - # label_list = np.delete(label_list, -2) - # to_flavor= np.array(to_flavor) - # # change the rotation matrix - # b_line = ([0, 0, 0, 0, 0, 0, 1 / 2, 0]) - # indices = np.where(np.all(to_flavor == b_line, axis=1))[0] - # to_flavor = np.delete(to_flavor, indices, axis=0) for l in label_list: inp.append(raw[l]) inp = np.array(inp) @@ -115,37 +104,35 @@ def rotate_data(raw, is_ffns_nnlo=False, rotate_to_evolution_basis=False): return dict(zip(br.flavor_basis_pids, flav_pdfs)) -def compute_LHA_data( - theory, operators, rotate_to_evolution_basis=False -): # pylint: disable=too-many-statements disable=too-many-branches - """ - Setup LHA benchmark :cite:`Giele:2002hx` +def compute_LHA_data(theory, operators, rotate_to_evolution_basis=False): + """Implement LHA benchmark :cite:`Giele:2002hx`. Parameters ---------- - theory : dict - theory card - operators : dict - operators card - rotate_to_evolution_basis : bool - rotate to evolution basis + theory : dict + theory card + operators : dict + operators card + rotate_to_evolution_basis : bool + rotate to evolution basis Returns ------- - ref : dict - output containing: target_xgrid, values + dict + output containing: target_xgrid, values + """ - Polarized = operators["polarized"] + polarized = operators["polarized"] Q2grid = operators["Q2grid"] if not np.allclose(Q2grid, [1e4]): raise ValueError("Q2grid has to be [1e4]") order = theory["PTO"] # select which data - if Polarized and order <= 1: + if polarized and order <= 1: yaml_file = "LHA_polarized.yaml" - elif Polarized and order > 1: - raise ValueError("LHA tables beyond NLO do not exist for Polarized Case") - elif Polarized == False: + elif polarized and order > 1: + raise ValueError("LHA tables beyond NLO do not exist for polarized Case") + else: yaml_file = "LHA.yaml" # load data with open(here / yaml_file, encoding="utf-8") as o: @@ -157,7 +144,6 @@ def compute_LHA_data( table = None part = None is_ffns_nnlo = False - # is_pol_nlo= False # Switching at the intermediate point. if xif > np.sqrt(2): @@ -169,31 +155,18 @@ def compute_LHA_data( if fns == "FFNS": if order == 0: part = 2 - if Polarized == False: - table = 2 - else: - table = 16 + table = 16 if polarized else 2 elif order == 1: - if Polarized == False: - table = 3 - else: - # is_pol_nlo=True - table = 17 + table = 17 if polarized else 3 elif order == 2: is_ffns_nnlo = True table = 14 elif fns == "ZM-VFNS": if order == 0: part = 3 - if Polarized == False: - table = 2 - else: - table = 16 + table = 16 if polarized else 2 elif order == 1: - if Polarized == False: - table = 4 - else: - table = 18 + table = 18 if polarized else 4 elif order == 2: table = 15 @@ -211,23 +184,24 @@ def compute_LHA_data( def save_initial_scale_plots_to_pdf(path, is_pol): - """ - Plots all PDFs at the inital scale . + r"""Plot all PDFs at the initial scale. - The reference values are given in Table 2 part 1 or Table 16 part 1 (Polarized) :cite:`Giele:2002hx`. + The reference values are given in Table 2 part 1 :cite:`Giele:2002hx` + or Table 16 part 1 (polarized) :cite:`Dittmar:2005ed` . - This excercise was usfull in order to detect the missing 2 in the definition of + This exercise was useful in order to detect the missing 2 in the definition of :math:`L_+ = 2(\\bar u + \\bar d)` Parameters ---------- - path : str + path : str output path - is_pol : bool + is_pol : bool polarized pdf data + """ # load data - if bool(is_pol) == False: + if not is_pol: yaml_file = "LHA.yaml" table = "table2" else: From 42bb04cdc3ec0394f96f55c8cbd0e0f2ce41cdb9 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 3 Feb 2023 17:31:58 +0100 Subject: [PATCH 45/67] remove some old inits --- .../polarized/time_like/__init__.py | 21 ------------------- .../polarized/time_like/__init__.py | 13 ------------ 2 files changed, 34 deletions(-) delete mode 100644 src/ekore/anomalous_dimensions/polarized/time_like/__init__.py delete mode 100644 src/ekore/operator_matrix_elements/polarized/time_like/__init__.py diff --git a/src/ekore/anomalous_dimensions/polarized/time_like/__init__.py b/src/ekore/anomalous_dimensions/polarized/time_like/__init__.py deleted file mode 100644 index 74aa85770..000000000 --- a/src/ekore/anomalous_dimensions/polarized/time_like/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -r"""The polarized, time-like Altarelli-Parisi splitting kernels. - -Normalization is given by - -.. math:: - \mathbf{P}(x) = \sum\limits_{j=0} a_s^{j+1} \mathbf P^{(j)}(x) - -with :math:`a_s = \frac{\alpha_S(\mu^2)}{4\pi}`. -""" - -import numba as nb - - -@nb.njit(cache=True) -def gamma_ns(_order, _mode, _n, _nf): - raise NotImplementedError("Polarised, time-like is not yet implemented") - - -@nb.njit(cache=True) -def gamma_singlet(_order, _n, _nf): - raise NotImplementedError("Polarised, time-like is not yet implemented") diff --git a/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py b/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py deleted file mode 100644 index 81b9f3de8..000000000 --- a/src/ekore/operator_matrix_elements/polarized/time_like/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -r"""The polarized, time-like |OME|.""" - -import numba as nb - - -@nb.njit(cache=True) -def A_non_singlet(_matching_order, _n, _sx, _nf, _L): - raise NotImplementedError("Polarised, time-like is not yet implemented") - - -@nb.njit(cache=True) -def A_singlet(_matching_order, _n, _sx, _nf, _L, _is_msbar, _sx_ns=None): - raise NotImplementedError("Polarised, time-like is not yet implemented") From 73dac71e73b5969c9a998da75fa6780637f464c5 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 15 Feb 2023 18:18:15 +0100 Subject: [PATCH 46/67] Update banana --- poetry.lock | 239 ++++++++++++++++++++++++++++--------------------- pyproject.toml | 2 +- 2 files changed, 136 insertions(+), 105 deletions(-) diff --git a/poetry.lock b/poetry.lock index d370e005c..a767df7a6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,14 +38,14 @@ files = [ [[package]] name = "astroid" -version = "2.13.4" +version = "2.14.2" description = "An abstract syntax tree for Python with inference support." category = "dev" optional = false python-versions = ">=3.7.2" files = [ - {file = "astroid-2.13.4-py3-none-any.whl", hash = "sha256:fe430a1dcc6af3abbccd29ba9f2544dcafc0610d37018b5102c232ff917e4bbf"}, - {file = "astroid-2.13.4.tar.gz", hash = "sha256:805d47d685a490f4024e3744064e919998b0eef6619e6ea6d2052deec5333fd5"}, + {file = "astroid-2.14.2-py3-none-any.whl", hash = "sha256:0e0e3709d64fbffd3037e4ff403580550f14471fd3eaae9fa11cc9a5c7901153"}, + {file = "astroid-2.14.2.tar.gz", hash = "sha256:a3cf9f02c53dd259144a7e8f3ccd75d67c9a8c716ef183e0c1f291bc5d7bb3cf"}, ] [package.dependencies] @@ -136,14 +136,14 @@ files = [ [[package]] name = "banana-hep" -version = "0.6.7" +version = "0.6.8" description = "Benchmark QCD physics" category = "main" optional = true -python-versions = ">=3.8.0,<3.11" +python-versions = ">=3.8.0,<3.12" files = [ - {file = "banana_hep-0.6.7-py3-none-any.whl", hash = "sha256:5d1d77c565f6c7852c1c1a5c09b9e6d01f99e5a5861554c5b5a4f0eb21a9ac84"}, - {file = "banana_hep-0.6.7.tar.gz", hash = "sha256:d2b9c6f13433c40526e0b572144bf93c0bc9ee0feb823c623c3854e0ab58563d"}, + {file = "banana_hep-0.6.8-py3-none-any.whl", hash = "sha256:fafaad5f74bcf6bd263c8899c37ee884e0b4ae0af374cde4b5c8d60794d9f212"}, + {file = "banana_hep-0.6.8.tar.gz", hash = "sha256:047ba50bbd88691dbd0336b561c413f971f5b4a37310aa88de8e04e8c0e41cc2"}, ] [package.dependencies] @@ -163,14 +163,14 @@ docs = ["Sphinx (>=4.3.2,<5.0.0)", "sphinx-rtd-theme (>=1.0.0,<2.0.0)", "sphinxc [[package]] name = "beautifulsoup4" -version = "4.11.1" +version = "4.11.2" description = "Screen-scraping library" category = "main" optional = false python-versions = ">=3.6.0" files = [ - {file = "beautifulsoup4-4.11.1-py3-none-any.whl", hash = "sha256:58d5c3d29f5a36ffeb94f02f0d786cd53014cf9b3b3951d42e0080d8a9498d30"}, - {file = "beautifulsoup4-4.11.1.tar.gz", hash = "sha256:ad9aa55b65ef2808eb405f46cf74df7fcb7044d5cbc26487f96eb2ef2e436693"}, + {file = "beautifulsoup4-4.11.2-py3-none-any.whl", hash = "sha256:0e79446b10b3ecb499c1556f7e228a53e64a2bfcebd455f370d8927cb5b59e39"}, + {file = "beautifulsoup4-4.11.2.tar.gz", hash = "sha256:bc4bdda6717de5a2987436fb8d72f45dc90dd856bdfd512a1314ce90349a0106"}, ] [package.dependencies] @@ -620,6 +620,7 @@ files = [ {file = "debugpy-1.6.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b5d1b13d7c7bf5d7cf700e33c0b8ddb7baf030fcf502f76fc061ddd9405d16c"}, {file = "debugpy-1.6.6-cp38-cp38-win32.whl", hash = "sha256:70ab53918fd907a3ade01909b3ed783287ede362c80c75f41e79596d5ccacd32"}, {file = "debugpy-1.6.6-cp38-cp38-win_amd64.whl", hash = "sha256:c05349890804d846eca32ce0623ab66c06f8800db881af7a876dc073ac1c2225"}, + {file = "debugpy-1.6.6-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:11a0f3a106f69901e4a9a5683ce943a7a5605696024134b522aa1bfda25b5fec"}, {file = "debugpy-1.6.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a771739902b1ae22a120dbbb6bd91b2cae6696c0e318b5007c5348519a4211c6"}, {file = "debugpy-1.6.6-cp39-cp39-win32.whl", hash = "sha256:549ae0cb2d34fc09d1675f9b01942499751d174381b6082279cf19cdb3c47cbe"}, {file = "debugpy-1.6.6-cp39-cp39-win_amd64.whl", hash = "sha256:de4a045fbf388e120bb6ec66501458d3134f4729faed26ff95de52a754abddb1"}, @@ -963,14 +964,14 @@ files = [ [[package]] name = "ipykernel" -version = "6.21.0" +version = "6.21.2" description = "IPython Kernel for Jupyter" category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "ipykernel-6.21.0-py3-none-any.whl", hash = "sha256:a9aaefb0cd6f44e3dcaeaafb9222862ae73831f71afd77f465fc83d6199d1888"}, - {file = "ipykernel-6.21.0.tar.gz", hash = "sha256:719eac0f1d86706589ee0910d6f785fd4c1ef123ab8e3466b8961c37991d0ef2"}, + {file = "ipykernel-6.21.2-py3-none-any.whl", hash = "sha256:430d00549b6aaf49bd0f5393150691edb1815afa62d457ee6b1a66b25cb17874"}, + {file = "ipykernel-6.21.2.tar.gz", hash = "sha256:6e9213484e4ce1fb14267ee435e18f23cc3a0634e635b9fb4ed4677b84e0fdf8"}, ] [package.dependencies] @@ -981,9 +982,10 @@ ipython = ">=7.23.1" jupyter-client = ">=6.1.12" jupyter-core = ">=4.12,<5.0.0 || >=5.1.0" matplotlib-inline = ">=0.1" +nest-asyncio = "*" packaging = "*" psutil = "*" -pyzmq = ">=17" +pyzmq = ">=20" tornado = ">=6.1" traitlets = ">=5.4.0" @@ -1457,64 +1459,65 @@ files = [ [[package]] name = "matplotlib" -version = "3.6.3" +version = "3.7.0" description = "Python plotting package" category = "main" optional = true python-versions = ">=3.8" files = [ - {file = "matplotlib-3.6.3-cp310-cp310-macosx_10_12_universal2.whl", hash = "sha256:80c166a0e28512e26755f69040e6bf2f946a02ffdb7c00bf6158cca3d2b146e6"}, - {file = "matplotlib-3.6.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:eb9421c403ffd387fbe729de6d9a03005bf42faba5e8432f4e51e703215b49fc"}, - {file = "matplotlib-3.6.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5223affa21050fb6118353c1380c15e23aedfb436bf3e162c26dc950617a7519"}, - {file = "matplotlib-3.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d00c248ab6b92bea3f8148714837937053a083ff03b4c5e30ed37e28fc0e7e56"}, - {file = "matplotlib-3.6.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca94f0362f6b6f424b555b956971dcb94b12d0368a6c3e07dc7a40d32d6d873d"}, - {file = "matplotlib-3.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59400cc9451094b7f08cc3f321972e6e1db4cd37a978d4e8a12824bf7fd2f03b"}, - {file = "matplotlib-3.6.3-cp310-cp310-win32.whl", hash = "sha256:57ad1aee29043163374bfa8990e1a2a10ff72c9a1bfaa92e9c46f6ea59269121"}, - {file = "matplotlib-3.6.3-cp310-cp310-win_amd64.whl", hash = "sha256:1fcc4cad498533d3c393a160975acc9b36ffa224d15a6b90ae579eacee5d8579"}, - {file = "matplotlib-3.6.3-cp311-cp311-macosx_10_12_universal2.whl", hash = "sha256:d2cfaa7fd62294d945b8843ea24228a27c8e7c5b48fa634f3c168153b825a21b"}, - {file = "matplotlib-3.6.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:c3f08df2ac4636249b8bc7a85b8b82c983bef1441595936f62c2918370ca7e1d"}, - {file = "matplotlib-3.6.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ff2aa84e74f80891e6bcf292ebb1dd57714ffbe13177642d65fee25384a30894"}, - {file = "matplotlib-3.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:11011c97d62c1db7bc20509572557842dbb8c2a2ddd3dd7f20501aa1cde3e54e"}, - {file = "matplotlib-3.6.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c235bf9be052347373f589e018988cad177abb3f997ab1a2e2210c41562cc0c"}, - {file = "matplotlib-3.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bebcff4c3ed02c6399d47329f3554193abd824d3d53b5ca02cf583bcd94470e2"}, - {file = "matplotlib-3.6.3-cp311-cp311-win32.whl", hash = "sha256:d5f18430f5cfa5571ab8f4c72c89af52aa0618e864c60028f11a857d62200cba"}, - {file = "matplotlib-3.6.3-cp311-cp311-win_amd64.whl", hash = "sha256:dfba7057609ca9567b9704626756f0142e97ec8c5ba2c70c6e7bd1c25ef99f06"}, - {file = "matplotlib-3.6.3-cp38-cp38-macosx_10_12_universal2.whl", hash = "sha256:9fb8fb19d03abf3c5dab89a8677e62c4023632f919a62b6dd1d6d2dbf42cd9f5"}, - {file = "matplotlib-3.6.3-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:bbf269e1d24bc25247095d71c7a969813f7080e2a7c6fa28931a603f747ab012"}, - {file = "matplotlib-3.6.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:994637e2995b0342699b396a320698b07cd148bbcf2dd2fa2daba73f34dd19f2"}, - {file = "matplotlib-3.6.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:77b384cee7ab8cf75ffccbfea351a09b97564fc62d149827a5e864bec81526e5"}, - {file = "matplotlib-3.6.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:73b93af33634ed919e72811c9703e1105185cd3fb46d76f30b7f4cfbbd063f89"}, - {file = "matplotlib-3.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:debeab8e2ab07e5e3dac33e12456da79c7e104270d2b2d1df92b9e40347cca75"}, - {file = "matplotlib-3.6.3-cp38-cp38-win32.whl", hash = "sha256:acc3b1a4bddbf56fe461e36fb9ef94c2cb607fc90d24ccc650040bfcc7610de4"}, - {file = "matplotlib-3.6.3-cp38-cp38-win_amd64.whl", hash = "sha256:1183877d008c752d7d535396096c910f4663e4b74a18313adee1213328388e1e"}, - {file = "matplotlib-3.6.3-cp39-cp39-macosx_10_12_universal2.whl", hash = "sha256:6adc441b5b2098a4b904bbf9d9e92fb816fef50c55aa2ea6a823fc89b94bb838"}, - {file = "matplotlib-3.6.3-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:6d81b11ede69e3a751424b98dc869c96c10256b2206bfdf41f9c720eee86844c"}, - {file = "matplotlib-3.6.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:29f17b7f2e068dc346687cbdf80b430580bab42346625821c2d3abf3a1ec5417"}, - {file = "matplotlib-3.6.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f56a7252eee8f3438447f75f5e1148a1896a2756a92285fe5d73bed6deebff4"}, - {file = "matplotlib-3.6.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bbddfeb1495484351fb5b30cf5bdf06b3de0bc4626a707d29e43dfd61af2a780"}, - {file = "matplotlib-3.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:809119d1cba3ece3c9742eb01827fe7a0e781ea3c5d89534655a75e07979344f"}, - {file = "matplotlib-3.6.3-cp39-cp39-win32.whl", hash = "sha256:e0a64d7cc336b52e90f59e6d638ae847b966f68582a7af041e063d568e814740"}, - {file = "matplotlib-3.6.3-cp39-cp39-win_amd64.whl", hash = "sha256:79e501eb847f4a489eb7065bb8d3187117f65a4c02d12ea3a19d6c5bef173bcc"}, - {file = "matplotlib-3.6.3-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2787a16df07370dcba385fe20cdd0cc3cfaabd3c873ddabca78c10514c799721"}, - {file = "matplotlib-3.6.3-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:68d94a436f62b8a861bf3ace82067a71bafb724b4e4f9133521e4d8012420dd7"}, - {file = "matplotlib-3.6.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81b409b2790cf8d7c1ef35920f01676d2ae7afa8241844e7aa5484fdf493a9a0"}, - {file = "matplotlib-3.6.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:faff486b36530a836a6b4395850322e74211cd81fc17f28b4904e1bd53668e3e"}, - {file = "matplotlib-3.6.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:38d38cb1ea1d80ee0f6351b65c6f76cad6060bbbead015720ba001348ae90f0c"}, - {file = "matplotlib-3.6.3-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:12f999661589981e74d793ee2f41b924b3b87d65fd929f6153bf0f30675c59b1"}, - {file = "matplotlib-3.6.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01b7f521a9a73c383825813af255f8c4485d1706e4f3e2ed5ae771e4403a40ab"}, - {file = "matplotlib-3.6.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:9ceebaf73f1a3444fa11014f38b9da37ff7ea328d6efa1652241fe3777bfdab9"}, - {file = "matplotlib-3.6.3.tar.gz", hash = "sha256:1f4d69707b1677560cd952544ee4962f68ff07952fb9069ff8c12b56353cb8c9"}, + {file = "matplotlib-3.7.0-cp310-cp310-macosx_10_12_universal2.whl", hash = "sha256:3da8b9618188346239e51f1ea6c0f8f05c6e218cfcc30b399dd7dd7f52e8bceb"}, + {file = "matplotlib-3.7.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:c0592ba57217c22987b7322df10f75ef95bc44dce781692b4b7524085de66019"}, + {file = "matplotlib-3.7.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:21269450243d6928da81a9bed201f0909432a74e7d0d65db5545b9fa8a0d0223"}, + {file = "matplotlib-3.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb2e76cd429058d8954121c334dddfcd11a6186c6975bca61f3f248c99031b05"}, + {file = "matplotlib-3.7.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:de20eb1247725a2f889173d391a6d9e7e0f2540feda24030748283108b0478ec"}, + {file = "matplotlib-3.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c5465735eaaafd1cfaec3fed60aee776aeb3fd3992aa2e49f4635339c931d443"}, + {file = "matplotlib-3.7.0-cp310-cp310-win32.whl", hash = "sha256:092e6abc80cdf8a95f7d1813e16c0e99ceda8d5b195a3ab859c680f3487b80a2"}, + {file = "matplotlib-3.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:4f640534ec2760e270801056bc0d8a10777c48b30966eef78a7c35d8590915ba"}, + {file = "matplotlib-3.7.0-cp311-cp311-macosx_10_12_universal2.whl", hash = "sha256:f336e7014889c38c59029ebacc35c59236a852e4b23836708cfd3f43d1eaeed5"}, + {file = "matplotlib-3.7.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:3a10428d4f8d1a478ceabd652e61a175b2fdeed4175ab48da4a7b8deb561e3fa"}, + {file = "matplotlib-3.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:46ca923e980f76d34c1c633343a72bb042d6ba690ecc649aababf5317997171d"}, + {file = "matplotlib-3.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c849aa94ff2a70fb71f318f48a61076d1205c6013b9d3885ade7f992093ac434"}, + {file = "matplotlib-3.7.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:827e78239292e561cfb70abf356a9d7eaf5bf6a85c97877f254009f20b892f89"}, + {file = "matplotlib-3.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:691ef1f15360e439886186d0db77b5345b24da12cbc4fc57b26c4826db4d6cab"}, + {file = "matplotlib-3.7.0-cp311-cp311-win32.whl", hash = "sha256:21a8aeac39b4a795e697265d800ce52ab59bdeb6bb23082e2d971f3041074f02"}, + {file = "matplotlib-3.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:01681566e95b9423021b49dea6a2395c16fa054604eacb87f0f4c439750f9114"}, + {file = "matplotlib-3.7.0-cp38-cp38-macosx_10_12_universal2.whl", hash = "sha256:cf119eee4e57389fba5ac8b816934e95c256535e55f0b21628b4205737d1de85"}, + {file = "matplotlib-3.7.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:21bd4033c40b95abd5b8453f036ed5aa70856e56ecbd887705c37dce007a4c21"}, + {file = "matplotlib-3.7.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:111ef351f28fd823ed7177632070a6badd6f475607122bc9002a526f2502a0b5"}, + {file = "matplotlib-3.7.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:f91d35b3ef51d29d9c661069b9e4ba431ce283ffc533b981506889e144b5b40e"}, + {file = "matplotlib-3.7.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0a776462a4a63c0bfc9df106c15a0897aa2dbab6795c693aa366e8e283958854"}, + {file = "matplotlib-3.7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0dfd4a0cbd151f6439e6d7f8dca5292839ca311e7e650596d073774847ca2e4f"}, + {file = "matplotlib-3.7.0-cp38-cp38-win32.whl", hash = "sha256:56b7b79488209041a9bf7ddc34f1b069274489ce69e34dc63ae241d0d6b4b736"}, + {file = "matplotlib-3.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:8665855f3919c80551f377bc16df618ceabf3ef65270bc14b60302dce88ca9ab"}, + {file = "matplotlib-3.7.0-cp39-cp39-macosx_10_12_universal2.whl", hash = "sha256:f910d924da8b9fb066b5beae0b85e34ed1b6293014892baadcf2a51da1c65807"}, + {file = "matplotlib-3.7.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:cf6346644e8fe234dc847e6232145dac199a650d3d8025b3ef65107221584ba4"}, + {file = "matplotlib-3.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3d1e52365d8d5af699f04581ca191112e1d1220a9ce4386b57d807124d8b55e6"}, + {file = "matplotlib-3.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c869b646489c6a94375714032e5cec08e3aa8d3f7d4e8ef2b0fb50a52b317ce6"}, + {file = "matplotlib-3.7.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f4ddac5f59e78d04b20469bc43853a8e619bb6505c7eac8ffb343ff2c516d72f"}, + {file = "matplotlib-3.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb0304c1cd802e9a25743414c887e8a7cd51d96c9ec96d388625d2cd1c137ae3"}, + {file = "matplotlib-3.7.0-cp39-cp39-win32.whl", hash = "sha256:a06a6c9822e80f323549c6bc9da96d4f233178212ad9a5f4ab87fd153077a507"}, + {file = "matplotlib-3.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:cb52aa97b92acdee090edfb65d1cb84ea60ab38e871ba8321a10bbcebc2a3540"}, + {file = "matplotlib-3.7.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3493b48e56468c39bd9c1532566dff3b8062952721b7521e1f394eb6791495f4"}, + {file = "matplotlib-3.7.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d0dcd1a0bf8d56551e8617d6dc3881d8a1c7fb37d14e5ec12cbb293f3e6170a"}, + {file = "matplotlib-3.7.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51fb664c37714cbaac69c16d6b3719f517a13c96c3f76f4caadd5a0aa7ed0329"}, + {file = "matplotlib-3.7.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4497d88c559b76da320b7759d64db442178beeea06a52dc0c629086982082dcd"}, + {file = "matplotlib-3.7.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:9d85355c48ef8b9994293eb7c00f44aa8a43cad7a297fbf0770a25cdb2244b91"}, + {file = "matplotlib-3.7.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:03eb2c8ff8d85da679b71e14c7c95d16d014c48e0c0bfa14db85f6cdc5c92aad"}, + {file = "matplotlib-3.7.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:71b751d06b2ed1fd017de512d7439c0259822864ea16731522b251a27c0b2ede"}, + {file = "matplotlib-3.7.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b51ab8a5d5d3bbd4527af633a638325f492e09e45e78afdf816ef55217a09664"}, + {file = "matplotlib-3.7.0.tar.gz", hash = "sha256:8f6efd313430d7ef70a38a3276281cb2e8646b3a22b3b21eb227da20e15e6813"}, ] [package.dependencies] contourpy = ">=1.0.1" cycler = ">=0.10" fonttools = ">=4.22.0" +importlib-resources = {version = ">=3.2.0", markers = "python_version < \"3.10\""} kiwisolver = ">=1.0.1" -numpy = ">=1.19" +numpy = ">=1.20" packaging = ">=20.0" pillow = ">=6.2.0" -pyparsing = ">=2.2.1" +pyparsing = ">=2.3.1" python-dateutil = ">=2.7" [[package]] @@ -1546,14 +1549,14 @@ files = [ [[package]] name = "mistune" -version = "2.0.4" +version = "2.0.5" description = "A sane Markdown parser with useful plugins and renderers" category = "main" optional = false python-versions = "*" files = [ - {file = "mistune-2.0.4-py2.py3-none-any.whl", hash = "sha256:182cc5ee6f8ed1b807de6b7bb50155df7b66495412836b9a74c8fbdfc75fe36d"}, - {file = "mistune-2.0.4.tar.gz", hash = "sha256:9ee0a66053e2267aba772c71e06891fa8f1af6d4b01d5e84e267b4570d4d9808"}, + {file = "mistune-2.0.5-py2.py3-none-any.whl", hash = "sha256:bad7f5d431886fcbaf5f758118ecff70d31f75231b34024a1341120340a65ce8"}, + {file = "mistune-2.0.5.tar.gz", hash = "sha256:0246113cb2492db875c6be56974a7c893333bf26cd92891c85f63151cee09d34"}, ] [[package]] @@ -1660,6 +1663,18 @@ nbformat = "*" sphinx = ">=1.8" traitlets = ">=5" +[[package]] +name = "nest-asyncio" +version = "1.5.6" +description = "Patch asyncio to allow nested event loops" +category = "dev" +optional = false +python-versions = ">=3.5" +files = [ + {file = "nest_asyncio-1.5.6-py3-none-any.whl", hash = "sha256:b9a953fb40dceaa587d109609098db21900182b16440652454a146cffb06e8b8"}, + {file = "nest_asyncio-1.5.6.tar.gz", hash = "sha256:d267cc1ff794403f7df692964d1d2a3fa9418ffea2a3f6859a439ff482fef290"}, +] + [[package]] name = "numba" version = "0.55.2" @@ -2011,19 +2026,19 @@ files = [ [[package]] name = "platformdirs" -version = "2.6.2" +version = "3.0.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-2.6.2-py3-none-any.whl", hash = "sha256:83c8f6d04389165de7c9b6f0c682439697887bca0aa2f1c87ef1826be3584490"}, - {file = "platformdirs-2.6.2.tar.gz", hash = "sha256:e1fea1fe471b9ff8332e229df3cb7de4f53eeea4998d3b6bfff542115e998bd2"}, + {file = "platformdirs-3.0.0-py3-none-any.whl", hash = "sha256:b1d5eb14f221506f50d6604a561f4c5786d9e80355219694a1b244bcd96f4567"}, + {file = "platformdirs-3.0.0.tar.gz", hash = "sha256:8a1228abb1ef82d788f74139988b137e78692984ec7b08eaa6c65f1723af28f9"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "pluggy" @@ -2175,18 +2190,18 @@ plugins = ["importlib-metadata"] [[package]] name = "pylint" -version = "2.15.10" +version = "2.16.2" description = "python code static checker" category = "dev" optional = false python-versions = ">=3.7.2" files = [ - {file = "pylint-2.15.10-py3-none-any.whl", hash = "sha256:9df0d07e8948a1c3ffa3b6e2d7e6e63d9fb457c5da5b961ed63106594780cc7e"}, - {file = "pylint-2.15.10.tar.gz", hash = "sha256:b3dc5ef7d33858f297ac0d06cc73862f01e4f2e74025ec3eff347ce0bc60baf5"}, + {file = "pylint-2.16.2-py3-none-any.whl", hash = "sha256:ff22dde9c2128cd257c145cfd51adeff0be7df4d80d669055f24a962b351bbe4"}, + {file = "pylint-2.16.2.tar.gz", hash = "sha256:13b2c805a404a9bf57d002cd5f054ca4d40b0b87542bdaba5e05321ae8262c84"}, ] [package.dependencies] -astroid = ">=2.12.13,<=2.14.0-dev0" +astroid = ">=2.14.2,<=2.16.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = {version = ">=0.2", markers = "python_version < \"3.11\""} isort = ">=4.2.5,<6" @@ -2617,14 +2632,14 @@ test = ["asv", "gmpy2", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeo [[package]] name = "setuptools" -version = "67.0.0" +version = "67.3.2" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.0.0-py3-none-any.whl", hash = "sha256:9d790961ba6219e9ff7d9557622d2fe136816a264dd01d5997cfc057d804853d"}, - {file = "setuptools-67.0.0.tar.gz", hash = "sha256:883131c5b6efa70b9101c7ef30b2b7b780a4283d5fc1616383cdf22c83cbefe6"}, + {file = "setuptools-67.3.2-py3-none-any.whl", hash = "sha256:bb6d8e508de562768f2027902929f8523932fcd1fb784e6d573d2cafac995a48"}, + {file = "setuptools-67.3.2.tar.gz", hash = "sha256:95f00380ef2ffa41d9bba85d95b27689d923c93dfbafed4aecd7cf988a25e012"}, ] [package.extras] @@ -2658,14 +2673,14 @@ files = [ [[package]] name = "soupsieve" -version = "2.3.2.post1" +version = "2.4" description = "A modern CSS selector implementation for Beautiful Soup." category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "soupsieve-2.3.2.post1-py3-none-any.whl", hash = "sha256:3b2503d3c7084a42b1ebd08116e5f81aadfaea95863628c80a3b774a11b7c759"}, - {file = "soupsieve-2.3.2.post1.tar.gz", hash = "sha256:fc53893b3da2c33de295667a0e19f078c14bf86544af307354de5fcf12a3f30d"}, + {file = "soupsieve-2.4-py3-none-any.whl", hash = "sha256:49e5368c2cda80ee7e84da9dbe3e110b70a4575f196efb74e51b94549d921955"}, + {file = "soupsieve-2.4.tar.gz", hash = "sha256:e28dba9ca6c7c00173e34e4ba57448f0688bb681b7c5e8bf4971daafc093d69a"}, ] [[package]] @@ -2706,19 +2721,20 @@ test = ["cython", "html5lib", "pytest", "pytest-cov", "typed-ast"] [[package]] name = "sphinx-rtd-theme" -version = "1.1.1" +version = "1.2.0" description = "Read the Docs theme for Sphinx" category = "main" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "sphinx_rtd_theme-1.1.1-py2.py3-none-any.whl", hash = "sha256:31faa07d3e97c8955637fc3f1423a5ab2c44b74b8cc558a51498c202ce5cbda7"}, - {file = "sphinx_rtd_theme-1.1.1.tar.gz", hash = "sha256:6146c845f1e1947b3c3dd4432c28998a1693ccc742b4f9ad7c63129f0757c103"}, + {file = "sphinx_rtd_theme-1.2.0-py2.py3-none-any.whl", hash = "sha256:f823f7e71890abe0ac6aaa6013361ea2696fc8d3e1fa798f463e82bdb77eeff2"}, + {file = "sphinx_rtd_theme-1.2.0.tar.gz", hash = "sha256:a0d8bd1a2ed52e0b338cbe19c4b2eef3c5e7a048769753dac6a9f059c7b641b8"}, ] [package.dependencies] -docutils = "<0.18" -sphinx = ">=1.6,<6" +docutils = "<0.19" +sphinx = ">=1.6,<7" +sphinxcontrib-jquery = {version = ">=2.0.0,<3.0.0 || >3.0.0", markers = "python_version > \"3\""} [package.extras] dev = ["bump2version", "sphinxcontrib-httpdomain", "transifex-client", "wheel"] @@ -2776,20 +2792,35 @@ test = ["pytest"] [[package]] name = "sphinxcontrib-htmlhelp" -version = "2.0.0" +version = "2.0.1" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "sphinxcontrib-htmlhelp-2.0.0.tar.gz", hash = "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2"}, - {file = "sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl", hash = "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07"}, + {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, + {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, ] [package.extras] lint = ["docutils-stubs", "flake8", "mypy"] test = ["html5lib", "pytest"] +[[package]] +name = "sphinxcontrib-jquery" +version = "2.0.0" +description = "Extension to include jQuery on newer Sphinx releases" +category = "main" +optional = false +python-versions = ">=2.7" +files = [ + {file = "sphinxcontrib-jquery-2.0.0.tar.gz", hash = "sha256:8fb65f6dba84bf7bcd1aea1f02ab3955ac34611d838bcc95d4983b805b234daa"}, + {file = "sphinxcontrib_jquery-2.0.0-py3-none-any.whl", hash = "sha256:ed47fa425c338ffebe3c37e1cdb56e30eb806116b85f01055b158c7057fdb995"}, +] + +[package.dependencies] +setuptools = "*" + [[package]] name = "sphinxcontrib-jsmath" version = "1.0.1" @@ -2893,7 +2924,7 @@ greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platfo [package.extras] aiomysql = ["aiomysql", "greenlet (!=0.4.17)"] -aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing-extensions (!=3.10.0.1)"] +aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing_extensions (!=3.10.0.1)"] asyncio = ["greenlet (!=0.4.17)"] asyncmy = ["asyncmy (>=0.2.3,!=0.2.4)", "greenlet (!=0.4.17)"] mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2)"] @@ -2903,14 +2934,14 @@ mssql-pyodbc = ["pyodbc"] mypy = ["mypy (>=0.910)", "sqlalchemy2-stubs"] mysql = ["mysqlclient (>=1.4.0)", "mysqlclient (>=1.4.0,<2)"] mysql-connector = ["mysql-connector-python"] -oracle = ["cx-oracle (>=7)", "cx-oracle (>=7,<8)"] +oracle = ["cx_oracle (>=7)", "cx_oracle (>=7,<8)"] postgresql = ["psycopg2 (>=2.7)"] postgresql-asyncpg = ["asyncpg", "greenlet (!=0.4.17)"] postgresql-pg8000 = ["pg8000 (>=1.16.6,!=1.29.0)"] postgresql-psycopg2binary = ["psycopg2-binary"] postgresql-psycopg2cffi = ["psycopg2cffi"] pymysql = ["pymysql", "pymysql (<1)"] -sqlcipher = ["sqlcipher3-binary"] +sqlcipher = ["sqlcipher3_binary"] [[package]] name = "stack-data" @@ -3014,14 +3045,14 @@ test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"] [[package]] name = "typing-extensions" -version = "4.4.0" +version = "4.5.0" description = "Backported and Experimental Type Hints for Python 3.7+" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "typing_extensions-4.4.0-py3-none-any.whl", hash = "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e"}, - {file = "typing_extensions-4.4.0.tar.gz", hash = "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa"}, + {file = "typing_extensions-4.5.0-py3-none-any.whl", hash = "sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4"}, + {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, ] [[package]] @@ -3043,24 +3074,24 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.17.1" +version = "20.19.0" description = "Virtual Python Environment builder" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "virtualenv-20.17.1-py3-none-any.whl", hash = "sha256:ce3b1684d6e1a20a3e5ed36795a97dfc6af29bc3970ca8dab93e11ac6094b3c4"}, - {file = "virtualenv-20.17.1.tar.gz", hash = "sha256:f8b927684efc6f1cc206c9db297a570ab9ad0e51c16fa9e45487d36d1905c058"}, + {file = "virtualenv-20.19.0-py3-none-any.whl", hash = "sha256:54eb59e7352b573aa04d53f80fc9736ed0ad5143af445a1e539aada6eb947dd1"}, + {file = "virtualenv-20.19.0.tar.gz", hash = "sha256:37a640ba82ed40b226599c522d411e4be5edb339a0c0de030c0dc7b646d61590"}, ] [package.dependencies] distlib = ">=0.3.6,<1" filelock = ">=3.4.1,<4" -platformdirs = ">=2.4,<3" +platformdirs = ">=2.4,<4" [package.extras] -docs = ["proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-argparse (>=0.3.2)", "sphinx-rtd-theme (>=1)", "towncrier (>=22.8)"] -testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=21.3)", "pytest (>=7.0.1)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.6.1)", "pytest-randomly (>=3.10.3)", "pytest-timeout (>=2.1)"] +docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=22.12)"] +test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23)", "pytest (>=7.2.1)", "pytest-env (>=0.8.1)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.10)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)"] [[package]] name = "wcwidth" @@ -3173,14 +3204,14 @@ files = [ [[package]] name = "zipp" -version = "3.12.0" +version = "3.13.0" description = "Backport of pathlib-compatible object wrapper for zip files" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "zipp-3.12.0-py3-none-any.whl", hash = "sha256:9eb0a4c5feab9b08871db0d672745b53450d7f26992fd1e4653aa43345e97b86"}, - {file = "zipp-3.12.0.tar.gz", hash = "sha256:73efd63936398aac78fd92b6f4865190119d6c91b531532e798977ea8dd402eb"}, + {file = "zipp-3.13.0-py3-none-any.whl", hash = "sha256:e8b2a36ea17df80ffe9e2c4fda3f693c3dad6df1697d3cd3af232db680950b0b"}, + {file = "zipp-3.13.0.tar.gz", hash = "sha256:23f70e964bc11a34cef175bc90ba2914e1e4545ea1e3e2f67c079671883f9cb6"}, ] [package.extras] @@ -3195,4 +3226,4 @@ mark = ["banana-hep", "sqlalchemy", "pandas", "matplotlib"] [metadata] lock-version = "2.0" python-versions = "^3.8,<3.11" -content-hash = "353908a1dad777bf5ca1b4204500c6ee7cbc3da671d3b234a29d5adc34eb5349" +content-hash = "0813035b8f6fa92fa6a2c55fe8a46bc1cb94eef03a088811e764c43bf31f6abf" diff --git a/pyproject.toml b/pyproject.toml index cebf5d0ee..cdf9bae73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ sphinx-rtd-theme = { version = "^1.0.0", optional = true } sphinxcontrib-bibtex = { version = "^2.4.1", optional = true } nbsphinx = { version = "^0.8.8", optional = true } # ekomark -banana-hep = { version = "^0.6.6", optional = true } +banana-hep = { version = "^0.6.8", optional = true } sqlalchemy = { version = "^1.4.21", optional = true } pandas = { version = "^1.3.0", optional = true } matplotlib = { version = "^3.5.1", optional = true } From 26f61c595c9c0cd104a3d8f26245cb386de4b42c Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 15 Feb 2023 18:41:48 +0100 Subject: [PATCH 47/67] Fix LHA SV --- benchmarks/lha_paper_bench.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/benchmarks/lha_paper_bench.py b/benchmarks/lha_paper_bench.py index f87e75210..e78765a60 100644 --- a/benchmarks/lha_paper_bench.py +++ b/benchmarks/lha_paper_bench.py @@ -77,10 +77,12 @@ def sv_theories(self, pto): low = self.theory.copy() low["PTO"] = pto low["fact_to_ren_scale_ratio"] = np.sqrt(1.0 / 2.0) + low["XIF"] = np.sqrt(1.0 / 2.0) low["ModSV"] = "exponentiated" high = self.theory.copy() high["PTO"] = pto high["fact_to_ren_scale_ratio"] = np.sqrt(2.0) + high["XIF"] = np.sqrt(2.0) high["ModSV"] = "exponentiated" return [high, low] @@ -243,12 +245,11 @@ def run_lha(self, theory_updates): if __name__ == "__main__": - # Benchmark to LHA obj = BenchmarkFFNS_polarized() # obj = BenchmarkFFNS() - obj.benchmark_plain(1) - # obj.benchmark_sv(2) + # obj.benchmark_plain(1) + obj.benchmark_sv(1) # # VFNS benchmarks with LHA settings # programs = ["LHA", "pegasus", "apfel"] From 7496c8ce6798ea2bba0301ed9337d58cd879f39c Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Wed, 15 Feb 2023 18:56:31 +0100 Subject: [PATCH 48/67] Fix tests --- tests/eko/evolution_operator/test_init.py | 2 +- .../polarized/space_like/test_init.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/eko/evolution_operator/test_init.py b/tests/eko/evolution_operator/test_init.py index a3c0f9e6f..fdefcfe2b 100644 --- a/tests/eko/evolution_operator/test_init.py +++ b/tests/eko/evolution_operator/test_init.py @@ -16,7 +16,7 @@ def test_quad_ker_errors(): - for p, t in [(True, False), (False, True), (True, True)]: + for p, t in [(False, True), (True, True)]: for mode0 in [br.non_singlet_pids_map["ns+"], 21]: with pytest.raises(NotImplementedError): quad_ker( diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py index 3cb137b13..b4453bc88 100644 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py @@ -1,10 +1,9 @@ -import pytest +import numpy as np import ekore.anomalous_dimensions.polarized.space_like as ad_ps def test_init(): - with pytest.raises(NotImplementedError): - ad_ps.gamma_ns((1, 0), 0, 1.0, 4) - with pytest.raises(NotImplementedError): - ad_ps.gamma_singlet((1, 0), 1.0, 4) + for k in range(1, 3 + 1): + assert ad_ps.gamma_ns((k, 0), 10101, 2.0, 4).shape == (k,) + assert ad_ps.gamma_singlet((k, 0), 2.0, 4).shape == (k, 2, 2) From 0027f2607e487242355f5d9f6346a42438890aba Mon Sep 17 00:00:00 2001 From: Giacomo Magni <39065935+giacomomagni@users.noreply.github.com> Date: Thu, 16 Feb 2023 08:55:16 +0100 Subject: [PATCH 49/67] Update src/eko/evolution_operator/grid.py Co-authored-by: Alessandro Candido --- src/eko/evolution_operator/grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eko/evolution_operator/grid.py b/src/eko/evolution_operator/grid.py index d76f7f7b5..8e8fc923b 100644 --- a/src/eko/evolution_operator/grid.py +++ b/src/eko/evolution_operator/grid.py @@ -106,7 +106,7 @@ def __init__( if order == (1, 0) and method != "iterate-exact": logger.warning("Evolution: In LO we use the exact solution always!") - logger.info(("P" if configs.polarized else "Unp") + "olarized evolution") + logger.info(dict(polarized=configs.polarized)) self.config = config self.q2_grid = mu2grid From b0f9469323b0cd2ca1364c3429b2835266072455 Mon Sep 17 00:00:00 2001 From: Giacomo Magni <39065935+giacomomagni@users.noreply.github.com> Date: Thu, 16 Feb 2023 08:55:26 +0100 Subject: [PATCH 50/67] Update src/ekomark/benchmark/external/LHA_utils.py Co-authored-by: Alessandro Candido --- src/ekomark/benchmark/external/LHA_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ekomark/benchmark/external/LHA_utils.py b/src/ekomark/benchmark/external/LHA_utils.py index 1f58505f1..fc29af48e 100644 --- a/src/ekomark/benchmark/external/LHA_utils.py +++ b/src/ekomark/benchmark/external/LHA_utils.py @@ -52,7 +52,9 @@ # rotate basis def rotate_data(raw, is_ffns_nnlo=False, rotate_to_evolution_basis=False): - """Rotate data either to flavor space or evolution space (from LHA space) which is yet an other basis. + """Rotate data in flavor space. + + Rotate either to flavor basis or evolution basis from the LHA basis, which is yet an other basis. Parameters ---------- From 4343e3b3c46be9addef3c44e237c92f1ad04c6e6 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 16 Feb 2023 11:47:42 +0100 Subject: [PATCH 51/67] Add NNPDFpol bench --- benchmarks/NNPDF_bench.py | 40 +++++++++++++++++-- .../benchmark/external/lhapdf_utils.py | 30 ++++++-------- 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/benchmarks/NNPDF_bench.py b/benchmarks/NNPDF_bench.py index 053c6960d..74eb7d3c2 100644 --- a/benchmarks/NNPDF_bench.py +++ b/benchmarks/NNPDF_bench.py @@ -4,6 +4,7 @@ import numpy as np from banana import register +from eko import interpolation from ekomark.benchmark.runner import Runner register(__file__) @@ -90,14 +91,45 @@ def benchmark_nnlo(self, Q0=1.65, Q2grid=(100,)): self.run([theory_card], [operator_card], ["NNPDF40_nnlo_as_01180"]) +class BenchmarkNNPDFpol11(BenchmarkNNPDF): + """Benchmark NNPDFpol11""" + + def benchmark(self, Q0=1.65, Q2grid=(100,)): + theory_card = { + "Qref": 91.2, + "mc": 1.41421, + "mb": 4.75, + "mt": 175, + "kcThr": 1.0, + "kbThr": 1.0, + "ktThr": 1.0, + "alphas": 0.119002, + "alphaqed": 0.007496, + "FNS": "ZM-VFNS", + "ModEv": "TRN", + "Q0": Q0, + "PTO": 1, + } + + operator_card = { + **base_operator, + "Q2grid": list(Q2grid), + "polarized": [True], + "interpolation_xgrid": interpolation.lambertgrid(50, 1e-5), + } + self.run([theory_card], [operator_card], ["NNPDFpol11_100"]) + + if __name__ == "__main__": - low2 = 4**2 + low2 = 5**2 high2 = 30**2 # nn31 = BenchmarkNNPDF31() # # test forward # nn31.benchmark_nlo(Q0=np.sqrt(low2), Q2grid=[10]) # # test backward # #nn31.benchmark_nlo(Q0=np.sqrt(high2), Q2grid=[low2]) - nn40 = BenchmarkNNPDF40() - # nn40.benchmark_nnlo(Q2grid=[100]) - nn40.benchmark_nnlo(Q0=np.sqrt(high2), Q2grid=[low2]) + # nn40 = BenchmarkNNPDF40() + # # nn40.benchmark_nnlo(Q2grid=[100]) + # nn40.benchmark_nnlo(Q0=np.sqrt(high2), Q2grid=[low2]) + nnpol = BenchmarkNNPDFpol11() + nnpol.benchmark(Q0=np.sqrt(high2), Q2grid=[low2]) diff --git a/src/ekomark/benchmark/external/lhapdf_utils.py b/src/ekomark/benchmark/external/lhapdf_utils.py index fa3095d51..669563dea 100644 --- a/src/ekomark/benchmark/external/lhapdf_utils.py +++ b/src/ekomark/benchmark/external/lhapdf_utils.py @@ -1,6 +1,4 @@ -""" -LHAPDF interface -""" +"""LHAPDF interface.""" import numpy as np from eko import basis_rotation as br @@ -12,29 +10,27 @@ def compute_LHAPDF_data(operators, pdf, skip_pdfs, rotate_to_evolution_basis=Fal Parameters ---------- - operators : dict - operators card - pdf : lhapdf_type - pdf - skip_pdfs : list - list of pdfs (pid or name) to skip - rotate_to_evolution_basis: bool - rotate to evolution basis + operators : dict + operators card + pdf : lhapdf_type + pdf + skip_pdfs : list + list of pdfs (pid or name) to skip + rotate_to_evolution_basis: bool + rotate to evolution basis Returns ------- - ref : dict - output containing: target_xgrid, values - """ + ref : dict + output containing: target_xgrid, values - target_xgrid = operators["xgrid"] + """ + target_xgrid = operators["interpolation_xgrid"] out_tabs = {} for q2 in operators["Q2grid"]: - tab = {} for pid in br.flavor_basis_pids: - if pid in skip_pdfs: continue From a615c26d4ab645f1a59850e679f458f1bc603648 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 16 Feb 2023 12:33:33 +0100 Subject: [PATCH 52/67] Add DSSV bench --- benchmarks/DSSV_bench.py | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 benchmarks/DSSV_bench.py diff --git a/benchmarks/DSSV_bench.py b/benchmarks/DSSV_bench.py new file mode 100644 index 000000000..f10b0200d --- /dev/null +++ b/benchmarks/DSSV_bench.py @@ -0,0 +1,56 @@ +"""Benchmark DSSV pdf family. + +Note that the PDF set is private, but can be obtained from the +authors upon request. +""" +import numpy as np +from banana import register + +from eko import interpolation +from ekomark.benchmark.runner import Runner + +register(__file__) + + +class BenchmarkDSSV(Runner): + """Benchmark DSSV pdf family.""" + + external = "LHAPDF" + + # Rotate to evolution basis + rotate_to_evolution_basis = True + + def skip_pdfs(self, _theory): + return [-6, 6, 5, -5, 4, -4, 22, "ph", "T35", "V35", "T24", "V24", "T15", "V15"] + + def benchmark(self, Q0=1.65, Q2grid=(100,)): + theory_card = { + "Qref": 1.0, + "mc": 1.4, + "mb": 4.75, + "mt": 175, + "kcThr": 1.0, + "kbThr": 1.0, + "ktThr": 1.0, + "alphas": 0.49127999999999999, + "FNS": "ZM-VFNS", + "ModEv": "EXA", + "Q0": Q0, + "PTO": 1, + "MaxNfPdf": 3, + "MaxNfAs": 3, + } + + operator_card = { + "Q2grid": list(Q2grid), + "polarized": [True], + "interpolation_xgrid": interpolation.lambertgrid(50, 1e-5), + } + self.run([theory_card], [operator_card], ["DSSV_REP_LHAPDF6"]) + + +if __name__ == "__main__": + low2 = 5**2 + high2 = 30**2 + dssv = BenchmarkDSSV() + dssv.benchmark(Q0=np.sqrt(low2), Q2grid=[high2]) From 243146a52fd1e156f8c9c7f504b16a8cb8558750 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 16 Feb 2023 12:38:59 +0100 Subject: [PATCH 53/67] Do forward evln --- benchmarks/NNPDF_bench.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/NNPDF_bench.py b/benchmarks/NNPDF_bench.py index 74eb7d3c2..e0a90ec99 100644 --- a/benchmarks/NNPDF_bench.py +++ b/benchmarks/NNPDF_bench.py @@ -132,4 +132,4 @@ def benchmark(self, Q0=1.65, Q2grid=(100,)): # # nn40.benchmark_nnlo(Q2grid=[100]) # nn40.benchmark_nnlo(Q0=np.sqrt(high2), Q2grid=[low2]) nnpol = BenchmarkNNPDFpol11() - nnpol.benchmark(Q0=np.sqrt(high2), Q2grid=[low2]) + nnpol.benchmark(Q0=np.sqrt(low2), Q2grid=[high2]) From e498019a9a280b2d2effc12f148673a3dbe211a5 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 17 Feb 2023 14:47:15 +0100 Subject: [PATCH 54/67] provide more tests --- doc/source/development/Benchmarks.rst | 7 + tests/eko/evolution_operator/test_init.py | 127 +++++++++--------- .../polarized/space_like/test_ad_as3.py | 11 ++ .../polarized/space_like/test_init.py | 35 ++++- 4 files changed, 116 insertions(+), 64 deletions(-) diff --git a/doc/source/development/Benchmarks.rst b/doc/source/development/Benchmarks.rst index 758bae648..42b2bd795 100644 --- a/doc/source/development/Benchmarks.rst +++ b/doc/source/development/Benchmarks.rst @@ -45,6 +45,13 @@ List of bugs in :cite:`Dittmar:2005ed` - in table 15, part 1: :math:`xd_v(x=10^{-4}, \mu_F^2 = 10^4~\mathrm{GeV}^2) = 1.0699\cdot 10^{-4}` (wrong exponent) and :math:`xg(x=10^{-4}, \mu_F^2 = 10^4~\mathrm{GeV}^2) = 9.9694\cdot 10^{2}` (wrong exponent) +- in table 16: the distribution :math:`L_{m}` is not vanishing despite the benchmark table is produced using the + toy PDF used, defined in :eqref:`4.57`, has :math:`\bar{u} = \bar{d}`. This means that :math:`T_3` + is not correct. The whole colum of :math:`L_{m}` should be set to 0, sine at |LO| it is not possible + to generate a difference between :math:`\bar{u}` and :math:`\bar{d}` + +- in table 17: same as before :math:`L_{m}` is bugged. + LHAPDF ------ diff --git a/tests/eko/evolution_operator/test_init.py b/tests/eko/evolution_operator/test_init.py index fdefcfe2b..84a1a0936 100644 --- a/tests/eko/evolution_operator/test_init.py +++ b/tests/eko/evolution_operator/test_init.py @@ -53,69 +53,70 @@ def test_quad_ker(monkeypatch): monkeypatch.setattr(ns, "dispatcher", lambda *args: 1.0) monkeypatch.setattr(s, "dispatcher", lambda *args: np.identity(2)) for is_log in [True, False]: - res_ns = quad_ker( - u=0, - order=(1, 0), - mode0=br.non_singlet_pids_map["ns+"], - mode1=0, - method="", - is_log=is_log, - logx=0.0, - areas=np.zeros(3), - as1=1, - as0=2, - nf=3, - L=0, - ev_op_iterations=0, - ev_op_max_order=(0, 0), - sv_mode=1, - is_threshold=False, - is_polarized=False, - is_time_like=False, - ) - np.testing.assert_allclose(res_ns, 0.0) - res_s = quad_ker( - u=0, - order=(1, 0), - mode0=100, - mode1=100, - method="", - is_log=is_log, - logx=0.123, - areas=np.zeros(3), - as1=1, - as0=2, - nf=3, - L=0, - ev_op_iterations=0, - ev_op_max_order=(0, 0), - sv_mode=1, - is_threshold=False, - is_polarized=False, - is_time_like=False, - ) - np.testing.assert_allclose(res_s, 1.0) - res_s = quad_ker( - u=0, - order=(1, 0), - mode0=100, - mode1=21, - method="", - is_log=is_log, - logx=0.0, - areas=np.zeros(3), - as1=1, - as0=2, - nf=3, - L=0, - ev_op_iterations=0, - ev_op_max_order=(0, 0), - sv_mode=1, - is_threshold=False, - is_polarized=False, - is_time_like=False, - ) - np.testing.assert_allclose(res_s, 0.0) + for polarized in [True, False]: + res_ns = quad_ker( + u=0, + order=(1, 0), + mode0=br.non_singlet_pids_map["ns+"], + mode1=0, + method="", + is_log=is_log, + logx=0.0, + areas=np.zeros(3), + as1=1, + as0=2, + nf=3, + L=0, + ev_op_iterations=0, + ev_op_max_order=(0, 0), + sv_mode=1, + is_threshold=False, + is_polarized=polarized, + is_time_like=False, + ) + np.testing.assert_allclose(res_ns, 0.0) + res_s = quad_ker( + u=0, + order=(1, 0), + mode0=100, + mode1=100, + method="", + is_log=is_log, + logx=0.123, + areas=np.zeros(3), + as1=1, + as0=2, + nf=3, + L=0, + ev_op_iterations=0, + ev_op_max_order=(0, 0), + sv_mode=1, + is_threshold=False, + is_polarized=polarized, + is_time_like=False, + ) + np.testing.assert_allclose(res_s, 1.0) + res_s = quad_ker( + u=0, + order=(1, 0), + mode0=100, + mode1=21, + method="", + is_log=is_log, + logx=0.0, + areas=np.zeros(3), + as1=1, + as0=2, + nf=3, + L=0, + ev_op_iterations=0, + ev_op_max_order=(0, 0), + sv_mode=1, + is_threshold=False, + is_polarized=polarized, + is_time_like=False, + ) + np.testing.assert_allclose(res_s, 0.0) for label in [(br.non_singlet_pids_map["ns+"], 0), (100, 100)]: for sv in [2, 3]: res_sv = quad_ker( diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py index e08518864..49042b073 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py @@ -2,6 +2,7 @@ import numpy as np import ekore.anomalous_dimensions.polarized.space_like.as3 as as3 +import ekore.anomalous_dimensions.unpolarized.space_like.as3 as as3_unpol from ekore import harmonics nf = 5 @@ -34,3 +35,13 @@ def test_ns_sea(): N = 1 + 2 * i sx = harmonics.sx(N, max_weight=4) np.testing.assert_allclose(-as3.gamma_nss(N, nf, sx), mom * nf, rtol=7e-7) + + +def test_ns(): + N = complex(3.45, 0.0) + sx = harmonics.sx(N, max_weight=4) + np.testing.assert_allclose( + as3.gamma_nsv(N, nf, sx), as3.gamma_nsm(N, nf, sx) + as3.gamma_nss(N, nf, sx) + ) + np.testing.assert_allclose(as3_unpol.gamma_nsp(N, nf, sx), as3.gamma_nsp(N, nf, sx)) + np.testing.assert_allclose(as3_unpol.gamma_nsp(N, nf, sx), as3.gamma_nsm(N, nf, sx)) diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py index b4453bc88..a53a80c3f 100644 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py @@ -1,9 +1,42 @@ import numpy as np +import pytest +from numpy.testing import assert_allclose, assert_almost_equal import ekore.anomalous_dimensions.polarized.space_like as ad_ps +from eko import basis_rotation as br -def test_init(): +def test_shapes(): for k in range(1, 3 + 1): assert ad_ps.gamma_ns((k, 0), 10101, 2.0, 4).shape == (k,) assert ad_ps.gamma_singlet((k, 0), 2.0, 4).shape == (k, 2, 2) + + +def test_gamma_ns(): + nf = 3 + # LO + assert_almost_equal( + ad_ps.gamma_ns((3, 0), br.non_singlet_pids_map["ns+"], 1, nf)[0], 0.0 + ) + # NLO + assert_allclose( + ad_ps.gamma_ns((2, 0), br.non_singlet_pids_map["ns+"], 1, nf), + np.zeros(2), + atol=2e-6, + ) + # NNLO + assert_allclose( + ad_ps.gamma_ns((3, 0), br.non_singlet_pids_map["ns+"], 1, nf), + np.zeros(3), + atol=2e-4, + ) + assert not np.array_equal( + ad_ps.gamma_ns((3, 0), br.non_singlet_pids_map["nsV"], 1, nf), np.zeros(3) + ) + + +def test_not_implemeted(): + with pytest.raises(NotImplementedError): + ad_ps.gamma_ns((4, 0), br.non_singlet_pids_map["ns-"], 1.234, 4) + with pytest.raises(NotImplementedError): + ad_ps.gamma_ns((2, 0), 10202, 1.234, 4) From b444e8efdfd67b73cc78c4dd9b52e937de7af5d6 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Fri, 17 Feb 2023 14:53:05 +0100 Subject: [PATCH 55/67] fix typo --- .../anomalous_dimensions/polarized/space_like/test_ad_as3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py index 49042b073..1b21097c6 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as3.py @@ -43,5 +43,5 @@ def test_ns(): np.testing.assert_allclose( as3.gamma_nsv(N, nf, sx), as3.gamma_nsm(N, nf, sx) + as3.gamma_nss(N, nf, sx) ) - np.testing.assert_allclose(as3_unpol.gamma_nsp(N, nf, sx), as3.gamma_nsp(N, nf, sx)) + np.testing.assert_allclose(as3_unpol.gamma_nsm(N, nf, sx), as3.gamma_nsp(N, nf, sx)) np.testing.assert_allclose(as3_unpol.gamma_nsp(N, nf, sx), as3.gamma_nsm(N, nf, sx)) From 65a81ee588e2c27213fc86d309a62d0ac585133f Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Sat, 18 Feb 2023 09:02:04 +0100 Subject: [PATCH 56/67] recover full coverage --- tests/eko/evolution_operator/test_init.py | 6 +++--- .../polarized/space_like/test_init.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/eko/evolution_operator/test_init.py b/tests/eko/evolution_operator/test_init.py index 84a1a0936..ddda30d13 100644 --- a/tests/eko/evolution_operator/test_init.py +++ b/tests/eko/evolution_operator/test_init.py @@ -61,8 +61,8 @@ def test_quad_ker(monkeypatch): mode1=0, method="", is_log=is_log, - logx=0.0, - areas=np.zeros(3), + logx=0.1, + areas=[0.1, 0.2, 0.3], as1=1, as0=2, nf=3, @@ -74,7 +74,7 @@ def test_quad_ker(monkeypatch): is_polarized=polarized, is_time_like=False, ) - np.testing.assert_allclose(res_ns, 0.0) + np.testing.assert_allclose(res_ns, 1.0) res_s = quad_ker( u=0, order=(1, 0), diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py index a53a80c3f..98e753c05 100644 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_init.py @@ -4,6 +4,7 @@ import ekore.anomalous_dimensions.polarized.space_like as ad_ps from eko import basis_rotation as br +from ekore import harmonics def test_shapes(): @@ -35,8 +36,16 @@ def test_gamma_ns(): ) -def test_not_implemeted(): +def test_not_implemeted(monkeypatch): with pytest.raises(NotImplementedError): ad_ps.gamma_ns((4, 0), br.non_singlet_pids_map["ns-"], 1.234, 4) with pytest.raises(NotImplementedError): ad_ps.gamma_ns((2, 0), 10202, 1.234, 4) + N = 2.345 + monkeypatch.setattr( + ad_ps, + "compute_cache", + lambda *args: harmonics.sx(N, 4), + ) + with pytest.raises(NotImplementedError): + ad_ps.gamma_singlet((4, 0), N, 4) From b5f242bb1c3f3ecc433bf6c44805415166b33ec3 Mon Sep 17 00:00:00 2001 From: aschaus Date: Sun, 19 Feb 2023 21:53:44 +0100 Subject: [PATCH 57/67] Revert "Document modified to describe pol AD" This reverts commit 86dbd73131f14f1fade10c4904fbafff453326e6, reversing changes made to 243146a52fd1e156f8c9c7f504b16a8cb8558750. --- doc/source/theory/pQCD.rst | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index 76e605a5f..ad8422671 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -83,33 +83,6 @@ where :math:`a = \alpha/(4\pi)`. The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| splitting kernels are given in :cite:`deFlorian:2015ujt,deFlorian:2016gvk` -Polarised Splitting Functions ------------------------------ -Polarised Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. - -The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. - -At |LO|, the non-singlet is the same in both the polarized and unpolarized case. Due to helicity conservation, the first moment of the anomalous dimension is :math:`\gamma_{qq} (N=1) = \gamma_{qg} (N=1) = 0`. - -At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomposed into the pure singlet (consisting of the flavour independent quark-quark and quark-antiquark anomalous dimensions) and the plus flavour asymmetry non-singlet: - -.. math :: - \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ - -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarised parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helictites. The first moments of the anomalous dimensions are: - -.. math :: - \gamma_{ns}^+ (N=1) = 0 \\ - \gamma_{qq} (N=1) = 24 C_F T_R \\ - \gamma_{qg} (N=1) = 0 \\ - -At |NNLO| the non-singlet is further decomposed into the helicity difference quark-antiquark anomalous dimension called the valence polarized non-singlet and defined as: - -.. math :: - \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} - -where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. - Order specification ------------------- From 4fbef559692d50869d3c7bd6cfe01227b36094d8 Mon Sep 17 00:00:00 2001 From: aschaus Date: Sun, 19 Feb 2023 21:58:12 +0100 Subject: [PATCH 58/67] documentation on pol splitting functions --- doc/source/theory/pQCD.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index ad8422671..ac1eb4ffa 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -83,6 +83,33 @@ where :math:`a = \alpha/(4\pi)`. The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| splitting kernels are given in :cite:`deFlorian:2015ujt,deFlorian:2016gvk` +Polarised Splitting Functions +----------------------------- +Polarised Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. + +The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. + +At |LO|, the non-singlet is the same in both the polarized and unpolarized case. Due to helicity conservation, the first moment of the anomalous dimension is :math:`\gamma_{qq} (N=1) = \gamma_{qg} (N=1) = 0`. + +At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomposed into the pure singlet (consisting of the flavour independent quark-quark and quark-antiquark anomalous dimensions) and the plus flavour asymmetry non-singlet: + +.. math :: + \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ + +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarised parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimensions are: + +.. math :: + \gamma_{ns}^+ (N=1) = 0 \\ + \gamma_{qq} (N=1) = 24 C_F T_R \\ + \gamma_{qg} (N=1) = 0 \\ + +At |NNLO| the non-singlet is further decomposed into the helicity difference quark-antiquark anomalous dimension called the valence polarized non-singlet and defined as: + +.. math :: + \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} + +where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. + Order specification ------------------- From 6e0f23308ac822f154ded56d1dedd3bcc830a4d7 Mon Sep 17 00:00:00 2001 From: aschaus Date: Sun, 19 Feb 2023 21:59:41 +0100 Subject: [PATCH 59/67] Revert "documentation on pol splitting functions" This reverts commit 4fbef559692d50869d3c7bd6cfe01227b36094d8. --- doc/source/theory/pQCD.rst | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index ac1eb4ffa..ad8422671 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -83,33 +83,6 @@ where :math:`a = \alpha/(4\pi)`. The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| splitting kernels are given in :cite:`deFlorian:2015ujt,deFlorian:2016gvk` -Polarised Splitting Functions ------------------------------ -Polarised Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. - -The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. - -At |LO|, the non-singlet is the same in both the polarized and unpolarized case. Due to helicity conservation, the first moment of the anomalous dimension is :math:`\gamma_{qq} (N=1) = \gamma_{qg} (N=1) = 0`. - -At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomposed into the pure singlet (consisting of the flavour independent quark-quark and quark-antiquark anomalous dimensions) and the plus flavour asymmetry non-singlet: - -.. math :: - \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ - -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarised parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimensions are: - -.. math :: - \gamma_{ns}^+ (N=1) = 0 \\ - \gamma_{qq} (N=1) = 24 C_F T_R \\ - \gamma_{qg} (N=1) = 0 \\ - -At |NNLO| the non-singlet is further decomposed into the helicity difference quark-antiquark anomalous dimension called the valence polarized non-singlet and defined as: - -.. math :: - \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} - -where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. - Order specification ------------------- From 0aa9059854f6b62895243d1127ec05e63ea73c79 Mon Sep 17 00:00:00 2001 From: aschaus Date: Sun, 19 Feb 2023 22:00:42 +0100 Subject: [PATCH 60/67] documentation for pol splitting functions --- doc/source/theory/pQCD.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index ad8422671..fb853b97a 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -83,6 +83,34 @@ where :math:`a = \alpha/(4\pi)`. The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| splitting kernels are given in :cite:`deFlorian:2015ujt,deFlorian:2016gvk` +Polarized Splitting Functions +----------------------------- +Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. + +The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. + +At |LO|, the non-singlet is the same in both the polarized and unpolarized case. Due to helicity conservation, the first moment of the anomalous dimension is :math:`\gamma_{qq} (N=1) = \gamma_{qg} (N=1) = 0`. + +At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomposed into the pure singlet (consisting of the flavour independent quark-quark and quark-antiquark anomalous dimensions) and the plus flavour asymmetry non-singlet: + +.. math :: + \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ + +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helictites. The first moments of the anomalous dimensions are: + +.. math :: + \gamma_{ns}^+ (N=1) = 0 \\ + \gamma_{qq} (N=1) = 24 C_F T_R \\ + \gamma_{qg} (N=1) = 0 \\ + +At |NNLO| the non-singlet is further decomposed into the helicity difference quark-antiquark anomalous dimension called the valence polarized non-singlet and defined as: + +.. math :: + \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} + +where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. + + Order specification ------------------- From 00810a0aa6ecfe1c64e47d656664a7ba961264d2 Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 20 Feb 2023 09:29:27 +0100 Subject: [PATCH 61/67] added test to NLO pol AD --- .../polarized/space_like/test_ad_as2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py index cc7034c96..c26f2f6c5 100755 --- a/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py +++ b/tests/ekore/anomalous_dimensions/polarized/space_like/test_ad_as2.py @@ -14,6 +14,14 @@ def test_qg_helicity_conservation(): np.testing.assert_almost_equal(as2.gamma_qg(N, nf, sx), 0) +def test_qq_momentum(): + N = complex(1.0, 0.0) + sx = harmonics.sx(N, max_weight=2) + np.testing.assert_almost_equal( + as2.gamma_singlet(N, nf, sx)[0, 0], 12 * TR * nf * CF, decimal=5 + ) + + def test_ps_momentum(): N = complex(2.0, 0.0) np.testing.assert_allclose(-as2.gamma_ps(N, nf), -4.0 * TR * nf * CF * 13 / 27) From 14023e3e0d1c58e6f9985666e33f4959c18a60d5 Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 20 Feb 2023 11:18:05 +0100 Subject: [PATCH 62/67] minor correction --- doc/source/theory/pQCD.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index fb853b97a..270233018 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -85,7 +85,7 @@ The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| sp Polarized Splitting Functions ----------------------------- -Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. +Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicities. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. @@ -96,7 +96,7 @@ At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomp .. math :: \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helictites. The first moments of the anomalous dimensions are: +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimenssions are: .. math :: \gamma_{ns}^+ (N=1) = 0 \\ @@ -108,7 +108,7 @@ At |NNLO| the non-singlet is further decomposed into the helicity difference qua .. math :: \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} -where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. +where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_{qq}` is defined as above in the |NLO| case. Order specification From dfdf2ab7d0b381ce35af00e77951454a23c4c120 Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 20 Feb 2023 11:20:40 +0100 Subject: [PATCH 63/67] Revert "minor correction" This reverts commit 14023e3e0d1c58e6f9985666e33f4959c18a60d5. --- doc/source/theory/pQCD.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index 270233018..fb853b97a 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -85,7 +85,7 @@ The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| sp Polarized Splitting Functions ----------------------------- -Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicities. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. +Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. @@ -96,7 +96,7 @@ At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomp .. math :: \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimenssions are: +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helictites. The first moments of the anomalous dimensions are: .. math :: \gamma_{ns}^+ (N=1) = 0 \\ @@ -108,7 +108,7 @@ At |NNLO| the non-singlet is further decomposed into the helicity difference qua .. math :: \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} -where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_{qq}` is defined as above in the |NLO| case. +where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. Order specification From b4d8b96034b7cfb9cd4c35cfc649e7773afb5a7c Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 20 Feb 2023 11:23:55 +0100 Subject: [PATCH 64/67] minor correction --- doc/source/theory/pQCD.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index fb853b97a..fd872374e 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -85,7 +85,7 @@ The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| sp Polarized Splitting Functions ----------------------------- -Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. +Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicities. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. @@ -96,7 +96,7 @@ At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomp .. math :: \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helictites. The first moments of the anomalous dimensions are: +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimensions are: .. math :: \gamma_{ns}^+ (N=1) = 0 \\ @@ -108,7 +108,7 @@ At |NNLO| the non-singlet is further decomposed into the helicity difference qua .. math :: \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} -where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. +where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_{qq}` is defined as above in the |NLO| case. Order specification From 79745e97a86d3c1461d26600e733eef57635ea3a Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 20 Feb 2023 12:06:11 +0100 Subject: [PATCH 65/67] Revert "minor correction" This reverts commit b4d8b96034b7cfb9cd4c35cfc649e7773afb5a7c. --- doc/source/theory/pQCD.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index fd872374e..fb853b97a 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -85,7 +85,7 @@ The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| sp Polarized Splitting Functions ----------------------------- -Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicities. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. +Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. @@ -96,7 +96,7 @@ At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomp .. math :: \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimensions are: +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helictites. The first moments of the anomalous dimensions are: .. math :: \gamma_{ns}^+ (N=1) = 0 \\ @@ -108,7 +108,7 @@ At |NNLO| the non-singlet is further decomposed into the helicity difference qua .. math :: \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} -where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_{qq}` is defined as above in the |NLO| case. +where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. Order specification From 9c9b7b8ea4a1f0b7912d150b844a4e855494d4de Mon Sep 17 00:00:00 2001 From: aschaus Date: Mon, 20 Feb 2023 12:07:54 +0100 Subject: [PATCH 66/67] minor corrections --- doc/source/theory/pQCD.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index fb853b97a..953c57f8d 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -85,7 +85,7 @@ The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| sp Polarized Splitting Functions ----------------------------- -Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicties. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. +Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicities. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. @@ -94,9 +94,9 @@ At |LO|, the non-singlet is the same in both the polarized and unpolarized case. At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomposed into the pure singlet (consisting of the flavour independent quark-quark and quark-antiquark anomalous dimensions) and the plus flavour asymmetry non-singlet: .. math :: - \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^- \\ + \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^+ \\ -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helictites. The first moments of the anomalous dimensions are: +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimensions are: .. math :: \gamma_{ns}^+ (N=1) = 0 \\ @@ -108,7 +108,7 @@ At |NNLO| the non-singlet is further decomposed into the helicity difference qua .. math :: \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} -where :math:`\gamma_{ns}^+` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_qq` is defined as above in the |NLO| case. +where :math:`\gamma_{ns}^-` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_{qq}` is defined as above in the |NLO| case. Order specification From 3be9aae759d72ab496170bcbe15cd95987aed416 Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Tue, 21 Feb 2023 09:16:24 +0100 Subject: [PATCH 67/67] =?UTF-8?q?move=20the=20docs=20u=C3=ACone=20paragrap?= =?UTF-8?q?h=20up=20and=20minor=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/source/theory/pQCD.rst | 66 ++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/doc/source/theory/pQCD.rst b/doc/source/theory/pQCD.rst index 953c57f8d..47f7a625f 100644 --- a/doc/source/theory/pQCD.rst +++ b/doc/source/theory/pQCD.rst @@ -64,51 +64,63 @@ coupling :math:`a_s(\mu^2)` and are given by :cite:`Moch:2004pa,Vogt:2004mw` Note the additional minus in the definition of :math:`\gamma`. -Unified Splitting Functions ---------------------------- +Polarized Splitting Functions +----------------------------- -When the |QED| corrections are taken into account, |DGLAP| equation take the form +Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. +They are used to evolve longitudinally polarized parton distribution functions. +Unlike in the unpolarized case, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, +the polarized splitting functions describe the parent and daughter momentums along with their spins +and thus take into account positive or negative helicities. +Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. -.. math :: - \mathbf{P}=\mathbf{\tilde{P}}+\mathbf{\bar{P}} +The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2014sna` and :cite:`Moch:2015usa`. -where :math:`\mathbf{\tilde{P}}` are the usual |QCD| splitting kernels defined in the previous section, -while :math:`\mathbf{\bar{P}}` are given by +At |LO|, the non-singlet is the same in both the polarized and unpolarized case. +Due to helicity conservation, the first moment of the anomalous dimension is :math:`\gamma^{(0)}_{qq} (N=1) = \gamma^{(0)}_{qg} (N=1) = 0`. + +At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomposed into the pure singlet +(consisting of the flavour independent quark-quark and quark-antiquark anomalous dimensions) and the plus flavour asymmetry non-singlet: .. math :: - \mathbf{\bar{P}} = a \mathbf{P}^{(0,1)} + a_s a \mathbf{P}^{(1,1)} + - a^2 \mathbf{P}^{(0,2)} + \dots + \gamma^{(1)}_{qq} =\gamma^{(1)}_{ps} + \gamma^{(1)}_{ns,+} -where :math:`a = \alpha/(4\pi)`. -The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| splitting kernels are given in -:cite:`deFlorian:2015ujt,deFlorian:2016gvk` +The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. +This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour +and daughters splitting into a different flavours and opposite helicity. The first moments of the anomalous dimensions are: -Polarized Splitting Functions ------------------------------ -Polarized Altarelli-Parisi splitting kernels are implemented up to |NNLO| and expanded in powers of the strong coupling as in the previous section. They are used to evolve longitudinally polarized parton distribution functions. Unlike in unpolarized splitting functions, where the probability of the splitting describes the momentum of parent and daughter partons with averaged spins, the polarized splitting functions describe the parent and daughter momentums along with their spins and thus take into account positive or negative helicities. Throughout, the anomalous dimensions are defined as above and are represented with :math:`\gamma` and not :math:`\Delta\gamma` just like in the unpolarized case. +.. math :: + \gamma^{(1)}_{ns,+} (N=1) &= 0 \\ + \gamma^{(1)}_{qq} (N=1) &= 24 C_F T_R \\ + \gamma^{(1)}_{qg} (N=1) &= 0 \\ -The |LO| and |NLO| kernels are given in :cite:`Gluck:1995yr` and the |NNLO| in :cite:`Moch:2015usa` and :cite:`Moch:2015usa`. +At |NNLO| the non-singlet is further decomposed into the helicity difference quark-antiquark anomalous dimension called the valence polarized non-singlet and defined as: -At |LO|, the non-singlet is the same in both the polarized and unpolarized case. Due to helicity conservation, the first moment of the anomalous dimension is :math:`\gamma_{qq} (N=1) = \gamma_{qg} (N=1) = 0`. +.. math :: + \gamma^{(2)}_{ns,v} =\gamma^{(2)}_{ns,-} + \gamma^{(2)}_{ns,s} -At |NLO|, the singlet entry of the quark-quark anomalous dimension can be decomposed into the pure singlet (consisting of the flavour independent quark-quark and quark-antiquark anomalous dimensions) and the plus flavour asymmetry non-singlet: +where :math:`\gamma^{(2)}_{ns,-}` is the minus flavour asymmetry non-singlet and :math:`\gamma^{(2)}_{ns,s}` the sea-like polarized non-singlet. +The singlet entry :math:`\gamma^{(2)}_{qq}` is defined as above in the |NLO| case. -.. math :: - \gamma_{qq} =\gamma_{ps} + \gamma_{ns}^+ \\ -The non-singlet sector in the polarized case swaps the plus and minus non-singlet relative to the unpolarized case. This is because the polarized non-singlet splitting functions are defined as the difference between the probability of the polarized parton splitting into daughter partons of the same flavour and daughters splitting into a different flavours and opposite helicities. The first moments of the anomalous dimensions are: +Unified Splitting Functions +--------------------------- + +When the |QED| corrections are taken into account, |DGLAP| equation take the form .. math :: - \gamma_{ns}^+ (N=1) = 0 \\ - \gamma_{qq} (N=1) = 24 C_F T_R \\ - \gamma_{qg} (N=1) = 0 \\ + \mathbf{P}=\mathbf{\tilde{P}}+\mathbf{\bar{P}} -At |NNLO| the non-singlet is further decomposed into the helicity difference quark-antiquark anomalous dimension called the valence polarized non-singlet and defined as: +where :math:`\mathbf{\tilde{P}}` are the usual |QCD| splitting kernels defined in the previous section, +while :math:`\mathbf{\bar{P}}` are given by .. math :: - \gamma_{nsv} =\gamma_{ns}^- + \gamma_{nss} + \mathbf{\bar{P}} = a \mathbf{P}^{(0,1)} + a_s a \mathbf{P}^{(1,1)} + + a^2 \mathbf{P}^{(0,2)} + \dots -where :math:`\gamma_{ns}^-` is the minus flavour asymmetry non-singlet and :math:`\gamma_{nss}` the sea-like polarized non-singlet. The singlet entry :math:`\gamma_{qq}` is defined as above in the |NLO| case. +where :math:`a = \alpha/(4\pi)`. +The expression of the pure |QED| and of the mixed |QED| :math:`\otimes` |QCD| splitting kernels are given in +:cite:`deFlorian:2015ujt,deFlorian:2016gvk` Order specification