Exemplo n.º 1
0
 def benchmark_APFEL_vfns_threshold(self):
     Q2s = np.power([30, 96, 150], 2)
     alphas_ref = 0.118
     scale_ref = 91.0 ** 2
     threshold_list = np.power([30, 95, 240], 2)
     thresholds_ratios = np.power((2.34, 1.0, 0.5), 2)
     apfel_vals_dict = {
         1: np.array(
             [0.011543349125207046, 0.00930916017456183, 0.008683622955304702]
         ),
         2: np.array(
             [0.011530819844835012, 0.009312638352288492, 0.00867793622077099]
         ),
     }
     # collect my values
     for order in [1, 2]:
         as_VFNS = StrongCoupling(
             alphas_ref,
             scale_ref,
             threshold_list,
             thresholds_ratios,
             order=order,
             method="expanded",
         )
         my_vals = []
         for Q2 in Q2s:
             print(Q2)
             my_vals.append(as_VFNS.a_s(Q2))
         # get APFEL numbers - if available else use cache
         apfel_vals = apfel_vals_dict[order]
         if use_APFEL:
             # run apfel
             apfel.CleanUp()
             apfel.SetTheory("QCD")
             apfel.SetPerturbativeOrder(order)
             apfel.SetAlphaEvolution("expanded")
             apfel.SetAlphaQCDRef(alphas_ref, np.sqrt(scale_ref))
             apfel.SetVFNS()
             apfel.SetPoleMasses(*np.sqrt(threshold_list))
             apfel.SetMassMatchingScales(*np.sqrt(thresholds_ratios))
             apfel.SetRenFacRatio(1)
             apfel.InitializeAPFEL()
             # collect a_s
             apfel_vals_cur = []
             for Q2 in Q2s:
                 apfel_vals_cur.append(apfel.AlphaQCD(np.sqrt(Q2)) / (4.0 * np.pi))
             print(apfel_vals_cur)
             np.testing.assert_allclose(apfel_vals, np.array(apfel_vals_cur))
         # check myself to APFEL
         np.testing.assert_allclose(apfel_vals, np.array(my_vals))
Exemplo n.º 2
0
 def benchmark_APFEL_ffns(self):
     Q2s = [1e1, 1e2, 1e3, 1e4]
     alphas_ref = 0.118
     scale_ref = 91.0 ** 2
     nf = 4
     apfel_vals_dict = {
         0: np.array(
             [
                 0.01980124164841284,
                 0.014349241933308077,
                 0.01125134009147229,
                 0.009253560532725833,
             ]
         ),
         1: np.array(
             [
                 0.021603236069744878,
                 0.014887068327193985,
                 0.01139235082295531,
                 0.009245832041857378,
             ]
         ),
         2: np.array(
             [
                 0.02204088975651748,
                 0.014966690529271008,
                 0.011406500825908607,
                 0.009245271638953058,
             ]
         ),
     }
     # collect my values
     threshold_holder = thresholds.ThresholdsAtlas.ffns(nf)
     for order in [0, 1, 2]:
         as_FFNS = StrongCoupling(
             alphas_ref,
             scale_ref,
             threshold_holder.area_walls[1:-1],
             (1.0, 1.0, 1.0),
             order=order,
             method="expanded",
         )
         my_vals = []
         for Q2 in Q2s:
             my_vals.append(as_FFNS.a_s(Q2))
         # get APFEL numbers - if available else use cache
         apfel_vals = apfel_vals_dict[order]
         if use_APFEL:
             # run apfel
             apfel.CleanUp()
             apfel.SetTheory("QCD")
             apfel.SetPerturbativeOrder(order)
             apfel.SetAlphaEvolution("expanded")
             apfel.SetAlphaQCDRef(alphas_ref, np.sqrt(scale_ref))
             apfel.SetFFNS(nf)
             apfel.SetRenFacRatio(1)
             # collect a_s
             apfel_vals_cur = []
             for Q2 in Q2s:
                 apfel_vals_cur.append(apfel.AlphaQCD(np.sqrt(Q2)) / (4.0 * np.pi))
             # print(apfel_vals_cur)
             np.testing.assert_allclose(apfel_vals, np.array(apfel_vals_cur))
         # check myself to APFEL
         np.testing.assert_allclose(apfel_vals, np.array(my_vals))
Exemplo n.º 3
0
 def benchmark_apfel_exact(self):
     """test exact towards APFEL"""
     Q2s = [1e1, 1e2, 1e3, 1e4]
     alphas_ref = 0.118
     scale_ref = 90 ** 2
     # collect my values
     threshold_holder = thresholds.ThresholdsAtlas.ffns(3)
     # LHAPDF cache
     apfel_vals_dict = {
         0: np.array(
             [
                 0.021635019899707245,
                 0.014937719308417242,
                 0.01140668497649318,
                 0.009225844999427163,
             ]
         ),
         1: np.array(
             [
                 0.025027723843261098,
                 0.015730685887616093,
                 0.01159096381106341,
                 0.009215179564010682,
             ]
         ),
         2: np.array(
             [
                 0.025717091835015565,
                 0.01583723253352162,
                 0.011610857909393214,
                 0.009214183434685514,
             ]
         ),
     }
     for order in range(2 + 1):
         sc = StrongCoupling(
             alphas_ref,
             scale_ref,
             threshold_holder.area_walls[1:-1],
             (1.0, 1.0, 1.0),
             order=order,
             method="exact",
         )
         my_vals = []
         for Q2 in Q2s:
             my_vals.append(sc.a_s(Q2))
         # get APFEL numbers - if available else use cache
         apfel_vals = apfel_vals_dict[order]
         if use_APFEL:
             # run apfel
             apfel.CleanUp()
             apfel.SetTheory("QCD")
             apfel.SetPerturbativeOrder(order)
             apfel.SetAlphaEvolution("exact")
             apfel.SetAlphaQCDRef(alphas_ref, np.sqrt(scale_ref))
             apfel.SetFFNS(3)
             apfel.SetRenFacRatio(1)
             apfel.InitializeAPFEL()
             # collect a_s
             apfel_vals_cur = []
             for Q2 in Q2s:
                 apfel_vals_cur.append(apfel.AlphaQCD(np.sqrt(Q2)) / (4.0 * np.pi))
             # print(apfel_vals_cur)
             np.testing.assert_allclose(apfel_vals, np.array(apfel_vals_cur))
         # check myself to APFEL
         np.testing.assert_allclose(apfel_vals, np.array(my_vals), rtol=2e-4)
Exemplo n.º 4
0
 def benchmark_APFEL_vfns_fact_to_ren(self):
     Q2s = [
         1.5 ** 2,
         2 ** 2,
         3 ** 2,
         4 ** 2,
         70 ** 2,
         80 ** 2,
         90 ** 2,
         100 ** 2,
         110 ** 2,
         120 ** 2,
     ]
     alphas_ref = 0.118
     scale_ref = 91.0 ** 2
     fact_to_ren_lin_list = [0.567, 2.34]
     threshold_list = np.power([2, 2 * 4, 2 * 92], 2)
     apfel_vals_dict_list = [
         {
             0: np.array(
                 [
                     0.02536996716194434,
                     0.02242405760517867,
                     0.019270297766607315,
                     0.017573474616674672,
                     0.009758787415866933,
                     0.00956761747052419,
                     0.009405104970805002,
                     0.00926434063784546,
                     0.009140585174416013,
                     0.009030457524243522,
                 ]
             ),
             1: np.array(
                 [
                     0.02892091611225328,
                     0.024548883236784783,
                     0.020329067356870584,
                     0.018489330048933994,
                     0.009777335619585536,
                     0.009576273535323533,
                     0.009405815393635488,
                     0.009258507721473314,
                     0.009129255945850333,
                     0.009014436496515657,
                 ]
             ),
             2: np.array(
                 [
                     0.029220134213545565,
                     0.024598646506863896,
                     0.020256507668384785,
                     0.018516529262400945,
                     0.00977816967988805,
                     0.009576658129637192,
                     0.009405846634492874,
                     0.009258253518802814,
                     0.009128766134980268,
                     0.009013748776298706,
                 ]
             ),
         },
         {
             0: np.array(
                 [
                     0.023451267902337505,
                     0.021080893784642736,
                     0.018452203115256843,
                     0.0170127532599337,
                     0.00974027424891201,
                     0.009551918909176069,
                     0.009403801918958557,
                     0.009275145889222168,
                     0.009161757943458262,
                     0.009060636882751797,
                 ]
             ),
             1: np.array(
                 [
                     0.028479841693964322,
                     0.02457741561064943,
                     0.020668723336288768,
                     0.01832324913740207,
                     0.00986337072082633,
                     0.009557712951433234,
                     0.009404279433906803,
                     0.009271211089740456,
                     0.009154091133886749,
                     0.009049764354779253,
                 ]
             ),
             2: np.array(
                 [
                     0.029458461672676982,
                     0.025177951225443865,
                     0.021006297788672076,
                     0.018449012475696365,
                     0.009880255980699394,
                     0.009557644276584587,
                     0.009404273824351815,
                     0.009271256953218584,
                     0.009154179878124983,
                     0.00904988942200004,
                 ]
             ),
         },
     ]
     for fact_to_ren_lin, apfel_vals_dict in zip(
         fact_to_ren_lin_list, apfel_vals_dict_list
     ):
         # collect my values
         for order in [0, 1, 2]:
             as_VFNS = StrongCoupling(
                 alphas_ref,
                 scale_ref,
                 1 / fact_to_ren_lin ** 2 * threshold_list,
                 (1.0, 1.0, 1.0),
                 order=order,
                 method="exact",
             )
             my_vals = []
             for Q2 in Q2s:
                 my_vals.append(as_VFNS.a_s(Q2, fact_to_ren_lin ** 2 * Q2))
             # get APFEL numbers - if available else use cache
             apfel_vals = apfel_vals_dict[order]
             if use_APFEL:
                 # run apfel
                 apfel.CleanUp()
                 apfel.SetTheory("QCD")
                 apfel.SetPerturbativeOrder(order)
                 apfel.SetAlphaEvolution("exact")
                 apfel.SetAlphaQCDRef(alphas_ref, np.sqrt(scale_ref))
                 apfel.SetVFNS()
                 apfel.SetPoleMasses(*np.sqrt(threshold_list))
                 apfel.SetRenFacRatio(1.0 / fact_to_ren_lin)
                 apfel.InitializeAPFEL()
                 # collect a_s
                 apfel_vals_cur = []
                 for Q2 in Q2s:
                     apfel_vals_cur.append(
                         apfel.AlphaQCD(np.sqrt(Q2)) / (4.0 * np.pi)
                     )
                 np.testing.assert_allclose(apfel_vals, np.array(apfel_vals_cur))
             # check myself to APFEL
             np.testing.assert_allclose(apfel_vals, np.array(my_vals), rtol=2.5e-5)
Exemplo n.º 5
0
 def benchmark_APFEL_vfns(self):
     Q2s = [1, 2 ** 2, 3 ** 2, 90 ** 2, 100 ** 2]
     alphas_ref = 0.118
     scale_ref = 91.0 ** 2
     threshold_list = np.power([2, 4, 175], 2)
     apfel_vals_dict = {
         0: np.array(
             [
                 0.028938898786215545,
                 0.021262022520127353,
                 0.018590827846469413,
                 0.009405104970805002,
                 0.00926434063784546,
             ]
         ),
         1: np.array(
             [
                 0.035670881093047654,
                 0.02337584106433519,
                 0.01985110421500437,
                 0.009405815313164215,
                 0.009258502199861199,
             ]
         ),
         2: np.array(
             [
                 0.03745593700854872,
                 0.023692463391822537,
                 0.019999870769373283,
                 0.009405846627291407,
                 0.009258253034683823,
             ]
         ),
     }
     # collect my values
     for order in [0, 1, 2]:
         as_VFNS = StrongCoupling(
             alphas_ref,
             scale_ref,
             threshold_list,
             (1.0, 1.0, 1.0),
             order=order,
             method="expanded",
         )
         my_vals = []
         for Q2 in Q2s:
             my_vals.append(as_VFNS.a_s(Q2))
         # get APFEL numbers - if available else use cache
         apfel_vals = apfel_vals_dict[order]
         if use_APFEL:
             # run apfel
             apfel.CleanUp()
             apfel.SetTheory("QCD")
             apfel.SetPerturbativeOrder(order)
             apfel.SetAlphaEvolution("expanded")
             apfel.SetAlphaQCDRef(alphas_ref, np.sqrt(scale_ref))
             apfel.SetVFNS()
             apfel.SetPoleMasses(*np.sqrt(threshold_list))
             apfel.SetRenFacRatio(1)
             apfel.InitializeAPFEL()
             # collect a_s
             apfel_vals_cur = []
             for Q2 in Q2s:
                 apfel_vals_cur.append(apfel.AlphaQCD(np.sqrt(Q2)) / (4.0 * np.pi))
             # print(apfel_vals_cur)
             np.testing.assert_allclose(apfel_vals, np.array(apfel_vals_cur))
         # check myself to APFEL
         np.testing.assert_allclose(apfel_vals, np.array(my_vals))