From fb886c27cdcad63b703ca2448d2324dd21992330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Laurenti?= Date: Mon, 16 Sep 2024 12:19:40 +0200 Subject: [PATCH 1/4] Add code for interpolating the exact (but still missing) aQg30 --- inc/adani/MatchingCondition.h | 7 +++- src/MatchingCondition.cc | 64 ++++++++++++++++++++++++++++++----- 2 files changed, 62 insertions(+), 9 deletions(-) diff --git a/inc/adani/MatchingCondition.h b/inc/adani/MatchingCondition.h index e7aff89..29631df 100644 --- a/inc/adani/MatchingCondition.h +++ b/inc/adani/MatchingCondition.h @@ -19,6 +19,8 @@ #include "CoefficientFunction.h" +#include +#include #include using std::string; @@ -33,7 +35,7 @@ class MatchingCondition { const int &order, const char &entry1, const char &entry2, const string &version ); - ~MatchingCondition(){}; + ~MatchingCondition(); int GetOrder() const { return order_; }; char GetEntry1() const { return entry1_; }; @@ -49,6 +51,9 @@ class MatchingCondition { const char entry2_; const string version_; + gsl_interp_accel *acc_; + gsl_spline *spline_; + //==========================================================================================// // Matching conditions O(as) //------------------------------------------------------------------------------------------// diff --git a/src/MatchingCondition.cc b/src/MatchingCondition.cc index a6884dc..4edeb6a 100644 --- a/src/MatchingCondition.cc +++ b/src/MatchingCondition.cc @@ -8,6 +8,15 @@ using std::cout; using std::endl; +//==========================================================================================// +// Numerical values of the exact aQg30 needed for the interpolation +//------------------------------------------------------------------------------------------// + +// clang-format off +const double aQg30_X[] = { 1e-4, 1e-3, 1e-2, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 }; +const double aQg30_VALUES[] = { 0.3, 0.4, 0.45, 0.5, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.5, 0.1, 0.0 }; +// clang-format on + //==========================================================================================// // MatchingCondition: constructor //------------------------------------------------------------------------------------------// @@ -45,17 +54,44 @@ MatchingCondition::MatchingCondition( exit(-1); } - if (entry2 == 'g' && version == "exact") { - cout << "Error: aQg channel doesn't have 'exact' version!" << endl; - exit(-1); - } - if (entry2 == 'q' && (version == "abmp" || version == "gm")) { cout << "Error: aQq channel doesn't have 'abmp' or 'gm' " "version!" << endl; exit(-1); } + + acc_ = nullptr; + spline_ = nullptr; + + if (entry2 == 'g' && version == "exact") { + + int dimX = sizeof(aQg30_X) / sizeof(aQg30_X[0]); + int dim = sizeof(aQg30_VALUES) / sizeof(aQg30_VALUES[0]); + + if (dim != dimX) { + cout + << "Error: dimensions of aQg30_X and aQg30_VALUES do not match!" + << endl; + cout << "length of aQg30_X: " << dimX << endl; + cout << "length of aQg30_VALUES: " << dim << endl; + exit(-1); + } + + acc_ = gsl_interp_accel_alloc(); + spline_ = gsl_spline_alloc(gsl_interp_cspline, dim); + + gsl_spline_init(spline_, aQg30_X, aQg30_VALUES, dim); + } +} + +//==========================================================================================// +// MatchingCondition: destructor +//------------------------------------------------------------------------------------------// + +MatchingCondition::~MatchingCondition() { + gsl_spline_free(spline_); + gsl_interp_accel_free(acc_); } //==========================================================================================// @@ -256,12 +292,13 @@ vector MatchingCondition::NotOrdered(double x) const { // Approximation of the nf-independent part of the mu-independent part of the // unrenormalized matching condition Qg at O(as^3). // -// v = 0 : exact result +// v = 0 : exact result from Ref. [arXiv:2403.00513] // v = 1 : Eq. (3.49) of Ref. [arXiv:1205.5727] // v = -1 : Eq. (16) Ref. of [arXiv:1701.05838] // v = -12 : Eq. (3.50) of Ref. [arXiv:1205.5727] // v = 2 : approximation from Giacomo Magni, based on the results of // [arXiv:2403.00513] +// v = 3 : small x limit, Eq. (4.4) from Ref. [arXiv:2403.00513] //------------------------------------------------------------------------------------------// double MatchingCondition::a_Qg_30(double x, int v) const { @@ -276,8 +313,10 @@ double MatchingCondition::a_Qg_30(double x, int v) const { double L13 = L12 * L1; if (v == 0) { - cout << "a_Qg_30 exact is not known/implemented yet!" << endl; - exit(-1); + if (x < 1e-4) + return a_Qg_30(x, 3); + else + return gsl_spline_eval(spline_, x, acc_); } else if (v == 1) { return ( 354.1002 * L13 + 479.3838 * L12 - 7856.784 * (2. - x) @@ -307,6 +346,15 @@ double MatchingCondition::a_Qg_30(double x, int v) const { + 10739.21741 * L + 1548.8916669999999 * L / x - 7861.809052567688 * x * L - 720.0483828 * L2 + 514.0912722 * L3 - 21.75925926 * L4 + 4.844444444 * L5; + } else if (v == 3) { + double L = log(x); + double L2 = L * L; + double L3 = L2 * L; + double L4 = L3 * L; + double L5 = L4 * L; + return (1548.891667 * L + 8956.649545) / x + 4.844444444 * L5 + - 21.75925926 * L4 + 514.0912722 * L3 - 720.0483828 * L2 + + 10739.21741 * L; } else { cout << "Error in MatchingCondition::a_Qg_30: Choose either v=0, v=1, " "v=-1, v=-12 or v=2" From 4b7dd685a4d04de8afc360de359ee266a6ac17ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Laurenti?= Date: Thu, 19 Sep 2024 12:35:05 +0200 Subject: [PATCH 2/4] Add doc in string --- src/MatchingCondition.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MatchingCondition.cc b/src/MatchingCondition.cc index 4edeb6a..f6d74e9 100644 --- a/src/MatchingCondition.cc +++ b/src/MatchingCondition.cc @@ -357,7 +357,7 @@ double MatchingCondition::a_Qg_30(double x, int v) const { + 10739.21741 * L; } else { cout << "Error in MatchingCondition::a_Qg_30: Choose either v=0, v=1, " - "v=-1, v=-12 or v=2" + "v=-1, v=-12, v=2 or v=3" << endl; exit(-1); } From 8201e6638b6db59ec5c6c6407a3e207522d5a1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Laurenti?= Date: Thu, 19 Sep 2024 12:35:55 +0200 Subject: [PATCH 3/4] Add doc in comment --- src/MatchingCondition.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/MatchingCondition.cc b/src/MatchingCondition.cc index f6d74e9..4fb788f 100644 --- a/src/MatchingCondition.cc +++ b/src/MatchingCondition.cc @@ -13,6 +13,8 @@ using std::endl; //------------------------------------------------------------------------------------------// // clang-format off +// FAKE NUMBERS +// WAITING FOR REAL ONES const double aQg30_X[] = { 1e-4, 1e-3, 1e-2, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 }; const double aQg30_VALUES[] = { 0.3, 0.4, 0.45, 0.5, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.5, 0.1, 0.0 }; // clang-format on From 400150422078d085b3da4f02dadf2447032d67c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Laurenti?= Date: Mon, 23 Sep 2024 18:42:31 +0200 Subject: [PATCH 4/4] Use exact aQg30 in examples --- examples/test.cpp | 4 ++-- examples/test.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/test.cpp b/examples/test.cpp index ca2b4c1..920b5dc 100644 --- a/examples/test.cpp +++ b/examples/test.cpp @@ -19,10 +19,10 @@ int main() { int nf = 4; ApproximateCoefficientFunction F2g( - 3, '2', 'g', true, "abmp", 1e-3, 1e-3, 1000, "analytical", 25000 + 3, '2', 'g', true, "exact", 1e-3, 1e-3, 1000, "analytical", 25000 ); ApproximateCoefficientFunction FLg( - 3, 'L', 'g', true, "abmp", 1e-3, 1e-3, 1000, "analytical", 25000 + 3, 'L', 'g', true, "exact", 1e-3, 1e-3, 1000, "analytical", 25000 ); ApproximateCoefficientFunction F2q( 3, '2', 'q', true, "exact", 1e-3, 1e-3, 1000 diff --git a/examples/test.py b/examples/test.py index fe96382..9404a94 100644 --- a/examples/test.py +++ b/examples/test.py @@ -4,8 +4,8 @@ nf = 4 m = 4.92 -F2g = ad.ApproximateCoefficientFunction(3, '2', 'g', True, "abmp", 1e-3, 1e-3, 1000, "analytical", 25000) -FLg = ad.ApproximateCoefficientFunction(3, 'L', 'g', True, "abmp", 1e-3, 1e-3, 1000, "analytical", 25000) +F2g = ad.ApproximateCoefficientFunction(3, '2', 'g', True, "exact", 1e-3, 1e-3, 1000, "analytical", 25000) +FLg = ad.ApproximateCoefficientFunction(3, 'L', 'g', True, "exact", 1e-3, 1e-3, 1000, "analytical", 25000) F2q = ad.ApproximateCoefficientFunction(3, '2', 'q', True, "exact", 1e-3, 1e-3, 1000) FLq = ad.ApproximateCoefficientFunction(3, 'L', 'q', True, "exact", 1e-3, 1e-3, 1000)