Merge lp:~maddevelopers/mg5amcnlo/3.0.3-neworders into lp:~maddevelopers/mg5amcnlo/3.0.4

Proposed by marco zaro
Status: Merged
Merged at revision: 971
Proposed branch: lp:~maddevelopers/mg5amcnlo/3.0.3-neworders
Merge into: lp:~maddevelopers/mg5amcnlo/3.0.4
Diff against target: 330 lines (+249/-8) (has conflicts)
3 files modified
UpdateNotes.txt (+14/-0)
madgraph/interface/madgraph_interface.py (+49/-8)
tests/unit_tests/fks/test_fks_base.py (+186/-0)
Text conflict in UpdateNotes.txt
Text conflict in madgraph/interface/madgraph_interface.py
Text conflict in tests/unit_tests/fks/test_fks_base.py
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/3.0.3-neworders
Reviewer Review Type Date Requested Status
Olivier Mattelaer Approve
Eleni Vryonidou Pending
Review via email: mp+389779@code.launchpad.net

Commit message

More flexible order syntax, with better behaviour in the case of EFT

Description of the change

More flexible order syntax, with better behaviour in the case of EFT.
Added the possibility to specify squared-orders as well as diagram-orders in the case of NLO

To post a comment you must log in.
Revision history for this message
marco zaro (marco-zaro) wrote :

for some reasons, changes do not appear in the diff...
I need to check what is going on.
Marco

970. By olivier-mattelaer

set the alias in place

971. By olivier-mattelaer

fix aEW and aS syntax and change UpdatesNotes accordingly

972. By marco zaro

small change in UpdateNotes

Revision history for this message
marco zaro (marco-zaro) wrote :

Hi all,
any update on this?
about the changes that do not appear in the diff, I will take care of updating the 3.0.4 branch once the merge is completed. In the meanwhile, can you please have a look at the behaviour with the new syntax?

Thanks,

Marco

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

You can merge it from my point of view
(This is even the recommended branch for the SMEFT_NLO paper so this is certainly good enough for them.

Thanks Marco,

Olivier

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UpdateNotes.txt'
2--- UpdateNotes.txt 2020-08-21 10:29:35 +0000
3+++ UpdateNotes.txt 2020-09-03 14:45:04 +0000
4@@ -1,5 +1,6 @@
5 Update notes for MadGraph5_aMC@NLO (in reverse time order)
6
7+<<<<<<< TREE
8
9
10 ** PARRALEL VERSION FOR EW branch **
11@@ -9,6 +10,19 @@
12 ALL: pass to python3 by defauult
13
14 3.0.3 (06/07/20)
15+=======
16+3.0.4 ()
17+ MZ: Change syntax meaning in 3.0 series to be consistent with the one of 2.0 series:
18+ QCD<=X, QED<=Y apply at the amplitude level (not to the squared amplitude anymore).
19+ Squared-amplitude constraints can be imposed by using the usual squared-order
20+ syntax, e.g.:
21+ QCD^2<=X, QED^2<=Y (constrained at the diagram squared level).
22+ OM: Some aliases have been added for the orders constraints:
23+ - aEW<=X / aS<=Y is equivalent to QCD^2<=2X / QED^2<=2Y
24+ - EW<=X / EW^2<=X is equivalent to QED<=X / QED^2<=X
25+
26+3.0.3 (21/06/20)
27+>>>>>>> MERGE-SOURCE
28 include up to 2.7.3
29
30 3.0.2 (25/05/20)
31
32=== modified file 'madgraph/interface/madgraph_interface.py'
33--- madgraph/interface/madgraph_interface.py 2020-08-21 10:29:35 +0000
34+++ madgraph/interface/madgraph_interface.py 2020-09-03 14:45:04 +0000
35@@ -4732,6 +4732,25 @@
36 squared_orders = {}
37 orders = {}
38 constrained_orders = {}
39+
40+ # define the various coupling order alias
41+ coupling_alias = {}
42+ model_orders = self._curr_model.get('coupling_orders')
43+ if 'EW' in model_orders:
44+ if 'QED' not in model_orders:
45+ coupling_alias['QED'] = 'EW'
46+ coupling_alias['QED^2'] = 'EW^2'
47+ if 'aEW' not in model_orders:
48+ coupling_alias['aEW'] = 'EW^2=2*'
49+ elif 'QED' in model_orders:
50+ coupling_alias['EW'] = 'QED'
51+ coupling_alias['EW^2'] = 'QED^2'
52+ if 'aEW' not in model_orders:
53+ coupling_alias['aEW'] = 'QED^2=2*'
54+ if 'QCD' in model_orders:
55+ if 'aS' not in model_orders:
56+ coupling_alias['aS'] = 'QCD^2=2*'
57+
58 ## The 'split_orders' (i.e. those for which individual matrix element
59 ## evalutations must be provided for each corresponding order value) are
60 ## defined from the orders specified in between [] and any order for
61@@ -4739,24 +4758,46 @@
62 split_orders = []
63 while order_re:
64 type = order_re.group('type')
65- if order_re.group('name').endswith('^2'):
66+ name = order_re.group('name')
67+ value = int(order_re.group('value'))
68+ if name in coupling_alias:
69+ old_name,old_value = name,value
70+
71+ name = coupling_alias[name]
72+ if name.endswith('=2*'):
73+ name = name[:-3]
74+ value *= 2
75+ logger.info("change syntax %s=%s to %s=%s to correspond to UFO model convention",
76+ old_name, old_value, name, value)
77+ if name.endswith('^2'):
78+ basename = name[:-2]
79+ if basename not in model_orders:
80+ valid = list(model_orders) + coupling_alias.keys()
81+ raise self.InvalidCmd("model order %s not valid for this model (valid one are: %s). Please correct" % (name, ', '.join(valid)))
82+
83 if type not in self._valid_sqso_types:
84 raise self.InvalidCmd("Type of squared order "+\
85 "constraint '%s'"% type+" is not supported.")
86 if type == '=':
87- name = order_re.group('name')
88- value = order_re.group('value')
89 logger.warning("Interpreting '%(n)s=%(v)s' as '%(n)s<=%(v)s'" %\
90 {'n':name, 'v': value})
91 type = "<="
92- squared_orders[order_re.group('name')[:-2]] = \
93- (int(order_re.group('value')),type)
94+ squared_orders[basename] = (value,type)
95 else:
96+ if name not in model_orders:
97+ valid = list(model_orders) + coupling_alias.keys()
98+ raise self.InvalidCmd("model order %s not valid for this model (valid one are: %s). Please correct" % (name, ', '.join(valid)))
99 if type not in self._valid_amp_so_types:
100+<<<<<<< TREE
101 raise self.InvalidCmd("Amplitude order constraints can only be of type %s"%\
102 (', '.join(self._valid_amp_so_types))+", not '%s'."%type)
103 name = order_re.group('name')
104 value = int(order_re.group('value'))
105+=======
106+ raise self.InvalidCmd, \
107+ "Amplitude order constraints can only be of type %s"%\
108+ (', '.join(self._valid_amp_so_types))+", not '%s'."%type
109+>>>>>>> MERGE-SOURCE
110 if type in ['=', '<=']:
111 if type == '=' and value != 0:
112 logger.warning("Interpreting '%(n)s=%(v)s' as '%(n)s<=%(v)s'" %\
113@@ -4773,10 +4814,10 @@
114 constrained_orders[name] = (value, type)
115 if name not in squared_orders:
116 squared_orders[name] = (2 * value,'>')
117-
118+
119 line = '%s %s' % (order_re.group('before'),order_re.group('after'))
120- order_re = order_pattern.match(line)
121-
122+ order_re = order_pattern.match(line)
123+
124 # handle the case where default is not 99 and some coupling defined
125 if self.options['default_unset_couplings'] != 99 and \
126 (orders or squared_orders):
127
128=== modified file 'tests/unit_tests/fks/test_fks_base.py'
129--- tests/unit_tests/fks/test_fks_base.py 2020-07-06 21:04:03 +0000
130+++ tests/unit_tests/fks/test_fks_base.py 2020-09-03 14:45:04 +0000
131@@ -40,6 +40,7 @@
132 class TestFKSProcess(unittest.TestCase):
133 """a class to test FKS Processes"""
134
135+<<<<<<< TREE
136
137 def setUp(self):
138
139@@ -213,6 +214,191 @@
140 TestFKSProcess.myproc2_qed = MG.Process(dict2_qed)
141 TestFKSProcess.myprocaa_qed = MG.Process(dict3_qed)
142 TestFKSProcess.mymodel = mymodel
143+=======
144+ # the model, import the SM but remove 2nd and 3rd gen quarks
145+ remove_list = [3,4,5,6,-3,-4,-5,-6]
146+ mymodel = import_ufo.import_model('sm')
147+ for p in mymodel['particles']:
148+ if p.get_pdg_code() in remove_list:
149+ mymodel['particles'].remove(p)
150+ for ii in mymodel['interactions']:
151+ if any([p.get_pdg_code() in remove_list for p in ii['particles']]):
152+ mymodel['interactions'].remove(ii)
153+
154+ myleglist = MG.LegList()
155+ # PROCESS: u g > u g
156+ mylegs = [{
157+ 'id': 2,
158+ 'number': 1,
159+ 'state': False},
160+ {
161+ 'id': 21,
162+ 'number': 2,
163+ 'state': False},
164+ {
165+ 'id': 2,
166+ 'number': 3,
167+ 'state': True},
168+ {
169+ 'id': 21,
170+ 'number': 4,
171+ 'state': True}]
172+
173+ for i in mylegs:
174+ myleglist.append(MG.Leg(i))
175+
176+ myleglist2 = MG.LegList()
177+ # PROCESS: d d~ > u u~
178+ mylegs2 = [{
179+ 'id': 1,
180+ 'number': 1,
181+ 'state': False},
182+ {
183+ 'id': -1,
184+ 'number': 2,
185+ 'state': False},
186+ {
187+ 'id': 2,
188+ 'number': 3,
189+ 'state': True},
190+ {
191+ 'id': -2,
192+ 'number': 4,
193+ 'state': True}]
194+
195+ for i in mylegs2:
196+ myleglist2.append(MG.Leg(i))
197+
198+ myleglist3 = MG.LegList()
199+ # PROCESS: d d~ > a a
200+ mylegs3 = [{
201+ 'id': 1,
202+ 'number': 1,
203+ 'state': False},
204+ {
205+ 'id': -1,
206+ 'number': 2,
207+ 'state': False},
208+ {
209+ 'id': 22,
210+ 'number': 3,
211+ 'state': True},
212+ {
213+ 'id': 22,
214+ 'number': 4,
215+ 'state': True}]
216+
217+ for i in mylegs3:
218+ myleglist3.append(MG.Leg(i))
219+
220+ # PROCESS: u g > u g
221+ dict_qcd = {'legs' : myleglist,
222+ 'born_sq_orders':{'QCD':4, 'QED':0},
223+ 'squared_orders':{'QCD':6, 'QED':0},
224+ 'split_orders':['QCD', 'QED'],
225+ 'sqorders_types':{'QED':'=', 'QCD':'='},
226+ 'model': mymodel,
227+ 'id': 1,
228+ 'required_s_channels':[],
229+ 'forbidden_s_channels':[],
230+ 'forbidden_particles':[],
231+ 'is_decay_chain': False,
232+ 'perturbation_couplings':['QCD'],
233+ 'decay_chains': MG.ProcessList(),
234+ 'overall_orders': {}}
235+
236+ dict_qed = {'legs' : myleglist,
237+ 'born_sq_orders':{'QCD':4, 'QED':0},
238+ 'squared_orders':{'QCD':4, 'QED':2},
239+ 'split_orders':['QCD', 'QED'],
240+ 'sqorders_types':{'QED':'=', 'QCD':'='},
241+ 'model': mymodel,
242+ 'id': 1,
243+ 'required_s_channels':[],
244+ 'forbidden_s_channels':[],
245+ 'forbidden_particles':[],
246+ 'is_decay_chain': False,
247+ 'perturbation_couplings':['QED'],
248+ 'decay_chains': MG.ProcessList(),
249+ 'overall_orders': {}}
250+
251+ # PROCESS: d d~ > u u~
252+ dict2_qcd = {'legs' : myleglist2,
253+ #'born_sq_orders':{'QCD':4, 'QED':0, 'WEIGHTED':4},
254+ #'squared_orders':{'QCD':6, 'QED':0, 'WEIGHTED':6},
255+ 'born_sq_orders':{'QCD':4, 'QED':0},
256+ 'squared_orders':{'QCD':6, 'QED':0},
257+ 'split_orders':['QCD', 'QED'],
258+ 'sqorders_types':{'QED':'=', 'QCD':'='},
259+ 'model': mymodel,
260+ 'id': 1,
261+ 'required_s_channels':[],
262+ 'forbidden_s_channels':[],
263+ 'forbidden_particles':[],
264+ 'is_decay_chain': False,
265+ 'perturbation_couplings':['QCD'],
266+ 'decay_chains': MG.ProcessList(),
267+ 'overall_orders': {}}
268+
269+ dict2_qed = {'legs' : myleglist2,
270+ #'born_sq_orders':{'QCD':4, 'QED':0, 'WEIGHTED':4},
271+ #'squared_orders':{'QCD':4, 'QED':2, 'WEIGHTED':8},
272+ 'born_sq_orders':{'QCD':4, 'QED':0},
273+ 'squared_orders':{'QCD':4, 'QED':2},
274+ 'split_orders':['QCD', 'QED'],
275+ 'sqorders_types':{'QED':'=', 'QCD':'='},
276+ 'model': mymodel,
277+ 'id': 1,
278+ 'required_s_channels':[],
279+ 'forbidden_s_channels':[],
280+ 'forbidden_particles':[],
281+ 'is_decay_chain': False,
282+ 'perturbation_couplings':['QED'],
283+ 'decay_chains': MG.ProcessList(),
284+ 'overall_orders': {}}
285+
286+ # PROCESS: d d~ > a a
287+ dict3_qcd = {'legs' : myleglist3,
288+ #'born_sq_orders':{'QCD':0, 'QED':4, 'WEIGHTED':8},
289+ #'squared_orders':{'QCD':2, 'QED':4, 'WEIGHTED':10},
290+ 'born_sq_orders':{'QCD':0, 'QED':4},
291+ 'squared_orders':{'QCD':2, 'QED':4},
292+ 'split_orders':['QCD', 'QED'],
293+ 'sqorders_types':{'QED':'=', 'QCD':'='},
294+ 'model': mymodel,
295+ 'id': 1,
296+ 'required_s_channels':[],
297+ 'forbidden_s_channels':[],
298+ 'forbidden_particles':[],
299+ 'is_decay_chain': False,
300+ 'perturbation_couplings':['QCD'],
301+ 'decay_chains': MG.ProcessList(),
302+ 'overall_orders': {}}
303+
304+ dict3_qed = {'legs' : myleglist3,
305+ #'born_sq_orders':{'QCD':0, 'QED':4, 'WEIGHTED':8},
306+ #'squared_orders':{'QCD':0, 'QED':6, 'WEIGHTED':12},
307+ 'born_sq_orders':{'QCD':0, 'QED':4},
308+ 'squared_orders':{'QCD':0, 'QED':6},
309+ 'split_orders':['QCD', 'QED'],
310+ 'sqorders_types':{'QED':'=', 'QCD':'='},
311+ 'model': mymodel,
312+ 'id': 1,
313+ 'required_s_channels':[],
314+ 'forbidden_s_channels':[],
315+ 'forbidden_particles':[],
316+ 'is_decay_chain': False,
317+ 'perturbation_couplings':['QED'],
318+ 'decay_chains': MG.ProcessList(),
319+ 'overall_orders': {}}
320+
321+ myproc = MG.Process(dict_qcd)
322+ myproc2 = MG.Process(dict2_qcd)
323+ myprocaa= MG.Process(dict3_qcd)
324+ myproc_qed = MG.Process(dict_qed)
325+ myproc2_qed = MG.Process(dict2_qed)
326+ myprocaa_qed = MG.Process(dict3_qed)
327+>>>>>>> MERGE-SOURCE
328
329
330 def test_FKSMultiProcess(self):

Subscribers

People subscribed via source and target branches

to all changes: