Skip to content

Commit

Permalink
Merge pull request #335 from NNPDF/fhmv_n3lo_ad
Browse files Browse the repository at this point in the history
Adding FHMRUVV N3LO splitting functions
  • Loading branch information
niclaurenti authored Jan 12, 2024
2 parents 5cb3cc5 + e99fe18 commit 5f16a8d
Show file tree
Hide file tree
Showing 40 changed files with 2,579 additions and 137 deletions.
1 change: 1 addition & 0 deletions benchmarks/eko/benchmark_inverse_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
xif=1.0,
n3lo_ad_variation=(0, 0, 0, 0, 0, 0, 0),
matching_order=[2, 0],
use_fhmruvv=False,
)

# operator settings
Expand Down
5 changes: 4 additions & 1 deletion doc/source/shared/abbreviations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

.. |BFKL| replace::
:abbr:`BFKL (Balitsky-Fadin-Kuraev-Lipatov)`

.. external
.. |yadism| replace::
Expand All @@ -91,7 +92,6 @@
.. |pineko| replace::
:pineko:`\ `


.. |APFEL| raw:: html

<a href="https://apfel.mi.infn.it/"><abbr title="A PDF Evolution Library">APFEL</abbr></a>
Expand All @@ -108,6 +108,9 @@

<a href="https://www.nikhef.nl/~h24/qcdnum/"><abbr title="Quantum ChromoDynamics NUM">QCDNUM</abbr></a>

.. |FHMRUVV| replace::
:abbr:`FHMRUVV (Falcioni, Herzog, Moch, Ruijl, Ueda, Vermaseren and Vogt)`

.. |T| raw:: html

<span class="green">✓</span>
Expand Down
1 change: 1 addition & 0 deletions extras/lh_bench_23/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.tar
*.csv
*.dat
25 changes: 24 additions & 1 deletion extras/lh_bench_23/cfg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import pathlib
from math import inf, nan

import numpy as np
Expand All @@ -8,8 +9,16 @@
from eko.io import runcards
from eko.io.types import ReferenceRunning

here = pathlib.Path(__file__).parent
eko_dir = here / "ekos"
table_dir = here / "tables"


_sqrt2 = float(np.sqrt(2))

# setup x rotation
xgrid = np.array([1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 0.1, 0.3, 0.5, 0.7, 0.9])

# theory settings
# ---------------
_t_vfns = dict(
Expand All @@ -30,8 +39,9 @@
matching_ratios=[1.0, 1.0, 1.0],
),
xif=1.0,
n3lo_ad_variation=(0, 0, 0, 0),
n3lo_ad_variation=(0, 0, 0, 0, 0, 0, 0),
matching_order=[2, 0],
use_fhmruvv=False,
)


Expand Down Expand Up @@ -59,6 +69,19 @@ def ffns_theory(xif=1.0):
return runcards.TheoryCard.from_dict(tt)


def n3lo_theory(ad_variation, is_ffns, use_fhmruvv=False, xif=1.0):
"""Generate an N3LO theory card."""
base = _t_ffns if is_ffns else _t_vfns
tt = copy.deepcopy(base)
tt["xif"] = xif
tt["order"] = [4, 0]
# here we keep the NNLO matching
tt["matching_order"] = [2, 0]
tt["n3lo_ad_variation"] = ad_variation
tt["use_fhmruvv"] = use_fhmruvv
return runcards.TheoryCard.from_dict(tt)


# operator settings
# -----------------
_o_vfns = dict(
Expand Down
49 changes: 49 additions & 0 deletions extras/lh_bench_23/plot_bench.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from cfg import here, table_dir, xgrid
from utils import (
compute_n3lo_avg_err,
compute_n3lo_nnlo_diff,
load_n3lo_tables,
load_nnlo_table,
plot_diff_to_nnlo,
plot_pdfs,
)

USE_LINX = True
REL_DIFF = True
SCHEME = "VFNS"
SV = "central"

plot_dir = here / "plots"
n3lo_table_dir = table_dir # / SCHEME


# load tables
eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="EKO")
fhmv_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="FHMV")
nnlo_central = load_nnlo_table(table_dir, SCHEME, SV)

# compute avg and std
eko_res = compute_n3lo_avg_err(eko_dfs)
fhmv_res = compute_n3lo_avg_err(fhmv_dfs)
# eko_4mom_res = = compute_n3lo_avg_err(eko_dfs_4mom)

n3lo_dfs = [
(eko_res, "aN3LO EKO"),
(fhmv_res, "aN3LO FHMV"),
# (eko_4mom_res, "aN3LO EKO 4 mom"),
]

# PDFs plots
plot_pdfs(xgrid, n3lo_dfs, nnlo_central, SCHEME, USE_LINX, plot_dir)

# relative diff plots
eko_diff = compute_n3lo_nnlo_diff(eko_res, nnlo_central, REL_DIFF)
fhmv_diff = compute_n3lo_nnlo_diff(fhmv_res, nnlo_central, REL_DIFF)
n3lo_dfs = [
(eko_diff, "aN3LO EKO"),
(fhmv_diff, "aN3LO FHMV"),
# (eko_4mom_res, "aN3LO EKO 4 mom"),
]

# relative, absolute diff plots
plot_diff_to_nnlo(xgrid, n3lo_dfs, SCHEME, USE_LINX, plot_dir, REL_DIFF)
45 changes: 45 additions & 0 deletions extras/lh_bench_23/plot_bench_evol.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from cfg import here, table_dir, xgrid
from utils import (
compute_n3lo_avg_err,
compute_n3lo_nnlo_diff,
load_n3lo_tables,
load_nnlo_table,
plot_diff_to_nnlo,
plot_pdfs,
)

USE_LINX = False
REL_DIFF = True
SCHEME = "VFNS"
SV = "central"

plot_dir = here / "plots_evol"
n3lo_table_dir = table_dir # / SCHEME


# load tables
eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="EKO", rotate_to_evol=True)
fhmv_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="FHMV", rotate_to_evol=True)
nnlo_central = load_nnlo_table(table_dir, SCHEME, SV, rotate_to_evol=True)

# compute avg and std
eko_res = compute_n3lo_avg_err(eko_dfs)
fhmv_res = compute_n3lo_avg_err(fhmv_dfs)

n3lo_dfs = [
(eko_res, "aN3LO EKO"),
(fhmv_res, "aN3LO FHMV"),
]

# absolute plots
plot_pdfs(xgrid, n3lo_dfs, nnlo_central, SCHEME, USE_LINX, plot_dir)

# relative, absolute diff plots
eko_diff = compute_n3lo_nnlo_diff(eko_res, nnlo_central, REL_DIFF)
fhmv_diff = compute_n3lo_nnlo_diff(fhmv_res, nnlo_central, REL_DIFF)
n3lo_dfs = [
(eko_diff, "aN3LO EKO"),
(fhmv_diff, "aN3LO FHMV"),
]

plot_diff_to_nnlo(xgrid, n3lo_dfs, SCHEME, USE_LINX, plot_dir, REL_DIFF)
62 changes: 62 additions & 0 deletions extras/lh_bench_23/plot_bench_msht.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from cfg import here, table_dir, xgrid
from utils import (
compute_n3lo_avg_err,
compute_n3lo_nnlo_diff,
load_msht,
load_n3lo_tables,
load_nnlo_table,
plot_diff_to_nnlo,
plot_pdfs,
)

USE_LINX = False
REL_DIFF = True
SCHEME = "VFNS"
SV = "central"

plot_dir = here / "plots_msht"
n3lo_table_dir = table_dir # / SCHEME
msht_table_dir = table_dir


# load tables
eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="EKO")
fhmv_eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="FHMV")
msht_dfs = load_msht(msht_table_dir, SCHEME, approx="MSHT")
fhmv_msht_dfs = load_msht(msht_table_dir, SCHEME, approx="FHMV")
nnlo_central = load_nnlo_table(table_dir, SCHEME, SV)

# compute avg and std
eko_res = compute_n3lo_avg_err(eko_dfs)
fhmv_eko_res = compute_n3lo_avg_err(fhmv_eko_dfs)
msht_res = compute_n3lo_avg_err(msht_dfs)
fhmv_msht_res = compute_n3lo_avg_err(fhmv_msht_dfs)
# eko_4mom_res = = compute_n3lo_avg_err(eko_dfs_4mom)

n3lo_dfs = [
(eko_res, "EKO"),
(fhmv_eko_res, "FHMV EKO"),
(msht_res, "MSHT"),
(fhmv_msht_res, "FHMV MSHT")
# (eko_4mom_res, "aN3LO EKO 4 mom"),
]

# PDFs plots
plot_pdfs(xgrid, n3lo_dfs, nnlo_central, SCHEME, USE_LINX, plot_dir)

# relative diff plots
eko_diff = compute_n3lo_nnlo_diff(eko_res, nnlo_central, REL_DIFF)
fhmv_eko_diff = compute_n3lo_nnlo_diff(fhmv_eko_res, nnlo_central, REL_DIFF)
msht_diff = compute_n3lo_nnlo_diff(msht_res, nnlo_central, REL_DIFF)
fhmv_msht_diff = compute_n3lo_nnlo_diff(fhmv_msht_res, nnlo_central, REL_DIFF)

n3lo_dfs = [
(eko_diff, "EKO"),
(fhmv_eko_diff, "FHMV EKO"),
(msht_diff, "MSHT"),
(fhmv_msht_diff, "FHMV MSHT")
# (eko_4mom_res, "aN3LO EKO 4 mom"),
]

# relative, absolute diff plots
plot_diff_to_nnlo(xgrid, n3lo_dfs, SCHEME, USE_LINX, plot_dir, REL_DIFF)
89 changes: 89 additions & 0 deletions extras/lh_bench_23/plotstyle.mplstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
### FIGURE
figure.facecolor : white
figure.dpi : 150
figure.titlesize : 16
figure.titleweight : bold
figure.figsize : 6.4, 4.8


### GRIDS
grid.color : 0.8
grid.linestyle : --
grid.alpha : 0.5


### PATCHES
patch.facecolor : 4C72B0
patch.linewidth : 0.7

#### IMAGE
image.cmap : Greys

### LEGEND
legend.fontsize : 12
legend.loc : best
legend.fancybox : True
legend.framealpha : 0.3
legend.facecolor : white
legend.frameon : True
legend.handleheight : 1
legend.numpoints : 1
legend.scatterpoints : 1


### XTICKS
xtick.color : ".6"
xtick.labelcolor : ".4"
xtick.labelsize : 10.0
xtick.direction : in
xtick.major.size : 4.0
xtick.major.width : 1.0
xtick.major.top : true
xtick.major.bottom : true
xtick.minor.size : 2.0
xtick.minor.width : 0.5
xtick.minor.top : true
xtick.minor.bottom : true

### XTICKS
ytick.color : ".6"
ytick.labelcolor : ".4"
ytick.labelsize : 10.0
ytick.direction : in
ytick.major.size : 4.0
ytick.major.width : 1.0
ytick.major.left : true
ytick.major.right : true
ytick.minor.size : 2.0
ytick.minor.width : 0.5
ytick.minor.left : true
ytick.minor.right : true

### FONTS
font.family : serif
font.sans-serif : Arial
font.size : 13
font.weight : bold

### TEXTS
text.usetex : True
text.latex.preamble : \usepackage{amsmath}
text.color : ".15"

### AXES
axes.grid : True
axes.axisbelow : True
axes.facecolor : white
axes.edgecolor : 0.8
axes.linewidth : 1.0
axes.titlesize : 16
axes.titleweight : bold
axes.labelsize : 16
axes.labelcolor : 0.15
axes.titlepad : 9.0
axes.xmargin : 0
axes.labelweight : bold
axes.spines.top : True
axes.spines.right : True
# axes.prop_cycle : cycler('color', ['001D66', 'da3b46', 'F6AE2D', '343434', '2ca02c', '9467bd', '8c564b'])
# axes.prop_cycle : cycler('color', ["001D66", "B01C64", "3D2E85", "FFBF33", "9467bd", "FF6000"])
Loading

0 comments on commit 5f16a8d

Please sign in to comment.