You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/sphinx/source/tutorials/run-qed-fit.rst
+67-44Lines changed: 67 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,14 +11,17 @@ Setting up the runcard
11
11
----------------------
12
12
13
13
It is possible to perform a QED fit by adding a ``fiatlux`` block to the
14
-
runcard. The following code snippet shows an example of a QED fit configuration:
14
+
runcard. The following code snippet shows all the available options to set up
15
+
a QED fit:
15
16
16
17
.. code-block:: yaml
17
18
18
19
fiatlux:
19
-
luxset: 251127-jcm-lh-qed-001
20
+
luxset: NNPDF40_nnlo_as_01180_qcd
20
21
additional_errors: true
21
22
luxseed: 1234567890
23
+
compute_in_setupfit: false
24
+
eps_base: 1e-5
22
25
23
26
The parameters contained in the ``fiatlux`` block are:
24
27
@@ -27,8 +30,8 @@ The parameters contained in the ``fiatlux`` block are:
27
30
<https://github.com/scarrazza/fiatlux/>`_. The code will use as many
28
31
photon replicas as the number of replicas contained in the ``luxset``. If
29
32
the user tries to generate a replica with ID higher than the maximum ID of
30
-
the ``luxset``, the code will start reusing photon replica from the first.
31
-
Being the LuxQED approach an iterated procedure, and given that some
33
+
the ``luxset``, the code will start reusing photon replica from the first
34
+
replica. Being the LuxQED approach an iterated procedure, and that some
32
35
replicas do not pass the ``postfit`` selection criteria, the user should
33
36
make sure that the number of replicas in the ``luxset`` is high enough
34
37
such that in the final iteration there will be a number of replicas higher
@@ -45,14 +48,27 @@ The parameters contained in the ``fiatlux`` block are:
45
48
* ``luxseed``
46
49
The seed used to generate the additional errors of the LuxQED as in ``additional_errors``.
47
50
48
-
The code uses both the ``fiatlux`` block and the ``theoryid`` specified in the
49
-
runcard to identify the photon PDF set. As explained below, the code searches
50
-
for precomputed photon PDF sets using the pair of ``luxset`` and ``theoryid``
51
-
parameters, first locally and then on the NNPDF server (see
52
-
:ref:`photon-resources` for details). The photon PDF set will be named
53
-
``photon_theoryID_<theoryid>_fit_<luxset>``.
51
+
* ``compute_in_setupfit``
52
+
Boolean flag to trigger the computation of the photon PDF set during
53
+
``vp-setupfit``. By default, it is set to `false`. This is not required if
54
+
the photon PDF set is already available locally or on the NNPDF server.
55
+
See the :ref:`section below <running-with-photon-sets>` for more details.
54
56
55
-
.. _photon-resources:
57
+
* ``eps_base``
58
+
(optional) The base precision of the FiatLux computation, which controls
59
+
the precision on final integration of double integral. By default, it is
60
+
set to ``1e-5``. This parameter is used only if the photon PDF set is
61
+
generated on the fly, either during ``vp-setupfit`` or ``n3fit``. See
62
+
:ref:`Generating new Photon sets <generating-photon-sets>` for more
63
+
details.
64
+
65
+
The code uses information contained in both the ``fiatlux`` block and the
66
+
``theoryid`` specified in the runcard to identify the photon PDF set, which will
67
+
be assigned the name ``photon_theoryID_<theoryid>_fit_<luxset>``. This name will
68
+
be used to either look for existing photon PDF sets or to store newly generated
69
+
ones, as explained below.
70
+
71
+
.. _running-with-photon-sets:
56
72
57
73
Running with Photon PDF sets
58
74
-----------------------------
@@ -63,6 +79,8 @@ minimize the overhead due to the generation of photon PDF sets and avoid
63
79
redundant computations, the code looks for precomputed photon resources either
64
80
locally or on the NNPDF server. If a desired photon PDF set does not exist in
65
81
either of the two locations, it will be computed on the fly and stored locally.
82
+
If the user is satisfied with the new local photon PDF set, they can upload it to
83
+
the NNPDF server following the instructions in :ref:`this section <generating-photon-sets>`.
66
84
The following sections describe how to use existing photon PDF sets or generate
67
85
new ones.
68
86
@@ -75,52 +93,48 @@ The desired photon PDF is specified by the ``luxset`` parameter in the
75
93
``fiatlux`` block and the ``theoryid``, as explained above. The code will first
76
94
look for the photon PDF set in the local directory specified in the
77
95
:ref:`profile file <nnprofile>`. If the set is not found locally, it will try to
78
-
download it from the NNPDF server. The following is an example of running
79
-
``vp-setupfit`` using the ``fiatlux`` block shown above:
96
+
download it from the NNPDF server. If the photon PDF set is not found on the
97
+
server either, and the user has not requested to compute it during
98
+
``vp-setupfit`` through the flag ``compute_in_setupfit``, the photon replica
99
+
will be computed as needed for the replica fitted during the execution of
100
+
``n3fit`` (see :ref:`here <photon_n3fit>` for more details).
101
+
102
+
The following is an example of running ``vp-setupfit`` using the
103
+
``fiatlux`` block shown above and setting ``compute_in_setupfit: false``:
80
104
81
105
.. code-block:: bash
82
106
83
107
$ vp-setupfit qed_example_runcard.yml
84
-
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_702_fit_251127-jcm-lh-qed-001in theory: 702. Attempting to download it.
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qedin theory: 40000100. Attempting to download it.
[INFO]: Extracting archive to /opt/homebrew/Caskroom/miniconda/base/envs/nnpdf/share/NNPDF/photons_qed
88
-
[INFO]: Photon QED set found for702 with luxset 251127-jcm-lh-qed-001.
112
+
[INFO]: Photon QED set found for40000100 with luxset NNPDF40_nnlo_as_01180_qed.
89
113
[WARNING]: Using q2min from runcard
90
114
[WARNING]: Using w2min from runcard
91
115
Using Keras backend
92
116
[INFO]: All requirements processed and checked successfully. Executing actions.
93
117
...
94
118
95
-
This will download and extract the photon PDF set in the local
119
+
In this case, the desired photon PDF set was already stored and precomputed on
120
+
the server. This is downloaded and extracted in the local
96
121
``photons_qed_path`` specified in the :ref:`profile file <nnprofile>`.
97
122
98
123
The ``vp-list`` utility tool can be used to list all the available photon PDF
99
124
sets locally and on the NNPDF server. To list the available photon PDF sets,
100
-
just run:
101
-
102
-
.. code-block:: bash
103
-
104
-
$ vp-list photons
105
-
[INFO]: The following photons are available locally:
106
-
- theoryID_702_fit_251127-jcm-lh-qed-001
107
-
[INFO]: The following photons are downloadable:
108
-
- theoryID_702_fit_251127-jcm-lh-qed-002
109
-
110
-
In this example, there is one photon PDF set available locally, and one photon
111
-
resource available on the NNPDF server precomputed with theory ID 702 and
112
-
``251127-jcm-lh-qed-002`` as input PDF. The user can manually download a photon
113
-
PDF set using the ``vp-get`` tool as explained :ref:`here <download>`. For
114
-
example:
125
+
just run `vp-list photons` to see which photon PDF sets are available locally
126
+
and which ones can be downloaded from the server. The user can manually download
127
+
a photon PDF set using the ``vp-get`` tool as explained :ref:`here <download>`.
128
+
For example:
115
129
116
130
.. code-block:: bash
117
131
118
-
$ vp-get photonQED 702 251127-jcm-lh-qed-002
119
-
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_702_fit_251127-jcm-lh-qed-002in theory: 702. Attempting to download it.
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qedin theory: 40000100. Attempting to download it.
As in the case of ``vp-setupfit``, this will download and extract the photon PDF
126
140
set in the local ``photons_qed_path`` specified in the :ref:`profile file <nnprofile>`.
@@ -135,6 +149,7 @@ fit with ``n3fit`` as usual.
135
149
more details.
136
150
137
151
.. _generating-photon-sets:
152
+
138
153
Generating new Photon PDF sets
139
154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140
155
If the desired photon PDF set is not available locally nor on the NNPDF server, the
@@ -162,8 +177,16 @@ prior to the evolution through EKO.
162
177
163
178
Automatic upload to the NNPDF server through ``vp-upload`` is **not**
164
179
supported at the moment. The user should manually create a ``tar`` archive
165
-
file containing the photon replicas and upload it to server. Refer to the
166
-
:ref:`profile file <nnprofile>` to find the remote URL where photon PDF sets are stored.
180
+
file containing the photon replicas
181
+
182
+
.. code-block:: bash
183
+
184
+
$ cd my_photon_folder
185
+
$ tar -czf my_photon.tgz *.npz
186
+
187
+
Once the archive file is created, the user can upload it to the server. Refer
188
+
to the :ref:`profile file <nnprofile>` to find the remote URL where photon PDF
189
+
sets are stored.
167
190
168
191
169
192
Using ``vp-setupfit`` (preferred)
@@ -177,9 +200,9 @@ Using ``vp-setupfit`` (preferred)
177
200
.. code-block:: bash
178
201
179
202
$ vp-setupfit qed_example_runcard.yml
180
-
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_703_fit_251127-jcm-lh-qed-001in theory: 703. Attempting to download it.
181
-
[ERROR]: Resource not in the remote repository: Photon QED setforTheoryID 703 and luxset 251127-jcm-lh-qed-001 is not availablein the remote server.
182
-
[WARNING]: Photon QED setfortheory 703 with luxset 251127-jcm-lh-qed-001 not found. It will be computedin vp-setupfit.
203
+
[INFO]: Could not find a resource (photonQED): Could not find Photon QED set /user/envs/nnpdf/share/NNPDF/photons_qed/photon_theoryID_40000100_fit_NNPDF40_nnlo_as_01180_qcdin theory: 40000100. Attempting to download it.
204
+
[ERROR]: Resource not in the remote repository: Photon QED setforTheoryID 40000100 and luxset NNPDF40_nnlo_as_01180_qcd is not availablein the remote server.
205
+
[WARNING]: Photon QED setfortheory 40000100 with luxset NNPDF40_nnlo_as_01180_qcd not found. It will be computedin vp-setupfit.
183
206
[INFO]: Forcing photon computation with FiatLux during setupfit.
184
207
[WARNING]: Using q2min from runcard
185
208
[WARNING]: Using w2min from runcard
@@ -206,6 +229,7 @@ Using ``vp-setupfit`` (preferred)
206
229
Once the preparation step is completed, and the photon PDF set is generated and stored
207
230
locally, the user can proceed to run the fit with ``n3fit`` as usual.
208
231
232
+
.. _photon_n3fit:
209
233
Using ``n3fit`` (discouraged)
210
234
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211
235
If the user prefers to compute the photon PDF set during the fitting step with
@@ -222,9 +246,8 @@ Using ``n3fit`` (discouraged)
222
246
$ n3fit qed_example_runcard.yml 1
223
247
[INFO]: Creating replica output folder in /user/runcards/qed_example_runcard/nnfit/replica_1
224
248
[WARNING]: Using q2min from runcard
225
-
[WARNING]: Using w2min from runcard
226
-
Using Keras backend
227
-
[WARNING]: No Photon QED set found for Theory 703 with luxset 251127-jcm-lh-qed-001. It will be computed using FiatLux. This may impact performance. It is recommended to precompute the photon set before running the fit. Refer to https://docs.nnpdf.science/tutorials/run-qed-fit.html for more details on precomputing photon PDF sets.
249
+
[WARNING]: Using w2min from runcard Using Keras backend
250
+
[WARNING]: No Photon QED set found for Theory 40000100 with luxset NNPDF40_nnlo_as_01180_qed. It will be computed using FiatLux. This may impact performance. It is recommended to precompute the photon set before running the fit. Refer to https://docs.nnpdf.science/tutorials/run-qed-fit.html for more details on precomputing photon PDF sets.
228
251
[INFO]: All requirements processed and checked successfully. Executing actions.
0 commit comments