Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NNPDF/eko
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 692e3d1577576676246cfd902170a2c92b061106
Choose a base ref
..
head repository: NNPDF/eko
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7974a56ed4550bf591212e34ad9b346f1504c45a
Choose a head ref
Showing with 30,086 additions and 1,451 deletions.
  1. +2 −0 .gitattributes
  2. +3 −3 .pre-commit-config.yaml
  3. +8 −3 README.md
  4. +4 −0 benchmarks/.gitignore
  5. +13 −9 benchmarks/NNPDF_bench.py
  6. +91 −0 benchmarks/asv.conf.json
  7. +19 −16 benchmarks/eko/benchmark_ad.py
  8. +17 −8 benchmarks/eko/benchmark_evol_to_unity.py
  9. +2 −2 benchmarks/lha_paper_bench.py
  10. 0 benchmarks/performance/__init__.py
  11. +29 −0 benchmarks/performance/harmonics.py
  12. +0 −23 doc/source/code/IO.rst
  13. +3 −3 doc/source/code/Utilities.rst
  14. +152 −11 doc/source/refs.bib
  15. +1 −1 doc/source/theory/DGLAP.rst
  16. +2 −2 doc/source/theory/FlavorSpace.rst
  17. +27 −15 doc/source/theory/Matching.rst
  18. +57 −16 doc/source/theory/Mellin.rst
  19. +50 −4 doc/source/theory/pQCD.rst
  20. +9 −0 extras/uni-dglap/Makefile
  21. +5,159 −0 extras/uni-dglap/uni-ad.nb
  22. +448 −0 extras/uni-dglap/uni-dglap-aem2.ipynb
  23. +769 −0 extras/uni-dglap/uni-dglap.ipynb
  24. +174 −0 extras/uni-dglap/uni-dglap.tex
  25. +246 −227 poetry.lock
  26. +11 −0 pyproject.toml
  27. +15 −21 src/eko/anomalous_dimensions/__init__.py
  28. +8 −4 src/eko/anomalous_dimensions/aem1.py
  29. +326 −0 src/eko/anomalous_dimensions/aem2.py
  30. +8 −8 src/eko/anomalous_dimensions/as1.py
  31. +357 −0 src/eko/anomalous_dimensions/as1aem1.py
  32. +58 −51 src/eko/anomalous_dimensions/as2.py
  33. +25 −29 src/eko/anomalous_dimensions/as3.py
  34. +7 −7 src/eko/beta.py
  35. +44 −13 src/eko/constants.py
  36. +113 −70 src/eko/evolution_operator/__init__.py
  37. +14 −10 src/eko/evolution_operator/grid.py
  38. +6 −6 src/eko/gamma.py
  39. +177 −0 src/eko/harmonics/__init__.py
  40. +23 −0 src/eko/harmonics/constants.py
  41. +24 −0 src/eko/harmonics/f_functions/__init__.py
  42. +98 −0 src/eko/harmonics/f_functions/f11.py
  43. +117 −0 src/eko/harmonics/f_functions/f13.py
  44. +1,353 −0 src/eko/harmonics/f_functions/f14_f12.py
  45. +3,013 −0 src/eko/harmonics/f_functions/f16.py
  46. +232 −0 src/eko/harmonics/f_functions/f17.py
  47. +1,991 −0 src/eko/harmonics/f_functions/f18.py
  48. +56 −0 src/eko/harmonics/f_functions/f19.py
  49. +70 −0 src/eko/harmonics/f_functions/f20.py
  50. +70 −0 src/eko/harmonics/f_functions/f21.py
  51. +50 −0 src/eko/harmonics/f_functions/f9.py
  52. +366 −0 src/eko/harmonics/g_functions.py
  53. +36 −131 src/eko/{anomalous_dimensions/harmonics.py → harmonics/polygamma.py}
  54. +70 −0 src/eko/harmonics/w1.py
  55. +73 −0 src/eko/harmonics/w2.py
  56. +215 −0 src/eko/harmonics/w3.py
  57. +271 −0 src/eko/harmonics/w4.py
  58. +453 −0 src/eko/harmonics/w5.py
  59. +5 −5 src/eko/interpolation.py
  60. +11 −11 src/eko/kernels/evolution_integrals.py
  61. +10 −10 src/eko/kernels/non_singlet.py
  62. +14 −14 src/eko/kernels/singlet.py
  63. +1 −1 src/eko/kernels/utils.py
  64. +16 −16 src/eko/matching_conditions/__init__.py
  65. +40 −37 src/eko/matching_conditions/{nlo.py → as1.py}
  66. +100 −116 src/eko/matching_conditions/{nnlo.py → as2.py}
  67. +174 −0 src/eko/matching_conditions/as3/__init__.py
  68. +3,805 −0 src/eko/matching_conditions/as3/aHg.py
  69. +937 −0 src/eko/matching_conditions/as3/aHgstfac.py
  70. +2,088 −0 src/eko/matching_conditions/as3/aHq.py
  71. +1,550 −0 src/eko/matching_conditions/as3/agg.py
  72. +332 −0 src/eko/matching_conditions/as3/aggTF2.py
  73. +984 −0 src/eko/matching_conditions/as3/agq.py
  74. +476 −0 src/eko/matching_conditions/as3/aqg.py
  75. +754 −0 src/eko/matching_conditions/as3/aqqNS.py
  76. +202 −0 src/eko/matching_conditions/as3/aqqPS.py
  77. +202 −193 src/eko/matching_conditions/operator_matrix_element.py
  78. +8 −8 src/eko/mellin.py
  79. +1 −1 src/eko/msbar_masses.py
  80. +1 −0 src/eko/output/struct.py
  81. +8 −4 src/eko/scale_variations/__init__.py
  82. +6 −12 src/eko/scale_variations/expanded.py
  83. +1 −1 src/eko/scale_variations/exponentiated.py
  84. +2 −2 src/eko/strong_coupling.py
  85. +2 −2 src/eko/thresholds.py
  86. +2 −0 src/ekomark/benchmark/external/LHA_utils.py
  87. +3 −2 src/ekomark/benchmark/runner.py
  88. +1 −0 src/ekomark/data/db.py
  89. +1 −1 src/ekomark/data/operators.py
  90. +1 −0 src/ekomark/navigator/glob.py
  91. +1 −1 src/ekomark/plots.py
  92. +0 −21 tests/eko/conftest.py
  93. +1 −1 tests/eko/test_ad.py
  94. +31 −0 tests/eko/test_ad_aem1.py
  95. +56 −0 tests/eko/test_ad_aem2.py
  96. +5 −32 tests/eko/{test_ad_lo.py → test_ad_as1.py}
  97. +62 −0 tests/eko/test_ad_as1aem1.py
  98. +25 −17 tests/eko/{test_ad_nlo.py → test_ad_as2.py}
  99. +32 −0 tests/eko/test_ad_as3.py
  100. +0 −45 tests/eko/test_ad_nnlo.py
  101. +1 −1 tests/eko/test_beta.py
  102. +1 −0 tests/eko/test_ev_op_grid.py
  103. +109 −57 tests/eko/test_ev_operator.py
  104. +166 −0 tests/eko/test_f_functions.py
  105. +116 −0 tests/eko/test_g_functions.py
  106. +169 −0 tests/eko/test_harmonics.py
  107. +8 −8 tests/eko/test_matching.py
  108. +236 −0 tests/eko/test_matching_n3lo.py
  109. +14 −13 tests/eko/test_matching_nlo.py
  110. +35 −34 tests/eko/test_matching_nnlo.py
  111. +218 −71 tests/eko/test_ome.py
  112. +15 −19 tests/eko/{test_ad_harmonics.py → test_polygamma.py}
  113. +1 −0 tests/eko/test_runner.py
  114. +11 −2 tests/eko/test_sv_expanded.py
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.ipynb linguist-generated
*.nb linguist-generated
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -12,7 +12,7 @@ repos:
- id: debug-statements
- id: fix-encoding-pragma
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
@@ -25,6 +25,6 @@ repos:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.32.1
hooks:
- id: pyupgrade
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://n3pdf.github.io/eko/"><img alt="EKO" src="https://raw.githubusercontent.com/N3PDF/eko/master/doc/source/img/Logo.png" width=300></a>
<a href="https://eko.readthedocs.io/"><img alt="EKO" src="https://raw.githubusercontent.com/N3PDF/eko/master/doc/source/img/Logo.png" width=300></a>
</p>
<p align="center">
<a href="https://github.com/N3PDF/eko/actions/workflows/unittests.yml"><img alt="Tests" src="https://github.com/N3PDF/eko/actions/workflows/unittests.yml/badge.svg" /></a>
@@ -11,10 +11,15 @@
EKO is a Python module to solve the DGLAP equations in N-space in terms of Evolution Kernel Operators in x-space.

## Installation
EKO is available via PyPI: <a href="https://pypi.org/project/eko/"><img alt="PyPI" src="https://img.shields.io/pypi/v/eko"/></a> - so you can simply run
EKO is available via
- PyPI: <a href="https://pypi.org/project/eko/"><img alt="PyPI" src="https://img.shields.io/pypi/v/eko"/></a>
```bash
pip install eko
```
- conda-forge: [![Conda Version](https://img.shields.io/conda/vn/conda-forge/eko.svg)](https://anaconda.org/conda-forge/eko)
```bash
conda install eko
```

### Development

@@ -41,6 +46,6 @@ When using our code please cite
- our paper: [![arXiv](https://img.shields.io/badge/arXiv-2202.02338-b31b1b?labelColor=222222)](https://arxiv.org/abs/2202.02338)

## Contributing
- Your feedback is welcome! If you want to report a (possible) bug or want to ask for a new feature, please raise an issue: <a href="https://img.shields.io/github/issues/N3PDF/eko"><img alt="GitHub issues" src="https://img.shields.io/github/issues/N3PDF/eko"/></a>
- Your feedback is welcome! If you want to report a (possible) bug or want to ask for a new feature, please raise an issue: <a href="https://github.com/N3PDF/eko/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/N3PDF/eko"/></a>
- Please follow our [Code of Conduct](https://github.com/N3PDF/eko/blob/master/.github/CODE_OF_CONDUCT.md) and read the
[Contribution Guidelines](https://github.com/N3PDF/eko/blob/master/.github/CONTRIBUTING.md)
4 changes: 4 additions & 0 deletions benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ignore airspeed velocity output
html/
results/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
22 changes: 13 additions & 9 deletions benchmarks/NNPDF_bench.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-
"""
Benchmark NNDPF31 pdf family
Benchmark NNPDF pdf family
"""
import numpy as np
from banana import register

from ekomark.benchmark.runner import Runner

register(__file__)


class BenchmarkNNPDF(Runner):
"""
@@ -26,9 +31,7 @@ def skip_pdfs(self, _theory):
]


base_operator = {
"ev_op_iterations": 1,
}
base_operator = {"ev_op_iterations": 1, "backward_inversion": "exact"}

base_theory = {
"Qref": 91.2,
@@ -39,7 +42,6 @@ def skip_pdfs(self, _theory):
"kbThr": 1.0,
"ktThr": 1.0,
"alphas": 0.118000,
"FNS": "ZM-VFNS",
"ModEv": "TRN",
}

@@ -75,6 +77,8 @@ def benchmark_nnlo(self, Q0=1.65, Q2grid=(100,)):
theory_card = {
**base_theory,
"PTO": 2,
"IC": 1,
"IB": 1,
"Q0": Q0,
}

@@ -83,13 +87,13 @@ def benchmark_nnlo(self, Q0=1.65, Q2grid=(100,)):


if __name__ == "__main__":
low2 = 4**2
high2 = 30**2
# nn31 = BenchmarkNNPDF31()
# low2 = 1.65**2
# high2 = 20
# # 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_nlo(Q2grid=[100])
nn40.benchmark_nnlo(Q2grid=[100])
# nn40.benchmark_nnlo(Q2grid=[100])
nn40.benchmark_nnlo(Q0=np.sqrt(high2), Q2grid=[low2])
91 changes: 91 additions & 0 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,

// The name of the project being benchmarked
"project": "eko",

// The project's homepage
"project_url": "https://n3pdf.github.io/eko/",

// The URL or local path of the source code repository for the
// project being benchmarked
"repo": "..",

// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "tip" (for mercurial).
"branches": ["HEAD"],

// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
"dvcs": "git",

// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "virtualenv",

// the base URL to show a commit for the project.
"show_commit_url": "https://github.com/N3PDF/eko/commit/",

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
"pythons": ["3.8", "3.9", "3.10"],

// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list indicates to just test against the default (latest)
//version.
"matrix": {
"poetry": []
},

// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
"benchmark_dir": "performance",

// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
// "env_dir": "env",

// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": "results",

// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": "html",

// The number of characters to retain in the commit hashes.
// "hash_length": 8,

// `asv` will cache wheels of the recent builds in each
// environment, making them faster to install next time. This is
// number of builds to keep, per environment.
"build_cache_size": 8,

// The commits after which the regression search in `asv publish`
// should start looking for regressions. Dictionary whose keys are
// regexps matching to benchmark names, and values corresponding to
// the commit (exclusive) after which to start looking for
// regressions. The default is to start from the first commit
// with results. If the commit is `null`, regression detection is
// skipped for the matching benchmark.
//
// "regressions_first_commits": {
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// }


"install_command": ["in-dir={env_dir} python -mpip install {wheel_file}[mark]"],

"build_command": [
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps -w {build_cache_dir} {build_dir}"
]
}
35 changes: 19 additions & 16 deletions benchmarks/eko/benchmark_ad.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import pytest

import eko.anomalous_dimensions.as2 as ad_as2
import eko.anomalous_dimensions.harmonics as h
import eko.harmonics as h
from eko.constants import CA, CF, TR


@@ -15,7 +15,7 @@ def benchmark_melling_g3_pegasus():


def check_melling_g3_pegasus(N):
S1 = h.harmonic_S1(N)
S1 = h.S1(N)
N1 = N + 1.0
N2 = N + 2.0
N3 = N + 3.0
@@ -28,7 +28,7 @@ def check_melling_g3_pegasus(N):
S14 = S13 + 1.0 / N4
S15 = S14 + 1.0 / N5
S16 = S15 + 1.0 / N6
zeta2 = h.zeta2
zeta2 = h.constants.zeta2

SPMOM = (
1.0000 * (zeta2 - S1 / N) / N
@@ -39,7 +39,7 @@ def check_melling_g3_pegasus(N):
- 0.3174 * (zeta2 - S15 / N5) / N5
+ 0.0699 * (zeta2 - S16 / N6) / N6
)
np.testing.assert_allclose(h.mellin_g3(N), SPMOM)
np.testing.assert_allclose(h.g_functions.mellin_g3(N, S1), SPMOM)


@pytest.mark.isolated
@@ -52,12 +52,12 @@ def benchmark_gamma_ns_1_pegasus():

def check_gamma_1_pegasus(N, NF):
# Test against pegasus implementation
ZETA2 = h.zeta2
ZETA3 = h.zeta3
ZETA2 = h.constants.zeta2
ZETA3 = h.constants.zeta3

# N = np.random.rand(1) + np.random.rand(1) * 1j
S1 = h.harmonic_S1(N)
S2 = h.harmonic_S2(N)
S1 = h.S1(N)
S2 = h.S2(N)

N1 = N + 1.0
N2 = N + 2.0
@@ -87,16 +87,18 @@ def check_gamma_1_pegasus(N, NF):
)
SLC = -5.0 / 8.0 * ZETA3
SLV = (
-ZETA2 / 2.0 * (h.cern_polygamma(N1 / 2, 0) - h.cern_polygamma(N / 2, 0))
-ZETA2
/ 2.0
* (h.polygamma.cern_polygamma(N1 / 2, 0) - h.polygamma.cern_polygamma(N / 2, 0))
+ S1 / NS
+ SPMOM
)
SSCHLM = SLC - SLV
SSTR2M = ZETA2 - h.cern_polygamma(N1 / 2, 1)
SSTR3M = 0.5 * h.cern_polygamma(N1 / 2, 2) + ZETA3
SSTR2M = ZETA2 - h.polygamma.cern_polygamma(N1 / 2, 1)
SSTR3M = 0.5 * h.polygamma.cern_polygamma(N1 / 2, 2) + ZETA3
SSCHLP = SLC + SLV
SSTR2P = ZETA2 - h.cern_polygamma(N2 / 2, 1)
SSTR3P = 0.5 * h.cern_polygamma(N2 / 2, 2) + ZETA3
SSTR2P = ZETA2 - h.polygamma.cern_polygamma(N2 / 2, 1)
SSTR3P = 0.5 * h.polygamma.cern_polygamma(N2 / 2, 2) + ZETA3

PNMA = (
16.0 * S1 * (2.0 * N + 1.0) / (NS * N1S)
@@ -136,8 +138,9 @@ def check_gamma_1_pegasus(N, NF):
P1NSP = CF * ((CF - CA / 2.0) * PNPA + CA * PNSB + TR * NF * PNSC)
P1NSM = CF * ((CF - CA / 2.0) * PNMA + CA * PNSB + TR * NF * PNSC)

np.testing.assert_allclose(ad_as2.gamma_nsp(N, NF), -P1NSP)
np.testing.assert_allclose(ad_as2.gamma_nsm(N, NF), -P1NSM)
sx = h.sx(N, 2)
np.testing.assert_allclose(ad_as2.gamma_nsp(N, NF, sx), -P1NSP)
np.testing.assert_allclose(ad_as2.gamma_nsm(N, NF, sx), -P1NSM)

NS = N * N
NT = NS * N
@@ -254,7 +257,7 @@ def check_gamma_1_pegasus(N, NF):
P1Sgq = (CF * CF * PGQA + CF * CA * PGQB + TR * NF * CF * PGQC) * 4.0
P1Sgg = (CA * CA * PGGA + TR * NF * (CA * PGGB + CF * PGGC)) * 4.0

gS1 = ad_as2.gamma_singlet(N, NF)
gS1 = ad_as2.gamma_singlet(N, NF, sx)
np.testing.assert_allclose(gS1[0, 0], -P1Sqq)
np.testing.assert_allclose(gS1[0, 1], -P1Sqg)
np.testing.assert_allclose(gS1[1, 0], -P1Sgq)
25 changes: 17 additions & 8 deletions benchmarks/eko/benchmark_evol_to_unity.py
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ class BenchmarkBackwardForward:
"ev_op_max_order": 1,
"ev_op_iterations": 1,
"backward_inversion": "exact",
"n_integration_cores": 1,
},
"debug": {
"skip_singlet": False,
@@ -103,12 +104,20 @@ def test_operator_grid(
np.zeros(dim),
atol=7e-4,
)
# gg
np.testing.assert_allclose(
# gg, check last two rows separately
gg_id = (
o_back.op_members[(21, 21)].value @ o.op_members[(21, 21)].value
+ o_back.op_members[(21, 100)].value @ o.op_members[(100, 21)].value,
np.eye(dim[0]),
atol=9e-2,
+ o_back.op_members[(21, 100)].value @ o.op_members[(100, 21)].value
)
np.testing.assert_allclose(
gg_id[:-2],
np.eye(dim[0])[:-2],
atol=3e-2,
)
np.testing.assert_allclose(
gg_id[-2:],
np.eye(dim[0])[-2:],
atol=11.2e-2,
)
# gq
np.testing.assert_allclose(
@@ -130,14 +139,14 @@ def test_operator_grid(
# ome.compute( q2, L)
# ome_back.compute(q2, L)

# dim = ome.ome_members[(100, 100)].value.shape
# dim = ome.op_members[(100, 100)].value.shape
# ome_tensor = np.zeros((3,3,dim[0],dim[0]))
# ome_tensor_back = ome_tensor
# idx_dict = dict(zip(["g", "q", "H"],[0,1,2]))
# for p1, j in idx_dict.items():
# for p2, k in idx_dict.items():
# ome_tensor[j,k] = ome.ome_members[f"S_{p1}{p2}"].value
# ome_tensor_back[j,k] = ome_back.ome_members[f"S_{p1}{p2}"].value
# ome_tensor[j,k] = ome.op_members[f"S_{p1}{p2}"].value
# ome_tensor_back[j,k] = ome_back.op_members[f"S_{p1}{p2}"].value

# ome_product = np.einsum("abjk,bckl -> acjl", ome_tensor_back, ome_tensor)
# for j, line in enumerate(ome_product):
4 changes: 2 additions & 2 deletions benchmarks/lha_paper_bench.py
Original file line number Diff line number Diff line change
@@ -222,9 +222,9 @@ def benchmark_sv(self, pto):

# Benchmark to LHA
# obj = BenchmarkVFNS()
# obj = BenchmarkFFNS()
obj = BenchmarkFFNS()

# obj.benchmark_plain(2)
# obj.benchmark_plain(0)
# obj.benchmark_sv(2)

# # VFNS benchmarks with LHA settings
Empty file.
Loading