Skip to content

Commit e0b16d0

Browse files
Add TMDlib interface to the documentation
1 parent 45f33e6 commit e0b16d0

File tree

2 files changed

+128
-0
lines changed

2 files changed

+128
-0
lines changed

docs/tmdlib.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# TMDlib Interface
2+
3+
`NeoPDF` provides an interface to the `TMDlib` library which allows users for example
4+
to interpolate TMD PDFs from the CLI. Most importantly, it is used to convert TMDlib
5+
sets into `NeoPDF` formats.
6+
7+
## Installing the interface
8+
9+
To install the `TMDlib` interface, first clone the repository and run the following
10+
command:
11+
12+
```bash
13+
cargo install --path neopdf_cli --features=tmdlib
14+
```
15+
16+
Note that this requires `TMDlib` and its dependencies to be installed and available
17+
in the environment paths.
18+
19+
## Interpolating TMDlib sets
20+
21+
To interpolate `TMDlib` sets from the CLI, the command is similar to the one used for
22+
regular sets:
23+
24+
```bash
25+
neopdf compute xfx_q2_kt --pdf-name MAP22_grids_FF_Km_N3LL --member 0 --pid 2 0.00010000000000000009 1.00000e-1 4.14987e3
26+
```
27+
28+
For more details on the required arguments, refer to the helper:
29+
30+
```bash
31+
> neopdf compute xfx_q2_kt --help ─╯
32+
33+
Evaluate TMD PDF for a given set, member, and input values
34+
35+
Usage: neopdf compute xfx_q2_kt --pdf-name <PDF_NAME> --member <MEMBER> --pid <PID> <INPUTS>...
36+
37+
Arguments:
38+
<INPUTS>... Input values (kt, x, Q2)
39+
40+
Options:
41+
-p, --pdf-name <PDF_NAME> Name of the TMD PDF set
42+
-m, --member <MEMBER> Member index (0-based)
43+
-i, --pid <PID> PDG flavor ID
44+
-h, --help Print help
45+
```
46+
47+
## Converting TMDlib sets into NeoPDF
48+
49+
To convert a `TMDlib` set into the `NeoPDF` format, one needs to write a configuration file
50+
in the `.toml` format. This configuration file should contain all the information about the
51+
metadata and the grid configurations. The following is an example:
52+
53+
```toml
54+
set_name = "MAP22_grids_FF_Km_N3LL"
55+
set_desc = "MAP22 TMDs for K- fragmentation, converted to NeoPDF"
56+
set_index = 0
57+
n_members = 2
58+
59+
# Inner edges for the subgrids. Leave empty for no subgrids.
60+
x_inner_edges = [0.2]
61+
q_inner_edges = [] # Q, not Q2
62+
kt_inner_edges = [1e-2, 1.0]
63+
64+
# Number of points for (subg)grids.
65+
n_x = [5, 5]
66+
n_q = [6]
67+
n_kt = [5, 5, 4]
68+
69+
# Grid axes that are not part of the TMD interpolation
70+
nucleons = [0.0] # dummy value
71+
alphas = [0.118] # alpha_s(M_Z)
72+
73+
# Metadata
74+
pids = [-3, -2, -1, 21, 1, 2, 3]
75+
polarised = false
76+
set_type = "TimeLike"
77+
interpolator_type = "LogChebyshev" # or LogTricubic
78+
error_type = "replicas"
79+
hadron_pid = 321 # Kaon
80+
alphas_qs = [91.1876] # dummy values
81+
alphas_vals = [0.118] # dummy values
82+
83+
# Physics Parameters
84+
flavor_scheme = "fixed"
85+
order_qcd = 2
86+
alphas_order_qcd = 2
87+
m_w = 80.352
88+
m_z = 91.1876
89+
m_up = 0.0
90+
m_down = 0.0
91+
m_strange = 0.0
92+
m_charm = 1.51
93+
m_bottom = 4.92
94+
m_top = 172.5
95+
alphas_type = "ipol"
96+
number_flavors = 4
97+
```
98+
99+
We can now convert the `MAP22_grids_FF_Km_N3LL` set by running the following command:
100+
```bash
101+
neopdf write convert-tmd --input MAP22_grids_FF_Km_N3LL.toml --output MAP22.neopdf.lz4
102+
```
103+
104+
Once the conversion has been performed successfully (and the converted `NeoPDF` set
105+
available in the `$NEOPDF_DATA_PATH`), we can inspect the content of the subgrids to make
106+
sure that everything is correct.
107+
108+
```bash
109+
> neopdf read subgrid --pdf-name MAP22.neopdf.lz4 --member 0 --subgrid-index 0 --pid 2 --kt-index 0 ─╯
110+
111+
Displaying grid for kT = 0.00010000000000000009
112+
113+
[x | Q2] 1.00000e0 2.40972e0 2.40972e1 4.14987e2 4.14987e3 1.00000e4
114+
1.00000e-1 -6.70867e-1 -4.80573e-1 -1.53370e-1 -1.26831e-2 1.49324e-2 0.00000e0
115+
1.10684e-1 -7.26434e-1 -4.81932e-1 -1.40332e-1 -7.62762e-3 1.61799e-2 0.00000e0
116+
1.41421e-1 -7.37791e-1 -3.84220e-1 -8.14145e-2 8.54183e-3 1.92982e-2 0.00000e0
117+
1.80695e-1 -5.23889e-1 -1.84548e-1 -1.28827e-2 2.17623e-2 1.98305e-2 0.00000e0
118+
2.00000e-1 -3.89947e-1 -1.06392e-1 7.02618e-3 2.38316e-2 1.86428e-2 0.00000e0
119+
```
120+
121+
We can verify that the contents of the subgrids are correct by checking one of the entries:
122+
123+
```bash
124+
> neopdf compute xfx_q2_kt --pdf-name MAP22_grids_FF_Km_N3LL --member 0 --pid 2 0.00010000000000000009 1.00000e-1 2.40972e0 ─╯
125+
126+
-0.4805722561384916
127+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ nav:
2727
- Design Rationale: design.md
2828
- Custom Interpolation: custom-interpolation.md
2929
- CLI Tutorials: cli-tutorials.md
30+
- TMDlib Interface: tmdlib.md
3031
- Examples:
3132
- 'Python API': 'examples/neopdf-pyapi.ipynb'
3233
- 'C++ OOP API': 'examples/c-oop.md'

0 commit comments

Comments
 (0)