Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
d86fe12
Init backward_paper
giacomomagni Jul 1, 2021
96b150a
add simple plotiing
giacomomagni Jul 1, 2021
d14f3e2
Improve plotting
giacomomagni Jul 5, 2021
a858d69
plot improvements
giacomomagni Jul 6, 2021
0c369cf
Select correct 4.0 pdfs, add pm basis plots
giacomomagni Jul 6, 2021
85d5748
Make use of Ekomark runner and add comparison below above thr
giacomomagni Jul 8, 2021
f04b3af
Plot log scale and linear, add IB check
giacomomagni Jul 8, 2021
66e7246
Merge branch 'develop' into feature/backward_paper
felixhekhorn Jul 8, 2021
3ad1224
Init back and forth check
giacomomagni Jul 8, 2021
20fa82c
Merge branch 'feature/backward_paper' of https://github.com/N3PDF/eko…
giacomomagni Jul 8, 2021
eb769e7
pass Q0 to lhapdf utils
giacomomagni Jul 12, 2021
35c2de0
more backward tests
giacomomagni Jul 12, 2021
892cfc7
update runner
giacomomagni Jul 12, 2021
54a7889
Add navigator app
giacomomagni Jul 13, 2021
31fc2b0
some fix in evolve backward
giacomomagni Jul 13, 2021
fb8c507
Add pull plot under PDF plot
giacomomagni Jul 14, 2021
086e80e
Fix on talbot path and on Op initial condition
giacomomagni Jul 14, 2021
9c48ca0
Fix lhapdf_utils skip pdfs
giacomomagni Jul 14, 2021
c6d82df
resotre full coverage
giacomomagni Jul 14, 2021
43e8265
computing momentum fraction
giacomomagni Jul 14, 2021
30258d9
Adding init method to ekomark runners
giacomomagni Jul 14, 2021
c870d39
improve bench evol to unity
giacomomagni Jul 15, 2021
d02a179
fix back and forth test accuracy
giacomomagni Jul 16, 2021
1f775fa
Improve plot options, fix back and forth tests
giacomomagni Jul 16, 2021
f906cb5
Adding cache to return_to_q0
giacomomagni Jul 19, 2021
267949d
Fix ome talbot path and more tests
giacomomagni Jul 22, 2021
9fc6da5
Merge branch 'develop' into feature/backward_paper
giacomomagni Jul 22, 2021
49d46d5
improve navigator lagend
giacomomagni Jul 23, 2021
6b1c34c
separate run back and forth from run
giacomomagni Jul 23, 2021
eb1dc12
update backward runner and syntax fix
giacomomagni Jul 23, 2021
429c58e
improve legends
giacomomagni Jul 23, 2021
dc77aad
Add alphas to output, relax some numerical tests, black
felixhekhorn Aug 26, 2021
117ecdb
restore mellin path for ome
giacomomagni Aug 27, 2021
691f7bc
Init n3lo matching with various harmonics
giacomomagni Sep 23, 2021
398946b
cache harmonics, add F19,F20,F21, more tests
giacomomagni Sep 26, 2021
435392d
New parametrization for F14 F12
giacomomagni Sep 28, 2021
f6e1d7b
Adding other harmonics
giacomomagni Sep 28, 2021
14100db
Replacing some harmonics with a linear combination
giacomomagni Sep 29, 2021
780f872
Adding N3LO gluon OME
giacomomagni Sep 29, 2021
81abc2d
Adding quark NS, PS and qg OME
giacomomagni Sep 29, 2021
d8f7102
adding init and small fixes
giacomomagni Sep 29, 2021
21a6d22
test and allow N3LO in operator matrix element
giacomomagni Sep 29, 2021
668d650
pylint fixes
giacomomagni Sep 30, 2021
61d1378
more OME n3lo tests
giacomomagni Sep 30, 2021
0edf1fd
Adding H22, H24, H25
giacomomagni Sep 30, 2021
a1ab220
Adding aHq N3LO ome
giacomomagni Oct 4, 2021
97e1d45
black ome n3lo
giacomomagni Oct 4, 2021
7e9782c
fake N3LO evolution
giacomomagni Oct 4, 2021
d86e396
cleaning and more matching log
giacomomagni Oct 4, 2021
8c6a256
Adding doc string to s functions and n3lo init
giacomomagni Oct 5, 2021
c9b7b2e
Adding docs to N3LO matching contions
giacomomagni Oct 5, 2021
9e9bf4a
Minor fix on indentation
giacomomagni Oct 5, 2021
d6f2e3c
Run matching in parallel and submit script
Oct 6, 2021
30315f1
Improve Hq asymtotic limit and aggTF2 binfact
giacomomagni Oct 7, 2021
a27cfbc
remove unused binfact
giacomomagni Oct 7, 2021
0263b7e
Merge branch 'develop' into feature/backward_paper
giacomomagni Oct 12, 2021
8f4984d
Black and test run_integration
giacomomagni Oct 12, 2021
c701139
Fix NS and Singlet matching labels, skip mathcing integration at LO
giacomomagni Oct 12, 2021
52315d6
Adding dump logs to navigator
Oct 22, 2021
fd44def
Adding more references and docs
giacomomagni Oct 22, 2021
b6693e9
Fix typo
giacomomagni Oct 22, 2021
707b3da
Further fix on B references
giacomomagni Oct 22, 2021
b16f7a2
Adding Q2 study runnner
Nov 1, 2021
3511764
New A_Hq parametrization and complete numba in n3lo matching
giacomomagni Nov 2, 2021
3005c4c
small fix on q2 runner
Nov 3, 2021
0366ed1
Adding plot_bench to ekonavigator
giacomomagni Nov 8, 2021
ae71076
Merge branch 'feature/backward_paper' of https://github.com/N3PDF/eko…
Nov 8, 2021
1cd30ae
Small fixes on navigators
Nov 8, 2021
d1086a7
Add mass and dataset variation to evolve backward
Nov 10, 2021
c32b4f6
remove unsed h and cs functions
giacomomagni Nov 29, 2021
c5219ec
Adding log parts to N3LO ome
giacomomagni Nov 29, 2021
9a49c3a
Fix dump to file navigator
Dec 10, 2021
ac15b17
update runners
Dec 10, 2021
f080ffa
Small fix on is_backward, no need to explicit IC
Dec 10, 2021
5d9e378
update evolve backward
Jan 10, 2022
4977739
Add environments dump
alecandido Jan 10, 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
118 changes: 118 additions & 0 deletions backward_paper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# VS Code
.vscode

# Rope project settings
.ropeproject

# mkdocs documentation
/site

assets/

# mypy
.mypy_cache/

# yaml
*.yaml

# database
*.db

# pdfs
*.pdf
5 changes: 5 additions & 0 deletions backward_paper/banana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
database_path: database.db
input_tables:
- theories
- operators
- cache
4 changes: 4 additions & 0 deletions backward_paper/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
import pathlib

pkg_path = pathlib.Path(__file__).absolute().parents[0]
249 changes: 249 additions & 0 deletions backward_paper/evolve_backward.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
# -*- coding: utf-8 -*-
"""
This script compute an EKO to evolve a PDF set under the charm thrshold replica by replica
"""
import numpy as np

from ekomark.data import operators

from eko.interpolation import make_lambert_grid, make_grid

from runner import BackwardPaperRunner

pid_dict = {"c": 4, "b": 5, "t": 6}


class BackwardRunner(BackwardPaperRunner):
"""
This class evolve a pdf below the charm thrshold and
compare it with the initial pdf replica by replica.
"""

external = "inputpdf"

base_theory = {
"Qref": 9.1187600e01,
"alphas": 0.1180024,
"mc": 1.51,
"mb": 4.92,
"mt": 172.5,
"kcThr": 1.0,
"kbThr": 1.0,
"ktThr": 1.0,
"PTO": 2,
"IC": 1,
"IB": 1,
"ModEv": "EXA",
}
base_operator = {
"interpolation_xgrid": [make_lambert_grid(60).tolist()],
# "interpolation_xgrid": [make_lambert_grid(60, x_min=1e-2).tolist()],
# "interpolation_xgrid": [make_grid(20, 30, x_min=1e-2).tolist()],
# "interpolation_xgrid": [make_grid(50, 10, x_low=0.8, x_min=1e-2).tolist()],
# "interpolation_xgrid": [make_grid(30, 10, x_low=0.6, x_min=1e-2).tolist()],
# "interpolation_polynomial_degree": [1],
"backward_inversion": ["exact"],
# "ev_op_iterations": [1],
}

def doit(
self, pdf_name, operator_updates, theory_updates=None, q_high=None, q_low=None
):
"""Set common options and run"""
if self.fig_name is None:
self.fig_name = pdf_name
if q_low is not None:
operator_updates["Q2grid"] = [[q_low ** 2]]
if theory_updates is None:
theory_updates = self.base_theory.copy()
if q_high is not None:
theory_updates["Q0"] = q_high

self.run(
[theory_updates],
operators.build((operator_updates)),
[pdf_name],
use_replicas=True,
)

def evolve_backward(self, pdf_name, q_high=1.65, q_low=1.5, return_to_Q0=False):
"""
Base backward evolution

Parameters
----------
pdf_name: str
PDF name
q_high: float
initial Q scale
q_low: float
final Q scale
return_to_Q0: bool
if True compute also the EKO back to test stability
"""
operator_updates = self.base_operator.copy()
theory_updates = self.base_theory.copy()
self.fig_name = None
if return_to_Q0:
self.return_to_Q0 = return_to_Q0
self.fig_name = f"back_forth_{pdf_name}_{q_low}_{q_high}_{operator_updates['backward_inversion'][0]}" # pylint: disable=line-too-long
theory_updates["IC"] = 1
theory_updates["IB"] = 1
# self.rotate_to_evolution_basis = True
# self.plot_pdfs = ["S", "g", "V"]
# self.plot_pdfs = [21, -5, 5]

operator_updates["Q2grid"] = [[q_low ** 2], [q_high ** 2], [q_high ** 2]]
theory_updates["Q0"] = [q_high, q_low, q_high]
return self.run_back_forth(
[theory_updates],
operators.build((operator_updates)),
[pdf_name],
)

return self.doit(pdf_name, operator_updates, theory_updates, q_high, q_low)

def evolve_above_below_thr(
self, pdf_name, q_high=1.65, heavy_quark="c", epsilon=0.01
):
"""
Comapare above and below the heavy quark threshold

Parameters
----------
pdf_name: str
PDF name
q_high: float
initial Q scale
heavy_quark: str
heavy quark name
epsilon: float
distance from threshold
"""
self.fig_name = f"compare_thr_{heavy_quark}_{pdf_name}"
self.plot_pdfs = [-pid_dict[heavy_quark], pid_dict[heavy_quark]]

operator_updates = self.base_operator.copy()
thr_scale = (
self.base_theory[f"m{heavy_quark}"] * self.base_theory[f"k{heavy_quark}Thr"]
)
operator_updates["Q2grid"] = [
list(np.power([thr_scale + epsilon, thr_scale - epsilon], 2))
]
self.doit(pdf_name, operator_updates, q_high=q_high)

def evolve_exact_expanded(self, pdf_name, q_high=1.65, q_low=1.5):
operator_updates = self.base_operator.copy()
operator_updates["backward_inversion"] = ["exact", "expanded"]
self.doit(pdf_name, operator_updates, q_high=q_high, q_low=q_low)

def evolve_backward_mass_variation(
self, pdf_name, q_high=1.65, charm_mass=1.51, epsilon=0.01
):
"""
Backward evolution changing also the charm mass value
(the final Q scale is set to charm mass - epsilon)

Parameters
----------
pdf_name: str
PDF name
q_high: float
initial Q scale
charm_mass: float
charm mass
"""
operator_updates = self.base_operator.copy()
theory_updates = self.base_theory.copy()
theory_updates["mc"] = charm_mass
q_low = charm_mass - epsilon
self.fig_name = None
return self.doit(pdf_name, operator_updates, theory_updates, q_high, q_low)


if __name__ == "__main__":

myrunner = BackwardRunner()

# Basic checks
# pdf_names = [
# "NNPDF40_nnlo_as_01180", # NNLO, fitted charm
# # "NNPDF40_nnlo_pch_as_01180", # NNLO, perturbative charm
# ]
# for name in pdf_names:
# # Simple inversion
# myrunner.evolve_backward(name)
# # Test beclow above thr
# myrunner.evolve_above_below_thr(name)
# # Test exapanded/exact
# myrunner.evolve_exact_expanded(name)

# # Test perturbarive B
# pdf_name = "NNPDF40_nnlo_as_01180"
# myrunner.evolve_above_below_thr(pdf_name, q_high=5, heavy_quark="b")

# # Test EKO back and forth
# myrunner.evolve_backward(pdf_name, q_high=5, q_low=30, return_to_Q0=True)
# myrunner.evolve_backward(pdf_name, q_low=5, q_high=4.91, return_to_Q0=True)
# myrunner.evolve_backward(pdf_name, q_low=4.91, q_high=5, return_to_Q0=True)

# # pch vs ic forward matching
# # q_low = 1.51 to compare with Silvia's plot
# pdf_name = "NNPDF40_nnlo_pch_as_01180"
# myrunner.evolve_backward(pdf_name, q_low=1.51, q_high=1.5, return_to_Q0=False)
# pdf_name = "NNPDF40_nnlo_as_01180"
# myrunner.evolve_backward(pdf_name, q_low=1.5101, q_high=1.65, return_to_Q0=False)

# # charm mass variations, also used for momentum fractions
# mass_variations = {
# 1.38: "211103-ern-001", # NNPDF40 baseline with mc=1.38
# 1.64: "211103-ern-002", # NNPDF40 baseline with mc=1.64
# 1.51: "NNPDF40_nnlo_as_01180", # NNLO, fitted charm
# 1.51: "NNPDF40_nnlo_as_01180_EMC", # NNPDF40 baseline, fitted charm + EMC F2c
# }
# for c_m, pdf_name in mass_variations.items():
# myrunner.evolve_backward_mass_variation(pdf_name, q_high=1.65, charm_mass=c_m, epsilon=1e-8)

# mass variation perturbative charm, forward evolution
# mass_variations_pch = {
# 1.38: "211103-ern-003", # NNPDF40 baseline with mc=1.38
# 1.64: "211103-ern-004", # NNPDF40 baseline with mc=1.64
# 1.51: "NNPDF40_nnlo_pch_as_01180", # NNLO, fitted charm
# }
# for c_m, pdf_name in mass_variations_pch.items():
# myrunner.evolve_backward_mass_variation(pdf_name, q_high=c_m-1e-8, charm_mass=c_m, epsilon=c_m-1.65)

# # dataset_variations
# pdf_names =[
# "NNPDF40_nnlo_as_01180_EMC", # NNPDF40 baseline, fitted charm + EMC F2c
# "NNPDF40_nnlo_as_01180_DIS_only", # NNPDF40 baseline DIS only
# "NNPDF40_nnlo_as_01180_collider_only", # NNPDF40 baseline collider only
# "NNPDF40_nnlo_as_01180_noLHCb", # NNPDF40 baseline no LHCb
# "NNPDF40_nnlo_as_01180", # NNLO, fitted charm
# ]
# for name in pdf_names:
# myrunner.evolve_backward(name)

# # Evolve above thr for RW fits inclding LHCb Z+c
# pdf_names = [
# "NNPDF40_nnlo_as_0118_LHCbZc_uncorr", # Uncorrelated sys
# "NNPDF40_nnlo_as_0118_LHCbZc_corr", # Correlated sys
# "NNPDF40_nnlo_as_0118_EMC_LHCbZc_uncorr", # Uncorrelated sys
# "NNPDF40_nnlo_as_0118_EMC_LHCbZc_corr", # Correlated sys
# "NNPDF40_nnlo_as_01180",
# "NNPDF40_nnlo_as_01180_EMC",
# ]
# for pdf_name in pdf_names:
# myrunner.evolve_backward(
# pdf_name, q_low=1.50, q_high=1.65, return_to_Q0=False
# )

# Flavor basis vs 4.0 comparison
# pdf_names = [
# "210701-n3fit-meth-013",
# "NNPDF40_nnlo_as_01180"
# ]
# for pdf_name in pdf_names:
# myrunner.evolve_backward(
# pdf_name, q_low=1.51-1e-8, q_high=1.65, return_to_Q0=False
# )
Loading