nnpdf 4.1.0__py3-none-any.whl → 4.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. n3fit/backends/keras_backend/MetaModel.py +27 -26
  2. n3fit/backends/keras_backend/callbacks.py +16 -8
  3. n3fit/backends/keras_backend/internal_state.py +13 -2
  4. n3fit/backends/keras_backend/operations.py +26 -26
  5. n3fit/hyper_optimization/hyper_scan.py +3 -9
  6. n3fit/hyper_optimization/penalties.py +11 -8
  7. n3fit/hyper_optimization/rewards.py +65 -34
  8. n3fit/model_gen.py +344 -270
  9. n3fit/model_trainer.py +71 -105
  10. n3fit/performfit.py +2 -7
  11. n3fit/tests/regressions/quickcard_1.json +12 -28
  12. n3fit/tests/regressions/quickcard_3.json +12 -28
  13. n3fit/tests/regressions/quickcard_pol_1.json +10 -26
  14. n3fit/tests/regressions/quickcard_pol_3.json +9 -25
  15. n3fit/tests/regressions/quickcard_qed_1.json +11 -27
  16. n3fit/tests/regressions/quickcard_qed_3.json +11 -27
  17. n3fit/tests/test_hyperopt.py +6 -12
  18. n3fit/tests/test_layers.py +6 -6
  19. n3fit/tests/test_modelgen.py +73 -24
  20. n3fit/tests/test_multireplica.py +52 -16
  21. n3fit/tests/test_penalties.py +7 -8
  22. n3fit/tests/test_preprocessing.py +2 -2
  23. n3fit/tests/test_vpinterface.py +5 -10
  24. n3fit/vpinterface.py +88 -44
  25. {nnpdf-4.1.0.dist-info → nnpdf-4.1.1.dist-info}/METADATA +9 -3
  26. {nnpdf-4.1.0.dist-info → nnpdf-4.1.1.dist-info}/RECORD +105 -67
  27. {nnpdf-4.1.0.dist-info → nnpdf-4.1.1.dist-info}/WHEEL +1 -1
  28. nnpdf_data/_version.py +1 -1
  29. nnpdf_data/commondata/ATLAS_2JET_7TEV_R06/metadata.yaml +16 -5
  30. nnpdf_data/commondata/ATLAS_TTBAR_13P6TEV_TOT/data.yaml +2 -0
  31. nnpdf_data/commondata/ATLAS_TTBAR_13P6TEV_TOT/kinematics.yaml +13 -0
  32. nnpdf_data/commondata/ATLAS_TTBAR_13P6TEV_TOT/metadata.yaml +51 -0
  33. nnpdf_data/commondata/ATLAS_TTBAR_13P6TEV_TOT/uncertainties.yaml +17 -0
  34. nnpdf_data/commondata/ATLAS_TTBAR_5TEV_TOT/data.yaml +2 -0
  35. nnpdf_data/commondata/ATLAS_TTBAR_5TEV_TOT/kinematics.yaml +13 -0
  36. nnpdf_data/commondata/ATLAS_TTBAR_5TEV_TOT/metadata.yaml +52 -0
  37. nnpdf_data/commondata/ATLAS_TTBAR_5TEV_TOT/uncertainties.yaml +22 -0
  38. nnpdf_data/commondata/ATLAS_WPWM_13P6TEV_TOT/data.yaml +3 -0
  39. nnpdf_data/commondata/ATLAS_WPWM_13P6TEV_TOT/kinematics.yaml +17 -0
  40. nnpdf_data/commondata/ATLAS_WPWM_13P6TEV_TOT/metadata.yaml +57 -0
  41. nnpdf_data/commondata/ATLAS_WPWM_13P6TEV_TOT/uncertainties.yaml +8 -0
  42. nnpdf_data/commondata/ATLAS_Z0_13P6TEV_TOT/data.yaml +2 -0
  43. nnpdf_data/commondata/ATLAS_Z0_13P6TEV_TOT/kinematics.yaml +9 -0
  44. nnpdf_data/commondata/ATLAS_Z0_13P6TEV_TOT/metadata.yaml +54 -0
  45. nnpdf_data/commondata/ATLAS_Z0_13P6TEV_TOT/uncertainties.yaml +7 -0
  46. nnpdf_data/commondata/CMS_1JET_8TEV/metadata.yaml +7 -1
  47. nnpdf_data/commondata/CMS_2JET_7TEV/metadata.yaml +16 -19
  48. nnpdf_data/commondata/CMS_TTBAR_13P6TEV_TOT/data.yaml +2 -0
  49. nnpdf_data/commondata/CMS_TTBAR_13P6TEV_TOT/kinematics.yaml +13 -0
  50. nnpdf_data/commondata/CMS_TTBAR_13P6TEV_TOT/metadata.yaml +51 -0
  51. nnpdf_data/commondata/CMS_TTBAR_13P6TEV_TOT/uncertainties.yaml +12 -0
  52. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/data_d2Sig_dmttBar_dyttBar.yaml +17 -0
  53. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/data_dSig_dmttBar.yaml +8 -0
  54. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/data_dSig_dpTt.yaml +8 -0
  55. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/data_dSig_dyt.yaml +11 -0
  56. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/filter.py +260 -0
  57. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/kinematics_d2Sig_dmttBar_dyttBar.yaml +193 -0
  58. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/kinematics_dSig_dmttBar.yaml +57 -0
  59. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/kinematics_dSig_dpTt.yaml +57 -0
  60. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/kinematics_dSig_dyt.yaml +81 -0
  61. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/metadata.yaml +114 -0
  62. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/rawdata/mtt_abs_parton.yaml +828 -0
  63. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/rawdata/mttytt-abs_parton.yaml +1899 -0
  64. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/rawdata/ptt_abs_parton.yaml +828 -0
  65. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/rawdata/submission.yaml +47 -0
  66. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/rawdata/yt_abs_parton.yaml +1179 -0
  67. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/uncertainties_d2Sig_dmttBar_dyttBar.yaml +2282 -0
  68. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/uncertainties_dSig_dmttBar.yaml +1256 -0
  69. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/uncertainties_dSig_dpTt.yaml +1256 -0
  70. nnpdf_data/commondata/CMS_TTBAR_13TEV_2L_138FB-1_DIF/uncertainties_dSig_dyt.yaml +1598 -0
  71. nnpdf_data/commondata/CMS_TTBAR_13TEV_35P9FB-1_TOT/data.yaml +2 -0
  72. nnpdf_data/commondata/CMS_TTBAR_13TEV_35P9FB-1_TOT/kinematics.yaml +13 -0
  73. nnpdf_data/commondata/CMS_TTBAR_13TEV_35P9FB-1_TOT/metadata.yaml +51 -0
  74. nnpdf_data/commondata/CMS_TTBAR_13TEV_35P9FB-1_TOT/uncertainties.yaml +17 -0
  75. nnpdf_data/commondata/CMS_TTBAR_5TEV_TOT/metadata.yaml +1 -1
  76. nnpdf_data/commondata/NNPDF_POS_2P24GEV/metadata.yaml +60 -0
  77. nnpdf_data/commondata/dataset_names.yml +6 -1
  78. nnpdf_data/theory_cards/41000010.yaml +42 -0
  79. nnpdf_data/theory_cards/41000011.yaml +43 -0
  80. nnpdf_data/theory_cards/41000012.yaml +43 -0
  81. nnpdf_data/theory_cards/41000013.yaml +42 -0
  82. nnpdf_data/theory_cards/41000014.yaml +43 -0
  83. nnpdf_data/theory_cards/41000015.yaml +43 -0
  84. validphys/_version.py +1 -1
  85. validphys/config.py +30 -10
  86. validphys/convolution.py +37 -14
  87. validphys/coredata.py +15 -5
  88. validphys/covmats.py +9 -2
  89. validphys/dataplots.py +1 -1
  90. validphys/filters.py +17 -3
  91. validphys/fkparser.py +11 -1
  92. validphys/gridvalues.py +1 -0
  93. validphys/hessian2mc.py +5 -5
  94. validphys/lhaindex.py +5 -0
  95. validphys/loader.py +1 -1
  96. validphys/n3fit_data.py +107 -61
  97. validphys/nnprofile_default.yaml +2 -1
  98. validphys/pineparser.py +12 -2
  99. validphys/scripts/postfit.py +4 -4
  100. validphys/scripts/vp_pdfrename.py +8 -9
  101. validphys/tests/conftest.py +6 -2
  102. validphys/tests/test_hessian2mc.py +7 -5
  103. validphys/utils.py +1 -0
  104. n3fit/tests/regressions/quickcard_pol/filter.yml +0 -80
  105. n3fit/tests/regressions/quickcard_pol/nnfit/input/lockfile.yaml +0 -111
  106. n3fit/tests/regressions/quickcard_pol/nnfit/replica_1/quickcard_pol.exportgrid +0 -572
  107. n3fit/tests/regressions/quickcard_pol/nnfit/replica_1/quickcard_pol.json +0 -71
  108. n3fit/tests/regressions/quickcard_pol/nnfit/replica_3/quickcard_pol.exportgrid +0 -615
  109. n3fit/tests/regressions/quickcard_pol/nnfit/replica_3/quickcard_pol.json +0 -71
  110. n3fit/tests/regressions/weights.weights.h5 +0 -0
  111. n3fit/tests/regressions/weights_pol.weights.h5 +0 -0
  112. n3fit/tests/test +0 -1
  113. nnpdf_data/theory_cards/40000099.yaml +0 -41
  114. nnpdf_data/theory_cards/40000099.yml +0 -41
  115. {nnpdf-4.1.0.dist-info → nnpdf-4.1.1.dist-info}/entry_points.txt +0 -0
  116. {nnpdf-4.1.0.dist-info → nnpdf-4.1.1.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,2 @@
1
+ data_central:
2
+ - 803
@@ -0,0 +1,13 @@
1
+ bins:
2
+ - zero:
3
+ min: null
4
+ mid: 0
5
+ max: null
6
+ m_t2:
7
+ min: null
8
+ mid: 29756.25
9
+ max: null
10
+ sqrts:
11
+ min: null
12
+ mid: 13000
13
+ max: null
@@ -0,0 +1,51 @@
1
+ setname: CMS_TTBAR_13TEV_35P9FB-1_TOT
2
+ nnpdf_metadata:
3
+ nnpdf31_process: TOP
4
+ experiment: CMS
5
+ arXiv:
6
+ url: https://arxiv.org/abs/1812.10505
7
+ iNSPIRE:
8
+ url: https://inspirehep.net/literature/1711626
9
+ hepdata:
10
+ url: NA
11
+ version:
12
+ version: 1
13
+ version_comment: "This data set supersedes CMS_TTBAR_13TEV_TOT"
14
+ implemented_observables:
15
+ - observable:
16
+ description: total cross section of ttBar
17
+ label: $\sigma_{t\bar{t}}$
18
+ units: $pb$
19
+ observable_name: X-SEC
20
+ process_type: INC
21
+ ndata: 1
22
+ tables: []
23
+ kinematics:
24
+ variables:
25
+ zero:
26
+ description: ''
27
+ label: $$
28
+ units: ''
29
+ m_t2:
30
+ description: mass of top quark squared
31
+ label: $m_{t}^2$
32
+ units: $GeV^2$
33
+ sqrts:
34
+ description: center of mass energy
35
+ label: $\sqrt{s}$
36
+ units: $GeV$
37
+ file: kinematics.yaml
38
+ data_central: data.yaml
39
+ data_uncertainties:
40
+ - uncertainties.yaml
41
+ kinematic_coverage:
42
+ - zero
43
+ - m_t2
44
+ - sqrts
45
+ plotting:
46
+ dataset_label: CMS 13 TeV $\sigma_{t\bar{t}}$
47
+ plot_x: sqrts
48
+ y_label: '$\sigma_{t\bar{t}}$ ($pb$)'
49
+ theory:
50
+ FK_tables:
51
+ - - CMS_TTBAR_13TEV_TOT_X-SEC
@@ -0,0 +1,17 @@
1
+ definitions:
2
+ stat:
3
+ description: total statistical uncertainty
4
+ treatment: ADD
5
+ type: UNCORR
6
+ sys:
7
+ description: total systematic uncertainty
8
+ treatment: MULT
9
+ type: CORR
10
+ lumi:
11
+ description: luminosity uncertainty
12
+ treatment: MULT
13
+ type: CMSLUMI16
14
+ bins:
15
+ - stat: 2
16
+ sys: 25
17
+ lumi: 20
@@ -43,7 +43,7 @@ implemented_observables:
43
43
  - m_t2
44
44
  - sqrts
45
45
  plotting:
46
- dataset_label: CMS 5 TeV $\sigma_{t\bar{t}}$
46
+ dataset_label: CMS 5.02 TeV $\sigma_{t\bar{t}}$
47
47
  plot_x: sqrts
48
48
  y_label: '$\sigma_{t\bar{t}}$ ($pb$)'
49
49
  theory:
@@ -916,3 +916,63 @@ implemented_observables:
916
916
  - - NNPDF_POS_ANTI_UP
917
917
  - - NNPDF_POS_ANTI_DUP
918
918
  data_uncertainties: []
919
+ - observable_name: F2C-CCP
920
+ observable:
921
+ description: Deep Inelastic Scattering
922
+ label: 'positivity dataset: CC DIS $\bar{c}$ structure function $F_2^{W^+,c}$'
923
+ units: ''
924
+ process_type: POS_DIS
925
+ tables: []
926
+ npoints: []
927
+ ndata: 20
928
+ plotting:
929
+ dataset_label: 'positivity dataset: CC DIS $\bar{c}$ structure function $F_2^{W^+,c}$'
930
+ plot_x: x
931
+ kinematic_coverage:
932
+ - x
933
+ - Q2
934
+ kinematics:
935
+ variables:
936
+ x:
937
+ description: Bjorken x
938
+ label: x
939
+ units: ''
940
+ Q2:
941
+ description: Factorization Scale
942
+ label: Q2
943
+ units: ''
944
+ file: kinematics_F2C.yaml
945
+ theory:
946
+ FK_tables:
947
+ - - NNPDF_POS_F2C_CCP_40
948
+ data_uncertainties: []
949
+ - observable_name: F2C-CCE
950
+ observable:
951
+ description: Deep Inelastic Scattering
952
+ label: 'positivity dataset: DIS $c$ structure function $F_2^{W^-,c}$'
953
+ units: ''
954
+ process_type: POS_DIS
955
+ tables: []
956
+ npoints: []
957
+ ndata: 20
958
+ plotting:
959
+ dataset_label: 'positivity dataset: DIS $c$ structure function $F_2^{W^-,c}$'
960
+ plot_x: x
961
+ kinematic_coverage:
962
+ - x
963
+ - Q2
964
+ kinematics:
965
+ variables:
966
+ x:
967
+ description: Bjorken x
968
+ label: x
969
+ units: ''
970
+ Q2:
971
+ description: Factorization Scale
972
+ label: Q2
973
+ units: ''
974
+ file: kinematics_F2C.yaml
975
+ theory:
976
+ FK_tables:
977
+ - - NNPDF_POS_F2C_CCE_40
978
+ data_uncertainties: []
@@ -85,7 +85,12 @@ ATLAS_2JET_7TEV_R06:
85
85
  CMS_1JET_8TEV:
86
86
  dataset: CMS_1JET_8TEV_PTY
87
87
  variant: legacy
88
- CMS_2JET_7TEV: CMS_2JET_7TEV_M12Y
88
+ CMS_2JET_7TEV:
89
+ dataset: CMS_2JET_7TEV_M12-Y
90
+ variant: legacy
91
+ CMS_2JET_7TEV_M12Y:
92
+ dataset: CMS_2JET_7TEV_M12-Y
93
+ variant: legacy
89
94
  HERACOMBCCEM:
90
95
  dataset: HERA_CC_318GEV_EM-SIGMARED
91
96
  variant: legacy
@@ -0,0 +1,42 @@
1
+ ID: 41_000_010
2
+ Comments: NNPDF4.1 NNLO QCD-only (xir,xif) = (0.5, 1)
3
+ PTO: 2
4
+ FNS: FONLL-C
5
+ DAMP: 0
6
+ IC: 1
7
+ Q0: 1.65
8
+ ModEv: EXA
9
+ IterEv: 60
10
+ XIR: 0.5
11
+ XIF: 1.0
12
+ NfFF: 5
13
+ QED: 0
14
+ HQ: POLE
15
+ mc: 1.502
16
+ Qmc: 1.502
17
+ kcThr: 1.0
18
+ mb: 4.936
19
+ Qmb: 4.936
20
+ kbThr: 1.0
21
+ mt: 172.5
22
+ Qmt: 172.5
23
+ ktThr: 1.0
24
+ CKM:
25
+ - 0.97367
26
+ - 0.22431
27
+ - 3.82e-3
28
+ - 0.221
29
+ - 0.975
30
+ - 41.1e-3
31
+ - 8.6e-3
32
+ - 41.5e-3
33
+ - 1.010
34
+ MZ: 91.1880
35
+ MW: 80.3692
36
+ GF: 1.1663788e-5
37
+ SIN2TW: 0.22348
38
+ TMC: 1
39
+ MP: 0.938
40
+ Qref: 91.1880
41
+ alphas: 0.118
42
+ alphaqed: 0.0075700
@@ -0,0 +1,43 @@
1
+ ID: 41_000_011
2
+ Comments: NNPDF4.1 NNLO QCD-only (xir, xif) = (1, 0.5)
3
+ PTO: 2
4
+ FNS: FONLL-C
5
+ DAMP: 0
6
+ IC: 1
7
+ Q0: 1.65
8
+ ModEv: EXA
9
+ ModSV: expanded
10
+ IterEv: 60
11
+ XIR: 1.0
12
+ XIF: 0.5
13
+ NfFF: 5
14
+ QED: 0
15
+ HQ: POLE
16
+ mc: 1.502
17
+ Qmc: 1.502
18
+ kcThr: 1.0
19
+ mb: 4.936
20
+ Qmb: 4.936
21
+ kbThr: 1.0
22
+ mt: 172.5
23
+ Qmt: 172.5
24
+ ktThr: 1.0
25
+ CKM:
26
+ - 0.97367
27
+ - 0.22431
28
+ - 3.82e-3
29
+ - 0.221
30
+ - 0.975
31
+ - 41.1e-3
32
+ - 8.6e-3
33
+ - 41.5e-3
34
+ - 1.010
35
+ MZ: 91.1880
36
+ MW: 80.3692
37
+ GF: 1.1663788e-5
38
+ SIN2TW: 0.22348
39
+ TMC: 1
40
+ MP: 0.938
41
+ Qref: 91.1880
42
+ alphas: 0.118
43
+ alphaqed: 0.0075700
@@ -0,0 +1,43 @@
1
+ ID: 41_000_012
2
+ Comments: NNPDF4.1 NNLO QCD-only (xir, xif) = (0.5, 0.5)
3
+ PTO: 2
4
+ FNS: FONLL-C
5
+ DAMP: 0
6
+ IC: 1
7
+ Q0: 1.65
8
+ ModEv: EXA
9
+ ModSV: expanded
10
+ IterEv: 60
11
+ XIR: 0.5
12
+ XIF: 0.5
13
+ NfFF: 5
14
+ QED: 0
15
+ HQ: POLE
16
+ mc: 1.502
17
+ Qmc: 1.502
18
+ kcThr: 1.0
19
+ mb: 4.936
20
+ Qmb: 4.936
21
+ kbThr: 1.0
22
+ mt: 172.5
23
+ Qmt: 172.5
24
+ ktThr: 1.0
25
+ CKM:
26
+ - 0.97367
27
+ - 0.22431
28
+ - 3.82e-3
29
+ - 0.221
30
+ - 0.975
31
+ - 41.1e-3
32
+ - 8.6e-3
33
+ - 41.5e-3
34
+ - 1.010
35
+ MZ: 91.1880
36
+ MW: 80.3692
37
+ GF: 1.1663788e-5
38
+ SIN2TW: 0.22348
39
+ TMC: 1
40
+ MP: 0.938
41
+ Qref: 91.1880
42
+ alphas: 0.118
43
+ alphaqed: 0.0075700
@@ -0,0 +1,42 @@
1
+ ID: 41_000_013
2
+ Comments: NNPDF4.1 NNLO QCD-only (xir, xif) = (2, 1)
3
+ PTO: 2
4
+ FNS: FONLL-C
5
+ DAMP: 0
6
+ IC: 1
7
+ Q0: 1.65
8
+ ModEv: EXA
9
+ IterEv: 60
10
+ XIR: 2.0
11
+ XIF: 1.0
12
+ NfFF: 5
13
+ QED: 0
14
+ HQ: POLE
15
+ mc: 1.502
16
+ Qmc: 1.502
17
+ kcThr: 1.0
18
+ mb: 4.936
19
+ Qmb: 4.936
20
+ kbThr: 1.0
21
+ mt: 172.5
22
+ Qmt: 172.5
23
+ ktThr: 1.0
24
+ CKM:
25
+ - 0.97367
26
+ - 0.22431
27
+ - 3.82e-3
28
+ - 0.221
29
+ - 0.975
30
+ - 41.1e-3
31
+ - 8.6e-3
32
+ - 41.5e-3
33
+ - 1.010
34
+ MZ: 91.1880
35
+ MW: 80.3692
36
+ GF: 1.1663788e-5
37
+ SIN2TW: 0.22348
38
+ TMC: 1
39
+ MP: 0.938
40
+ Qref: 91.1880
41
+ alphas: 0.118
42
+ alphaqed: 0.0075700
@@ -0,0 +1,43 @@
1
+ ID: 41_000_014
2
+ Comments: NNPDF4.1 NNLO QCD-only (xir, xif) = (1, 2)
3
+ PTO: 2
4
+ FNS: FONLL-C
5
+ DAMP: 0
6
+ IC: 1
7
+ Q0: 1.65
8
+ ModEv: EXA
9
+ ModSV: expanded
10
+ IterEv: 60
11
+ XIR: 1.0
12
+ XIF: 2.0
13
+ NfFF: 5
14
+ QED: 0
15
+ HQ: POLE
16
+ mc: 1.502
17
+ Qmc: 1.502
18
+ kcThr: 1.0
19
+ mb: 4.936
20
+ Qmb: 4.936
21
+ kbThr: 1.0
22
+ mt: 172.5
23
+ Qmt: 172.5
24
+ ktThr: 1.0
25
+ CKM:
26
+ - 0.97367
27
+ - 0.22431
28
+ - 3.82e-3
29
+ - 0.221
30
+ - 0.975
31
+ - 41.1e-3
32
+ - 8.6e-3
33
+ - 41.5e-3
34
+ - 1.010
35
+ MZ: 91.1880
36
+ MW: 80.3692
37
+ GF: 1.1663788e-5
38
+ SIN2TW: 0.22348
39
+ TMC: 1
40
+ MP: 0.938
41
+ Qref: 91.1880
42
+ alphas: 0.118
43
+ alphaqed: 0.0075700
@@ -0,0 +1,43 @@
1
+ ID: 41_000_015
2
+ Comments: NNPDF4.1 NNLO QCD-only (xir, xif) = (2, 2)
3
+ PTO: 2
4
+ FNS: FONLL-C
5
+ DAMP: 0
6
+ IC: 1
7
+ Q0: 1.65
8
+ ModEv: EXA
9
+ ModSV: expanded
10
+ IterEv: 60
11
+ XIR: 2.0
12
+ XIF: 2.0
13
+ NfFF: 5
14
+ QED: 0
15
+ HQ: POLE
16
+ mc: 1.502
17
+ Qmc: 1.502
18
+ kcThr: 1.0
19
+ mb: 4.936
20
+ Qmb: 4.936
21
+ kbThr: 1.0
22
+ mt: 172.5
23
+ Qmt: 172.5
24
+ ktThr: 1.0
25
+ CKM:
26
+ - 0.97367
27
+ - 0.22431
28
+ - 3.82e-3
29
+ - 0.221
30
+ - 0.975
31
+ - 41.1e-3
32
+ - 8.6e-3
33
+ - 41.5e-3
34
+ - 1.010
35
+ MZ: 91.1880
36
+ MW: 80.3692
37
+ GF: 1.1663788e-5
38
+ SIN2TW: 0.22348
39
+ TMC: 1
40
+ MP: 0.938
41
+ Qref: 91.1880
42
+ alphas: 0.118
43
+ alphaqed: 0.0075700
validphys/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "4.1.0"
1
+ __version__ = "4.1.1"
validphys/config.py CHANGED
@@ -911,9 +911,9 @@ class CoreConfig(configparser.Config):
911
911
  from validphys import n3fit_data
912
912
 
913
913
  if diagonal_basis:
914
- return n3fit_data._diagonal_masks
914
+ return n3fit_data.diagonal_masks
915
915
  else:
916
- return n3fit_data._standard_masks
916
+ return n3fit_data.standard_masks
917
917
 
918
918
  @configparser.explicit_node
919
919
  def produce_covariance_matrix(self, use_pdferr: bool = False):
@@ -1304,16 +1304,26 @@ class CoreConfig(configparser.Config):
1304
1304
  thcovmat_present = False
1305
1305
 
1306
1306
  if use_thcovmat_if_present and thcovmat_present:
1307
- # Expected path of theory covmat hardcoded
1308
- covmat_path = (
1309
- fit.path / "tables" / "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv"
1310
- )
1311
- # All possible valid files
1307
+ tables_path = fit.path / "tables"
1308
+ theorycovmatconfig = fit.as_input()["theorycovmatconfig"]
1309
+ user_covmat_path = theorycovmatconfig.get("user_covmat_path", None)
1310
+ point_prescriptions = theorycovmatconfig.get("point_prescriptions", None)
1311
+
1312
+ generic_name = "datacuts_theory_theorycovmatconfig_theory_covmat_custom.csv"
1313
+ if user_covmat_path is not None:
1314
+ # User covmat + point prescriptions
1315
+ if point_prescriptions is not None and point_prescriptions != []:
1316
+ generic_name = "datacuts_theory_theorycovmatconfig_total_theory_covmat.csv"
1317
+ # Only user covmat
1318
+ else:
1319
+ generic_name = "datacuts_theory_theorycovmatconfig_user_covmat.csv"
1320
+ covmat_path = tables_path / generic_name
1312
1321
  if not covmat_path.exists():
1313
1322
  raise ConfigError(
1314
1323
  "Fit appeared to use theory covmat in fit but the file was not at the "
1315
1324
  f"usual location: {covmat_path}."
1316
1325
  )
1326
+ logging.info(f"Using theory covmat in fit: {covmat_path}")
1317
1327
  fit_theory_covmat = ThCovMatSpec(covmat_path)
1318
1328
  else:
1319
1329
  fit_theory_covmat = None
@@ -1411,8 +1421,20 @@ class CoreConfig(configparser.Config):
1411
1421
  """
1412
1422
  Returns a tuple of AddedFilterRule objects. Rules are immutable after parsing.
1413
1423
  AddedFilterRule objects inherit from FilterRule objects.
1424
+ It checks if the rules are unique, i.e. if there are no
1425
+ multiple filters for the same dataset or process with the
1426
+ same fields (`reason` is not used in the comparison).
1414
1427
  """
1415
- return tuple(AddedFilterRule(**rule) for rule in rules) if rules else None
1428
+ if rules is not None:
1429
+ unique_rules = set(AddedFilterRule(**rule) for rule in rules)
1430
+ if len(unique_rules) != len(rules):
1431
+ raise RuleProcessingError(
1432
+ "Detected repeated filter rules. Please, make sure that "
1433
+ " rules are not repeated in the runcard."
1434
+ )
1435
+ return tuple(unique_rules)
1436
+ else:
1437
+ return None
1416
1438
 
1417
1439
  def parse_drop_internal_rules(self, drop_internal_rules: (list, type(None)) = None):
1418
1440
  """Turns drop_internal_rules into a tuple for internal caching."""
@@ -1444,7 +1466,6 @@ class CoreConfig(configparser.Config):
1444
1466
  ``drop_internal_rules``: tuple(dataset names)
1445
1467
  Drop internal dataset-specific rules, it is applied before ``added_filter_rules``
1446
1468
  """
1447
-
1448
1469
  theory_parameters = theoryid.get_description()
1449
1470
 
1450
1471
  if filter_rules is None:
@@ -1476,7 +1497,6 @@ class CoreConfig(configparser.Config):
1476
1497
 
1477
1498
  if added_filter_rules:
1478
1499
  for i, rule in enumerate(added_filter_rules):
1479
-
1480
1500
  try:
1481
1501
  rule_list.append(
1482
1502
  Rule(
validphys/convolution.py CHANGED
@@ -174,6 +174,7 @@ def _predictions(dataset, pdf, fkfunc):
174
174
  return opfunc(*all_predictions)
175
175
 
176
176
 
177
+ @functools.cache
177
178
  def predictions(dataset, pdf):
178
179
  """ "Compute theory predictions for a given PDF and dataset. Information
179
180
  regading the dataset, on cuts, CFactors and combinations of FKTables is
@@ -225,6 +226,7 @@ def predictions(dataset, pdf):
225
226
  return _predictions(dataset, pdf, fk_predictions)
226
227
 
227
228
 
229
+ @functools.cache
228
230
  def central_predictions(
229
231
  dataset: validphys.core.DataSetSpec, pdf: validphys.core.PDF
230
232
  ) -> pd.DataFrame:
@@ -370,15 +372,28 @@ def _gv_hadron_predictions(loaded_fk, gv1func, gv2func=None):
370
372
  # possible x1-x2 combinations (f1, f2, x1, x2)
371
373
  luminosity = np.einsum("ijk, ijl->ijkl", expanded_gv1, expanded_gv2)
372
374
 
373
- def appl(df):
374
- # x1 and x2 are encoded as the first and second index levels.
375
- xx1 = df.index.get_level_values(1)
376
- xx2 = df.index.get_level_values(2)
377
- # take the active combinations from the luminosity tensor
378
- partial_lumi = luminosity[..., xx1, xx2]
379
- return pd.Series(np.einsum("ijk,kj->i", partial_lumi, df.values))
380
-
381
- return sigma.groupby(level=0).apply(appl)
375
+ if loaded_fk.legacy:
376
+ # Old FkTables are singled out since they are not always sorted in x1/x2 so matching the
377
+ # FkTable with the PDF grids (gv1/gv2) is done by means of dataframes, which is slow.
378
+ # The gv1/gv2 grids are arrays of shape (replicas, flavours<14>, xarray)
379
+ # the expanded gv1/gv2 instead are shaped according to the channels (which will match)
380
+ # therefore the luminosity is an array of shape (replicas, channels, x1, x2)
381
+ def appl(df):
382
+ # x1 and x2 are encoded as the first and second index levels.
383
+ xx1 = df.index.get_level_values(1)
384
+ xx2 = df.index.get_level_values(2)
385
+ # take the active combinations from the luminosity tensor
386
+ partial_lumi = luminosity[..., xx1, xx2]
387
+ return pd.Series(np.einsum("ijk,kj->i", partial_lumi, df.values))
388
+
389
+ return sigma.groupby(level=0).apply(appl)
390
+
391
+ # Pineappl FkTables are sorted and can be treated as numpy arrays
392
+ lx = len(xgrid)
393
+ lc = len(fl1)
394
+ fktab = sigma.values.reshape(-1, lx, lx, lc)
395
+ ret = np.einsum("rcab, nabc->nr", luminosity, fktab)
396
+ return pd.DataFrame(ret, index=loaded_fk.data_index)
382
397
 
383
398
 
384
399
  def _gv_dis_predictions(loaded_fk, gvfunc):
@@ -394,12 +409,20 @@ def _gv_dis_predictions(loaded_fk, gvfunc):
394
409
  if sigma.empty:
395
410
  return pd.DataFrame(columns=range(gv.shape[0]))
396
411
 
397
- def appl(df):
398
- # x is encoded as the first index level.
399
- xind = df.index.get_level_values(1)
400
- return pd.Series(np.einsum("ijk,kj->i", gv[:, :, xind], df.values))
412
+ if loaded_fk.legacy:
413
+ # Old FkTable are not necessarily sorted in x and need to be treated as dataframes
414
+ # See comment in `_gv_hadron_predictions` for more details
415
+ def appl(df):
416
+ # x is encoded as the first index level.
417
+ xind = df.index.get_level_values(1)
418
+ return pd.Series(np.einsum("ijk,kj->i", gv[:, :, xind], df.values))
419
+
420
+ return sigma.groupby(level=0).apply(appl)
401
421
 
402
- return sigma.groupby(level=0).apply(appl)
422
+ lx = len(xgrid)
423
+ fktab = sigma.values.reshape(-1, lx, len(fm))
424
+ ret = np.einsum("rfa, naf->nr", gv, fktab)
425
+ return pd.DataFrame(ret, index=loaded_fk.data_index)
403
426
 
404
427
 
405
428
  def hadron_predictions(loaded_fk, pdf):
validphys/coredata.py CHANGED
@@ -57,6 +57,13 @@ class FKTableData:
57
57
  The most common use-case is when a total cross section is used
58
58
  as a normalization table for a differential cross section,
59
59
  in legacy code (<= NNPDF4.0) both fktables would be cut using the differential index.
60
+
61
+ data_index: pd.Series
62
+ index of the data points
63
+
64
+ legacy: bool
65
+ If False, this corresponds to an FkTable read from the old applgrid interface.
66
+ Deprecated and support will be dropped during the 4.1.X series of tags.
60
67
  """
61
68
 
62
69
  hadronic: bool
@@ -64,9 +71,11 @@ class FKTableData:
64
71
  ndata: int
65
72
  xgrid: np.ndarray
66
73
  sigma: pd.DataFrame
74
+ data_index: pd.Series
67
75
  convolution_types: Optional[tuple[str]] = None
68
76
  metadata: dict = dataclasses.field(default_factory=dict, repr=False)
69
77
  protected: bool = False
78
+ legacy: bool = False
70
79
 
71
80
  def with_cfactor(self, cfactor):
72
81
  """Returns a copy of the FKTableData object with cfactors applied to the fktable"""
@@ -124,11 +133,12 @@ class FKTableData:
124
133
  newndata = len(cuts)
125
134
  try:
126
135
  newsigma = self.sigma.loc[cuts]
136
+ newdata_idx = self.data_index.loc[cuts]
127
137
  except KeyError as e:
128
138
  # This will be an ugly erorr msg, but it should be scary anyway
129
139
  log.error(f"Problem applying cuts to {self.metadata}")
130
140
  raise e
131
- return dataclasses.replace(self, ndata=newndata, sigma=newsigma)
141
+ return dataclasses.replace(self, ndata=newndata, sigma=newsigma, data_index=newdata_idx)
132
142
 
133
143
  @property
134
144
  def luminosity_mapping(self):
@@ -169,8 +179,8 @@ class FKTableData:
169
179
  # Make the dataframe into a dense numpy array
170
180
 
171
181
  # First get the data index out of the way
172
- # this is necessary because cuts/shifts and for performance reasons
173
- # otherwise we will be putting things in a numpy array in very awkward orders
182
+ # this is necessary because cuts/shifts and because old fktables are not necessarily ordered
183
+ # in addition, for performance reason, we want to order the np array as (ndata, basis, x1, x2)
174
184
  ns = self.sigma.unstack(level=("data",), fill_value=0)
175
185
  x1 = ns.index.get_level_values(0)
176
186
 
@@ -245,5 +255,5 @@ class CFactorData:
245
255
  """
246
256
 
247
257
  description: str
248
- central_value: np.array
249
- uncertainty: np.array
258
+ central_value: np.ndarray
259
+ uncertainty: np.ndarray