Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
21cec95
Import N3LO matching and relative tests from #74
giacomomagni Jan 15, 2022
d03d04b
Import N3LO docs from #74
giacomomagni Jan 15, 2022
08fd985
Simplify aHq interpolation
giacomomagni Jan 17, 2022
95d304c
Some pylint fixes
giacomomagni Jan 17, 2022
771db0f
Fix typo
giacomomagni Jan 17, 2022
ed53a4a
Merge branch 'develop' into feature/N3LO_matching
giacomomagni Jan 26, 2022
047c660
Fix N3LO inverse expanded matching
giacomomagni Jan 26, 2022
ed8900d
Merge branch 'develop' into feature/N3LO_matching
giacomomagni Feb 21, 2022
3839d85
alphas N3LO in now available!
giacomomagni Feb 21, 2022
dd578d2
precommit n3lo matching conditions
giacomomagni Feb 21, 2022
b77ce1e
Adding explict citation to Blumlein papers
giacomomagni Feb 21, 2022
8055822
Small amend to docs
giacomomagni Feb 22, 2022
cd56e3f
Remove üöß from references
felixhekhorn Feb 22, 2022
107544a
Copy N3LO references
felixhekhorn Feb 23, 2022
c2084a6
Revert "Copy N3LO references"
alecandido Feb 23, 2022
d266ef6
Extend B citations in all n3lo ome and fix B name
giacomomagni Feb 23, 2022
54f04f5
small amend on msbar matching
giacomomagni Feb 23, 2022
5182e44
Merge branch 'develop' into feature/N3LO_matching
giacomomagni Feb 28, 2022
e8465a3
passing nf to a_s in matching conditions
giacomomagni Mar 1, 2022
467471a
Update nnpdf bench runner
giacomomagni Mar 1, 2022
bb98b7a
Merge branch 'develop' into feature/N3LO_matching
giacomomagni Mar 8, 2022
53bf327
Move new test to test/eko
giacomomagni Mar 8, 2022
d91ffbb
small typo
giacomomagni Mar 8, 2022
6d1dbe4
Merge branch 'develop' into feature/N3LO_matching
giacomomagni Mar 14, 2022
2696ee6
add some missing docstring in f_functions
giacomomagni Mar 14, 2022
5d8b198
Using QuadKerBase inside quad ker matching
giacomomagni Mar 14, 2022
2539cb4
Address issue #103
giacomomagni Mar 14, 2022
a85b43b
lower evol to unity accuracy due to second-last row
giacomomagni Mar 14, 2022
57e1380
Genearlize Evolution oparator
giacomomagni Mar 14, 2022
d32a493
make OperatorMatrixElement and Oparator child
giacomomagni Mar 14, 2022
31c6a09
replace ome_members by op_members
giacomomagni Mar 16, 2022
3ab899e
remove ome_members_initialize in OperatorMatrixElement
giacomomagni Mar 16, 2022
f93c78c
some suggested fixes
giacomomagni Mar 17, 2022
d48596e
delay n3lo import statement
giacomomagni Mar 17, 2022
1b00f4a
Revert "delay n3lo import statement"
felixhekhorn Mar 17, 2022
05791da
Minor doc fixes
felixhekhorn Mar 17, 2022
df66c3e
Using Enum for sv modes
giacomomagni Mar 17, 2022
0080246
improve enum for sv modes
giacomomagni Mar 18, 2022
802ea9b
move f functions to a subpackage
giacomomagni Mar 18, 2022
568255f
dropping _pto from matching nlo nnlo
giacomomagni Mar 18, 2022
ddd2b62
recover 100% coverage
giacomomagni Mar 18, 2022
606138f
dropping _3 from matching nn3lo
giacomomagni Mar 18, 2022
8fd88b2
Remove all numba signatures
felixhekhorn Mar 18, 2022
e18e72b
Adding n_core_parallel option
giacomomagni Mar 28, 2022
8008269
remove parallel computation in tests
giacomomagni Mar 28, 2022
5986134
restore benchmarks
giacomomagni Mar 28, 2022
d5f8bba
minor fixes on data db
giacomomagni Mar 29, 2022
e6ee4bf
Merge pull request #108 from N3PDF/feature/nb-njit
giacomomagni Mar 29, 2022
6eb55c7
move harmonics to a proper subpackage
giacomomagni Mar 29, 2022
1611c51
update tests accordingly
giacomomagni Mar 29, 2022
5533c3f
other minor updates
giacomomagni Mar 29, 2022
fd01b7a
first attempt for the harmoncs cache
giacomomagni Mar 30, 2022
aeed018
restore old signature in ome as1 and as2, delete conftest
giacomomagni Mar 30, 2022
bcaf20b
Move get_s3x and get_s4x to harmonics
giacomomagni Mar 30, 2022
174a8e8
update as3 ome harmincs and tests
giacomomagni Mar 30, 2022
cd48236
remove old n3lo names
giacomomagni Mar 30, 2022
18078f9
passing S1 and S2 to nlo ad
giacomomagni Mar 30, 2022
fb75e69
Fix sx doc in as3
giacomomagni Mar 30, 2022
40e388e
fix docs in ope as1 and as2
giacomomagni Mar 30, 2022
b1d5b63
fix docs in as1
giacomomagni Mar 30, 2022
562f3c9
fix harmonics in benchmarks
giacomomagni Mar 30, 2022
aafb65a
remove get_
giacomomagni Mar 31, 2022
25c744a
use sx in ad init
giacomomagni Mar 31, 2022
c072ebf
fix benchmarks
giacomomagni Mar 31, 2022
1eb8ef2
remove old stuff in test ad nnlo
giacomomagni Mar 31, 2022
d782a61
start reordering harmonics in ome as3
giacomomagni Mar 31, 2022
ce590bb
add recursive relation for S sums and propagate cached S1,S2,S3 to g_…
giacomomagni Mar 31, 2022
547cca5
remane one test
giacomomagni Mar 31, 2022
27972ae
use cached S in cern polygamma
giacomomagni Mar 31, 2022
66a3624
rename harmonic_sum to s
giacomomagni Mar 31, 2022
b8e5558
remove zeros from harmonic cache
giacomomagni Apr 1, 2022
9fef339
update cached harmoincs in ome as3
giacomomagni Apr 1, 2022
4e86511
update harmonics docs
giacomomagni Apr 1, 2022
4cb7767
remove try except
giacomomagni Apr 1, 2022
e3606fc
removing not necesarry LO
giacomomagni Apr 4, 2022
d1a3e8b
some docs fixes
giacomomagni Apr 4, 2022
143726f
Init asv
felixhekhorn Apr 4, 2022
4e5c2b1
Add asv as dev-dep
felixhekhorn Apr 4, 2022
81ad0b5
Call ev_op.compute once in parallel
felixhekhorn Apr 5, 2022
4aa9cd9
Update Mellin doc
felixhekhorn Apr 5, 2022
2d5482f
Update docstrings
felixhekhorn Apr 5, 2022
bb9693c
Update lock file
felixhekhorn Apr 5, 2022
44759d0
Attempt to add more harmonic tests
felixhekhorn Apr 5, 2022
8c9e7d3
fix w5 docstring
giacomomagni Apr 5, 2022
deee6a2
Add is_singlet to harmonics sums and remove (-1)**N
giacomomagni Apr 5, 2022
f44a1f6
Adding is_singlet to tests
giacomomagni Apr 5, 2022
f76f97c
Allow for generic complex S minus harmonics
giacomomagni Apr 5, 2022
fa9f688
remove impossible odd moment test on ahq3
giacomomagni Apr 5, 2022
510c741
passing correct harmonics to as3.A_qqNS
giacomomagni Apr 6, 2022
4319726
Add S minus test against old definition
giacomomagni Apr 6, 2022
87065d2
remove useless minus sign
giacomomagni Apr 6, 2022
b06d813
expand harmonics docs
giacomomagni Apr 6, 2022
febe124
suggested fixes in tests
giacomomagni Apr 6, 2022
c59aa0f
Remove commented code
felixhekhorn Apr 6, 2022
9606618
Unify non-singlet language
felixhekhorn Apr 6, 2022
957a7ad
Update docstrings style for constants
alecandido May 10, 2022
684cf76
Correct f functions module level docstrings formatting
alecandido May 10, 2022
47e6c8b
Amend docstrings style for wN modules
alecandido May 10, 2022
86f14e0
Poetry update
alecandido May 10, 2022
4cb3798
Amend more docstrings
alecandido May 10, 2022
b897e70
small remarks in tests g,f functions
giacomomagni May 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
Expand Down
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):
"""
Expand All @@ -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,
Expand All @@ -39,7 +42,6 @@ def skip_pdfs(self, _theory):
"kbThr": 1.0,
"ktThr": 1.0,
"alphas": 0.118000,
"FNS": "ZM-VFNS",
"ModEv": "TRN",
}

Expand Down Expand Up @@ -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,
}

Expand All @@ -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
Expand Up @@ -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


Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
25 changes: 17 additions & 8 deletions benchmarks/eko/benchmark_evol_to_unity.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class BenchmarkBackwardForward:
"ev_op_max_order": 1,
"ev_op_iterations": 1,
"backward_inversion": "exact",
"n_integration_cores": 1,
}
g = OperatorGrid.from_dict(
theory_card,
Expand Down Expand Up @@ -99,12 +100,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,
Comment thread
giacomomagni marked this conversation as resolved.
)
# gq
np.testing.assert_allclose(
Expand All @@ -126,14 +135,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):
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/lha_paper_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file.
29 changes: 29 additions & 0 deletions benchmarks/performance/harmonics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
import numpy as np

from eko import anomalous_dimensions as ad
from eko.mellin import Path

NF = 5


class TimeSuite:
def setup(self):
ts = np.linspace(0.5, 1.0 - 1e-5, 100)
logx = 0.8
axis_offset = True
self.ns = []
for t in ts:
self.ns.append(Path(t, logx, axis_offset).n)

def time_as1_sing(self):
for n in self.ns:
ad.gamma_singlet(0, n, NF)

def time_as2_sing(self):
for n in self.ns:
ad.gamma_singlet(1, n, NF)

def time_as3_sing(self):
for n in self.ns:
ad.gamma_singlet(2, n, NF)
23 changes: 0 additions & 23 deletions doc/source/code/IO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,6 @@ The input is split into two runcard
and environment
- a operator runcard that defines the numerical setup and the requested operators

.. list-table:: theory input runcard
:header-rows: 1

* - Name
- Type
- default
- description
* - ``PTO``
- :py:obj:`int`
- [required]
- order of perturbation theory: ``0`` = LO, ...
* - ``alphas``
- :py:obj:`float`
- [required]
- reference value of the strong coupling :math:`\alpha_s(\mu_0^2)` (Note that we have to use
:math:`\alpha_s(\mu_0^2)` here, instead of :math:`a_s(\mu_0^2)` for legacy reasons)

.. include:: IO-tabs/ThresholdConfig.rst

.. include:: IO-tabs/InterpolatorDispatcher.rst

- :py:obj:`list(float)` ``Q2grid`` the target grid in :math:`Q^2`; **Required**


Output
------
Expand Down
Loading