From 6ca6c8bd966453c17e1b08fab6237a0807161adf Mon Sep 17 00:00:00 2001 From: giacomomagni Date: Tue, 22 Oct 2024 12:10:04 +0200 Subject: [PATCH] fix tutorial --- doc/source/overview/tutorials/pdf.ipynb | 70 ++++++++++--------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/doc/source/overview/tutorials/pdf.ipynb b/doc/source/overview/tutorials/pdf.ipynb index bfc6ad3ad..38ddcd63d 100644 --- a/doc/source/overview/tutorials/pdf.ipynb +++ b/doc/source/overview/tutorials/pdf.ipynb @@ -74,7 +74,7 @@ "from ekobox.apply import apply_pdf\n", "\n", "with eko.EKO.read(\"./myeko.tar\") as evolution_operator:\n", - " evolved_pdfs = apply_pdf(evolution_operator, pdf)" + " evolved_pdfs, _integration_errors = apply_pdf(evolution_operator, pdf)" ] }, { @@ -82,7 +82,9 @@ "id": "0c2e752c-4a7c-4e2a-bd97-94f54907184a", "metadata": {}, "source": [ - "The returned object `evolved_pdfs` is a dictionary which maps the requested final scales onto further dictionaries:" + "The function returns two dictionaries, one filled with PDF values for each final scale (`evolved_pdfs`), \n", + "and the other containing the integration errors (`_integration_errors`). \n", + "Both of them have the same structure, for example, let's inspect `evolved_pdfs` :" ] }, { @@ -111,8 +113,8 @@ "id": "0ddf91bb-bc2c-4833-b624-32c5ac2d717a", "metadata": {}, "source": [ - "Each final scale contains a dictionary with a key `pdfs`, where all PDF values are hold, and a key `errors` , where the integration errors are hold.\n", - "Finally, inside each of those there is a mapping of Monte Carlo particle identifiers onto a the PDF value at the requested interpolation points.\n", + "Each final scale contains a dictionary, where all PDF values are hold.\n", + "Those are mapped with the Monte Carlo particle identifiers onto a the PDF value at the requested interpolation points.\n", "\n", "E.g. to access the gluon PDF at $Q^2 = 10000\\,\\text{GeV}^2$ you can run:" ] @@ -136,7 +138,7 @@ } ], "source": [ - "evolved_pdfs[(10000.0, 5)][\"pdfs\"][21]" + "evolved_pdfs[(10000.0, 5)][21]" ] }, { @@ -222,13 +224,6 @@ "id": "8c18c327", "metadata": {}, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Overwriting old PDF installation\n" - ] - }, { "name": "stdout", "output_type": "stream", @@ -263,7 +258,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "LHAPDF 6.4.0 loading /home/felix/local/share/LHAPDF/Evolved_PDF/Evolved_PDF_0000.dat\n", + "LHAPDF 6.5.0 loading /Users/giacomomagni/.conda/envs/eko_dev/share/LHAPDF/Evolved_PDF/Evolved_PDF_0000.dat\n", "Evolved_PDF PDF set, member #0, version 1\n" ] } @@ -339,7 +334,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "LHAPDF 6.4.0 loading /home/felix/local/share/LHAPDF/CT14llo/CT14llo_0000.dat\n", + "LHAPDF 6.5.0 loading /Users/giacomomagni/.conda/envs/eko_dev/share/LHAPDF/CT14llo/CT14llo_0000.dat\n", "CT14llo PDF set, member #0, version 1; LHAPDF ID = 13205\n" ] } @@ -384,17 +379,10 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 22, "id": "05b81dca", "metadata": {}, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Overwriting old PDF installation\n" - ] - }, { "name": "stdout", "output_type": "stream", @@ -424,7 +412,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 23, "id": "2b02aab1", "metadata": {}, "outputs": [ @@ -432,34 +420,34 @@ "name": "stdout", "output_type": "stream", "text": [ - "LHAPDF 6.4.0 loading /home/felix/local/share/LHAPDF/my_ct14llo/my_ct14llo_0000.dat\n", - "my_ct14llo PDF set, member #0, version 1\n", + "LHAPDF 6.5.0 loading /Users/giacomomagni/.conda/envs/eko_dev/share/LHAPDF/my_ct14llo/my_ct14llo_0000.dat\n", " x Q2 ct14llo my_ct14llo relative_diff\n", - "0 0.000010 25.000000 7.635785e+01 7.630719e+01 0.000663\n", - "1 0.000173 25.000000 3.194273e+01 3.192239e+01 0.000637\n", - "2 0.003000 25.000000 1.081843e+01 1.081160e+01 0.000632\n", + "0 0.000010 25.000000 7.635785e+01 7.630727e+01 0.000662\n", + "1 0.000173 25.000000 3.194273e+01 3.192242e+01 0.000636\n", + "2 0.003000 25.000000 1.081843e+01 1.081161e+01 0.000631\n", "3 0.051962 25.000000 1.958956e+00 1.958820e+00 0.000069\n", - "4 0.900000 25.000000 1.922415e-05 1.955440e-05 -0.017179\n", - "5 0.000010 111.803399 1.333957e+02 1.333028e+02 0.000697\n", - "6 0.000173 111.803399 4.777286e+01 4.773855e+01 0.000718\n", + "4 0.900000 25.000000 1.922415e-05 1.955338e-05 -0.017126\n", + "5 0.000010 111.803399 1.333957e+02 1.333029e+02 0.000696\n", + "6 0.000173 111.803399 4.777286e+01 4.773856e+01 0.000718\n", "7 0.003000 111.803399 1.341028e+01 1.340044e+01 0.000734\n", "8 0.051962 111.803399 1.978216e+00 1.978292e+00 -0.000038\n", - "9 0.900000 111.803399 6.644805e-06 6.756354e-06 -0.016787\n", - "10 0.000010 500.000000 1.967032e+02 1.965517e+02 0.000770\n", - "11 0.000173 500.000000 6.291393e+01 6.286327e+01 0.000805\n", + "9 0.900000 111.803399 6.644805e-06 6.754169e-06 -0.016459\n", + "10 0.000010 500.000000 1.967032e+02 1.965518e+02 0.000770\n", + "11 0.000173 500.000000 6.291393e+01 6.286326e+01 0.000805\n", "12 0.003000 500.000000 1.542347e+01 1.541073e+01 0.000826\n", "13 0.051962 500.000000 1.947465e+00 1.947532e+00 -0.000034\n", - "14 0.900000 500.000000 2.929060e-06 2.979511e-06 -0.017224\n", - "15 0.000010 2236.067977 2.633266e+02 2.631189e+02 0.000789\n", + "14 0.900000 500.000000 2.929060e-06 2.977019e-06 -0.016373\n", + "15 0.000010 2236.067977 2.633266e+02 2.631190e+02 0.000789\n", "16 0.000173 2236.067977 7.708540e+01 7.702204e+01 0.000822\n", "17 0.003000 2236.067977 1.700410e+01 1.699004e+01 0.000827\n", "18 0.051962 2236.067977 1.893923e+00 1.894094e+00 -0.000090\n", - "19 0.900000 2236.067977 1.544450e-06 1.572860e-06 -0.018395\n", - "20 0.000010 10000.000000 3.314097e+02 3.311450e+02 0.000799\n", - "21 0.000173 10000.000000 9.023010e+01 9.015576e+01 0.000824\n", - "22 0.003000 10000.000000 1.825934e+01 1.824477e+01 0.000798\n", + "19 0.900000 2236.067977 1.544450e-06 1.570506e-06 -0.016870\n", + "20 0.000010 10000.000000 3.314097e+02 3.311451e+02 0.000799\n", + "21 0.000173 10000.000000 9.023010e+01 9.015575e+01 0.000824\n", + "22 0.003000 10000.000000 1.825934e+01 1.824476e+01 0.000798\n", "23 0.051962 10000.000000 1.830992e+00 1.831291e+00 -0.000163\n", - "24 0.900000 10000.000000 9.288458e-07 9.463689e-07 -0.018866\n" + "24 0.900000 10000.000000 9.288458e-07 9.442889e-07 -0.016626\n", + "my_ct14llo PDF set, member #0, version 1\n" ] } ],