Merge lp:~maddevelopers/mg5amcnlo/multi_fermion_vertices into lp:~maddevelopers/mg5amcnlo/combine_v0_6_0
- multi_fermion_vertices
- Merge into combine_v0_6_0
Status: | Merged |
---|---|
Merge reported by: | Olivier Mattelaer |
Merged at revision: | not available |
Proposed branch: | lp:~maddevelopers/mg5amcnlo/multi_fermion_vertices |
Merge into: | lp:~maddevelopers/mg5amcnlo/combine_v0_6_0 |
Diff against target: |
12439 lines (+10005/-824) 59 files modified
.project (+0/-17) aloha/aloha_lib.py (+4/-1) aloha/aloha_writers.py (+30/-82) aloha/create_aloha.py (+46/-33) aloha/template_files/wavefunctions.py (+341/-210) bin/create_release.py (+16/-2) bin/mg5 (+12/-11) madgraph/VERSION (+2/-2) madgraph/core/base_objects.py (+10/-4) madgraph/core/color_amp.py (+3/-3) madgraph/core/helas_objects.py (+280/-265) madgraph/interface/cmd_interface.py (+29/-2) madgraph/iolibs/export_v4.py (+76/-20) madgraph/iolibs/helas_call_writers.py (+178/-49) madgraph/iolibs/import_v4.py (+6/-1) madgraph/iolibs/template_files/matrix_madevent_v4.inc (+1/-3) madgraph/various/process_checks.py (+3/-4) models/template_files/fortran/formats.inc (+1/-1) models/uutt_sch_4fermion/__init__.py (+15/-0) models/uutt_sch_4fermion/couplings.py (+119/-0) models/uutt_sch_4fermion/function_library.py (+54/-0) models/uutt_sch_4fermion/lorentz.py (+75/-0) models/uutt_sch_4fermion/object_library.py (+191/-0) models/uutt_sch_4fermion/parameters.py (+245/-0) models/uutt_sch_4fermion/particles.py (+384/-0) models/uutt_sch_4fermion/vertices.py (+347/-0) models/uutt_sch_4fermion/write_param_card.py (+65/-0) models/uutt_tch_4fermion/__init__.py (+15/-0) models/uutt_tch_4fermion/couplings.py (+122/-0) models/uutt_tch_4fermion/function_library.py (+54/-0) models/uutt_tch_4fermion/lorentz.py (+79/-0) models/uutt_tch_4fermion/object_library.py (+191/-0) models/uutt_tch_4fermion/parameters.py (+237/-0) models/uutt_tch_4fermion/particles.py (+384/-0) models/uutt_tch_4fermion/vertices.py (+354/-0) models/uutt_tch_4fermion/write_param_card.py (+65/-0) models/uutt_tch_scalar/__init__.py (+15/-0) models/uutt_tch_scalar/couplings.py (+119/-0) models/uutt_tch_scalar/function_library.py (+54/-0) models/uutt_tch_scalar/lorentz.py (+71/-0) models/uutt_tch_scalar/object_library.py (+191/-0) models/uutt_tch_scalar/parameters.py (+245/-0) models/uutt_tch_scalar/particles.py (+395/-0) models/uutt_tch_scalar/vertices.py (+353/-0) models/uutt_tch_scalar/write_param_card.py (+65/-0) tests/acceptance_tests/test_cmd.py (+40/-2) tests/acceptance_tests/test_model_equivalence.py (+2/-2) tests/input_files/test_8fs.pkl (+2051/-0) tests/parallel_tests/sample_script.py (+18/-14) tests/test_manager.py (+1/-1) tests/unit_tests/__init__.py (+9/-2) tests/unit_tests/core/test_base_objects.py (+4/-4) tests/unit_tests/core/test_color_amp.py (+1/-1) tests/unit_tests/iolibs/test_export_v4.py (+1561/-29) tests/unit_tests/iolibs/test_helas_call_writers.py (+33/-33) tests/unit_tests/various/test_4fermion_models.py (+136/-0) tests/unit_tests/various/test_aloha.py (+90/-22) tests/unit_tests/various/test_diquark_models.py (+30/-0) tests/unit_tests/various/test_rambo.py (+487/-4) |
To merge this branch: | bzr merge lp:~maddevelopers/mg5amcnlo/multi_fermion_vertices |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Mattelaer | Approve | ||
Review via email: mp+44150@code.launchpad.net |
Commit message
Description of the change
- Added functionality for multi-fermion vertices in MG5
- Modified order in ALOHA calls to use the order in the UFO interaction (change both in MG5 and in ALOHA)
- Include Modification for Spin2 in ALOHA
- 71. By Johan Alwall
-
Fixed documentation texts for the t-channel tests in test_4fermion_
models. py - 72. By Johan Alwall
-
Merged with the latest version of branch combine_v0_6_0
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Johan Alwall (johan-alwall) wrote : | # |
??? Can you get on Skype?
On Tue, Dec 21, 2010 at 11:24 AM, Olivier Mattelaer
<email address hidden> wrote:
> thanks for the merging, this will help a lot (since the diff is more clear now :-) )
> --
> https:/
> You proposed lp:~maddevelopers/madgraph5/multi_fermion_vertices for merging.
>
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Hi Johan,
Don't use this to contact me. I'm never receiving the email....
Cheers,
Olivier
- 73. By Johan Alwall
-
Merged with latest trunk 0.6.1
- 74. By Johan Alwall
-
Fixed configs for multivertices with additional radiation
- 75. By Johan Alwall
-
Fixed small bug in configs.inc
- 76. By Johan Alwall
-
Merged with trunk v. 0.6.1.2
- 77. By Johan Alwall
-
Fixed AMP2 writing for pure multiparticle vertex diagrams, fixed format of couplings
- 78. By Johan Alwall
-
Updated VERSION
- 79. By Johan Alwall
-
Added tests for AMP2 expressions also for 4-fermion vertex processes
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
So Johan,
I think that we can make the merge. What do think?
- 80. By Olivier Mattelaer
-
update value for the SM coupling estimation
- 81. By Olivier Mattelaer
-
merge ALOHA_SPIN2 and resolve conflicts (in tests only)
Johan Alwall (johan-alwall) wrote : | # |
Yeah, I think so too. There is one more thing I would like to fix,
related to the order of decaying particles in decay chains (I have got
one question about this, so others are bound to have the same
problem). I'll fix that in the multi_fermion_
you know so you can take a look.
- 82. By Johan Alwall
-
Allow decay chain specification with order of decays exchanged, e.g. p p > t t~, t~ > w- b~, t > w+ b
Preview Diff
1 | === removed file '.project' |
2 | --- .project 2010-08-16 15:41:39 +0000 |
3 | +++ .project 1970-01-01 00:00:00 +0000 |
4 | @@ -1,17 +0,0 @@ |
5 | -<?xml version="1.0" encoding="UTF-8"?> |
6 | -<projectDescription> |
7 | - <name>MG-new_color_stuff</name> |
8 | - <comment></comment> |
9 | - <projects> |
10 | - </projects> |
11 | - <buildSpec> |
12 | - <buildCommand> |
13 | - <name>org.python.pydev.PyDevBuilder</name> |
14 | - <arguments> |
15 | - </arguments> |
16 | - </buildCommand> |
17 | - </buildSpec> |
18 | - <natures> |
19 | - <nature>org.python.pydev.pythonNature</nature> |
20 | - </natures> |
21 | -</projectDescription> |
22 | |
23 | === modified file 'aloha/aloha_lib.py' |
24 | --- aloha/aloha_lib.py 2010-11-18 14:21:11 +0000 |
25 | +++ aloha/aloha_lib.py 2011-01-27 02:53:44 +0000 |
26 | @@ -591,6 +591,7 @@ |
27 | self.prefactor *= obj.prefactor |
28 | if obj in self: |
29 | index = self.index(obj) |
30 | + self[index] = self[index].copy() |
31 | self[index].power += 1 |
32 | else: |
33 | obj.prefactor = 1 |
34 | @@ -1292,6 +1293,7 @@ |
35 | def __mul__(self, obj): |
36 | """multiplication performing directly the einstein/spin sommation. |
37 | """ |
38 | + |
39 | if not hasattr(obj, 'vartype') or not self.vartype: |
40 | out = LorentzObjectRepresentation({}, self.lorentz_ind, self.spin_ind) |
41 | for ind in out.listindices(): |
42 | @@ -1388,10 +1390,11 @@ |
43 | factor = self.get_rep(self_ind) |
44 | factor *= obj.get_rep(obj_ind) |
45 | |
46 | + |
47 | if factor: |
48 | #compute the prefactor due to the lorentz contraction |
49 | factor *= (-1) ** (len(l_value) - l_value.count(0)) |
50 | - out += factor |
51 | + out += factor |
52 | return out |
53 | |
54 | def combine_indices(self, l_dict, s_dict): |
55 | |
56 | === modified file 'aloha/aloha_writers.py' |
57 | --- aloha/aloha_writers.py 2010-09-12 01:46:50 +0000 |
58 | +++ aloha/aloha_writers.py 2011-01-27 02:53:44 +0000 |
59 | @@ -34,8 +34,23 @@ |
60 | #prepare the necessary object |
61 | self.collect_variables() # Look for the different variables |
62 | self.make_all_lists() # Compute the expression for the call ordering |
63 | - #the definition of objects,... |
64 | - |
65 | + #the definition of objects,.. |
66 | + |
67 | + def pass_to_HELAS(self, indices, start=0): |
68 | + """find the Fortran HELAS position for the list of index""" |
69 | + |
70 | + |
71 | + if len(indices) == 1: |
72 | + return indices[0] + start |
73 | + |
74 | + ind_name = self.obj.numerator.lorentz_ind |
75 | + if ind_name == ['I3', 'I2']: |
76 | + return 4 * indices[1] + indices[0] + start |
77 | + elif len(indices) == 2: |
78 | + return 4 * indices[0] + indices[1] + start |
79 | + else: |
80 | + raise Exception |
81 | + |
82 | def collect_variables(self): |
83 | """Collects Momenta,Mass,Width into lists""" |
84 | |
85 | @@ -146,90 +161,28 @@ |
86 | if outgoing is None: |
87 | outgoing = self.offshell |
88 | |
89 | - # particle type counter |
90 | - nb_type = {'S':0, 'F':0, 'V':0, 'T':0} |
91 | call_arg = [] #incoming argument of the routine |
92 | |
93 | - # update the type counter + make call_arg for amplitude |
94 | - for index,spin in enumerate(self.particles): |
95 | - nb_type[spin] += 1 |
96 | - call_arg.append('%s%d' % (spin, index +1)) |
97 | - |
98 | - # reorder call_arg if not amplitude |
99 | - if outgoing: |
100 | - part_pos = outgoing -1 |
101 | - out_type = self.particles[part_pos] |
102 | - |
103 | - #order is FVST #look at the border of the cycling move |
104 | - # start/stop are the index of the group of spin where to perform |
105 | - #cycling ordering. |
106 | - if out_type == 'F': |
107 | - start = 0 |
108 | - stop = nb_type['F'] |
109 | - elif out_type == 'V': |
110 | - start = nb_type['F'] |
111 | - stop = start + nb_type['V'] |
112 | - elif out_type == 'S': |
113 | - start = nb_type['F'] + nb_type['V'] |
114 | - stop = start + nb_type['S'] |
115 | - elif out_type == 'T': |
116 | - start = nb_type['F'] + nb_type['V']+ nb_type['S'] |
117 | - stop = start + nb_type['T'] |
118 | - else: |
119 | - raise NotImplemented, 'Only type FVST are supported' |
120 | - |
121 | - #reorganize the order and suppress the output from this part |
122 | - call_arg = self.new_order(call_arg, part_pos, start, stop) |
123 | - |
124 | + |
125 | + call_arg = ['%s%d' % (spin, index +1) |
126 | + for index,spin in enumerate(self.particles) |
127 | + if outgoing != index +1] |
128 | + |
129 | return call_arg |
130 | |
131 | def reorder_call_list(self, call_list, old, new): |
132 | - """ restore the cycling ordering """ |
133 | + """ restore the correct order for symmetries """ |
134 | spins = self.particles |
135 | assert(0 < old < new) |
136 | old, new = old -1, new -1 # pass in real position in particles list |
137 | assert(spins[old] == spins[new]) |
138 | spin =spins[old] |
139 | |
140 | - new_call = [] |
141 | - #before first same spin |
142 | - for i in range(len(spins)): |
143 | - if spins[i] == spins[old]: |
144 | - start_spin = i |
145 | - break |
146 | - new_call.append(call_list[i]) |
147 | - #find end of same spin area |
148 | - stop_spin = len(spins) |
149 | - for i in range(new+1, len(spins)): |
150 | - if spins[i] != spins[old]: |
151 | - stop_spin = i |
152 | - break |
153 | - l_old = range(old + 1, stop_spin) + range(start_spin, old) |
154 | - l_new = range(new + 1, stop_spin) + range(start_spin, new) |
155 | - old_index = l_new.index(old) |
156 | - l_new[old_index] = new |
157 | - for i in range(len(l_old)): |
158 | - part_nb = l_old[l_new.index(l_old[i])] +1 |
159 | - new_call.append('%s%d' % (spin, part_nb)) |
160 | - |
161 | - for i in range(stop_spin, len(spins)): |
162 | - new_call.append(call_list[i-1]) |
163 | + new_call = call_list[:] |
164 | + val = new_call.pop(old) |
165 | + new_call.insert(new - 1, val) |
166 | return new_call |
167 | |
168 | - @ staticmethod |
169 | - def new_order(call_list, remove, start, stop): |
170 | - """ create the new order for the calling using cycling order""" |
171 | - |
172 | - assert(start <= remove <= stop <= len(call_list)) |
173 | - |
174 | - new_list= call_list[:start] |
175 | - for i in range(remove+1, stop): |
176 | - new_list.append(call_list[i]) |
177 | - for i in range(start, remove): |
178 | - new_list.append(call_list[i]) |
179 | - new_list += call_list[stop:] |
180 | - |
181 | - return new_list |
182 | |
183 | def make_momentum_conservation(self): |
184 | """ compute the sign for the momentum conservation """ |
185 | @@ -444,6 +397,7 @@ |
186 | out = '%.9f' % number |
187 | out = self.zero_pattern.sub('', out) |
188 | return out |
189 | + |
190 | |
191 | def define_expression(self): |
192 | OutString = '' |
193 | @@ -466,15 +420,13 @@ |
194 | string = re.sub('\((?P<num>[+-]*[0-9])\+(?P<num2>[+-][0-9])[Jj]\)\.', '(\g<num>d0,\g<num2>d0)', string) |
195 | string = re.sub('(?P<num>[0-9])[Jj]\.', '\g<num>*(0d0,1d0)', string) |
196 | OutString = OutString + string + '\n' |
197 | - counter = 1 |
198 | for ind in numerator.listindices(): |
199 | - string = '%s(%d)= C*denom*' % (OffShellParticle, counter) |
200 | + string = '%s(%d)= C*denom*' % (OffShellParticle, self.pass_to_HELAS(ind, start=1)) |
201 | string += self.write_obj(numerator.get_rep(ind)) |
202 | string = string.replace('+-', '-') |
203 | string = re.sub('\((?P<num>[+-][0-9])\+(?P<num2>[+-][0-9])[Jj]\)\.', '(\g<num>d0,\g<num2>d0)', string) |
204 | string = re.sub('(?P<num>[0-9])[Jj]\.', '\g<num>*(0d0,1d0)', string) |
205 | OutString = OutString + string + '\n' |
206 | - counter += 1 |
207 | return OutString |
208 | |
209 | def define_symmetry(self, new_nb): |
210 | @@ -674,13 +626,11 @@ |
211 | string = 'denom =' + '1./(' + denom + ')' |
212 | string = string.replace('+-', '-') |
213 | OutString = OutString + string + ';\n' |
214 | - counter = 0 |
215 | for ind in numerator.listindices(): |
216 | - string = '%s[%d]= C*denom*' % (OffShellParticle, counter) |
217 | + string = '%s[%d]= C*denom*' % (OffShellParticle, self.pass_to_HELAS(ind)) |
218 | string += self.write_obj(numerator.get_rep(ind)) |
219 | string = string.replace('+-', '-') |
220 | OutString = OutString + string + ';\n' |
221 | - counter += 1 |
222 | OutString = re.sub('(?P<variable>[A-Za-z]+[0-9]\[*[0-9]*\]*)\*\*(?P<num>[0-9])','pow(\g<variable>,\g<num>)',OutString) |
223 | return OutString |
224 | |
225 | @@ -824,13 +774,11 @@ |
226 | string = 'denom =' + '1.0/(' + denom + ')' |
227 | string = string.replace('+-', '-') |
228 | OutString += string + '\n' |
229 | - counter = 0 |
230 | for ind in numerator.listindices(): |
231 | - string = '%s[%d]= C*denom*' % (self.outname, counter) |
232 | + string = '%s[%d]= C*denom*' % (self.outname, self.pass_to_HELAS(ind)) |
233 | string += self.write_obj(numerator.get_rep(ind)) |
234 | string = string.replace('+-', '-') |
235 | OutString += string + '\n' |
236 | - counter += 1 |
237 | return OutString |
238 | |
239 | def define_foot(self): |
240 | |
241 | === modified file 'aloha/create_aloha.py' |
242 | --- aloha/create_aloha.py 2010-10-11 20:32:01 +0000 |
243 | +++ aloha/create_aloha.py 2011-01-27 02:53:44 +0000 |
244 | @@ -27,6 +27,7 @@ |
245 | sys.path.append(root_path) |
246 | from aloha.aloha_object import * |
247 | import aloha.aloha_writers as aloha_writers |
248 | +import aloha.aloha_lib as aloha_lib |
249 | try: |
250 | import madgraph.iolibs.files as files |
251 | except: |
252 | @@ -36,6 +37,7 @@ |
253 | logger = logging.getLogger('ALOHA') |
254 | |
255 | _conjugate_gap = 50 |
256 | +_spin2_mult = 1000 |
257 | |
258 | class ALOHAERROR(Exception): pass |
259 | |
260 | @@ -91,10 +93,10 @@ |
261 | self.routine_kernel = None |
262 | |
263 | |
264 | - def compute_routine(self, mode): |
265 | + def compute_routine(self, mode, factorize=True): |
266 | """compute the expression and return it""" |
267 | self.outgoing = mode |
268 | - self.expr = self.compute_aloha_high_kernel(mode) |
269 | + self.expr = self.compute_aloha_high_kernel(mode, factorize) |
270 | return self.define_simple_output() |
271 | |
272 | def define_all_conjugate_builder(self, pair_list): |
273 | @@ -115,9 +117,10 @@ |
274 | one is conjugated""" |
275 | |
276 | new_builder = copy.copy(self) |
277 | + new_builder.conjg = self.conjg[:] |
278 | try: |
279 | for index in pairs: |
280 | - new_builder.apply_conjugation(index) |
281 | + new_builder.apply_conjugation(index) |
282 | except TypeError: |
283 | new_builder.apply_conjugation(pairs) |
284 | return new_builder |
285 | @@ -125,7 +128,8 @@ |
286 | def apply_conjugation(self, pair=1): |
287 | """ apply conjugation on self object""" |
288 | |
289 | - old_id = pair |
290 | + |
291 | + old_id = 2 * pair - 1 |
292 | new_id = _conjugate_gap + old_id |
293 | |
294 | if self.routine_kernel is None: |
295 | @@ -138,7 +142,8 @@ |
296 | |
297 | if pair: |
298 | self.name += str(pair) |
299 | - self.conjg.append(pair) |
300 | + self.conjg.append(pair) |
301 | + |
302 | |
303 | |
304 | def define_simple_output(self): |
305 | @@ -148,11 +153,10 @@ |
306 | return AbstractRoutine(self.expr, self.outgoing, self.spins, self.name, \ |
307 | infostr) |
308 | |
309 | - def compute_aloha_high_kernel(self, mode): |
310 | + def compute_aloha_high_kernel(self, mode, factorize=True): |
311 | """compute the abstract routine associate to this mode """ |
312 | # reset tag for particles |
313 | aloha_lib.USE_TAG=set() |
314 | - |
315 | #multiply by the wave functions |
316 | nb_spinor = 0 |
317 | if not self.routine_kernel: |
318 | @@ -171,7 +175,6 @@ |
319 | aloha_lib.USE_TAG = set(self.kernel_tag) |
320 | for (i, spin ) in enumerate(self.spins): |
321 | id = i + 1 |
322 | - |
323 | #Check if this is the outgoing particle |
324 | if id == self.outgoing: |
325 | if spin == 1: |
326 | @@ -182,9 +185,9 @@ |
327 | id += _conjugate_gap |
328 | nb_spinor += 1 |
329 | if nb_spinor %2: |
330 | - lorentz *= SpinorPropagator(id, 'I2', i + 1) |
331 | + lorentz *= SpinorPropagator(id, 'I2', self.outgoing) |
332 | else: |
333 | - lorentz *= SpinorPropagator('I2', id, i + 1) |
334 | + lorentz *= SpinorPropagator('I2', id, self.outgoing) |
335 | elif spin == 3 : |
336 | lorentz *= VectorPropagator(id, 'I2', id) |
337 | elif spin == 5 : |
338 | @@ -199,13 +202,15 @@ |
339 | elif spin == 2: |
340 | # shift the tag if we multiply by C matrices |
341 | if (id+1) // 2 in self.conjg: |
342 | - id += _conjugate_gap |
343 | + spin_id = id + _conjugate_gap |
344 | + else: |
345 | + spin_id = id |
346 | nb_spinor += 1 |
347 | - lorentz *= Spinor(id, i + 1) |
348 | + lorentz *= Spinor(spin_id, id) |
349 | elif spin == 3: |
350 | lorentz *= Vector(id, id) |
351 | elif spin == 5: |
352 | - lorentz *= Spin2(10*id+1, 10*id+2, 'I2', 'I3', id) |
353 | + lorentz *= Spin2(1 * _spin2_mult + id, 2 * _spin2_mult + id, id) |
354 | else: |
355 | raise self.AbstractALOHAError( |
356 | 'The spin value %s is not supported yet' % spin) |
357 | @@ -221,15 +226,19 @@ |
358 | |
359 | #lorentz = lorentz.simplify() |
360 | lorentz = lorentz.expand() |
361 | - |
362 | - if self.spins[self.outgoing-1] == 5: |
363 | + if self.outgoing and self.spins[self.outgoing-1] == 5: |
364 | if not self.aloha_lib: |
365 | AbstractRoutineBuilder.load_library() |
366 | lorentz *= self.aloha_lib[('Spin2Prop', id)] |
367 | + aloha_lib.USE_TAG.add('OM%d' % id) |
368 | + aloha_lib.USE_TAG.add('P%d' % id) |
369 | + |
370 | + |
371 | |
372 | |
373 | lorentz = lorentz.simplify() |
374 | - lorentz = lorentz.factorize() |
375 | + if factorize: |
376 | + lorentz = lorentz.factorize() |
377 | |
378 | lorentz.tag = set(aloha_lib.USE_TAG) |
379 | #raise |
380 | @@ -269,8 +278,12 @@ |
381 | @classmethod |
382 | def load_library(cls): |
383 | # load the library |
384 | - fsock = open(os.path.join(aloha_path, 'ALOHALib.pkl'), 'r') |
385 | - cls.aloha_lib = cPickle.load(fsock) |
386 | + try: |
387 | + fsock = open(os.path.join(aloha_path, 'ALOHALib.pkl'), 'r') |
388 | + except IOError: |
389 | + cls.aloha_lib = create_library() |
390 | + else: |
391 | + cls.aloha_lib = cPickle.load(fsock) |
392 | |
393 | |
394 | class AbstractALOHAModel(dict): |
395 | @@ -638,22 +651,22 @@ |
396 | lib = {} # key: (name, part_nb, special) -> object |
397 | for i in range(1, 10): |
398 | logger.info('step %s/9' % i) |
399 | - lib[('Scalar', i)] = create( Scalar(i) ) |
400 | - lib[('ScalarProp', i)] = complex(0,1) |
401 | - lib[('Denom', i )] = create( DenominatorPropagator(i) ) |
402 | - lib[('Spinor', i )] = create( Spinor(i, i) ) |
403 | - lib[('SpinorProp', i, 0)] = create( SpinorPropagator(i, 'I2', i) ) |
404 | - lib[('SpinorProp', i, 1)] = create( SpinorPropagator('I2', i, i) ) |
405 | - lib[('Vector', i)] = create( Vector(i+1, i+1) ) |
406 | - lib[('VectorProp', i)] = create( VectorPropagator(i,'I2', i) ) |
407 | - lib[('Spin2', i )] = create( Spin2(10*i+1, 10*i+2, i) ) |
408 | - lib[('Spin2Prop',i)] = create( Spin2Propagator(10*i+1, \ |
409 | - 10*i+2,'I2','I3', i) ) |
410 | - logger.info('writing') |
411 | - fsock = open('./ALOHALib.pkl','wb') |
412 | + #lib[('Scalar', i)] = create( Scalar(i) ) |
413 | + #lib[('ScalarProp', i)] = complex(0,1) |
414 | + #lib[('Denom', i )] = create( DenominatorPropagator(i) ) |
415 | + #lib[('Spinor', i )] = create( Spinor(i, i) ) |
416 | + #lib[('SpinorProp', i, 0)] = create( SpinorPropagator(i, 'I2', i) ) |
417 | + #lib[('SpinorProp', i, 1)] = create( SpinorPropagator('I2', i, i) ) |
418 | + #lib[('Vector', i)] = create( Vector(i+1, i+1) ) |
419 | + #lib[('VectorProp', i)] = create( VectorPropagator(i,'I2', i) ) |
420 | + #lib[('Spin2', i )] = create( Spin2(10*i+1, 10*i+2, i) ) |
421 | + lib[('Spin2Prop',i)] = create( Spin2Propagator(_spin2_mult + i, \ |
422 | + 2 * _spin2_mult + i,'I2','I3', i) ) |
423 | + logger.info('writing Spin2 lib') |
424 | + fsock = open(os.path.join(aloha_path, 'ALOHALib.pkl'),'wb') |
425 | cPickle.dump(lib, fsock, -1) |
426 | - logger.info('done') |
427 | - |
428 | + return lib |
429 | + |
430 | if '__main__' == __name__: |
431 | logging.basicConfig(level=0) |
432 | #create_library() |
433 | |
434 | === modified file 'aloha/template_files/wavefunctions.py' |
435 | --- aloha/template_files/wavefunctions.py 2010-09-05 16:14:23 +0000 |
436 | +++ aloha/template_files/wavefunctions.py 2011-01-27 02:53:44 +0000 |
437 | @@ -1,224 +1,355 @@ |
438 | -import cmath |
439 | +from __future__ import division |
440 | import math |
441 | +from math import sqrt, pow |
442 | |
443 | class WaveFunction(list): |
444 | - """a objet for a WaveFunction""" |
445 | - |
446 | - spin_to_size={0:1, |
447 | - 1:3, |
448 | - 2:6, |
449 | - 3:6} |
450 | - |
451 | - def __init__(self, spin= None, size=None): |
452 | - """Init the list with zero value""" |
453 | - |
454 | - if spin: |
455 | - size = self.spin_to_size[spin] |
456 | - list.__init__(self, [0]*size) |
457 | - |
458 | + """a objet for a WaveFunction""" |
459 | + |
460 | + spin_to_size={0:1, |
461 | + 1:3, |
462 | + 2:6, |
463 | + 3:6, |
464 | + 5:18} |
465 | + |
466 | + def __init__(self, spin= None, size=None): |
467 | + """Init the list with zero value""" |
468 | + |
469 | + if spin: |
470 | + size = self.spin_to_size[spin] |
471 | + list.__init__(self, [0]*size) |
472 | + |
473 | |
474 | def ixxxxx(p,fmass,nhel,nsf): |
475 | - """Defines an inflow fermion.""" |
476 | - |
477 | - fi = WaveFunction(2) |
478 | - |
479 | - fi[4] = complex(p[0]*nsf,p[3]*nsf) |
480 | - fi[5] = complex(p[1]*nsf,p[2]*nsf) |
481 | - |
482 | - nh = nhel*nsf |
483 | - |
484 | - if (fmass != 0.): |
485 | - pp = min(p[0],math.sqrt(math.pow(p[1],2)+math.pow(p[2],2)+math.pow(p[3],2))) |
486 | - if (pp == 0.): |
487 | - sqm = math.sqrt(abs(fmass)) |
488 | - ip = (1+nh)/2 |
489 | - im = (1-nh)/2 |
490 | - |
491 | - fi[0] = ip*sqm |
492 | - fi[1] = im*nsf*sqm |
493 | - fi[2] = ip*nsf*sqm |
494 | - fi[3] = im*sqm |
495 | - |
496 | - else: |
497 | - sf = [(1+nsf+(1-nsf)*nh)*0.5,(1+nsf-(1-nsf)*nh)*0.5] |
498 | - omega = [math.sqrt(p[0]+pp),fmass/(math.sqrt(p[0]+pp))] |
499 | - ip = (1+nh)/2 |
500 | - im = (1-nh)/2 |
501 | - sfomeg = [sf[0]*omega[ip],sf[1]*omega[im]] |
502 | - pp3 = max(pp+p[3],0.) |
503 | - if (pp3 == 0.): |
504 | - chi1 = complex(-nh,0.) |
505 | - else: |
506 | - chi1 = complex(nh*p[1]/math.sqrt(2.*pp*pp3),\ |
507 | - p[2]/math.sqrt(2.*pp*pp3)) |
508 | - chi = [complex(math.sqrt(pp3*0.5/pp)),chi1] |
509 | - |
510 | - fi[0] = sfomeg[0]*chi[im] |
511 | - fi[1] = sfomeg[0]*chi[ip] |
512 | - fi[2] = sfomeg[1]*chi[im] |
513 | - fi[3] = sfomeg[1]*chi[ip] |
514 | - |
515 | - else: |
516 | - sqp0p3 = math.sqrt(max(p[0]+p[3],0.))*nsf |
517 | - if (sqp0p3 == 0.): |
518 | - chi1 = complex(-nhel*math.sqrt(2.*p[0]),0.) |
519 | - else: |
520 | - chi1 = complex(nh*p[1]/sqp0p3,p[2]/sqp0p3) |
521 | - chi = [complex(sqp0p3,0.),chi1] |
522 | - if (nh == 1): |
523 | - fi[0] = complex(0.,0.) |
524 | - fi[1] = complex(0.,0.) |
525 | - fi[2] = chi[0] |
526 | - fi[3] = chi[1] |
527 | - else: |
528 | - fi[0] = chi[1] |
529 | - fi[1] = chi[0] |
530 | - fi[2] = complex(0.,0.) |
531 | - fi[3] = complex(0.,0.) |
532 | - |
533 | - return fi |
534 | + """Defines an inflow fermion.""" |
535 | + |
536 | + fi = WaveFunction(2) |
537 | + |
538 | + fi[4] = complex(p[0]*nsf,p[3]*nsf) |
539 | + fi[5] = complex(p[1]*nsf,p[2]*nsf) |
540 | + |
541 | + nh = nhel*nsf |
542 | + |
543 | + if (fmass != 0.): |
544 | + pp = min(p[0],sqrt(p[1]**2 + p[2]**2 + p[3]**2 )) |
545 | + if (pp == 0.): |
546 | + sqm = sqrt(abs(fmass)) |
547 | + ip = (1+nh)/2 |
548 | + im = (1-nh)/2 |
549 | + |
550 | + fi[0] = ip*sqm |
551 | + fi[1] = im*nsf*sqm |
552 | + fi[2] = ip*nsf*sqm |
553 | + fi[3] = im*sqm |
554 | + |
555 | + else: |
556 | + sf = [(1+nsf+(1-nsf)*nh)*0.5,(1+nsf-(1-nsf)*nh)*0.5] |
557 | + omega = [sqrt(p[0]+pp),fmass/(sqrt(p[0]+pp))] |
558 | + ip = (1+nh)//2 |
559 | + im = (1-nh)//2 |
560 | + sfomeg = [sf[0]*omega[ip],sf[1]*omega[im]] |
561 | + pp3 = max(pp+p[3],0.) |
562 | + if (pp3 == 0.): |
563 | + chi1 = complex(-nh,0.) |
564 | + else: |
565 | + chi1 = complex(nh*p[1]/sqrt(2.*pp*pp3),\ |
566 | + p[2]/sqrt(2.*pp*pp3)) |
567 | + chi = [complex(sqrt(pp3*0.5/pp)),chi1] |
568 | + |
569 | + fi[0] = sfomeg[0]*chi[im] |
570 | + fi[1] = sfomeg[0]*chi[ip] |
571 | + fi[2] = sfomeg[1]*chi[im] |
572 | + fi[3] = sfomeg[1]*chi[ip] |
573 | + |
574 | + else: |
575 | + sqp0p3 = sqrt(max(p[0]+p[3],0.))*nsf |
576 | + if (sqp0p3 == 0.): |
577 | + chi1 = complex(-nhel*sqrt(2.*p[0]),0.) |
578 | + else: |
579 | + chi1 = complex(nh*p[1]/sqp0p3,p[2]/sqp0p3) |
580 | + chi = [complex(sqp0p3,0.),chi1] |
581 | + if (nh == 1): |
582 | + fi[0] = complex(0.,0.) |
583 | + fi[1] = complex(0.,0.) |
584 | + fi[2] = chi[0] |
585 | + fi[3] = chi[1] |
586 | + else: |
587 | + fi[0] = chi[1] |
588 | + fi[1] = chi[0] |
589 | + fi[2] = complex(0.,0.) |
590 | + fi[3] = complex(0.,0.) |
591 | + |
592 | + return fi |
593 | |
594 | def oxxxxx(p,fmass,nhel,nsf): |
595 | - """ initialize an outgoing fermion""" |
596 | - |
597 | - fo = WaveFunction(2) |
598 | - |
599 | - fo[4] = complex(p[0]*nsf,p[3]*nsf) |
600 | - fo[5] = complex(p[1]*nsf,p[2]*nsf) |
601 | - |
602 | - nh = nhel*nsf |
603 | - |
604 | - if (fmass != 0.): |
605 | - pp = min(p[0],math.sqrt(math.pow(p[1],2)+math.pow(p[2],2)+math.pow(p[3],2))) |
606 | - if (pp == 0.): |
607 | - sqm = math.sqrt(abs(fmass)) |
608 | - ip = -((1+nh)/2) |
609 | - im = (1-nh)/2 |
610 | - |
611 | - fo[0] = im*sqm |
612 | - fo[1] = ip*nsf*sqm |
613 | - fo[2] = im*nsf*sqm |
614 | - fo[3] = ip*sqm |
615 | - |
616 | - else: |
617 | - sf = [(1+nsf+(1-nsf)*nh)*0.5,(1+nsf-(1-nsf)*nh)*0.5] |
618 | - omega = [math.sqrt(p[0]+pp),fmass/(math.sqrt(p[0]+pp))] |
619 | - ip = (1+nh)/2 |
620 | - im = (1-nh)/2 |
621 | - sfomeg = [sf[0]*omega[ip],sf[1]*omega[im]] |
622 | - pp3 = max(pp+p[3],0.) |
623 | - if (pp3 == 0.): |
624 | - chi1 = complex(-nh,0.) |
625 | - else: |
626 | - chi1 = complex(nh*p[1]/math.sqrt(2.*pp*pp3),\ |
627 | - -p[2]/math.sqrt(2.*pp*pp3)) |
628 | - chi = [complex(math.sqrt(pp3*0.5/pp)),chi1] |
629 | - |
630 | - fo[0] = sfomeg[1]*chi[im] |
631 | - fo[1] = sfomeg[1]*chi[ip] |
632 | - fo[2] = sfomeg[0]*chi[im] |
633 | - fo[3] = sfomeg[0]*chi[ip] |
634 | - |
635 | - else: |
636 | - sqp0p3 = math.sqrt(max(p[0]+p[3],0.))*nsf |
637 | - if (sqp0p3 == 0.): |
638 | - chi1 = complex(-nhel*math.sqrt(2.*p[0]),0.) |
639 | - else: |
640 | - chi1 = complex(nh*p[1]/sqp0p3,-p[2]/sqp0p3) |
641 | - chi = [complex(sqp0p3,0.),chi1] |
642 | - if (nh == 1): |
643 | - fo[0] = chi[0] |
644 | - fo[1] = chi[1] |
645 | - fo[2] = complex(0.,0.) |
646 | - fo[3] = complex(0.,0.) |
647 | - else: |
648 | - fo[0] = complex(0.,0.) |
649 | - fo[1] = complex(0.,0.) |
650 | - fo[2] = chi[1] |
651 | - fo[3] = chi[0] |
652 | - |
653 | - return fo |
654 | + """ initialize an outgoing fermion""" |
655 | + |
656 | + fo = WaveFunction(2) |
657 | + |
658 | + fo[4] = complex(p[0]*nsf,p[3]*nsf) |
659 | + fo[5] = complex(p[1]*nsf,p[2]*nsf) |
660 | + |
661 | + nh = nhel*nsf |
662 | + |
663 | + if (fmass != 0.): |
664 | + pp = min(p[0],sqrt(p[1]**2 + p[2]**2 + p[3]**2 )) |
665 | + if (pp == 0.): |
666 | + sqm = sqrt(abs(fmass)) |
667 | + ip = -((1+nh)/2) |
668 | + im = (1-nh)/2 |
669 | + |
670 | + fo[0] = im*sqm |
671 | + fo[1] = ip*nsf*sqm |
672 | + fo[2] = im*nsf*sqm |
673 | + fo[3] = ip*sqm |
674 | + |
675 | + else: |
676 | + sf = [(1+nsf+(1-nsf)*nh)*0.5,(1+nsf-(1-nsf)*nh)*0.5] |
677 | + omega = [sqrt(p[0]+pp),fmass/(sqrt(p[0]+pp))] |
678 | + ip = (1+nh)//2 |
679 | + im = (1-nh)//2 |
680 | + sfomeg = [sf[0]*omega[ip],sf[1]*omega[im]] |
681 | + pp3 = max(pp+p[3],0.) |
682 | + if (pp3 == 0.): |
683 | + chi1 = complex(-nh,0.) |
684 | + else: |
685 | + chi1 = complex(nh*p[1]/sqrt(2.*pp*pp3),\ |
686 | + -p[2]/sqrt(2.*pp*pp3)) |
687 | + chi = [complex(sqrt(pp3*0.5/pp)),chi1] |
688 | + |
689 | + fo[0] = sfomeg[1]*chi[im] |
690 | + fo[1] = sfomeg[1]*chi[ip] |
691 | + fo[2] = sfomeg[0]*chi[im] |
692 | + fo[3] = sfomeg[0]*chi[ip] |
693 | + |
694 | + else: |
695 | + sqp0p3 = sqrt(max(p[0]+p[3],0.))*nsf |
696 | + if (sqp0p3 == 0.): |
697 | + chi1 = complex(-nhel*sqrt(2.*p[0]),0.) |
698 | + else: |
699 | + chi1 = complex(nh*p[1]/sqp0p3,-p[2]/sqp0p3) |
700 | + chi = [complex(sqp0p3,0.),chi1] |
701 | + if (nh == 1): |
702 | + fo[0] = chi[0] |
703 | + fo[1] = chi[1] |
704 | + fo[2] = complex(0.,0.) |
705 | + fo[3] = complex(0.,0.) |
706 | + else: |
707 | + fo[0] = complex(0.,0.) |
708 | + fo[1] = complex(0.,0.) |
709 | + fo[2] = chi[1] |
710 | + fo[3] = chi[0] |
711 | + |
712 | + return fo |
713 | |
714 | def vxxxxx(p,vmass,nhel,nsv): |
715 | - """ initialize a vector wavefunction. nhel=4 is for checking BRST""" |
716 | - |
717 | - vc = WaveFunction(3) |
718 | - |
719 | - sqh = math.sqrt(0.5) |
720 | - nsvahl = nsv*abs(nhel) |
721 | - pt2 = math.pow(p[1],2)+math.pow(p[2],2) |
722 | - pp = min(p[0],math.sqrt(pt2+pow(p[3],2))) |
723 | - pt = min(pp,math.sqrt(pt2)) |
724 | - |
725 | - vc[4] = complex(p[0]*nsv,p[3]*nsv) |
726 | - vc[5] = complex(p[1]*nsv,p[2]*nsv) |
727 | - |
728 | - if (nhel == 4): |
729 | - if (vmass == 0.): |
730 | - vc[0] = 1. |
731 | - vc[1]=p[1]/p[0] |
732 | - vc[2]=p[2]/p[0] |
733 | - vc[3]=p[3]/p[0] |
734 | - else: |
735 | - vc[0] = p[0]/vmass |
736 | - vc[1] = p[1]/vmass |
737 | - vc[2] = p[2]/vmass |
738 | - vc[3] = p[3]/vmass |
739 | - |
740 | - return vc |
741 | - |
742 | - if (vmass != 0.): |
743 | - hel0 = 1.-abs(nhel) |
744 | - |
745 | - if (pp == 0.): |
746 | - vc[0] = complex(0.,0.) |
747 | - vc[1] = complex(-nhel*sqh,0.) |
748 | - vc[2] = complex(0.,nsvahl*sqh) |
749 | - vc[3] = complex(hel0,0.) |
750 | - |
751 | - else: |
752 | - emp = p[0]/(vmass*pp) |
753 | - vc[0] = complex(hel0*pp/vmass,0.) |
754 | - vc[3] = complex(hel0*p[3]*emp+nhel*pt/pp*sqh) |
755 | - if (pt != 0.): |
756 | - pzpt = p[3]/(pp*pt)*sqh*nhel |
757 | - vc[1] = complex(hel0*p[1]*emp-p[1]*pzpt, \ |
758 | - -nsvahl*p[2]/pt*sqh) |
759 | - vc[2] = complex(hel0*p[2]*emp-p[2]*pzpt, \ |
760 | - nsvahl*p[1]/pt*sqh) |
761 | - else: |
762 | - vc[1] = complex(-nhel*sqh,0.) |
763 | - vc[2] = complex(0.,nsvahl*sign(sqh,p[3])) |
764 | - else: |
765 | - pp = p[0] |
766 | - pt = math.sqrt(math.pow(p[1],2)+math.pow(p[2],2)) |
767 | - vc[0] = complex(0.,0.) |
768 | - vc[3] = complex(nhel*pt/pp*sqh) |
769 | - if (pt != 0.): |
770 | - pzpt = p[3]/(pp*pt)*sqh*nhel |
771 | - vc[1] = complex(-p[1]*pzpt,-nsv*p[2]/pt*sqh) |
772 | - vc[2] = complex(-p[2]*pzpt,nsv*p[1]/pt*sqh) |
773 | - else: |
774 | - vc[1] = complex(-nhel*sqh,0.) |
775 | - vc[2] = complex(0.,nsv*sign(sqh,p[3])) |
776 | - |
777 | - return vc |
778 | + """ initialize a vector wavefunction. nhel=4 is for checking BRST""" |
779 | + |
780 | + vc = WaveFunction(3) |
781 | + |
782 | + sqh = sqrt(0.5) |
783 | + nsvahl = nsv*abs(nhel) |
784 | + pt2 = p[1]**2 + p[2]**2 |
785 | + pp = min(p[0],sqrt(pt2 + p[3]**2)) |
786 | + pt = min(pp,sqrt(pt2)) |
787 | + |
788 | + vc[4] = complex(p[0]*nsv,p[3]*nsv) |
789 | + vc[5] = complex(p[1]*nsv,p[2]*nsv) |
790 | + |
791 | + if (nhel == 4): |
792 | + if (vmass == 0.): |
793 | + vc[0] = 1. |
794 | + vc[1]=p[1]/p[0] |
795 | + vc[2]=p[2]/p[0] |
796 | + vc[3]=p[3]/p[0] |
797 | + else: |
798 | + vc[0] = p[0]/vmass |
799 | + vc[1] = p[1]/vmass |
800 | + vc[2] = p[2]/vmass |
801 | + vc[3] = p[3]/vmass |
802 | + |
803 | + return vc |
804 | + |
805 | + if (vmass != 0.): |
806 | + hel0 = 1.-abs(nhel) |
807 | + |
808 | + if (pp == 0.): |
809 | + vc[0] = complex(0.,0.) |
810 | + vc[1] = complex(-nhel*sqh,0.) |
811 | + vc[2] = complex(0.,nsvahl*sqh) |
812 | + vc[3] = complex(hel0,0.) |
813 | + |
814 | + else: |
815 | + emp = p[0]/(vmass*pp) |
816 | + vc[0] = complex(hel0*pp/vmass,0.) |
817 | + vc[3] = complex(hel0*p[3]*emp+nhel*pt/pp*sqh) |
818 | + if (pt != 0.): |
819 | + pzpt = p[3]/(pp*pt)*sqh*nhel |
820 | + vc[1] = complex(hel0*p[1]*emp-p[1]*pzpt, \ |
821 | + -nsvahl*p[2]/pt*sqh) |
822 | + vc[2] = complex(hel0*p[2]*emp-p[2]*pzpt, \ |
823 | + nsvahl*p[1]/pt*sqh) |
824 | + else: |
825 | + vc[1] = complex(-nhel*sqh,0.) |
826 | + vc[2] = complex(0.,nsvahl*sign(sqh,p[3])) |
827 | + else: |
828 | + pp = p[0] |
829 | + pt = sqrt(p[1]**2 + p[2]**2) |
830 | + vc[0] = complex(0.,0.) |
831 | + vc[3] = complex(nhel*pt/pp*sqh) |
832 | + if (pt != 0.): |
833 | + pzpt = p[3]/(pp*pt)*sqh*nhel |
834 | + vc[1] = complex(-p[1]*pzpt,-nsv*p[2]/pt*sqh) |
835 | + vc[2] = complex(-p[2]*pzpt,nsv*p[1]/pt*sqh) |
836 | + else: |
837 | + vc[1] = complex(-nhel*sqh,0.) |
838 | + vc[2] = complex(0.,nsv*sign(sqh,p[3])) |
839 | + |
840 | + return vc |
841 | |
842 | def sign(x,y): |
843 | - """Fortran's sign transfer function""" |
844 | - if (y < 0.): |
845 | - return -abs(x) |
846 | - else: |
847 | - return abs(x) |
848 | - |
849 | + """Fortran's sign transfer function""" |
850 | + if (y < 0.): |
851 | + return -abs(x) |
852 | + else: |
853 | + return abs(x) |
854 | + |
855 | |
856 | def sxxxxx(p,nss): |
857 | - """initialize a scalar wavefunction""" |
858 | - |
859 | - sc = WaveFunction(1) |
860 | - |
861 | - sc[0] = complex(1.,0.) |
862 | - sc[1] = complex(p[0]*nss,p[3]*nss) |
863 | - sc[2] = complex(p[1]*nss,p[2]*nss) |
864 | - return sc |
865 | + """initialize a scalar wavefunction""" |
866 | + |
867 | + sc = WaveFunction(1) |
868 | + |
869 | + sc[0] = complex(1.,0.) |
870 | + sc[1] = complex(p[0]*nss,p[3]*nss) |
871 | + sc[2] = complex(p[1]*nss,p[2]*nss) |
872 | + return sc |
873 | + |
874 | + |
875 | +def txxxxx(p, tmass, nhel, nst): |
876 | + """ initialize a tensor wavefunction""" |
877 | + |
878 | + tc = WaveFunction(5) |
879 | + |
880 | + sqh = sqrt(0.5) |
881 | + sqs = sqrt(1/6) |
882 | + |
883 | + pt2 = p[1]**2 + p[2]**2 |
884 | + pp = min(p[0],sqrt(pt2+p[3]**2)) |
885 | + pt = min(pp,sqrt(pt2)) |
886 | + |
887 | + ft = {} |
888 | + ft[(4,0)] = complex(p[0], p[3]) * nst |
889 | + ft[(5,0)] = complex(p[1], p[2]) * nst |
890 | + |
891 | + if ( nhel >= 0 ): |
892 | + #construct eps+ |
893 | + ep = [0] * 4 |
894 | + |
895 | + if ( pp == 0 ): |
896 | + #ep[0] = 0 |
897 | + ep[1] = -sqh |
898 | + ep[2] = complex(0, nst*sqh) |
899 | + #ep[3] = 0 |
900 | + else: |
901 | + #ep[0] = 0 |
902 | + ep[3] = pt/pp*sqh |
903 | + if (pt != 0): |
904 | + pzpt = p[3]/(pp*pt)*sqh |
905 | + ep[1] = complex( -p[1]*pzpt , -nst*p[2]/pt*sqh ) |
906 | + ep[2] = complex( -p[2]*pzpt , nst*p[1]/pt*sqh ) |
907 | + else: |
908 | + ep[1] = -sqh |
909 | + ep[2] = complex( 0 , nst*sign(sqh,p[3]) ) |
910 | + |
911 | + |
912 | + |
913 | + if ( nhel <= 0 ): |
914 | + #construct eps- |
915 | + em = [0] * 4 |
916 | + if ( pp == 0 ): |
917 | + #em[0] = 0 |
918 | + em[1] = sqh |
919 | + em[2] = cpmplex( 0 , nst*sqh ) |
920 | + #em[3] = 0 |
921 | + else: |
922 | + #em[0] = 0 |
923 | + em[3] = -pt/pp*sqh |
924 | + if pt: |
925 | + pzpt = -p[3]/(pp*pt)*sqh |
926 | + em[1] = complex( -p[1]*pzpt , -nst*p[2]/pt*sqh ) |
927 | + em[2] = complex( -p[2]*pzpt , nst*p[1]/pt*sqh ) |
928 | + else: |
929 | + em[1] = sqh |
930 | + em[2] = complex( 0 , nst*sign(sqh,p[3]) ) |
931 | + |
932 | + |
933 | + if ( abs(nhel) <= 1 ): |
934 | + #construct eps0 |
935 | + e0 = [0] * 4 |
936 | + if ( pp == 0 ): |
937 | + #e0[0] = dcmplx( rZero ) |
938 | + #e0[1] = dcmplx( rZero ) |
939 | + #e0[2] = dcmplx( rZero ) |
940 | + e0[3] = 1 |
941 | + else: |
942 | + emp = p[0]/(tmass*pp) |
943 | + e0[0] = pp/tmass |
944 | + e0[3] = p[3]*emp |
945 | + if pt: |
946 | + e0[1] = p[1]*emp |
947 | + e0[2] = p[2]*emp |
948 | + #else: |
949 | + # e0[1] = dcmplx( rZero ) |
950 | + # e0[2] = dcmplx( rZero ) |
951 | + |
952 | + if nhel == 2: |
953 | + for j in range(4): |
954 | + for i in range(4): |
955 | + ft[(i,j)] = ep[i]*ep[j] |
956 | + elif nhel == -2: |
957 | + for j in range(4): |
958 | + for i in range(4): |
959 | + ft[(i,j)] = em[i]*em[j] |
960 | + elif tmass == 0: |
961 | + for j in range(4): |
962 | + for i in range(4): |
963 | + ft[(i,j)] = 0 |
964 | + elif nhel == 1: |
965 | + for j in range(4): |
966 | + for i in range(4): |
967 | + ft[(i,j)] = sqh*( ep[i]*e0[j] + e0[i]*ep[j] ) |
968 | + elif nhel == 0: |
969 | + for j in range(4): |
970 | + for i in range(4): |
971 | + ft[(i,j)] = sqs*( ep[i]*em[j] + em[i]*ep[j] + 2 *e0[i]*e0[j] ) |
972 | + elif nhel == -1: |
973 | + for j in range(4): |
974 | + for i in range(4): |
975 | + ft[(i,j)] = sqh*( em[i]*e0[j] + e0[i]*em[j] ) |
976 | + |
977 | + else: |
978 | + raise Exception, 'invalid helicity TXXXXXX' |
979 | + |
980 | + tc[0] = ft[(0,0)] |
981 | + tc[1] = ft[(0,1)] |
982 | + tc[2] = ft[(0,2)] |
983 | + tc[3] = ft[(0,3)] |
984 | + tc[4] = ft[(1,0)] |
985 | + tc[5] = ft[(1,1)] |
986 | + tc[6] = ft[(1,2)] |
987 | + tc[7] = ft[(1,3)] |
988 | + tc[8] = ft[(2,0)] |
989 | + tc[9] = ft[(2,1)] |
990 | + tc[10] = ft[(2,2)] |
991 | + tc[11] = ft[(2,3)] |
992 | + tc[12] = ft[(3,0)] |
993 | + tc[13] = ft[(3,1)] |
994 | + tc[14] = ft[(3,2)] |
995 | + tc[15] = ft[(3,3)] |
996 | + tc[16] = ft[(4,0)] |
997 | + tc[17] = ft[(5,0)] |
998 | + |
999 | + return tc |
1000 | + |
1001 | + |
1002 | |
1003 | |
1004 | === modified file 'bin/create_release.py' |
1005 | --- bin/create_release.py 2010-12-21 14:49:59 +0000 |
1006 | +++ bin/create_release.py 2011-01-27 02:53:44 +0000 |
1007 | @@ -51,12 +51,15 @@ |
1008 | import optparse |
1009 | import logging |
1010 | import logging.config |
1011 | +import time |
1012 | |
1013 | import os |
1014 | import os.path as path |
1015 | import shutil |
1016 | import subprocess |
1017 | |
1018 | +from datetime import date |
1019 | + |
1020 | # Get the parent directory (mg root) of the script real path (bin) |
1021 | # and add it to the current PYTHONPATH |
1022 | |
1023 | @@ -80,14 +83,25 @@ |
1024 | format="%(message)s") |
1025 | |
1026 | # 0. check that all modification are commited in this directory |
1027 | -# |
1028 | +# and that the date is up-to-date |
1029 | diff_result = subprocess.Popen(["bzr", "diff"], stdout=subprocess.PIPE).communicate()[0] |
1030 | |
1031 | if diff_result: |
1032 | - logging.error("Directory is not up-to-date. The release follow the last commited version.") |
1033 | + logging.warning("Directory is not up-to-date. The release follow the last commited version.") |
1034 | answer = raw_input('Do you want to continue anyway? (y/n)') |
1035 | if answer != 'y': |
1036 | exit() |
1037 | +release_date = date.fromtimestamp(time.time()) |
1038 | +for line in file('VERSION'): |
1039 | + if 'version' in line: |
1040 | + logging.info(line) |
1041 | + if 'date' in line: |
1042 | + if not str(release_date.year) in line or not str(release_date.month) in line or \ |
1043 | + not str(release_date.day) in line: |
1044 | + logging.warning("WARNING: The release time information is : %s" % line) |
1045 | + answer = raw_input('Do you want to continue anyway? (y/n)') |
1046 | + if answer != 'y': |
1047 | + exit() |
1048 | |
1049 | # 1. bzr branch the present directory to a new directory |
1050 | # MadGraph5_vVERSION |
1051 | |
1052 | === modified file 'bin/mg5' |
1053 | --- bin/mg5 2010-11-19 21:40:50 +0000 |
1054 | +++ bin/mg5 2011-01-27 02:53:44 +0000 |
1055 | @@ -19,21 +19,21 @@ |
1056 | and call immediately the command line interface scripts""" |
1057 | |
1058 | import sys |
1059 | - |
1060 | if not sys.version_info[0] == 2 or sys.version_info[1] < 6: |
1061 | sys.exit('MadGraph 5 works only with python 2.6 or later (but not python 3.X).\n\ |
1062 | Please upgrate your version of python.') |
1063 | |
1064 | +import os |
1065 | + |
1066 | # tab completion and history |
1067 | try: |
1068 | + import rlcompleter |
1069 | import readline |
1070 | except ImportError: |
1071 | print "For tab completion and history, install module readline." |
1072 | else: |
1073 | - import rlcompleter |
1074 | - readline.parse_and_bind("tab: complete") |
1075 | + readline.parse_and_bind("bind ^I rl_complete") |
1076 | try: |
1077 | - import os |
1078 | history_file = os.path.join(os.environ['HOME'], '.pythonhistory') |
1079 | readline.read_history_file(history_file) |
1080 | except: |
1081 | @@ -44,13 +44,12 @@ |
1082 | import logging.config |
1083 | |
1084 | import subprocess |
1085 | -import os.path as path |
1086 | |
1087 | # Get the parent directory (mg root) of the script real path (bin) |
1088 | # and add it to the current PYTHONPATH |
1089 | |
1090 | -root_path = path.split(path.dirname(path.realpath( __file__ )))[0] |
1091 | -sys.path.append(root_path) |
1092 | +root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0] |
1093 | +sys.path.insert(0, root_path) |
1094 | |
1095 | |
1096 | # Write out nice usage message if called with -h or --help |
1097 | @@ -71,17 +70,19 @@ |
1098 | args = '' |
1099 | |
1100 | # Check if optimize mode is (and should be) activated |
1101 | -if __debug__ and not options.debug: |
1102 | - if not os.path.exists(os.path.join(root_path, 'bin','create_release.py')): |
1103 | +if __debug__ and not options.debug and \ |
1104 | + (not os.path.exists(os.path.join(root_path, 'bin','create_release.py')) or options.web): |
1105 | subprocess.call([sys.executable] + ['-O'] + sys.argv) |
1106 | sys.exit() |
1107 | - else: |
1108 | + |
1109 | +if __debug__: |
1110 | print 'Running MG5 in debug mode' |
1111 | |
1112 | + |
1113 | # Set logging level according to the logging level given by options |
1114 | #logging.basicConfig(level=vars(logging)[options.logging]) |
1115 | try: |
1116 | - logging.config.fileConfig(path.join(root_path, 'madgraph', 'interface', '.mg5_logging.conf')) |
1117 | + logging.config.fileConfig(os.path.join(root_path, 'madgraph', 'interface', '.mg5_logging.conf')) |
1118 | logging.root.setLevel(eval('logging.' + options.logging)) |
1119 | logging.getLogger('madgraph').setLevel(eval('logging.' + options.logging)) |
1120 | except: |
1121 | |
1122 | === modified file 'madgraph/VERSION' |
1123 | --- madgraph/VERSION 2010-12-17 01:47:59 +0000 |
1124 | +++ madgraph/VERSION 2011-01-27 02:53:44 +0000 |
1125 | @@ -1,2 +1,2 @@ |
1126 | -version = 0.6.0 |
1127 | -date = 2010-12-17 |
1128 | +version = 0.6.2d |
1129 | +date = 2011-01-21 |
1130 | |
1131 | === modified file 'madgraph/core/base_objects.py' |
1132 | --- madgraph/core/base_objects.py 2010-12-15 21:03:07 +0000 |
1133 | +++ madgraph/core/base_objects.py 2011-01-27 02:53:44 +0000 |
1134 | @@ -341,16 +341,22 @@ |
1135 | if spin == 1: |
1136 | # Scalar |
1137 | return [ 0 ] |
1138 | - if spin == 2: |
1139 | + elif spin == 2: |
1140 | # Spinor |
1141 | return [ -1, 1 ] |
1142 | - if spin == 3 and self.get('mass').lower() == 'zero': |
1143 | + elif spin == 3 and self.get('mass').lower() == 'zero': |
1144 | # Massless vector |
1145 | return [ -1, 1 ] |
1146 | - if spin == 3: |
1147 | + elif spin == 3: |
1148 | # Massive vector |
1149 | return [ -1, 0, 1 ] |
1150 | - |
1151 | + elif spin == 5 and self.get('mass').lower() == 'zero': |
1152 | + # Massless tensor |
1153 | + return [-2, -1, 1, 2] |
1154 | + elif spin == 5: |
1155 | + # Massive tensor |
1156 | + return [-2, -1, 0, 1, 2] |
1157 | + |
1158 | raise self.PhysicsObjectError, \ |
1159 | "No helicity state assignment for spin %d particles" % spin |
1160 | |
1161 | |
1162 | === modified file 'madgraph/core/color_amp.py' |
1163 | --- madgraph/core/color_amp.py 2010-12-19 23:58:53 +0000 |
1164 | +++ madgraph/core/color_amp.py 2011-01-27 02:53:44 +0000 |
1165 | @@ -378,7 +378,7 @@ |
1166 | my_cf[0].append(color_algebra.K6Bar(indices[1], |
1167 | indices[2], |
1168 | indices[3])) |
1169 | - if indices[0] == 8: |
1170 | + if abs(indices[0]) == 8: |
1171 | # Add a T which contracts the octet to a |
1172 | # triplet-antitriplet pair |
1173 | my_cf[0].append(color_algebra.T(indices[1], |
1174 | @@ -450,12 +450,12 @@ |
1175 | res_dict[leg_num] = [0, 0] |
1176 | |
1177 | # Raise an error if external legs contain non supported repr |
1178 | - if leg_repr not in [1, 3, -3, 6, -6, 8]: |
1179 | + if abs(leg_repr) not in [1, 3, 6, 8]: |
1180 | raise ColorBasis.ColorBasisError, \ |
1181 | "Particle ID=%i has an unsupported color representation" % leg_repr |
1182 | |
1183 | # Build the fake indices replacements for octets |
1184 | - if leg_repr == 8: |
1185 | + if abs(leg_repr) == 8: |
1186 | fake_repl.append((leg_repr, leg_num, |
1187 | offset1 + leg_num, |
1188 | offset2 + leg_num)) |
1189 | |
1190 | === modified file 'madgraph/core/helas_objects.py' |
1191 | --- madgraph/core/helas_objects.py 2010-12-17 01:47:59 +0000 |
1192 | +++ madgraph/core/helas_objects.py 2011-01-27 02:53:44 +0000 |
1193 | @@ -443,16 +443,10 @@ |
1194 | # For boson, set state to intermediate |
1195 | self.set('state', 'intermediate') |
1196 | else: |
1197 | - # For fermion, set state to same as other fermion (in the right way) |
1198 | - mother_fermions = filter(lambda wf: wf.is_fermion(), |
1199 | - self.get('mothers')) |
1200 | - if len(mother_fermions) != 1: |
1201 | - raise self.PhysicsObjectError, \ |
1202 | - """Multifermion vertices not implemented. |
1203 | - Please decompose your vertex into 2-fermion |
1204 | - vertices to get fermion flow correct.""" |
1205 | + # For fermion, set state to same as other fermion (in the |
1206 | + # right way) |
1207 | + mother = self.find_mother_fermion() |
1208 | |
1209 | - mother = mother_fermions[0] |
1210 | if self.get('self_antipart'): |
1211 | self.set('state', mother.get_with_flow('state')) |
1212 | self.set('is_part', mother.get_with_flow('is_part')) |
1213 | @@ -499,12 +493,15 @@ |
1214 | # Use the HelasWavefunctionList helper function |
1215 | # Have to keep track of wavefunction number, since we might |
1216 | # need to add new wavefunctions. |
1217 | - wf_number = self.get('mothers').check_and_fix_fermion_flow(\ |
1218 | - wavefunctions, |
1219 | - diagram_wavefunctions, |
1220 | - external_wavefunctions, |
1221 | - self.get_with_flow('state'), |
1222 | - wf_number) |
1223 | + self.set('mothers', self.get('mothers').sort_by_pdg_codes(\ |
1224 | + self.get('pdg_codes'), self.get_anti_pdg_code())[0]) |
1225 | + |
1226 | + wf_number = self.get('mothers').\ |
1227 | + check_and_fix_fermion_flow(wavefunctions, |
1228 | + diagram_wavefunctions, |
1229 | + external_wavefunctions, |
1230 | + self, |
1231 | + wf_number) |
1232 | |
1233 | return self, wf_number |
1234 | |
1235 | @@ -550,22 +547,14 @@ |
1236 | flip_sign = found_majorana |
1237 | else: |
1238 | # Follow fermion flow up through tree |
1239 | - fermion_mother = filter(lambda wf: wf.is_fermion() and |
1240 | - wf.get_with_flow('state') == \ |
1241 | - self.get_with_flow('state'), |
1242 | - mothers) |
1243 | + fermion_mother = self.find_mother_fermion() |
1244 | |
1245 | - if len(fermion_mother) > 1: |
1246 | - raise self.PhysicsObjectError, \ |
1247 | - "6-fermion vertices not yet implemented" |
1248 | - if len(fermion_mother) == 0: |
1249 | - # Fermion flow already resolved for mothers |
1250 | - fermion_mother = filter(lambda wf: wf.is_fermion(), |
1251 | - mothers) |
1252 | - new_mother = fermion_mother[0] |
1253 | + if fermion_mother.get_with_flow('state') != \ |
1254 | + self.get_with_flow('state'): |
1255 | + new_mother = fermion_mother |
1256 | else: |
1257 | # Perform recursion by calling on mother |
1258 | - new_mother, wf_number = fermion_mother[0].\ |
1259 | + new_mother, wf_number = fermion_mother.\ |
1260 | check_majorana_and_flip_flow(\ |
1261 | found_majorana, |
1262 | wavefunctions, |
1263 | @@ -586,7 +575,7 @@ |
1264 | not self.get('self_antipart') |
1265 | |
1266 | # Replace old mother with new mother |
1267 | - mothers[mothers.index(fermion_mother[0])] = new_mother |
1268 | + mothers[mothers.index(fermion_mother)] = new_mother |
1269 | |
1270 | # Flip sign if needed |
1271 | if flip_flow or flip_sign: |
1272 | @@ -683,49 +672,40 @@ |
1273 | else: |
1274 | return [] |
1275 | |
1276 | - # Pick out fermion mothers |
1277 | - out_fermions = filter(lambda wf: wf.get_with_flow('state') == \ |
1278 | - 'outgoing', self.get('mothers')) |
1279 | - in_fermions = filter(lambda wf: wf.get_with_flow('state') == \ |
1280 | - 'incoming', self.get('mothers')) |
1281 | + # Pick out fermion mother |
1282 | + fermion_mother = None |
1283 | + if self.is_fermion(): |
1284 | + fermion_mother = self.find_mother_fermion() |
1285 | + |
1286 | + other_fermions = [wf for wf in self.get('mothers') if \ |
1287 | + wf.is_fermion() and wf != fermion_mother] |
1288 | + |
1289 | # Pick out bosons |
1290 | bosons = filter(lambda wf: wf.is_boson(), self.get('mothers')) |
1291 | |
1292 | - if self.is_boson() and len(in_fermions) + len(out_fermions) > 2\ |
1293 | - or self.is_fermion() and \ |
1294 | - len(in_fermions) + len(out_fermions) > 1: |
1295 | - raise self.PhysicsObjectError, \ |
1296 | - "Multifermion vertices not implemented" |
1297 | - |
1298 | fermion_number_list = [] |
1299 | |
1300 | - for boson in bosons: |
1301 | - # Bosons return a list [n1,n2,...] |
1302 | - fermion_number_list.extend(boson.get_fermion_order()) |
1303 | - |
1304 | if self.is_fermion(): |
1305 | # Fermions return the result N from their mother |
1306 | # and the list from bosons, so [N,[n1,n2,...]] |
1307 | - fermion_mother = filter(lambda wf: wf.is_fermion(), |
1308 | - self.get('mothers'))[0] |
1309 | mother_list = fermion_mother.get_fermion_order() |
1310 | fermion_number_list.extend(mother_list[1]) |
1311 | + |
1312 | + # If there are fermion line pairs, append them as |
1313 | + # [NI,NO,n1,n2,...] |
1314 | + fermion_numbers = [f.get_fermion_order() for f in other_fermions] |
1315 | + for iferm in range(0, len(fermion_numbers), 2): |
1316 | + fermion_number_list.append(fermion_numbers[iferm][0]) |
1317 | + fermion_number_list.append(fermion_numbers[iferm+1][0]) |
1318 | + fermion_number_list.extend(fermion_numbers[iferm][1]) |
1319 | + fermion_number_list.extend(fermion_numbers[iferm+1][1]) |
1320 | + |
1321 | + for boson in bosons: |
1322 | + # Bosons return a list [n1,n2,...] |
1323 | + fermion_number_list.extend(boson.get_fermion_order()) |
1324 | + |
1325 | + if self.is_fermion(): |
1326 | return [mother_list[0], fermion_number_list] |
1327 | - elif in_fermions and out_fermions: |
1328 | - # Combine the incoming and outgoing fermion numbers |
1329 | - # and add the bosonic numbers: [NI,NO,n1,n2,...] |
1330 | - in_list = in_fermions[0].get_fermion_order() |
1331 | - out_list = out_fermions[0].get_fermion_order() |
1332 | - # Combine to get [N1,N2,n1,n2,...] |
1333 | - fermion_number_list.append(in_list[0]) |
1334 | - fermion_number_list.append(out_list[0]) |
1335 | - fermion_number_list.extend(in_list[1]) |
1336 | - fermion_number_list.extend(out_list[1]) |
1337 | - elif len(in_fermions) != len(out_fermions): |
1338 | - raise self.PhysicsObjectError, \ |
1339 | - "Error: %d incoming fermions != %d outgoing fermions" % \ |
1340 | - (len(in_fermions), len(out_fermions)) |
1341 | - |
1342 | |
1343 | return fermion_number_list |
1344 | |
1345 | @@ -763,6 +743,18 @@ |
1346 | state_number[self.get('state')] * \ |
1347 | self.get('spin') |
1348 | |
1349 | + def find_mother_fermion(self): |
1350 | + """Return the fermion mother which is fermion flow connected to |
1351 | + this fermion""" |
1352 | + |
1353 | + if not self.is_fermion(): |
1354 | + return None |
1355 | + |
1356 | + part_number = self.find_outgoing_number() |
1357 | + mother_number = (part_number-1)//2*2 |
1358 | + |
1359 | + return HelasMatrixElement.sorted_mothers(self)[mother_number] |
1360 | + |
1361 | def find_outgoing_number(self): |
1362 | "Return the position of the resulting particles in the interactions" |
1363 | # First shot: just the index in the interaction |
1364 | @@ -800,7 +792,7 @@ |
1365 | |
1366 | # Check if we need to append a charge conjugation flag |
1367 | if self.needs_hermitian_conjugate(): |
1368 | - res.append('C') |
1369 | + res.append(self.get_conjugate_index()) |
1370 | |
1371 | return (tuple(res), self.get('lorentz')) |
1372 | |
1373 | @@ -815,6 +807,8 @@ |
1374 | if not mothers: |
1375 | return vertices |
1376 | |
1377 | + mothers = self.get('mothers') |
1378 | + |
1379 | # Add vertices for all mothers |
1380 | for mother in mothers: |
1381 | # This is where recursion happens |
1382 | @@ -890,7 +884,8 @@ |
1383 | """Returns two lists of vertices corresponding to the s- and |
1384 | t-channels that can be traced from this wavefunction, ordered |
1385 | from the outermost s-channel and in/down towards the highest |
1386 | - number initial state leg.""" |
1387 | + number initial state leg. mother_leg corresponds to self but with |
1388 | + correct leg number = min(final state mothers).""" |
1389 | |
1390 | schannels = base_objects.VertexList() |
1391 | tchannels = base_objects.VertexList() |
1392 | @@ -916,15 +911,7 @@ |
1393 | # leg of a decay process. Add vertex and continue stepping |
1394 | # down towards external initial state |
1395 | legs = base_objects.LegList() |
1396 | - |
1397 | - if ninitial == 1 or init_mothers[0].get('number_external') == 2 \ |
1398 | - or init_mothers[0].get('leg_state') == True: |
1399 | - # This is an s-channel or a leg on its way towards the |
1400 | - # final vertex |
1401 | - mothers = final_mothers + init_mothers |
1402 | - else: |
1403 | - # This is a t-channel leg going up towards leg number 1 |
1404 | - mothers = init_mothers + final_mothers |
1405 | + mothers = final_mothers + init_mothers |
1406 | |
1407 | for mother in mothers: |
1408 | legs.append(base_objects.Leg({ |
1409 | @@ -934,19 +921,20 @@ |
1410 | 'from_group': False |
1411 | })) |
1412 | |
1413 | - if ninitial == 1 or init_mothers[0].get('number_external') == 2 \ |
1414 | - or init_mothers[0].get('leg_state') == True: |
1415 | - # For decay processes or if this is an s-channel leg |
1416 | - # or we are going towards external leg 2, mother leg |
1417 | - # is one of the mothers |
1418 | + if init_mothers[0].get('number_external') == 1 and \ |
1419 | + not init_mothers[0].get('leg_state') and \ |
1420 | + ninitial > 1: |
1421 | + # If this is t-channel going towards external leg 1, |
1422 | + # mother_leg is resulting wf |
1423 | + legs.append(mother_leg) |
1424 | + else: |
1425 | + # For decay processes or if init_mother is an s-channel leg |
1426 | + # or we are going towards external leg 2, mother_leg |
1427 | + # is one of the mothers (placed next-to-last) |
1428 | legs.insert(-1, mother_leg) |
1429 | - # Also need to switch direction of the resulting s-channel |
1430 | + # Need to switch direction of the resulting s-channel |
1431 | legs[-1].set('id', init_mothers[0].get_anti_pdg_code()) |
1432 | - else: |
1433 | - # If the mother is going |
1434 | - # towards external leg 1, mother leg is resulting wf |
1435 | - legs.append(mother_leg) |
1436 | - |
1437 | + |
1438 | # Renumber resulting leg according to minimum leg number |
1439 | legs[-1].set('number', min([l.get('number') for l in legs[:-1]])) |
1440 | |
1441 | @@ -954,30 +942,32 @@ |
1442 | 'id': self.get('interaction_id'), |
1443 | 'legs': legs}) |
1444 | |
1445 | - # Add s- and t-channels from further down |
1446 | + # Add s- and t-channels from init_mother |
1447 | new_mother_leg = legs[-1] |
1448 | - if init_mothers[0].get('number_external') == 1: |
1449 | - # If we are going towards external leg 1, mother of |
1450 | - # next vertex is legs[0] |
1451 | - new_mother_leg = legs[0] |
1452 | + if init_mothers[0].get('number_external') == 1 and \ |
1453 | + not init_mothers[0].get('leg_state') and \ |
1454 | + ninitial > 1: |
1455 | + # Mother of next vertex is init_mothers[0] |
1456 | + # (next-to-last in legs) |
1457 | + new_mother_leg = legs[-2] |
1458 | |
1459 | mother_s, tchannels = \ |
1460 | init_mothers[0].get_s_and_t_channels(ninitial, |
1461 | new_mother_leg) |
1462 | - schannels.extend(mother_s) |
1463 | - |
1464 | if ninitial == 1 or init_mothers[0].get('leg_state') == True: |
1465 | - # This leg is s-channel |
1466 | + # This vertex is s-channel |
1467 | schannels.append(vertex) |
1468 | elif init_mothers[0].get('number_external') == 1: |
1469 | - # If we are going towards external leg 1, add to |
1470 | - # t-channels, at end |
1471 | + # If init_mothers is going towards external leg 1, add |
1472 | + # to t-channels, at end |
1473 | tchannels.append(vertex) |
1474 | else: |
1475 | - # If we are going towards external leg 2, add to |
1476 | + # If init_mothers is going towards external leg 2, add to |
1477 | # t-channels, at start |
1478 | tchannels.insert(0, vertex) |
1479 | |
1480 | + schannels.extend(mother_s) |
1481 | + |
1482 | elif len(init_mothers) == 2: |
1483 | # This is a t-channel junction. Start with the leg going |
1484 | # towards external particle 1, and then do external |
1485 | @@ -996,7 +986,7 @@ |
1486 | 'state': mother.get('leg_state'), |
1487 | 'from_group': False |
1488 | })) |
1489 | - legs.insert(-1, mother_leg) |
1490 | + legs.insert(0, mother_leg) |
1491 | |
1492 | # Renumber resulting leg according to minimum leg number |
1493 | legs[-1].set('number', min([l.get('number') for l in legs[:-1]])) |
1494 | @@ -1007,7 +997,7 @@ |
1495 | |
1496 | # Add s- and t-channels going down towards leg 1 |
1497 | mother_s, tchannels = \ |
1498 | - init_mothers1.get_s_and_t_channels(ninitial, legs[0]) |
1499 | + init_mothers1.get_s_and_t_channels(ninitial, legs[1]) |
1500 | schannels.extend(mother_s) |
1501 | |
1502 | # Add vertex |
1503 | @@ -1019,6 +1009,7 @@ |
1504 | schannels.extend(mother_s) |
1505 | tchannels.extend(mother_t) |
1506 | |
1507 | + |
1508 | return schannels, tchannels |
1509 | |
1510 | def get_conjugate_index(self): |
1511 | @@ -1039,6 +1030,18 @@ |
1512 | else: |
1513 | return () |
1514 | |
1515 | + def get_vertex_leg_numbers(self): |
1516 | + """Get a list of the number of legs in vertices in this diagram""" |
1517 | + |
1518 | + if not self.get('mothers'): |
1519 | + return [] |
1520 | + |
1521 | + vertex_leg_numbers = [len(self.get('mothers')) + 1] |
1522 | + for mother in self.get('mothers'): |
1523 | + vertex_leg_numbers.extend(mother.get_vertex_leg_numbers()) |
1524 | + |
1525 | + return vertex_leg_numbers |
1526 | + |
1527 | # Overloaded operators |
1528 | |
1529 | def __eq__(self, other): |
1530 | @@ -1100,7 +1103,7 @@ |
1531 | wavefunctions, |
1532 | diagram_wavefunctions, |
1533 | external_wavefunctions, |
1534 | - my_state, |
1535 | + my_wf, |
1536 | wf_number, |
1537 | force_flip_flow=False, |
1538 | number_to_wavefunctions=[]): |
1539 | @@ -1117,90 +1120,85 @@ |
1540 | wavefunction number. |
1541 | """ |
1542 | |
1543 | - # Clash is defined by whether the mothers have N(incoming) != |
1544 | - # N(outgoing) after this state has been subtracted |
1545 | - mother_states = [ wf.get_with_flow('state') for wf in \ |
1546 | - self ] |
1547 | - try: |
1548 | - mother_states.remove(my_state) |
1549 | - except ValueError: |
1550 | - pass |
1551 | - |
1552 | - Nincoming = len(filter(lambda state: state == 'incoming', |
1553 | - mother_states)) |
1554 | - Noutgoing = len(filter(lambda state: state == 'outgoing', |
1555 | - mother_states)) |
1556 | - |
1557 | - if Nincoming == Noutgoing: |
1558 | + # Clash is defined by whether any of the fermion lines are clashing |
1559 | + fermion_mother = None |
1560 | + |
1561 | + # Keep track of clashing fermion wavefunctions |
1562 | + clashes = [] |
1563 | + |
1564 | + # First check the fermion mother on the same fermion line |
1565 | + if my_wf and my_wf.is_fermion(): |
1566 | + fermion_mother = my_wf.find_mother_fermion() |
1567 | + if my_wf.get_with_flow('state') != \ |
1568 | + fermion_mother.get_with_flow('state'): |
1569 | + clashes.append([fermion_mother]) |
1570 | + |
1571 | + # Now check all other fermions |
1572 | + other_fermions = [w for w in self if \ |
1573 | + w.is_fermion() and w != fermion_mother] |
1574 | + |
1575 | + for iferm in range(0, len(other_fermions), 2): |
1576 | + if other_fermions[iferm].get_with_flow('state') == \ |
1577 | + other_fermions[iferm+1].get_with_flow('state'): |
1578 | + clashes.append([other_fermions[iferm], |
1579 | + other_fermions[iferm+1]]) |
1580 | + |
1581 | + if not clashes: |
1582 | return wf_number |
1583 | |
1584 | - fermion_mothers = filter(lambda wf: wf.is_fermion(), |
1585 | - self) |
1586 | - if my_state in ['incoming', 'outgoing'] and len(fermion_mothers) > 1\ |
1587 | - or len(fermion_mothers) > 2: |
1588 | - raise self.PhysicsObjectListError, \ |
1589 | - """Multifermion vertices not implemented. |
1590 | - Please decompose your vertex into 2-fermion |
1591 | - vertices to get fermion flow correct.""" |
1592 | - |
1593 | # If any of the mothers have negative fermionflow, we need to |
1594 | # take this mother first. |
1595 | - neg_fermionflow_mothers = [mother for mother in fermion_mothers if \ |
1596 | - mother.get('fermionflow') < 0] |
1597 | - |
1598 | - if not neg_fermionflow_mothers: |
1599 | - neg_fermionflow_mothers = fermion_mothers |
1600 | - |
1601 | - for mother in neg_fermionflow_mothers: |
1602 | - if Nincoming > Noutgoing and \ |
1603 | - mother.get_with_flow('state') == 'outgoing' or \ |
1604 | - Nincoming < Noutgoing and \ |
1605 | - mother.get_with_flow('state') == 'incoming' or \ |
1606 | - Nincoming == Noutgoing: |
1607 | - # This is not a problematic leg |
1608 | - continue |
1609 | - |
1610 | - # Call recursive function to check for Majorana fermions |
1611 | - # and flip fermionflow if found |
1612 | - |
1613 | - found_majorana = False |
1614 | - new_mother, wf_number = mother.check_majorana_and_flip_flow(\ |
1615 | - found_majorana, |
1616 | - wavefunctions, |
1617 | - diagram_wavefunctions, |
1618 | - external_wavefunctions, |
1619 | - wf_number, |
1620 | - force_flip_flow, |
1621 | - number_to_wavefunctions) |
1622 | - |
1623 | - # Replace old mother with new mother |
1624 | - self[self.index(mother)] = new_mother |
1625 | - |
1626 | - # Update counters |
1627 | - mother_states = [ wf.get_with_flow('state') for wf in \ |
1628 | - self ] |
1629 | - try: |
1630 | - mother_states.remove(my_state) |
1631 | - except ValueError: |
1632 | - pass |
1633 | - |
1634 | - Nincoming = len(filter(lambda state: state == 'incoming', |
1635 | - mother_states)) |
1636 | - Noutgoing = len(filter(lambda state: state == 'outgoing', |
1637 | - mother_states)) |
1638 | - |
1639 | - if Nincoming != Noutgoing: |
1640 | - # No Majorana fermion in any relevant legs - try again, |
1641 | - # but simply use the first relevant leg |
1642 | - force_flip_flow = True |
1643 | - wf_number = self.check_and_fix_fermion_flow(\ |
1644 | - wavefunctions, |
1645 | - diagram_wavefunctions, |
1646 | - external_wavefunctions, |
1647 | - my_state, |
1648 | - wf_number, |
1649 | - force_flip_flow, |
1650 | - number_to_wavefunctions) |
1651 | + for clash in clashes: |
1652 | + neg_fermionflow_mothers = [m for m in clash if \ |
1653 | + m.get('fermionflow') < 0] |
1654 | + |
1655 | + if not neg_fermionflow_mothers: |
1656 | + neg_fermionflow_mothers = clash |
1657 | + |
1658 | + for mother in neg_fermionflow_mothers: |
1659 | + |
1660 | + # Call recursive function to check for Majorana fermions |
1661 | + # and flip fermionflow if found |
1662 | + |
1663 | + found_majorana = False |
1664 | + state_before = mother.get_with_flow('state') |
1665 | + new_mother, wf_number = mother.check_majorana_and_flip_flow(\ |
1666 | + found_majorana, |
1667 | + wavefunctions, |
1668 | + diagram_wavefunctions, |
1669 | + external_wavefunctions, |
1670 | + wf_number, |
1671 | + force_flip_flow, |
1672 | + number_to_wavefunctions) |
1673 | + |
1674 | + if new_mother.get_with_flow('state') == state_before: |
1675 | + # Fermion flow was not flipped, try next mother |
1676 | + continue |
1677 | + |
1678 | + # Replace old mother with new mother |
1679 | + mother_index = self.index(mother) |
1680 | + self[self.index(mother)] = new_mother |
1681 | + clash_index = clash.index(mother) |
1682 | + clash[clash.index(mother)] = new_mother |
1683 | + |
1684 | + # Fermion flow was flipped, abort loop |
1685 | + break |
1686 | + |
1687 | + if len(clash) == 1 and clash[0].get_with_flow('state') != \ |
1688 | + my_wf.get_with_flow('state') or \ |
1689 | + len(clash) == 2 and clash[0].get_with_flow('state') == \ |
1690 | + clash[1].get_with_flow('state'): |
1691 | + # No Majorana fermion in any relevant legs - try again, |
1692 | + # but simply use the first relevant leg |
1693 | + force_flip_flow = True |
1694 | + wf_number = self.check_and_fix_fermion_flow(\ |
1695 | + wavefunctions, |
1696 | + diagram_wavefunctions, |
1697 | + external_wavefunctions, |
1698 | + my_wf, |
1699 | + wf_number, |
1700 | + force_flip_flow, |
1701 | + number_to_wavefunctions) |
1702 | |
1703 | return wf_number |
1704 | |
1705 | @@ -1231,13 +1229,16 @@ |
1706 | order of the pdg codes given. my_pdg_code is the pdg code of |
1707 | the daughter wavefunction (or 0 if daughter is amplitude).""" |
1708 | |
1709 | + if not pdg_codes: |
1710 | + return self, 0 |
1711 | + |
1712 | pdg_codes = copy.copy(pdg_codes) |
1713 | |
1714 | # Remove the argument wavefunction code from pdg_codes |
1715 | |
1716 | my_index = -1 |
1717 | if my_pdg_code: |
1718 | - # Find the last index instead of the first, to work with UFO models |
1719 | + # Remember index of my code |
1720 | my_index = pdg_codes.index(my_pdg_code) |
1721 | pdg_codes.pop(my_index) |
1722 | |
1723 | @@ -1262,7 +1263,7 @@ |
1724 | if mothers: |
1725 | raise base_objects.PhysicsObject.PhysicsObjectError |
1726 | |
1727 | - return sorted_mothers, my_index |
1728 | + return HelasWavefunctionList(sorted_mothers), my_index |
1729 | |
1730 | @staticmethod |
1731 | def extract_wavefunctions(mothers): |
1732 | @@ -1482,11 +1483,14 @@ |
1733 | HelasWavefunction.check_and_fix_fermion_flow. |
1734 | """ |
1735 | |
1736 | + self.set('mothers', self.get('mothers').sort_by_pdg_codes(\ |
1737 | + self.get('pdg_codes'), 0)[0]) |
1738 | + |
1739 | return self.get('mothers').check_and_fix_fermion_flow(\ |
1740 | wavefunctions, |
1741 | diagram_wavefunctions, |
1742 | external_wavefunctions, |
1743 | - "Nostate", |
1744 | + None, |
1745 | wf_number) |
1746 | |
1747 | |
1748 | @@ -1510,7 +1514,7 @@ |
1749 | |
1750 | # Check if we need to append a charge conjugation flag |
1751 | if self.needs_hermitian_conjugate(): |
1752 | - res.append('C') |
1753 | + res.append(self.get_conjugate_index()) |
1754 | |
1755 | return (tuple(res), self.get('lorentz')) |
1756 | |
1757 | @@ -1519,38 +1523,26 @@ |
1758 | to this amplitude""" |
1759 | |
1760 | # Pick out fermion mothers |
1761 | - out_fermions = filter(lambda wf: wf.get_with_flow('state') == \ |
1762 | - 'outgoing', self.get('mothers')) |
1763 | - in_fermions = filter(lambda wf: wf.get_with_flow('state') == \ |
1764 | - 'incoming', self.get('mothers')) |
1765 | + fermions = [wf for wf in self.get('mothers') if wf.is_fermion()] |
1766 | + |
1767 | # Pick out bosons |
1768 | bosons = filter(lambda wf: wf.is_boson(), self.get('mothers')) |
1769 | |
1770 | - if len(in_fermions) + len(out_fermions) > 2: |
1771 | - raise self.PhysicsObjectError, \ |
1772 | - "Multifermion vertices not implemented" |
1773 | - |
1774 | fermion_number_list = [] |
1775 | |
1776 | + # If there are fermion line pairs, append them as |
1777 | + # [NI,NO,n1,n2,...] |
1778 | + fermion_numbers = [f.get_fermion_order() for f in fermions] |
1779 | + for iferm in range(0, len(fermion_numbers), 2): |
1780 | + fermion_number_list.append(fermion_numbers[iferm][0]) |
1781 | + fermion_number_list.append(fermion_numbers[iferm+1][0]) |
1782 | + fermion_number_list.extend(fermion_numbers[iferm][1]) |
1783 | + fermion_number_list.extend(fermion_numbers[iferm+1][1]) |
1784 | + |
1785 | for boson in bosons: |
1786 | # Bosons return a list [n1,n2,...] |
1787 | fermion_number_list.extend(boson.get_fermion_order()) |
1788 | |
1789 | - if in_fermions and out_fermions: |
1790 | - # Fermions return the result N from their mother |
1791 | - # and the list from bosons, so [N,[n1,n2,...]] |
1792 | - in_list = in_fermions[0].get_fermion_order() |
1793 | - out_list = out_fermions[0].get_fermion_order() |
1794 | - # Combine to get [N1,N2,n1,n2,...] |
1795 | - fermion_number_list.append(in_list[0]) |
1796 | - fermion_number_list.append(out_list[0]) |
1797 | - fermion_number_list.extend(in_list[1]) |
1798 | - fermion_number_list.extend(out_list[1]) |
1799 | - elif len(in_fermions) != len(out_fermions): |
1800 | - raise self.PhysicsObjectError, \ |
1801 | - "Error: %d incoming fermions != %d outgoing fermions" % \ |
1802 | - (len(in_fermions), len(out_fermions)) |
1803 | - |
1804 | self['fermionfactor'] = self.sign_flips_to_order(fermion_number_list) |
1805 | |
1806 | def sign_flips_to_order(self, fermions): |
1807 | @@ -1671,17 +1663,13 @@ |
1808 | |
1809 | # Create vertex |
1810 | legs = base_objects.LegList() |
1811 | - for mother in [init_mothers1] + final_mothers + [init_mothers2]: |
1812 | + for mother in final_mothers + [init_mothers1] + [init_mothers2]: |
1813 | legs.append(base_objects.Leg({ |
1814 | 'id': mother.get_pdg_code(), |
1815 | 'number': mother.get('number_external'), |
1816 | 'state': mother.get('leg_state'), |
1817 | 'from_group': False |
1818 | })) |
1819 | - # Sort the legs |
1820 | - legs = base_objects.LegList(\ |
1821 | - sorted(legs[:-1], lambda l1, l2: l1.get('number') - \ |
1822 | - l2.get('number')) + legs[-1:]) |
1823 | # Renumber resulting leg according to minimum leg number |
1824 | legs[-1].set('number', min([l.get('number') for l in legs[:-1]])) |
1825 | |
1826 | @@ -1691,7 +1679,7 @@ |
1827 | |
1828 | # Add s- and t-channels going down towards leg 1 |
1829 | mother_s, tchannels = \ |
1830 | - init_mothers1.get_s_and_t_channels(ninitial, legs[0]) |
1831 | + init_mothers1.get_s_and_t_channels(ninitial, legs[-2]) |
1832 | |
1833 | schannels.extend(mother_s) |
1834 | |
1835 | @@ -1704,6 +1692,41 @@ |
1836 | schannels.extend(mother_s) |
1837 | tchannels.extend(mother_t) |
1838 | |
1839 | + # Split up multiparticle vertices using fake s-channel propagators |
1840 | + multischannels = [(i, v) for (i, v) in enumerate(schannels) \ |
1841 | + if len(v.get('legs')) > 3] |
1842 | + multitchannels = [(i, v) for (i, v) in enumerate(tchannels) \ |
1843 | + if len(v.get('legs')) > 3] |
1844 | + |
1845 | + for channel in multischannels + multitchannels: |
1846 | + newschannels = [] |
1847 | + vertex = channel[1] |
1848 | + while len(vertex.get('legs')) > 3: |
1849 | + # Pop the first two legs and create a new |
1850 | + # s-channel from them |
1851 | + popped_legs = \ |
1852 | + base_objects.LegList([vertex.get('legs').pop(0) \ |
1853 | + for i in [0,1]]) |
1854 | + popped_legs.append(base_objects.Leg({'id': 21, |
1855 | + 'number': min([l.get('number') for l in popped_legs]), |
1856 | + 'state': True, |
1857 | + 'from_group': False})) |
1858 | + |
1859 | + new_vertex = base_objects.Vertex({ |
1860 | + 'id': vertex.get('id'), |
1861 | + 'legs': popped_legs}) |
1862 | + |
1863 | + # Insert the new s-channel before this vertex |
1864 | + if channel in multischannels: |
1865 | + schannels.insert(channel[0], new_vertex) |
1866 | + else: |
1867 | + schannels.append(new_vertex) |
1868 | + legs = vertex.get('legs') |
1869 | + # Insert the new s-channel into vertex |
1870 | + legs.insert(0, copy.copy(popped_legs[-1])) |
1871 | + # Renumber resulting leg according to minimum leg number |
1872 | + legs[-1].set('number', min([l.get('number') for l in legs[:-1]])) |
1873 | + |
1874 | # Finally go through all vertices, sort the legs and replace |
1875 | # leg number with propagator number -1, -2, ... |
1876 | number_dict = {} |
1877 | @@ -1772,6 +1795,15 @@ |
1878 | else: |
1879 | return () |
1880 | |
1881 | + def get_vertex_leg_numbers(self): |
1882 | + """Get a list of the number of legs in vertices in this diagram""" |
1883 | + |
1884 | + vertex_leg_numbers = [len(self.get('mothers'))] |
1885 | + for mother in self.get('mothers'): |
1886 | + vertex_leg_numbers.extend(mother.get_vertex_leg_numbers()) |
1887 | + |
1888 | + return vertex_leg_numbers |
1889 | + |
1890 | def set_coupling_color_factor(self): |
1891 | """Check if there is a mismatch between order of fermions |
1892 | w.r.t. color""" |
1893 | @@ -1889,6 +1921,11 @@ |
1894 | |
1895 | return coupling_orders |
1896 | |
1897 | + def get_vertex_leg_numbers(self): |
1898 | + """Get a list of the number of legs in vertices in this diagram""" |
1899 | + |
1900 | + return self.get('amplitudes')[0].get_vertex_leg_numbers() |
1901 | + |
1902 | |
1903 | #=============================================================================== |
1904 | # HelasDiagramList |
1905 | @@ -2236,31 +2273,37 @@ |
1906 | helas_diagram.set('number', diagram_number) |
1907 | for number_wf_dict, color_list in zip(number_to_wavefunctions, |
1908 | color_lists): |
1909 | + |
1910 | + # Now generate HelasAmplitudes from the last vertex. |
1911 | + if lastvx.get('id'): |
1912 | + inter = model.get_interaction(lastvx.get('id')) |
1913 | + keys = sorted(inter.get('couplings').keys()) |
1914 | + pdg_codes = [p.get_pdg_code() for p in \ |
1915 | + inter.get('particles')] |
1916 | + else: |
1917 | + # Special case for decay chain - amplitude is just a |
1918 | + # placeholder for replaced wavefunction |
1919 | + inter = None |
1920 | + keys = [(0, 0)] |
1921 | + pdg_codes = None |
1922 | + |
1923 | # Find mothers for the amplitude |
1924 | legs = lastvx.get('legs') |
1925 | mothers = self.getmothers(legs, number_wf_dict, |
1926 | external_wavefunctions, |
1927 | wavefunctions, |
1928 | - diagram_wavefunctions) |
1929 | + diagram_wavefunctions).\ |
1930 | + sort_by_pdg_codes(pdg_codes, 0)[0] |
1931 | # Need to check for clashing fermion flow due to |
1932 | # Majorana fermions, and modify if necessary |
1933 | wf_number = mothers.check_and_fix_fermion_flow(wavefunctions, |
1934 | diagram_wavefunctions, |
1935 | external_wavefunctions, |
1936 | - "Nostate", |
1937 | + None, |
1938 | wf_number, |
1939 | False, |
1940 | number_to_wavefunctions) |
1941 | |
1942 | - # Now generate HelasAmplitudes from the last vertex. |
1943 | - if lastvx.get('id'): |
1944 | - inter = model.get('interaction_dict')[lastvx.get('id')] |
1945 | - keys = sorted(inter.get('couplings').keys()) |
1946 | - else: |
1947 | - # Special case for decay chain - amplitude is just a |
1948 | - # placeholder for replaced wavefunction |
1949 | - inter = None |
1950 | - keys = [(0, 0)] |
1951 | for i, coupl_key in enumerate(keys): |
1952 | amp = HelasAmplitude(lastvx, model) |
1953 | if inter: |
1954 | @@ -2340,7 +2383,8 @@ |
1955 | for wf in self.get_all_wavefunctions() + \ |
1956 | sum([d.get_all_wavefunctions() for d in \ |
1957 | decay_dict.values()], []): |
1958 | - if wf.get('self_antipart') and wf.is_fermion(): |
1959 | + if wf.get('fermionflow') < 0 or \ |
1960 | + wf.get('self_antipart') and wf.is_fermion(): |
1961 | got_majoranas = True |
1962 | |
1963 | # Now insert decays for all legs that have decays |
1964 | @@ -2533,13 +2577,6 @@ |
1965 | numbers[0] = numbers[0] + 1 |
1966 | wf.set('number', numbers[0]) |
1967 | |
1968 | - # External wavefunction offset for new wfs |
1969 | - incr_new = number_external - \ |
1970 | - decay_wfs[0].get('number_external') |
1971 | - for wf in decay_wfs: |
1972 | - wf.set('number_external', wf.get('number_external') + incr_new) |
1973 | - |
1974 | - |
1975 | # External wavefunction offset for old wfs, only the first |
1976 | # time this external wavefunction is replaced |
1977 | (nex, nin) = decay.get_nexternal_ninitial() |
1978 | @@ -2752,7 +2789,7 @@ |
1979 | for wf in final_decay_wfs: |
1980 | wf.set('onshell', True) |
1981 | |
1982 | - if len_decay == 1: |
1983 | + if len_decay == 1 and len(final_decay_wfs) == 1: |
1984 | # Can use simplified treatment, by just modifying old_wf |
1985 | self.replace_single_wavefunction(old_wf, |
1986 | final_decay_wfs[0]) |
1987 | @@ -3378,7 +3415,7 @@ |
1988 | def sorted_mothers(arg): |
1989 | """Gives a list of mother wavefunctions sorted according to |
1990 | 1. The order of the particles in the interaction |
1991 | - 2. Cyclic reordering of particles in same spin group (if boson) |
1992 | + 2. Cyclic reordering of particles in same spin group |
1993 | 3. Fermions ordered IOIOIO... according to the pairs in |
1994 | the interaction.""" |
1995 | |
1996 | @@ -3388,7 +3425,6 @@ |
1997 | if not arg.get('interaction_id'): |
1998 | return arg.get('mothers') |
1999 | |
2000 | - sorted_mothers = copy.copy(arg.get('mothers')) |
2001 | my_pdg_code = 0 |
2002 | my_spin = 0 |
2003 | if isinstance(arg, HelasWavefunction): |
2004 | @@ -3398,32 +3434,9 @@ |
2005 | sorted_mothers, my_index = arg.get('mothers').sort_by_pdg_codes(\ |
2006 | arg.get('pdg_codes'), my_pdg_code) |
2007 | |
2008 | - same_spin_mothers = [] |
2009 | - if isinstance(arg, HelasWavefunction) and \ |
2010 | - my_spin % 2 == 1: |
2011 | - # For bosons with same spin as this wf, need special treatment |
2012 | - same_spin_index = -1 |
2013 | - i=0 |
2014 | - while i < len(sorted_mothers): |
2015 | - if sorted_mothers[i].get_spin_state_number() == my_spin: |
2016 | - if same_spin_index < 0: |
2017 | - # Remember starting index for same spin states |
2018 | - same_spin_index = i |
2019 | - same_spin_mothers.append(sorted_mothers.pop(i)) |
2020 | - else: |
2021 | - i += 1 |
2022 | - |
2023 | - # Make cyclic reordering of mothers with same spin as this wf |
2024 | - if same_spin_mothers: |
2025 | - same_spin_mothers = same_spin_mothers[my_index - same_spin_index:] \ |
2026 | - + same_spin_mothers[:my_index - same_spin_index] |
2027 | - |
2028 | - # Insert same_spin_mothers in sorted_mothers |
2029 | - sorted_mothers = sorted_mothers[:same_spin_index] + \ |
2030 | - same_spin_mothers + sorted_mothers[same_spin_index:] |
2031 | # If fermion, partner is the corresponding fermion flow partner |
2032 | partner = None |
2033 | - if isinstance(arg, HelasWavefunction) and my_spin % 2 == 0: |
2034 | + if isinstance(arg, HelasWavefunction) and arg.is_fermion(): |
2035 | # Fermion case, just pick out the fermion flow partner |
2036 | if my_index % 2 == 0: |
2037 | # partner is after arg |
2038 | @@ -3432,10 +3445,15 @@ |
2039 | # partner is before arg |
2040 | partner_index = my_index - 1 |
2041 | partner = sorted_mothers.pop(partner_index) |
2042 | + # If partner is incoming, move to before arg |
2043 | + if partner.get_spin_state_number() > 0: |
2044 | + my_index = partner_index |
2045 | + else: |
2046 | + my_index = partner_index + 1 |
2047 | |
2048 | # Reorder fermions pairwise according to incoming/outgoing |
2049 | for i in range(0, len(sorted_mothers), 2): |
2050 | - if sorted_mothers[i].get_spin_state_number() % 2 == 0: |
2051 | + if sorted_mothers[i].is_fermion(): |
2052 | # This is a fermion, order between this fermion and its brother |
2053 | if sorted_mothers[i].get_spin_state_number() > 0 and \ |
2054 | sorted_mothers[i + 1].get_spin_state_number() < 0: |
2055 | @@ -3447,12 +3465,6 @@ |
2056 | sorted_mothers[i + 1].get_spin_state_number() > 0: |
2057 | # This is the right order |
2058 | pass |
2059 | - else: |
2060 | - # Two incoming or two outgoing in a row - not good! |
2061 | - raise base_objects.PhysicsObject.PhysicsObjectError, \ |
2062 | - "Two incoming or outgoing fermions in a row: %i, %i" % \ |
2063 | - (sorted_mothers[i].get_spin_state_number(), |
2064 | - sorted_mothers[i+1].get_spin_state_number()) |
2065 | else: |
2066 | # No more fermions in sorted_mothers |
2067 | break |
2068 | @@ -3652,8 +3664,11 @@ |
2069 | me.get('processes')[0].\ |
2070 | get_initial_ids()[0] == fs_id, |
2071 | decay_elements[index])) |
2072 | - else: |
2073 | - # All decays for this particle type are used |
2074 | + |
2075 | + if len(fs_legs) != len(decay_elements) or not chains[0]: |
2076 | + # In second case, or no chains are found |
2077 | + # (e.g. because the order of decays is reversed), |
2078 | + # all decays for this particle type are used |
2079 | chain = sum([filter(lambda me: \ |
2080 | me.get('processes')[0].\ |
2081 | get_initial_ids()[0] == fs_id, |
2082 | |
2083 | === modified file 'madgraph/interface/cmd_interface.py' |
2084 | --- madgraph/interface/cmd_interface.py 2010-12-18 22:39:25 +0000 |
2085 | +++ madgraph/interface/cmd_interface.py 2011-01-27 02:53:44 +0000 |
2086 | @@ -197,6 +197,13 @@ |
2087 | if '#' in line: |
2088 | line = line.split('#')[0] |
2089 | |
2090 | + # Deal with line splitting |
2091 | + if ';' in line: |
2092 | + for subline in line.split(';'): |
2093 | + stop = self.onecmd(subline) |
2094 | + stop = self.postcmd(stop, subline) |
2095 | + return '' |
2096 | + |
2097 | # execute the line command |
2098 | return line |
2099 | |
2100 | @@ -1304,7 +1311,8 @@ |
2101 | |
2102 | # Options and formats available |
2103 | _display_opts = ['particles', 'interactions', 'processes', 'diagrams', |
2104 | - 'multiparticles', 'couplings', 'lorentz', 'checks'] |
2105 | + 'multiparticles', 'couplings', 'lorentz', 'checks', |
2106 | + 'parameters'] |
2107 | _add_opts = ['process'] |
2108 | _save_opts = ['model', 'processes'] |
2109 | _tutorial_opts = ['start', 'stop'] |
2110 | @@ -1510,7 +1518,26 @@ |
2111 | print "Interactions %s has the following property:" % arg |
2112 | print self._curr_model['interactions'][int(arg)-1] |
2113 | |
2114 | - |
2115 | + elif args[0] == 'parameters' and len(args) == 1: |
2116 | + text = "Current model contains %i parameters\n" % \ |
2117 | + sum([len(part) for part in |
2118 | + self._curr_model['parameters'].values()]) |
2119 | + |
2120 | + for key, item in self._curr_model['parameters'].items(): |
2121 | + text += '\nparameter type: %s\n' % str(key) |
2122 | + for value in item: |
2123 | + if hasattr(value, 'expr'): |
2124 | + if value.value is not None: |
2125 | + text+= ' %s = %s = %s\n' % (value.name, value.expr ,value.value) |
2126 | + else: |
2127 | + text+= ' %s = %s\n' % (value.name, value.expr) |
2128 | + else: |
2129 | + if value.value is not None: |
2130 | + text+= ' %s = %s\n' % (value.name, value.value) |
2131 | + else: |
2132 | + text+= ' %s \n' % (value.name) |
2133 | + pydoc.pager(text) |
2134 | + |
2135 | elif args[0] == 'processes': |
2136 | for amp in self._curr_amps: |
2137 | print amp.nice_string_processes() |
2138 | |
2139 | === modified file 'madgraph/iolibs/export_v4.py' |
2140 | --- madgraph/iolibs/export_v4.py 2010-12-20 05:04:27 +0000 |
2141 | +++ madgraph/iolibs/export_v4.py 2011-01-27 02:53:44 +0000 |
2142 | @@ -197,6 +197,11 @@ |
2143 | """Finalize ME v4 directory by creating jpeg diagrams, html |
2144 | pages,proc_card_mg5.dat and madevent.tar.gz.""" |
2145 | |
2146 | + if not misc.which('f77'): |
2147 | + logger.info('Change makefiles to use gfortran') |
2148 | + subprocess.call(['python','./bin/Passto_gfortran.py'], cwd=dir_path, \ |
2149 | + stdout = open(os.devnull, 'w')) |
2150 | + |
2151 | old_pos = os.getcwd() |
2152 | os.chdir(os.path.join(dir_path, 'SubProcesses')) |
2153 | P_dir_list = [proc for proc in os.listdir('.') if os.path.isdir(proc) and \ |
2154 | @@ -408,6 +413,10 @@ |
2155 | matrix_element) |
2156 | replace_dict['helas_calls'] = "\n".join(helas_calls) |
2157 | |
2158 | + # Extract amp2 lines |
2159 | + amp2_lines = get_amp2_lines(matrix_element) |
2160 | + replace_dict['amp2_lines'] = '\n'.join(amp2_lines) |
2161 | + |
2162 | # Extract JAMP lines |
2163 | jamp_lines = get_JAMP_lines(matrix_element) |
2164 | replace_dict['jamp_lines'] = '\n'.join(jamp_lines) |
2165 | @@ -495,18 +504,22 @@ |
2166 | |
2167 | s_and_t_channels = [] |
2168 | |
2169 | - for idiag, diag in enumerate(matrix_element.get('base_amplitude').\ |
2170 | - get('diagrams')): |
2171 | - if any([len(vert.get('legs')) > 3 for vert in diag.get('vertices')]): |
2172 | + base_diagrams = matrix_element.get('base_amplitude').get('diagrams') |
2173 | + minvert = min([max([len(vert.get('legs')) for vert in \ |
2174 | + diag.get('vertices')]) for diag in base_diagrams]) |
2175 | + |
2176 | + for idiag, diag in enumerate(base_diagrams): |
2177 | + if any([len(vert.get('legs')) > minvert for vert in |
2178 | + diag.get('vertices')]): |
2179 | # Only 3-vertices allowed in configs.inc |
2180 | continue |
2181 | iconfig = iconfig + 1 |
2182 | helas_diag = matrix_element.get('diagrams')[idiag] |
2183 | - amp_number = helas_diag.get('amplitudes')[0].get('number') |
2184 | - lines.append("# Diagram %d, Amplitude %d" % \ |
2185 | - (helas_diag.get('number'), amp_number)) |
2186 | + lines.append("# Diagram %d" % \ |
2187 | + (helas_diag.get('number'))) |
2188 | # Correspondance between the config and the amplitudes |
2189 | - lines.append("data mapconfig(%d)/%d/" % (iconfig, amp_number)) |
2190 | + lines.append("data mapconfig(%d)/%d/" % (iconfig, |
2191 | + helas_diag.get('number'))) |
2192 | |
2193 | # Need to reorganize the topology so that we start with all |
2194 | # final state external particles and work our way inwards |
2195 | @@ -635,7 +648,8 @@ |
2196 | repr_dict = {} |
2197 | for l in legs: |
2198 | repr_dict[l.get('number')] = \ |
2199 | - proc.get('model').get_particle(l.get('id')).get_color() |
2200 | + proc.get('model').get_particle(l.get('id')).get_color()\ |
2201 | + * (-1)**(1+l.get('state')) |
2202 | # Get the list of color flows |
2203 | color_flow_list = \ |
2204 | matrix_element.get('color_basis').color_flow_decomposition(repr_dict, |
2205 | @@ -804,19 +818,25 @@ |
2206 | for iconf, configs in enumerate(s_and_t_channels): |
2207 | for vertex in configs[0] + configs[1][:-1]: |
2208 | leg = vertex.get('legs')[-1] |
2209 | - particle = particle_dict[leg.get('id')] |
2210 | - # Get mass |
2211 | - if particle.get('mass').lower() == 'zero': |
2212 | - mass = particle.get('mass') |
2213 | - else: |
2214 | - mass = "abs(%s)" % particle.get('mass') |
2215 | - # Get width |
2216 | - if particle.get('width').lower() == 'zero': |
2217 | - width = particle.get('width') |
2218 | - else: |
2219 | - width = "abs(%s)" % particle.get('width') |
2220 | + if leg.get('id') == 21 and 21 not in particle_dict: |
2221 | + # Fake propagator used in multiparticle vertices |
2222 | + mass = 'zero' |
2223 | + width = 'zero' |
2224 | + pow_part = 0 |
2225 | + else: |
2226 | + particle = particle_dict[leg.get('id')] |
2227 | + # Get mass |
2228 | + if particle.get('mass').lower() == 'zero': |
2229 | + mass = particle.get('mass') |
2230 | + else: |
2231 | + mass = "abs(%s)" % particle.get('mass') |
2232 | + # Get width |
2233 | + if particle.get('width').lower() == 'zero': |
2234 | + width = particle.get('width') |
2235 | + else: |
2236 | + width = "abs(%s)" % particle.get('width') |
2237 | |
2238 | - pow_part = 1 + int(particle.is_boson()) |
2239 | + pow_part = 1 + int(particle.is_boson()) |
2240 | |
2241 | lines.append("pmass(%d,%d) = %s" % \ |
2242 | (leg.get('number'), iconf + 1, mass)) |
2243 | @@ -951,6 +971,18 @@ |
2244 | fortran_model, |
2245 | len(matrix_element.get_all_amplitudes())) |
2246 | |
2247 | + # Generate diagrams |
2248 | + filename = "matrix.ps" |
2249 | + plot = draw.MultiEpsDiagramDrawer(matrix_element.get('base_amplitude').\ |
2250 | + get('diagrams'), |
2251 | + filename, |
2252 | + model=matrix_element.get('processes')[0].\ |
2253 | + get('model'), |
2254 | + amplitude='') |
2255 | + logger.info("Generating Feynman diagrams for " + \ |
2256 | + matrix_element.get('processes')[0].nice_string()) |
2257 | + plot.draw() |
2258 | + |
2259 | linkfiles = ['check_sa.f', 'coupl.inc', 'makefile'] |
2260 | |
2261 | |
2262 | @@ -1263,6 +1295,29 @@ |
2263 | |
2264 | return ret_list |
2265 | |
2266 | +def get_amp2_lines(matrix_element): |
2267 | + """Return the amp2(i) = sum(amp for diag(i))^2 lines""" |
2268 | + |
2269 | + nexternal, ninitial = matrix_element.get_nexternal_ninitial() |
2270 | + # Get minimum legs in a vertex |
2271 | + minvert = min([max(diag.get_vertex_leg_numbers()) for diag in \ |
2272 | + matrix_element.get('diagrams')]) |
2273 | + |
2274 | + ret_lines = [] |
2275 | + for idiag, diag in enumerate(matrix_element.get('diagrams')): |
2276 | + # Ignore any diagrams with 4-particle vertices. |
2277 | + if max(diag.get_vertex_leg_numbers()) > minvert: |
2278 | + continue |
2279 | + # Now write out the expression for AMP2, meaning the sum of |
2280 | + # squared amplitudes belonging to the same diagram |
2281 | + line = "AMP2(%(num)d)=AMP2(%(num)d)+" % {"num": (idiag + 1)} |
2282 | + line += "+".join(["AMP(%(num)d)*dconjg(AMP(%(num)d))" % \ |
2283 | + {"num": a.get('number')} for a in \ |
2284 | + diag.get('amplitudes')]) |
2285 | + ret_lines.append(line) |
2286 | + |
2287 | + return ret_lines |
2288 | + |
2289 | def get_JAMP_lines(matrix_element): |
2290 | """Return the JAMP = sum(fermionfactor * AMP(i)) lines""" |
2291 | |
2292 | @@ -1586,6 +1641,7 @@ |
2293 | one_mass = particle.get('mass') |
2294 | if one_mass.lower() != 'zero': |
2295 | masses.add(one_mass) |
2296 | + |
2297 | # find width |
2298 | one_width = particle.get('width') |
2299 | if one_width.lower() != 'zero': |
2300 | |
2301 | === modified file 'madgraph/iolibs/helas_call_writers.py' |
2302 | --- madgraph/iolibs/helas_call_writers.py 2010-12-15 21:03:07 +0000 |
2303 | +++ madgraph/iolibs/helas_call_writers.py 2011-01-27 02:53:44 +0000 |
2304 | @@ -227,8 +227,8 @@ |
2305 | key = ((3, 3, 5, 3), 'A') |
2306 | call = lambda wf: \ |
2307 | "CALL UVVAXX(W(1,%d),W(1,%d),%s,zero,zero,zero,W(1,%d))" % \ |
2308 | - (wf.get('mothers')[0].get('number'), |
2309 | - wf.get('mothers')[1].get('number'), |
2310 | + (FortranHelasCallWriter.sorted_mothers(wf)[0].get('number'), |
2311 | + FortranHelasCallWriter.sorted_mothers(wf)[1].get('number'), |
2312 | wf.get('coupling'), |
2313 | wf.get('number')) |
2314 | self.add_wavefunction(key, call) |
2315 | @@ -236,8 +236,8 @@ |
2316 | key = ((3, 5, 3, 1), 'A') |
2317 | call = lambda wf: \ |
2318 | "CALL JVTAXX(W(1,%d),W(1,%d),%s,zero,zero,W(1,%d))" % \ |
2319 | - (wf.get('mothers')[0].get('number'), |
2320 | - wf.get('mothers')[1].get('number'), |
2321 | + (FortranHelasCallWriter.sorted_mothers(wf)[0].get('number'), |
2322 | + FortranHelasCallWriter.sorted_mothers(wf)[1].get('number'), |
2323 | wf.get('coupling'), |
2324 | wf.get('number')) |
2325 | self.add_wavefunction(key, call) |
2326 | @@ -245,9 +245,9 @@ |
2327 | key = ((3, 3, 5), 'A') |
2328 | call = lambda amp: \ |
2329 | "CALL VVTAXX(W(1,%d),W(1,%d),W(1,%d),%s,zero,AMP(%d))" % \ |
2330 | - (amp.get('mothers')[0].get('number'), |
2331 | - amp.get('mothers')[1].get('number'), |
2332 | - amp.get('mothers')[2].get('number'), |
2333 | + (FortranHelasCallWriter.sorted_mothers(amp)[0].get('number'), |
2334 | + FortranHelasCallWriter.sorted_mothers(amp)[1].get('number'), |
2335 | + FortranHelasCallWriter.sorted_mothers(amp)[2].get('number'), |
2336 | amp.get('coupling'), |
2337 | amp.get('number')) |
2338 | self.add_amplitude(key, call) |
2339 | @@ -257,56 +257,93 @@ |
2340 | key = ((3, 3, 3, 3, 1), 'gggg3') |
2341 | call = lambda wf: \ |
2342 | "CALL JGGGXX(W(1,%d),W(1,%d),W(1,%d),%s,W(1,%d))" % \ |
2343 | - (wf.get('mothers')[1].get('number'), |
2344 | - wf.get('mothers')[0].get('number'), |
2345 | - wf.get('mothers')[2].get('number'), |
2346 | + (FortranHelasCallWriter.sorted_mothers(wf)[1].get('number'), |
2347 | + FortranHelasCallWriter.sorted_mothers(wf)[0].get('number'), |
2348 | + FortranHelasCallWriter.sorted_mothers(wf)[2].get('number'), |
2349 | wf.get('coupling'), |
2350 | wf.get('number')) |
2351 | self.add_wavefunction(key, call) |
2352 | key = ((3, 3, 3, 3), 'gggg1') |
2353 | call = lambda amp: \ |
2354 | "CALL GGGGXX(W(1,%d),W(1,%d),W(1,%d),W(1,%d),%s,AMP(%d))" % \ |
2355 | - (amp.get('mothers')[0].get('number'), |
2356 | - amp.get('mothers')[1].get('number'), |
2357 | - amp.get('mothers')[2].get('number'), |
2358 | - amp.get('mothers')[3].get('number'), |
2359 | + (FortranHelasCallWriter.sorted_mothers(amp)[0].get('number'), |
2360 | + FortranHelasCallWriter.sorted_mothers(amp)[1].get('number'), |
2361 | + FortranHelasCallWriter.sorted_mothers(amp)[2].get('number'), |
2362 | + FortranHelasCallWriter.sorted_mothers(amp)[3].get('number'), |
2363 | amp.get('coupling'), |
2364 | amp.get('number')) |
2365 | self.add_amplitude(key, call) |
2366 | key = ((3, 3, 3, 3, 1), 'gggg2') |
2367 | call = lambda wf: \ |
2368 | "CALL JGGGXX(W(1,%d),W(1,%d),W(1,%d),%s,W(1,%d))" % \ |
2369 | - (wf.get('mothers')[0].get('number'), |
2370 | - wf.get('mothers')[2].get('number'), |
2371 | - wf.get('mothers')[1].get('number'), |
2372 | + (FortranHelasCallWriter.sorted_mothers(wf)[0].get('number'), |
2373 | + FortranHelasCallWriter.sorted_mothers(wf)[2].get('number'), |
2374 | + FortranHelasCallWriter.sorted_mothers(wf)[1].get('number'), |
2375 | wf.get('coupling'), |
2376 | wf.get('number')) |
2377 | self.add_wavefunction(key, call) |
2378 | key = ((3, 3, 3, 3), 'gggg2') |
2379 | call = lambda amp: \ |
2380 | "CALL GGGGXX(W(1,%d),W(1,%d),W(1,%d),W(1,%d),%s,AMP(%d))" % \ |
2381 | - (amp.get('mothers')[2].get('number'), |
2382 | - amp.get('mothers')[0].get('number'), |
2383 | - amp.get('mothers')[1].get('number'), |
2384 | - amp.get('mothers')[3].get('number'), |
2385 | + (FortranHelasCallWriter.sorted_mothers(amp)[2].get('number'), |
2386 | + FortranHelasCallWriter.sorted_mothers(amp)[0].get('number'), |
2387 | + FortranHelasCallWriter.sorted_mothers(amp)[1].get('number'), |
2388 | + FortranHelasCallWriter.sorted_mothers(amp)[3].get('number'), |
2389 | amp.get('coupling'), |
2390 | amp.get('number')) |
2391 | self.add_amplitude(key, call) |
2392 | key = ((3, 3, 3, 3, 1), 'gggg1') |
2393 | call = lambda wf: \ |
2394 | "CALL JGGGXX(W(1,%d),W(1,%d),W(1,%d),%s,W(1,%d))" % \ |
2395 | - (wf.get('mothers')[2].get('number'), |
2396 | - wf.get('mothers')[1].get('number'), |
2397 | - wf.get('mothers')[0].get('number'), |
2398 | + (FortranHelasCallWriter.sorted_mothers(wf)[2].get('number'), |
2399 | + FortranHelasCallWriter.sorted_mothers(wf)[1].get('number'), |
2400 | + FortranHelasCallWriter.sorted_mothers(wf)[0].get('number'), |
2401 | wf.get('coupling'), |
2402 | wf.get('number')) |
2403 | self.add_wavefunction(key, call) |
2404 | key = ((3, 3, 3, 3), 'gggg3') |
2405 | call = lambda amp: \ |
2406 | "CALL GGGGXX(W(1,%d),W(1,%d),W(1,%d),W(1,%d),%s,AMP(%d))" % \ |
2407 | - (amp.get('mothers')[1].get('number'), |
2408 | + (FortranHelasCallWriter.sorted_mothers(amp)[1].get('number'), |
2409 | + FortranHelasCallWriter.sorted_mothers(amp)[2].get('number'), |
2410 | + FortranHelasCallWriter.sorted_mothers(amp)[0].get('number'), |
2411 | + FortranHelasCallWriter.sorted_mothers(amp)[3].get('number'), |
2412 | + amp.get('coupling'), |
2413 | + amp.get('number')) |
2414 | + self.add_amplitude(key, call) |
2415 | + |
2416 | + # HEFT VVVS calls |
2417 | + |
2418 | + key = ((1, 3, 3, 3, 3), '') |
2419 | + call = lambda wf: \ |
2420 | + "CALL JVVSXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \ |
2421 | + (wf.get('mothers')[0].get('number'), |
2422 | + wf.get('mothers')[1].get('number'), |
2423 | + wf.get('mothers')[2].get('number'), |
2424 | + wf.get('coupling'), |
2425 | + wf.get('mass'), |
2426 | + wf.get('width'), |
2427 | + wf.get('number')) |
2428 | + self.add_wavefunction(key, call) |
2429 | + |
2430 | + key = ((3, 3, 3, 1, 4), '') |
2431 | + call = lambda wf: \ |
2432 | + "CALL HVVVXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \ |
2433 | + (wf.get('mothers')[0].get('number'), |
2434 | + wf.get('mothers')[1].get('number'), |
2435 | + wf.get('mothers')[2].get('number'), |
2436 | + wf.get('coupling'), |
2437 | + wf.get('mass'), |
2438 | + wf.get('width'), |
2439 | + wf.get('number')) |
2440 | + self.add_wavefunction(key, call) |
2441 | + |
2442 | + key = ((1, 3, 3, 3), '') |
2443 | + call = lambda amp: \ |
2444 | + "CALL VVVSXX(W(1,%d),W(1,%d),W(1,%d),W(1,%d),DUM1,%s,AMP(%d))" % \ |
2445 | + (amp.get('mothers')[0].get('number'), |
2446 | + amp.get('mothers')[1].get('number'), |
2447 | amp.get('mothers')[2].get('number'), |
2448 | - amp.get('mothers')[0].get('number'), |
2449 | amp.get('mothers')[3].get('number'), |
2450 | amp.get('coupling'), |
2451 | amp.get('number')) |
2452 | @@ -502,7 +539,7 @@ |
2453 | if argument.needs_hermitian_conjugate(): |
2454 | call = call + 'C' |
2455 | |
2456 | - assert len(call) < 11, "Call to Helas routine %s should be maximum 6 chars" \ |
2457 | + assert len(call) < 12, "Call to Helas routine %s should be maximum 6 chars" \ |
2458 | % call[5:] |
2459 | |
2460 | # Fill out with X up to 6 positions |
2461 | @@ -552,9 +589,9 @@ |
2462 | # Create call for wavefunction |
2463 | if len(argument.get('mothers')) == 2: |
2464 | call_function = lambda wf: call % \ |
2465 | - (wf.get('mothers')[0].\ |
2466 | + (FortranHelasCallWriter.sorted_mothers(wf)[0].\ |
2467 | get('number'), |
2468 | - wf.get('mothers')[1].\ |
2469 | + FortranHelasCallWriter.sorted_mothers(wf)[1].\ |
2470 | get('number'), |
2471 | wf.get_with_flow('coupling'), |
2472 | wf.get('mass'), |
2473 | @@ -562,11 +599,11 @@ |
2474 | wf.get('number')) |
2475 | else: |
2476 | call_function = lambda wf: call % \ |
2477 | - (wf.get('mothers')[0].\ |
2478 | - get('number'), |
2479 | - wf.get('mothers')[1].\ |
2480 | - get('number'), |
2481 | - wf.get('mothers')[2].\ |
2482 | + (FortranHelasCallWriter.sorted_mothers(wf)[0].\ |
2483 | + get('number'), |
2484 | + FortranHelasCallWriter.sorted_mothers(wf)[1].\ |
2485 | + get('number'), |
2486 | + FortranHelasCallWriter.sorted_mothers(wf)[2].\ |
2487 | get('number'), |
2488 | wf.get_with_flow('coupling'), |
2489 | wf.get('mass'), |
2490 | @@ -576,24 +613,24 @@ |
2491 | # Create call for amplitude |
2492 | if len(argument.get('mothers')) == 3: |
2493 | call_function = lambda amp: call % \ |
2494 | - (amp.get('mothers')[0].\ |
2495 | - get('number'), |
2496 | - amp.get('mothers')[1].\ |
2497 | - get('number'), |
2498 | - amp.get('mothers')[2].\ |
2499 | + (FortranHelasCallWriter.sorted_mothers(amp)[0].\ |
2500 | + get('number'), |
2501 | + FortranHelasCallWriter.sorted_mothers(amp)[1].\ |
2502 | + get('number'), |
2503 | + FortranHelasCallWriter.sorted_mothers(amp)[2].\ |
2504 | get('number'), |
2505 | |
2506 | amp.get('coupling'), |
2507 | amp.get('number')) |
2508 | else: |
2509 | call_function = lambda amp: call % \ |
2510 | - (amp.get('mothers')[0].\ |
2511 | - get('number'), |
2512 | - amp.get('mothers')[1].\ |
2513 | - get('number'), |
2514 | - amp.get('mothers')[2].\ |
2515 | - get('number'), |
2516 | - amp.get('mothers')[3].\ |
2517 | + (FortranHelasCallWriter.sorted_mothers(amp)[0].\ |
2518 | + get('number'), |
2519 | + FortranHelasCallWriter.sorted_mothers(amp)[1].\ |
2520 | + get('number'), |
2521 | + FortranHelasCallWriter.sorted_mothers(amp)[2].\ |
2522 | + get('number'), |
2523 | + FortranHelasCallWriter.sorted_mothers(amp)[3].\ |
2524 | get('number'), |
2525 | amp.get('coupling'), |
2526 | amp.get('number')) |
2527 | @@ -625,6 +662,95 @@ |
2528 | FortranHelasCallWriter.sort_amp[l2] - \ |
2529 | FortranHelasCallWriter.sort_amp[l1])) |
2530 | |
2531 | + @staticmethod |
2532 | + def sorted_mothers(arg): |
2533 | + """Gives a list of mother wavefunctions sorted according to |
2534 | + 1. The order of the particles in the interaction |
2535 | + 2. Cyclic reordering of particles in same spin group |
2536 | + 3. Fermions ordered IOIOIO... according to the pairs in |
2537 | + the interaction.""" |
2538 | + |
2539 | + assert isinstance(arg, (helas_objects.HelasWavefunction, helas_objects.HelasAmplitude)), \ |
2540 | + "%s is not a valid HelasWavefunction or HelasAmplitude" % repr(arg) |
2541 | + |
2542 | + if not arg.get('interaction_id'): |
2543 | + return arg.get('mothers') |
2544 | + my_pdg_code = 0 |
2545 | + my_spin = 0 |
2546 | + if isinstance(arg, helas_objects.HelasWavefunction): |
2547 | + my_pdg_code = arg.get_anti_pdg_code() |
2548 | + my_spin = arg.get_spin_state_number() |
2549 | + |
2550 | + sorted_mothers, my_index = arg.get('mothers').sort_by_pdg_codes(\ |
2551 | + arg.get('pdg_codes'), my_pdg_code) |
2552 | + |
2553 | + # If fermion, partner is the corresponding fermion flow partner |
2554 | + partner = None |
2555 | + if isinstance(arg, helas_objects.HelasWavefunction) and arg.is_fermion(): |
2556 | + # Fermion case, just pick out the fermion flow partner |
2557 | + if my_index % 2 == 0: |
2558 | + # partner is after arg |
2559 | + partner_index = my_index |
2560 | + else: |
2561 | + # partner is before arg |
2562 | + partner_index = my_index - 1 |
2563 | + partner = sorted_mothers.pop(partner_index) |
2564 | + # If partner is incoming, move to before arg |
2565 | + if partner.get_spin_state_number() > 0: |
2566 | + my_index = partner_index |
2567 | + else: |
2568 | + my_index = partner_index + 1 |
2569 | + |
2570 | + # Reorder fermions pairwise according to incoming/outgoing |
2571 | + for i in range(0, len(sorted_mothers), 2): |
2572 | + if sorted_mothers[i].is_fermion(): |
2573 | + # This is a fermion, order between this fermion and its brother |
2574 | + if sorted_mothers[i].get_spin_state_number() > 0 and \ |
2575 | + sorted_mothers[i + 1].get_spin_state_number() < 0: |
2576 | + # Switch places between outgoing and incoming |
2577 | + sorted_mothers = sorted_mothers[:i] + \ |
2578 | + [sorted_mothers[i+1], sorted_mothers[i]] + \ |
2579 | + sorted_mothers[i+2:] |
2580 | + elif sorted_mothers[i].get_spin_state_number() < 0 and \ |
2581 | + sorted_mothers[i + 1].get_spin_state_number() > 0: |
2582 | + # This is the right order |
2583 | + pass |
2584 | + else: |
2585 | + # No more fermions in sorted_mothers |
2586 | + break |
2587 | + |
2588 | + # Put back partner into sorted_mothers |
2589 | + if partner: |
2590 | + sorted_mothers.insert(partner_index, partner) |
2591 | + |
2592 | + same_spin_mothers = [] |
2593 | + if isinstance(arg, helas_objects.HelasWavefunction): |
2594 | + # Pick out mothers with same spin, for cyclic reordering |
2595 | + same_spin_index = -1 |
2596 | + i=0 |
2597 | + while i < len(sorted_mothers): |
2598 | + if abs(sorted_mothers[i].get_spin_state_number()) == \ |
2599 | + abs(my_spin): |
2600 | + if same_spin_index < 0: |
2601 | + # Remember starting index for same spin states |
2602 | + same_spin_index = i |
2603 | + same_spin_mothers.append(sorted_mothers.pop(i)) |
2604 | + else: |
2605 | + i += 1 |
2606 | + |
2607 | + # Make cyclic reordering of mothers with same spin as this wf |
2608 | + if same_spin_mothers: |
2609 | + same_spin_mothers = same_spin_mothers[my_index - same_spin_index:] \ |
2610 | + + same_spin_mothers[:my_index - same_spin_index] |
2611 | + |
2612 | + # Insert same_spin_mothers in sorted_mothers |
2613 | + sorted_mothers = sorted_mothers[:same_spin_index] + \ |
2614 | + same_spin_mothers + sorted_mothers[same_spin_index:] |
2615 | + |
2616 | + # Next sort according to spin_state_number |
2617 | + return helas_objects.HelasWavefunctionList(sorted_mothers) |
2618 | + |
2619 | + |
2620 | #=============================================================================== |
2621 | # UFOHelasCallWriter |
2622 | #=============================================================================== |
2623 | @@ -754,7 +880,8 @@ |
2624 | # Check if we need to append a charge conjugation flag |
2625 | c_flag = '' |
2626 | if argument.needs_hermitian_conjugate(): |
2627 | - c_flag = 'C1' # MG5 not configure for 4F vertex |
2628 | + c_flag = "".join(['C%d' % i for i in \ |
2629 | + argument.get_conjugate_index()]) |
2630 | |
2631 | call = 'CALL %s%s_%s' % (argument.get('lorentz'), c_flag, outgoing) |
2632 | |
2633 | @@ -888,7 +1015,8 @@ |
2634 | # Check if we need to append a charge conjugation flag |
2635 | c_flag = '' |
2636 | if argument.needs_hermitian_conjugate(): |
2637 | - c_flag = 'C1' # MG5 not configure for 4F vertex |
2638 | + c_flag = "".join(['C%d' % i for i in \ |
2639 | + argument.get_conjugate_index()]) |
2640 | |
2641 | call = '%s%s_%s' % (argument.get('lorentz'), c_flag, outgoing) |
2642 | |
2643 | @@ -1055,7 +1183,8 @@ |
2644 | # Check if we need to append a charge conjugation flag |
2645 | c_flag = '' |
2646 | if argument.needs_hermitian_conjugate(): |
2647 | - c_flag = 'C1' # MG5 not configure for 4F vertex |
2648 | + c_flag = "".join(['C%d' % i for i in \ |
2649 | + argument.get_conjugate_index()]) |
2650 | |
2651 | if isinstance(argument, helas_objects.HelasWavefunction): |
2652 | call = 'w[%d] = ' |
2653 | |
2654 | === modified file 'madgraph/iolibs/import_v4.py' |
2655 | --- madgraph/iolibs/import_v4.py 2010-12-18 22:39:25 +0000 |
2656 | +++ madgraph/iolibs/import_v4.py 2011-01-27 02:53:44 +0000 |
2657 | @@ -80,7 +80,12 @@ |
2658 | |
2659 | # treat simple case (model_path is a valid path/ mgme_dir doesn't exist) |
2660 | if os.path.isdir(model_path): |
2661 | - return model_path |
2662 | + pass |
2663 | + elif mgme_dir and os.path.isdir(os.path.join(mgme_dir, 'models', |
2664 | + model_path + "_v4")): |
2665 | + model_path = os.path.join(mgme_dir, 'models', model_path + "_v4") |
2666 | + elif mgme_dir and os.path.isdir(os.path.join(mgme_dir, 'Models', model_path)): |
2667 | + model_path = os.path.join(mgme_dir, 'Models', model_path) |
2668 | elif not mgme_dir: |
2669 | error_text = "Path %s is not a valid pathname\n" % model_path |
2670 | error_text += "and no MG_ME installation detected in order to search in Models" |
2671 | |
2672 | === modified file 'madgraph/iolibs/template_files/matrix_madevent_v4.inc' |
2673 | --- madgraph/iolibs/template_files/matrix_madevent_v4.inc 2010-10-18 21:37:36 +0000 |
2674 | +++ madgraph/iolibs/template_files/matrix_madevent_v4.inc 2011-01-27 02:53:44 +0000 |
2675 | @@ -198,9 +198,7 @@ |
2676 | ENDDO |
2677 | MATRIX =MATRIX+ZTEMP*DCONJG(JAMP(I))/DENOM(I) |
2678 | ENDDO |
2679 | - Do I = 1, NGRAPHS |
2680 | - amp2(i)=amp2(i)+amp(i)*dconjg(amp(i)) |
2681 | - Enddo |
2682 | +%(amp2_lines)s |
2683 | Do I = 1, NCOLOR |
2684 | Jamp2(i)=Jamp2(i)+Jamp(i)*dconjg(Jamp(i)) |
2685 | Enddo |
2686 | |
2687 | === modified file 'madgraph/various/process_checks.py' |
2688 | --- madgraph/various/process_checks.py 2010-12-15 21:03:07 +0000 |
2689 | +++ madgraph/various/process_checks.py 2011-01-27 02:53:44 +0000 |
2690 | @@ -41,12 +41,12 @@ |
2691 | |
2692 | import madgraph.various.rambo as rambo |
2693 | |
2694 | -from madgraph import MG5DIR |
2695 | +from madgraph import MG5DIR, MadGraph5Error |
2696 | |
2697 | import models.model_reader as model_reader |
2698 | import aloha.template_files.wavefunctions as wavefunctions |
2699 | from aloha.template_files.wavefunctions import \ |
2700 | - ixxxxx, oxxxxx, vxxxxx, sxxxxx |
2701 | + ixxxxx, oxxxxx, vxxxxx, sxxxxx, txxxxx |
2702 | |
2703 | #=============================================================================== |
2704 | # Logger for process_checks |
2705 | @@ -110,7 +110,7 @@ |
2706 | return p, w_rambo |
2707 | |
2708 | if nincoming != 2: |
2709 | - raise RAMBOError('Need 1 or 2 incoming particles') |
2710 | + raise rambo.RAMBOError('Need 1 or 2 incoming particles') |
2711 | |
2712 | if nfinal == 1: |
2713 | energy = masses[0] |
2714 | @@ -1070,4 +1070,3 @@ |
2715 | return res_str |
2716 | else: |
2717 | return fail_proc |
2718 | - return res_str |
2719 | |
2720 | === modified file 'models/template_files/fortran/formats.inc' |
2721 | --- models/template_files/fortran/formats.inc 2010-06-02 23:59:09 +0000 |
2722 | +++ models/template_files/fortran/formats.inc 2011-01-27 02:53:44 +0000 |
2723 | @@ -11,7 +11,7 @@ |
2724 | c Simple real |
2725 | 1 format(1x,a15,f11.5) |
2726 | c Simple Complex |
2727 | - 2 format(1x,a15,f11.5,1x,f11.5) |
2728 | + 2 format(1x,a15,e13.5,1x,e13.5) |
2729 | c Real with mass dimension |
2730 | 3 format(1x,a15,f11.5,' GeV') |
2731 | c Chiral couplings |
2732 | |
2733 | === added directory 'models/uutt_sch_4fermion' |
2734 | === added file 'models/uutt_sch_4fermion/__init__.py' |
2735 | --- models/uutt_sch_4fermion/__init__.py 1970-01-01 00:00:00 +0000 |
2736 | +++ models/uutt_sch_4fermion/__init__.py 2011-01-27 02:53:44 +0000 |
2737 | @@ -0,0 +1,15 @@ |
2738 | + |
2739 | +import particles |
2740 | +import couplings |
2741 | +import lorentz |
2742 | +import parameters |
2743 | +import vertices |
2744 | +import write_param_card |
2745 | + |
2746 | + |
2747 | +all_particles = particles.all_particles |
2748 | +all_vertices = vertices.all_vertices |
2749 | +all_couplings = couplings.all_couplings |
2750 | +all_lorentz = lorentz.all_lorentz |
2751 | +all_parameters = parameters.all_parameters |
2752 | +all_functions = function_library.all_functions |
2753 | |
2754 | === added file 'models/uutt_sch_4fermion/couplings.py' |
2755 | --- models/uutt_sch_4fermion/couplings.py 1970-01-01 00:00:00 +0000 |
2756 | +++ models/uutt_sch_4fermion/couplings.py 2011-01-27 02:53:44 +0000 |
2757 | @@ -0,0 +1,119 @@ |
2758 | +# This file was automatically created by FeynRules $Revision: 302 $ |
2759 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
2760 | +# Date: Tue 31 Aug 2010 16:54:46 |
2761 | + |
2762 | + |
2763 | +from object_library import all_couplings, Coupling |
2764 | + |
2765 | +from function_library import complexconjugate, re, im, csc, sec, acsc, asec |
2766 | + |
2767 | + |
2768 | + |
2769 | +GC_1 = Coupling(name = 'GC_1', |
2770 | + value = '-(ee*complex(0,1))/3.', |
2771 | + order = {'QED':1}) |
2772 | + |
2773 | +GC_2 = Coupling(name = 'GC_2', |
2774 | + value = '(2*ee*complex(0,1))/3.', |
2775 | + order = {'QED':1}) |
2776 | + |
2777 | +GC_3 = Coupling(name = 'GC_3', |
2778 | + value = '-(ee*complex(0,1))', |
2779 | + order = {'QED':1}) |
2780 | + |
2781 | +GC_4 = Coupling(name = 'GC_4', |
2782 | + value = '-G', |
2783 | + order = {'QCD':1}) |
2784 | + |
2785 | +GC_5 = Coupling(name = 'GC_5', |
2786 | + value = 'complex(0,1)*G', |
2787 | + order = {'QCD':1}) |
2788 | + |
2789 | +GC_6 = Coupling(name = 'GC_6', |
2790 | + value = 'complex(0,1)*G**2', |
2791 | + order = {'QCD':2}) |
2792 | + |
2793 | +GC_7 = Coupling(name = 'GC_7', |
2794 | + value = 'cw*complex(0,1)*gw', |
2795 | + order = {'QED':1}) |
2796 | + |
2797 | +GC_8 = Coupling(name = 'GC_8', |
2798 | + value = '-(complex(0,1)*gw**2)', |
2799 | + order = {'QED':2}) |
2800 | + |
2801 | +GC_9 = Coupling(name = 'GC_9', |
2802 | + value = 'cw**2*complex(0,1)*gw**2', |
2803 | + order = {'QED':2}) |
2804 | + |
2805 | +GC_10 = Coupling(name = 'GC_10', |
2806 | + value = '(ee**2*complex(0,1))/(2.*sw**2)', |
2807 | + order = {'QED':2}) |
2808 | + |
2809 | +GC_11 = Coupling(name = 'GC_11', |
2810 | + value = '(ee*complex(0,1))/(sw*cmath.sqrt(2))', |
2811 | + order = {'QED':1}) |
2812 | + |
2813 | +GC_12 = Coupling(name = 'GC_12', |
2814 | + value = '-(cw*ee*complex(0,1))/(2.*sw)', |
2815 | + order = {'QED':1}) |
2816 | + |
2817 | +GC_13 = Coupling(name = 'GC_13', |
2818 | + value = '(cw*ee*complex(0,1))/(2.*sw)', |
2819 | + order = {'QED':1}) |
2820 | + |
2821 | +GC_14 = Coupling(name = 'GC_14', |
2822 | + value = '-(ee*complex(0,1)*sw)/(6.*cw)', |
2823 | + order = {'QED':1}) |
2824 | + |
2825 | +GC_15 = Coupling(name = 'GC_15', |
2826 | + value = '(ee*complex(0,1)*sw)/(2.*cw)', |
2827 | + order = {'QED':1}) |
2828 | + |
2829 | +GC_16 = Coupling(name = 'GC_16', |
2830 | + value = 'complex(0,1)*gw*sw', |
2831 | + order = {'QED':1}) |
2832 | + |
2833 | +GC_17 = Coupling(name = 'GC_17', |
2834 | + value = '-2*cw*complex(0,1)*gw**2*sw', |
2835 | + order = {'QED':2}) |
2836 | + |
2837 | +GC_18 = Coupling(name = 'GC_18', |
2838 | + value = 'complex(0,1)*gw**2*sw**2', |
2839 | + order = {'QED':2}) |
2840 | + |
2841 | +GC_19 = Coupling(name = 'GC_19', |
2842 | + value = '(cw*ee*complex(0,1))/(2.*sw) + (ee*complex(0,1)*sw)/(2.*cw)', |
2843 | + order = {'QED':1}) |
2844 | + |
2845 | +GC_20 = Coupling(name = 'GC_20', |
2846 | + value = 'ee**2*complex(0,1) + (cw**2*ee**2*complex(0,1))/(2.*sw**2) + (ee**2*complex(0,1)*sw**2)/(2.*cw**2)', |
2847 | + order = {'QED':2}) |
2848 | + |
2849 | +GC_21 = Coupling(name = 'GC_21', |
2850 | + value = '-6*complex(0,1)*lam*v', |
2851 | + order = {'QED':1}) |
2852 | + |
2853 | +GC_22 = Coupling(name = 'GC_22', |
2854 | + value = '(ee**2*complex(0,1)*v)/(2.*sw**2)', |
2855 | + order = {'QED':1}) |
2856 | + |
2857 | +GC_23 = Coupling(name = 'GC_23', |
2858 | + value = 'ee**2*complex(0,1)*v + (cw**2*ee**2*complex(0,1)*v)/(2.*sw**2) + (ee**2*complex(0,1)*sw**2*v)/(2.*cw**2)', |
2859 | + order = {'QED':1}) |
2860 | + |
2861 | +GC_24 = Coupling(name = 'GC_24', |
2862 | + value = '-((complex(0,1)*yb)/cmath.sqrt(2))', |
2863 | + order = {'QED':1}) |
2864 | + |
2865 | +GC_25 = Coupling(name = 'GC_25', |
2866 | + value = '-((complex(0,1)*yt)/cmath.sqrt(2))', |
2867 | + order = {'QED':1}) |
2868 | + |
2869 | +GC_26 = Coupling(name = 'GC_26', |
2870 | + value = '-((complex(0,1)*ytau)/cmath.sqrt(2))', |
2871 | + order = {'QED':1}) |
2872 | + |
2873 | +# 4-fermion coupling is 2*g^2*prop for t-channel (due to FS symmetry) |
2874 | +GC_27 = Coupling(name = 'GC_27', |
2875 | + value = '-uusix*ttsix/Msix**2', |
2876 | + order = {'NP':2}) |
2877 | |
2878 | === added file 'models/uutt_sch_4fermion/function_library.py' |
2879 | --- models/uutt_sch_4fermion/function_library.py 1970-01-01 00:00:00 +0000 |
2880 | +++ models/uutt_sch_4fermion/function_library.py 2011-01-27 02:53:44 +0000 |
2881 | @@ -0,0 +1,54 @@ |
2882 | +# This file is part of the UFO. |
2883 | +# |
2884 | +# This file contains definitions for functions that |
2885 | +# are extensions of the cmath library, and correspond |
2886 | +# either to functions that are in cmath, but inconvenient |
2887 | +# to access from there (e.g. z.conjugate()), |
2888 | +# or functions that are simply not defined. |
2889 | +# |
2890 | +# |
2891 | + |
2892 | +__date__ = "22 July 2010" |
2893 | +__author__ = "claude.duhr@durham.ac.uk" |
2894 | + |
2895 | +import cmath |
2896 | +from object_library import all_functions, Function |
2897 | + |
2898 | +# |
2899 | +# shortcuts for functions from cmath |
2900 | +# |
2901 | + |
2902 | +complexconjugate = Function(name = 'complexconjugate', |
2903 | + arguments = ('z',), |
2904 | + expression = 'z.conjugate()') |
2905 | + |
2906 | + |
2907 | +re = Function(name = 're', |
2908 | + arguments = ('z',), |
2909 | + expression = 'z.real') |
2910 | + |
2911 | +im = Function(name = 'im', |
2912 | + arguments = ('z',), |
2913 | + expression = 'z.imag') |
2914 | + |
2915 | +# New functions (trigonometric) |
2916 | + |
2917 | +sec = Function(name = 'sec', |
2918 | + arguments = ('z',), |
2919 | + expression = '1./cmath.cos(z)') |
2920 | + |
2921 | +asec = Function(name = 'asec', |
2922 | + arguments = ('z',), |
2923 | + expression = 'cmath.acos(1./z)') |
2924 | + |
2925 | +csc = Function(name = 'csc', |
2926 | + arguments = ('z',), |
2927 | + expression = '1./cmath.sin(z)') |
2928 | + |
2929 | +acsc = Function(name = 'acsc', |
2930 | + arguments = ('z',), |
2931 | + expression = 'cmath.asin(1./z)') |
2932 | + |
2933 | + |
2934 | + |
2935 | + |
2936 | |
2937 | === added file 'models/uutt_sch_4fermion/lorentz.py' |
2938 | --- models/uutt_sch_4fermion/lorentz.py 1970-01-01 00:00:00 +0000 |
2939 | +++ models/uutt_sch_4fermion/lorentz.py 2011-01-27 02:53:44 +0000 |
2940 | @@ -0,0 +1,75 @@ |
2941 | +# This file was automatically created by FeynRules $Revision: 302 $ |
2942 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
2943 | +# Date: Tue 31 Aug 2010 16:54:46 |
2944 | + |
2945 | + |
2946 | +from object_library import all_lorentz, Lorentz |
2947 | + |
2948 | +from function_library import complexconjugate, re, im, csc, sec, acsc, asec |
2949 | + |
2950 | + |
2951 | + |
2952 | +SSS1 = Lorentz(name = 'SSS1', |
2953 | + spins = [ 1, 1, 1 ], |
2954 | + structure = '1') |
2955 | + |
2956 | +FFS1 = Lorentz(name = 'FFS1', |
2957 | + spins = [ 2, 2, 1 ], |
2958 | + structure = 'Identity(1,2)') |
2959 | + |
2960 | +FFV1 = Lorentz(name = 'FFV1', |
2961 | + spins = [ 2, 2, 3 ], |
2962 | + structure = 'Gamma(3,2,1)') |
2963 | + |
2964 | +FFV2 = Lorentz(name = 'FFV2', |
2965 | + spins = [ 2, 2, 3 ], |
2966 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1)') |
2967 | + |
2968 | +FFV3 = Lorentz(name = 'FFV3', |
2969 | + spins = [ 2, 2, 3 ], |
2970 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1) - 2*Gamma(3,2,\'s1\')*ProjP(\'s1\',1)') |
2971 | + |
2972 | +FFV4 = Lorentz(name = 'FFV4', |
2973 | + spins = [ 2, 2, 3 ], |
2974 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1) + 2*Gamma(3,2,\'s1\')*ProjP(\'s1\',1)') |
2975 | + |
2976 | +FFV5 = Lorentz(name = 'FFV5', |
2977 | + spins = [ 2, 2, 3 ], |
2978 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1) + 4*Gamma(3,2,\'s1\')*ProjP(\'s1\',1)') |
2979 | + |
2980 | +VVS1 = Lorentz(name = 'VVS1', |
2981 | + spins = [ 3, 3, 1 ], |
2982 | + structure = 'Metric(1,2)') |
2983 | + |
2984 | +VVV1 = Lorentz(name = 'VVV1', |
2985 | + spins = [ 3, 3, 3 ], |
2986 | + structure = 'P(3,1)*Metric(1,2) - P(3,2)*Metric(1,2) - P(2,1)*Metric(1,3) + P(2,3)*Metric(1,3) + P(1,2)*Metric(2,3) - P(1,3)*Metric(2,3)') |
2987 | + |
2988 | +VVSS1 = Lorentz(name = 'VVSS1', |
2989 | + spins = [ 3, 3, 1, 1 ], |
2990 | + structure = 'Metric(1,2)') |
2991 | + |
2992 | +VVVV1 = Lorentz(name = 'VVVV1', |
2993 | + spins = [ 3, 3, 3, 3 ], |
2994 | + structure = 'Metric(1,4)*Metric(2,3) - Metric(1,3)*Metric(2,4)') |
2995 | + |
2996 | +VVVV2 = Lorentz(name = 'VVVV2', |
2997 | + spins = [ 3, 3, 3, 3 ], |
2998 | + structure = 'Metric(1,4)*Metric(2,3) + Metric(1,3)*Metric(2,4) - 2*Metric(1,2)*Metric(3,4)') |
2999 | + |
3000 | +VVVV3 = Lorentz(name = 'VVVV3', |
3001 | + spins = [ 3, 3, 3, 3 ], |
3002 | + structure = 'Metric(1,4)*Metric(2,3) - Metric(1,2)*Metric(3,4)') |
3003 | + |
3004 | +VVVV4 = Lorentz(name = 'VVVV4', |
3005 | + spins = [ 3, 3, 3, 3 ], |
3006 | + structure = 'Metric(1,3)*Metric(2,4) - Metric(1,2)*Metric(3,4)') |
3007 | + |
3008 | +VVVV5 = Lorentz(name = 'VVVV5', |
3009 | + spins = [ 3, 3, 3, 3 ], |
3010 | + structure = 'Metric(1,4)*Metric(2,3) - (Metric(1,3)*Metric(2,4))/2. - (Metric(1,2)*Metric(3,4))/2.') |
3011 | + |
3012 | +FFFF1 = Lorentz(name = 'FFFF1', |
3013 | + spins = [ 2, 2, 2, 2 ], |
3014 | + structure = 'Identity(1,2)*Identity(4,3)') |
3015 | + |
3016 | |
3017 | === added file 'models/uutt_sch_4fermion/object_library.py' |
3018 | --- models/uutt_sch_4fermion/object_library.py 1970-01-01 00:00:00 +0000 |
3019 | +++ models/uutt_sch_4fermion/object_library.py 2011-01-27 02:53:44 +0000 |
3020 | @@ -0,0 +1,191 @@ |
3021 | +## |
3022 | +## |
3023 | +## Feynrules Header |
3024 | +## |
3025 | +## |
3026 | +## |
3027 | +## |
3028 | +## |
3029 | + |
3030 | +import cmath |
3031 | + |
3032 | + |
3033 | +class FRBaseClass(object): |
3034 | + """The class from which all FeynRules classes are derived.""" |
3035 | + |
3036 | + require_args = [] |
3037 | + |
3038 | + def __init__(self, *args, **options): |
3039 | + assert(len(self.require_args) == len (args)) |
3040 | + |
3041 | + for i, name in enumerate(self.require_args): |
3042 | + setattr(self, name, args[i]) |
3043 | + |
3044 | + for (option, value) in options.items(): |
3045 | + setattr(self, option, value) |
3046 | + |
3047 | + def get(self, name): |
3048 | + return getattr(self, name) |
3049 | + |
3050 | + def set(self, name, value): |
3051 | + setattr(self, name, value) |
3052 | + |
3053 | + def get_all(self): |
3054 | + """Return a dictionary containing all the information of the object""" |
3055 | + return self.__dict__ |
3056 | + |
3057 | + def __str__(self): |
3058 | + return self.name |
3059 | + |
3060 | + |
3061 | + def __repr__(self): |
3062 | + replacements = [ |
3063 | + ('+','__plus__'), |
3064 | + ('-','__minus__'), |
3065 | + ('@','__at__'), |
3066 | + ('!','__exclam__'), |
3067 | + ('?','__quest__'), |
3068 | + ('*','__star__'), |
3069 | + ('~','__tilde__') |
3070 | + ] |
3071 | + text = self.name |
3072 | + for orig,sub in replacements: |
3073 | + text = text.replace(orig,sub) |
3074 | + return text |
3075 | + |
3076 | + |
3077 | + |
3078 | +all_particles = [] |
3079 | + |
3080 | + |
3081 | + |
3082 | +class Particle(FRBaseClass): |
3083 | + """A standard Particle""" |
3084 | + |
3085 | + require_args=['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge'] |
3086 | + |
3087 | + require_args_all = ['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge', 'propagating', 'goldstoneboson'] |
3088 | + |
3089 | + def __init__(self, pdg_code, name, antiname, spin, color, mass, width, texname, |
3090 | + antitexname, line, charge , propagating=True, goldstoneboson=False, **options): |
3091 | + |
3092 | + args= (pdg_code, name, antiname, spin, color, mass, width, texname, |
3093 | + antitexname, line, float(charge)) |
3094 | + |
3095 | + FRBaseClass.__init__(self, *args, **options) |
3096 | + |
3097 | + global all_particles |
3098 | + all_particles.append(self) |
3099 | + |
3100 | + self.propagating = propagating |
3101 | + self.goldstoneboson= goldstoneboson |
3102 | + |
3103 | + self.selfconjugate = (name == antiname) |
3104 | + |
3105 | + def anti(self): |
3106 | + if self.selfconjugate: |
3107 | + raise Exception('%s has no anti particle.' % self.name) |
3108 | + outdic = {} |
3109 | + for k,v in self.__dict__.iteritems(): |
3110 | + if k not in self.require_args_all: |
3111 | + outdic[k] = -v |
3112 | + if self.color in [1,8]: |
3113 | + newcolor = self.color |
3114 | + else: |
3115 | + newcolor = -self.color |
3116 | + |
3117 | + return Particle(-self.pdg_code, self.antiname, self.name, self.spin, newcolor, self.mass, self.width, |
3118 | + self.antitexname, self.texname, self.line, -self.charge, self.propagating, self.goldstoneboson, **outdic) |
3119 | + |
3120 | + |
3121 | + |
3122 | +all_parameters = [] |
3123 | + |
3124 | +class Parameter(FRBaseClass): |
3125 | + |
3126 | + require_args=['name', 'nature', 'type', 'value', 'texname'] |
3127 | + |
3128 | + def __init__(self, name, nature, type, value, texname, lhablock=None, lhacode=None): |
3129 | + |
3130 | + args = (name,nature,type,value,texname) |
3131 | + |
3132 | + FRBaseClass.__init__(self, *args) |
3133 | + |
3134 | + args=(name,nature,type,value,texname) |
3135 | + |
3136 | + global all_parameters |
3137 | + all_parameters.append(self) |
3138 | + |
3139 | + if (lhablock is None or lhacode is None) and nature == 'external': |
3140 | + raise Exception('Need LHA information for external parameter "%s".' % name) |
3141 | + self.lhablock = lhablock |
3142 | + self.lhacode = lhacode |
3143 | + |
3144 | +all_vertices = [] |
3145 | + |
3146 | +class Vertex(FRBaseClass): |
3147 | + |
3148 | + require_args=['name', 'particles', 'color', 'lorentz', 'couplings'] |
3149 | + |
3150 | + def __init__(self, name, particles, color, lorentz, couplings, **opt): |
3151 | + |
3152 | + args = (name, particles, color, lorentz, couplings) |
3153 | + |
3154 | + FRBaseClass.__init__(self, *args, **opt) |
3155 | + |
3156 | + args=(particles,color,lorentz,couplings) |
3157 | + |
3158 | + global all_vertices |
3159 | + all_vertices.append(self) |
3160 | + |
3161 | +all_couplings = [] |
3162 | + |
3163 | +class Coupling(FRBaseClass): |
3164 | + |
3165 | + require_args=['name', 'value', 'order'] |
3166 | + |
3167 | + def __init__(self, name, value, order, **opt): |
3168 | + |
3169 | + args =(name, value, order) |
3170 | + FRBaseClass.__init__(self, *args, **opt) |
3171 | + global all_couplings |
3172 | + all_couplings.append(self) |
3173 | + |
3174 | + |
3175 | + |
3176 | +all_lorentz = [] |
3177 | + |
3178 | +class Lorentz(FRBaseClass): |
3179 | + |
3180 | + require_args=['name','spins','structure'] |
3181 | + |
3182 | + def __init__(self, name, spins, structure, **opt): |
3183 | + args = (name, spins, structure) |
3184 | + FRBaseClass.__init__(self, *args, **opt) |
3185 | + |
3186 | + global all_lorentz |
3187 | + all_lorentz.append(self) |
3188 | + |
3189 | + |
3190 | +all_functions = [] |
3191 | + |
3192 | +class Function(object): |
3193 | + |
3194 | + def __init__(self, name, arguments, expression): |
3195 | + |
3196 | + global all_functions |
3197 | + all_functions.append(self) |
3198 | + |
3199 | + self.name = name |
3200 | + self.arguments = arguments |
3201 | + self.expr = expression |
3202 | + |
3203 | + def __call__(self, *opt): |
3204 | + |
3205 | + for i, arg in enumerate(self.arguments): |
3206 | + exec('%s = %s' % (arg, opt[i] )) |
3207 | + |
3208 | + return eval(self.expr) |
3209 | + |
3210 | + |
3211 | + |
3212 | |
3213 | === added file 'models/uutt_sch_4fermion/parameters.py' |
3214 | --- models/uutt_sch_4fermion/parameters.py 1970-01-01 00:00:00 +0000 |
3215 | +++ models/uutt_sch_4fermion/parameters.py 2011-01-27 02:53:44 +0000 |
3216 | @@ -0,0 +1,245 @@ |
3217 | +# This file was automatically created by FeynRules $Revision: 302 $ |
3218 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
3219 | +# Date: Tue 31 Aug 2010 16:54:46 |
3220 | + |
3221 | + |
3222 | + |
3223 | +from object_library import all_parameters, Parameter |
3224 | + |
3225 | + |
3226 | +from function_library import complexconjugate, re, im, csc, sec, acsc, asec |
3227 | + |
3228 | +aEWM1 = Parameter(name = 'aEWM1', |
3229 | + nature = 'external', |
3230 | + type = 'real', |
3231 | + value = 132.50698, |
3232 | + texname = '\\text{aEWM1}', |
3233 | + lhablock = 'SMINPUTS', |
3234 | + lhacode = [ 1 ]) |
3235 | + |
3236 | +Gf = Parameter(name = 'Gf', |
3237 | + nature = 'external', |
3238 | + type = 'real', |
3239 | + value = 0.0000116639, |
3240 | + texname = 'G_f', |
3241 | + lhablock = 'SMINPUTS', |
3242 | + lhacode = [ 2 ]) |
3243 | + |
3244 | +aS = Parameter(name = 'aS', |
3245 | + nature = 'external', |
3246 | + type = 'real', |
3247 | + value = 0.118, |
3248 | + texname = '\\text{aS}', |
3249 | + lhablock = 'SMINPUTS', |
3250 | + lhacode = [ 3 ]) |
3251 | + |
3252 | +ymb = Parameter(name = 'ymb', |
3253 | + nature = 'external', |
3254 | + type = 'real', |
3255 | + value = 4.2, |
3256 | + texname = '\\text{ymb}', |
3257 | + lhablock = 'YUKAWA', |
3258 | + lhacode = [ 5 ]) |
3259 | + |
3260 | +ymt = Parameter(name = 'ymt', |
3261 | + nature = 'external', |
3262 | + type = 'real', |
3263 | + value = 164.5, |
3264 | + texname = '\\text{ymt}', |
3265 | + lhablock = 'YUKAWA', |
3266 | + lhacode = [ 6 ]) |
3267 | + |
3268 | +ymtau = Parameter(name = 'ymtau', |
3269 | + nature = 'external', |
3270 | + type = 'real', |
3271 | + value = 1.777, |
3272 | + texname = '\\text{ymtau}', |
3273 | + lhablock = 'YUKAWA', |
3274 | + lhacode = [ 15 ]) |
3275 | + |
3276 | +MTA = Parameter(name = 'MTA', |
3277 | + nature = 'external', |
3278 | + type = 'real', |
3279 | + value = 1.777, |
3280 | + texname = '\\text{MTA}', |
3281 | + lhablock = 'MASS', |
3282 | + lhacode = [ 15 ]) |
3283 | + |
3284 | +MT = Parameter(name = 'MT', |
3285 | + nature = 'external', |
3286 | + type = 'real', |
3287 | + value = 174.3, |
3288 | + texname = '\\text{MT}', |
3289 | + lhablock = 'MASS', |
3290 | + lhacode = [ 6 ]) |
3291 | + |
3292 | +MB = Parameter(name = 'MB', |
3293 | + nature = 'external', |
3294 | + type = 'real', |
3295 | + value = 4.7, |
3296 | + texname = '\\text{MB}', |
3297 | + lhablock = 'MASS', |
3298 | + lhacode = [ 5 ]) |
3299 | + |
3300 | +MZ = Parameter(name = 'MZ', |
3301 | + nature = 'external', |
3302 | + type = 'real', |
3303 | + value = 91.188, |
3304 | + texname = '\\text{MZ}', |
3305 | + lhablock = 'MASS', |
3306 | + lhacode = [ 23 ]) |
3307 | + |
3308 | +MH = Parameter(name = 'MH', |
3309 | + nature = 'external', |
3310 | + type = 'real', |
3311 | + value = 120., |
3312 | + texname = '\\text{MH}', |
3313 | + lhablock = 'MASS', |
3314 | + lhacode = [ 25 ]) |
3315 | + |
3316 | +WT = Parameter(name = 'WT', |
3317 | + nature = 'external', |
3318 | + type = 'real', |
3319 | + value = 1.50833649, |
3320 | + texname = '\\text{WT}', |
3321 | + lhablock = 'DECAY', |
3322 | + lhacode = [ 6 ]) |
3323 | + |
3324 | +WZ = Parameter(name = 'WZ', |
3325 | + nature = 'external', |
3326 | + type = 'real', |
3327 | + value = 2.44140351, |
3328 | + texname = '\\text{WZ}', |
3329 | + lhablock = 'DECAY', |
3330 | + lhacode = [ 23 ]) |
3331 | + |
3332 | +WW = Parameter(name = 'WW', |
3333 | + nature = 'external', |
3334 | + type = 'real', |
3335 | + value = 2.04759951, |
3336 | + texname = '\\text{WW}', |
3337 | + lhablock = 'DECAY', |
3338 | + lhacode = [ 24 ]) |
3339 | + |
3340 | +WH = Parameter(name = 'WH', |
3341 | + nature = 'external', |
3342 | + type = 'real', |
3343 | + value = 0.00575308848, |
3344 | + texname = '\\text{WH}', |
3345 | + lhablock = 'DECAY', |
3346 | + lhacode = [ 25 ]) |
3347 | + |
3348 | +aEW = Parameter(name = 'aEW', |
3349 | + nature = 'internal', |
3350 | + type = 'real', |
3351 | + value = '1/aEWM1', |
3352 | + texname = '\\text{aEW}') |
3353 | + |
3354 | +G = Parameter(name = 'G', |
3355 | + nature = 'internal', |
3356 | + type = 'real', |
3357 | + value = '2*cmath.sqrt(aS)*cmath.sqrt(cmath.pi)', |
3358 | + texname = 'G') |
3359 | + |
3360 | +MW = Parameter(name = 'MW', |
3361 | + nature = 'internal', |
3362 | + type = 'real', |
3363 | + value = 'cmath.sqrt(MZ**2/2. + cmath.sqrt(MZ**4/4. - (aEW*cmath.pi*MZ**2)/(Gf*cmath.sqrt(2))))', |
3364 | + texname = 'M_W') |
3365 | + |
3366 | +ee = Parameter(name = 'ee', |
3367 | + nature = 'internal', |
3368 | + type = 'real', |
3369 | + value = '2*cmath.sqrt(aEW)*cmath.sqrt(cmath.pi)', |
3370 | + texname = 'e') |
3371 | + |
3372 | +sw2 = Parameter(name = 'sw2', |
3373 | + nature = 'internal', |
3374 | + type = 'real', |
3375 | + value = '1 - MW**2/MZ**2', |
3376 | + texname = '\\text{sw2}') |
3377 | + |
3378 | +cw = Parameter(name = 'cw', |
3379 | + nature = 'internal', |
3380 | + type = 'real', |
3381 | + value = 'cmath.sqrt(1 - sw2)', |
3382 | + texname = 'c_w') |
3383 | + |
3384 | +sw = Parameter(name = 'sw', |
3385 | + nature = 'internal', |
3386 | + type = 'real', |
3387 | + value = 'cmath.sqrt(sw2)', |
3388 | + texname = 's_w') |
3389 | + |
3390 | +g1 = Parameter(name = 'g1', |
3391 | + nature = 'internal', |
3392 | + type = 'real', |
3393 | + value = 'ee/cw', |
3394 | + texname = 'g_1') |
3395 | + |
3396 | +gw = Parameter(name = 'gw', |
3397 | + nature = 'internal', |
3398 | + type = 'real', |
3399 | + value = 'ee/sw', |
3400 | + texname = 'g_w') |
3401 | + |
3402 | +v = Parameter(name = 'v', |
3403 | + nature = 'internal', |
3404 | + type = 'real', |
3405 | + value = '(2*MW*sw)/ee', |
3406 | + texname = 'v') |
3407 | + |
3408 | +lam = Parameter(name = 'lam', |
3409 | + nature = 'internal', |
3410 | + type = 'real', |
3411 | + value = 'MH**2/(2.*v**2)', |
3412 | + texname = '\\text{lam}') |
3413 | + |
3414 | +yb = Parameter(name = 'yb', |
3415 | + nature = 'internal', |
3416 | + type = 'real', |
3417 | + value = '(ymb*cmath.sqrt(2))/v', |
3418 | + texname = '\\text{yb}') |
3419 | + |
3420 | +yt = Parameter(name = 'yt', |
3421 | + nature = 'internal', |
3422 | + type = 'real', |
3423 | + value = '(ymt*cmath.sqrt(2))/v', |
3424 | + texname = '\\text{yt}') |
3425 | + |
3426 | +ytau = Parameter(name = 'ytau', |
3427 | + nature = 'internal', |
3428 | + type = 'real', |
3429 | + value = '(ymtau*cmath.sqrt(2))/v', |
3430 | + texname = '\\text{ytau}') |
3431 | + |
3432 | +muH = Parameter(name = 'muH', |
3433 | + nature = 'internal', |
3434 | + type = 'real', |
3435 | + value = 'cmath.sqrt(lam*v**2)', |
3436 | + texname = '\\mu ') |
3437 | + |
3438 | +ttsix = Parameter(name = 'ttsix', |
3439 | + nature = 'external', |
3440 | + type = 'real', |
3441 | + value = 1, |
3442 | + texname = '\\text{ttsix}', |
3443 | + lhablock = 'BSMINPUTS', |
3444 | + lhacode = [ 1 ]) |
3445 | + |
3446 | +uusix = Parameter(name = 'uusix', |
3447 | + nature = 'external', |
3448 | + type = 'real', |
3449 | + value = 0.1, |
3450 | + texname = '\\text{ttsix}', |
3451 | + lhablock = 'BSMINPUTS', |
3452 | + lhacode = [ 2 ]) |
3453 | + |
3454 | +Msix = Parameter(name = 'Msix', |
3455 | + nature = 'external', |
3456 | + type = 'real', |
3457 | + value = 1.e5, |
3458 | + texname = '\\text{Mut}', |
3459 | + lhablock = 'BSMINPUTS', |
3460 | + lhacode = [ 3 ]) |
3461 | + |
3462 | |
3463 | === added file 'models/uutt_sch_4fermion/particles.py' |
3464 | --- models/uutt_sch_4fermion/particles.py 1970-01-01 00:00:00 +0000 |
3465 | +++ models/uutt_sch_4fermion/particles.py 2011-01-27 02:53:44 +0000 |
3466 | @@ -0,0 +1,384 @@ |
3467 | +# This file was automatically created by FeynRules $Revision: 302 $ |
3468 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
3469 | +# Date: Tue 31 Aug 2010 16:54:46 |
3470 | + |
3471 | + |
3472 | +from __future__ import division |
3473 | +from object_library import all_particles, Particle |
3474 | + |
3475 | +ve = Particle(pdg_code = 12, |
3476 | + name = 've', |
3477 | + antiname = 've~', |
3478 | + spin = 2, |
3479 | + color = 1, |
3480 | + mass = 'ZERO', |
3481 | + width = 'ZERO', |
3482 | + texname = 've', |
3483 | + antitexname = 've', |
3484 | + line = 'straight', |
3485 | + charge = 0, |
3486 | + LeptonNumber = 1, |
3487 | + GhostNumber = 0) |
3488 | + |
3489 | +ve__tilde__ = ve.anti() |
3490 | + |
3491 | +vm = Particle(pdg_code = 14, |
3492 | + name = 'vm', |
3493 | + antiname = 'vm~', |
3494 | + spin = 2, |
3495 | + color = 1, |
3496 | + mass = 'ZERO', |
3497 | + width = 'ZERO', |
3498 | + texname = 'vm', |
3499 | + antitexname = 'vm', |
3500 | + line = 'straight', |
3501 | + charge = 0, |
3502 | + LeptonNumber = 1, |
3503 | + GhostNumber = 0) |
3504 | + |
3505 | +vm__tilde__ = vm.anti() |
3506 | + |
3507 | +vt = Particle(pdg_code = 16, |
3508 | + name = 'vt', |
3509 | + antiname = 'vt~', |
3510 | + spin = 2, |
3511 | + color = 1, |
3512 | + mass = 'ZERO', |
3513 | + width = 'ZERO', |
3514 | + texname = 'vt', |
3515 | + antitexname = 'vt', |
3516 | + line = 'straight', |
3517 | + charge = 0, |
3518 | + LeptonNumber = 1, |
3519 | + GhostNumber = 0) |
3520 | + |
3521 | +vt__tilde__ = vt.anti() |
3522 | + |
3523 | +e__minus__ = Particle(pdg_code = 11, |
3524 | + name = 'e-', |
3525 | + antiname = 'e+', |
3526 | + spin = 2, |
3527 | + color = 1, |
3528 | + mass = 'ZERO', |
3529 | + width = 'ZERO', |
3530 | + texname = 'e-', |
3531 | + antitexname = 'e-', |
3532 | + line = 'straight', |
3533 | + charge = -1, |
3534 | + LeptonNumber = 1, |
3535 | + GhostNumber = 0) |
3536 | + |
3537 | +e__plus__ = e__minus__.anti() |
3538 | + |
3539 | +m__minus__ = Particle(pdg_code = 13, |
3540 | + name = 'm-', |
3541 | + antiname = 'm+', |
3542 | + spin = 2, |
3543 | + color = 1, |
3544 | + mass = 'ZERO', |
3545 | + width = 'ZERO', |
3546 | + texname = 'm-', |
3547 | + antitexname = 'm-', |
3548 | + line = 'straight', |
3549 | + charge = -1, |
3550 | + LeptonNumber = 1, |
3551 | + GhostNumber = 0) |
3552 | + |
3553 | +m__plus__ = m__minus__.anti() |
3554 | + |
3555 | +tt__minus__ = Particle(pdg_code = 15, |
3556 | + name = 'tt-', |
3557 | + antiname = 'tt+', |
3558 | + spin = 2, |
3559 | + color = 1, |
3560 | + mass = 'MTA', |
3561 | + width = 'ZERO', |
3562 | + texname = 'tt-', |
3563 | + antitexname = 'tt-', |
3564 | + line = 'straight', |
3565 | + charge = -1, |
3566 | + LeptonNumber = 1, |
3567 | + GhostNumber = 0) |
3568 | + |
3569 | +tt__plus__ = tt__minus__.anti() |
3570 | + |
3571 | +u = Particle(pdg_code = 2, |
3572 | + name = 'u', |
3573 | + antiname = 'u~', |
3574 | + spin = 2, |
3575 | + color = 3, |
3576 | + mass = 'ZERO', |
3577 | + width = 'ZERO', |
3578 | + texname = 'u', |
3579 | + antitexname = 'u', |
3580 | + line = 'straight', |
3581 | + charge = 2/3, |
3582 | + LeptonNumber = 0, |
3583 | + GhostNumber = 0) |
3584 | + |
3585 | +u__tilde__ = u.anti() |
3586 | + |
3587 | +c = Particle(pdg_code = 4, |
3588 | + name = 'c', |
3589 | + antiname = 'c~', |
3590 | + spin = 2, |
3591 | + color = 3, |
3592 | + mass = 'ZERO', |
3593 | + width = 'ZERO', |
3594 | + texname = 'c', |
3595 | + antitexname = 'c', |
3596 | + line = 'straight', |
3597 | + charge = 2/3, |
3598 | + LeptonNumber = 0, |
3599 | + GhostNumber = 0) |
3600 | + |
3601 | +c__tilde__ = c.anti() |
3602 | + |
3603 | +t = Particle(pdg_code = 6, |
3604 | + name = 't', |
3605 | + antiname = 't~', |
3606 | + spin = 2, |
3607 | + color = 3, |
3608 | + mass = 'MT', |
3609 | + width = 'WT', |
3610 | + texname = 't', |
3611 | + antitexname = 't', |
3612 | + line = 'straight', |
3613 | + charge = 2/3, |
3614 | + LeptonNumber = 0, |
3615 | + GhostNumber = 0) |
3616 | + |
3617 | +t__tilde__ = t.anti() |
3618 | + |
3619 | +d = Particle(pdg_code = 1, |
3620 | + name = 'd', |
3621 | + antiname = 'd~', |
3622 | + spin = 2, |
3623 | + color = 3, |
3624 | + mass = 'ZERO', |
3625 | + width = 'ZERO', |
3626 | + texname = 'd', |
3627 | + antitexname = 'd', |
3628 | + line = 'straight', |
3629 | + charge = -1/3, |
3630 | + LeptonNumber = 0, |
3631 | + GhostNumber = 0) |
3632 | + |
3633 | +d__tilde__ = d.anti() |
3634 | + |
3635 | +s = Particle(pdg_code = 3, |
3636 | + name = 's', |
3637 | + antiname = 's~', |
3638 | + spin = 2, |
3639 | + color = 3, |
3640 | + mass = 'ZERO', |
3641 | + width = 'ZERO', |
3642 | + texname = 's', |
3643 | + antitexname = 's', |
3644 | + line = 'straight', |
3645 | + charge = -1/3, |
3646 | + LeptonNumber = 0, |
3647 | + GhostNumber = 0) |
3648 | + |
3649 | +s__tilde__ = s.anti() |
3650 | + |
3651 | +b = Particle(pdg_code = 5, |
3652 | + name = 'b', |
3653 | + antiname = 'b~', |
3654 | + spin = 2, |
3655 | + color = 3, |
3656 | + mass = 'MB', |
3657 | + width = 'ZERO', |
3658 | + texname = 'b', |
3659 | + antitexname = 'b', |
3660 | + line = 'straight', |
3661 | + charge = -1/3, |
3662 | + LeptonNumber = 0, |
3663 | + GhostNumber = 0) |
3664 | + |
3665 | +b__tilde__ = b.anti() |
3666 | + |
3667 | +ghA = Particle(pdg_code = 9000001, |
3668 | + name = 'ghA', |
3669 | + antiname = 'ghA~', |
3670 | + spin = -1, |
3671 | + color = 1, |
3672 | + mass = 'ZERO', |
3673 | + width = 'WghA', |
3674 | + texname = 'ghA', |
3675 | + antitexname = 'ghA', |
3676 | + line = 'dotted', |
3677 | + charge = 0, |
3678 | + LeptonNumber = 0, |
3679 | + GhostNumber = 1) |
3680 | + |
3681 | +ghA__tilde__ = ghA.anti() |
3682 | + |
3683 | +ghZ = Particle(pdg_code = 9000002, |
3684 | + name = 'ghZ', |
3685 | + antiname = 'ghZ~', |
3686 | + spin = -1, |
3687 | + color = 1, |
3688 | + mass = 'MZ', |
3689 | + width = 'WghZ', |
3690 | + texname = 'ghZ', |
3691 | + antitexname = 'ghZ', |
3692 | + line = 'dotted', |
3693 | + charge = 0, |
3694 | + LeptonNumber = 0, |
3695 | + GhostNumber = 1) |
3696 | + |
3697 | +ghZ__tilde__ = ghZ.anti() |
3698 | + |
3699 | +ghWp = Particle(pdg_code = 9000003, |
3700 | + name = 'ghWp', |
3701 | + antiname = 'ghWp~', |
3702 | + spin = -1, |
3703 | + color = 1, |
3704 | + mass = 'MW', |
3705 | + width = 'WghWp', |
3706 | + texname = 'ghWp', |
3707 | + antitexname = 'ghWp', |
3708 | + line = 'dotted', |
3709 | + charge = 1, |
3710 | + LeptonNumber = 0, |
3711 | + GhostNumber = 1) |
3712 | + |
3713 | +ghWp__tilde__ = ghWp.anti() |
3714 | + |
3715 | +ghWm = Particle(pdg_code = 9000004, |
3716 | + name = 'ghWm', |
3717 | + antiname = 'ghWm~', |
3718 | + spin = -1, |
3719 | + color = 1, |
3720 | + mass = 'MW', |
3721 | + width = 'WghWm', |
3722 | + texname = 'ghWm', |
3723 | + antitexname = 'ghWm', |
3724 | + line = 'dotted', |
3725 | + charge = -1, |
3726 | + LeptonNumber = 0, |
3727 | + GhostNumber = 1) |
3728 | + |
3729 | +ghWm__tilde__ = ghWm.anti() |
3730 | + |
3731 | +ghG = Particle(pdg_code = 9000005, |
3732 | + name = 'ghG', |
3733 | + antiname = 'ghG~', |
3734 | + spin = -1, |
3735 | + color = 8, |
3736 | + mass = 'ZERO', |
3737 | + width = 'WghG', |
3738 | + texname = 'ghG', |
3739 | + antitexname = 'ghG', |
3740 | + line = 'dotted', |
3741 | + charge = 0, |
3742 | + LeptonNumber = 0, |
3743 | + GhostNumber = 1) |
3744 | + |
3745 | +ghG__tilde__ = ghG.anti() |
3746 | + |
3747 | +A = Particle(pdg_code = 22, |
3748 | + name = 'A', |
3749 | + antiname = 'A', |
3750 | + spin = 3, |
3751 | + color = 1, |
3752 | + mass = 'ZERO', |
3753 | + width = 'ZERO', |
3754 | + texname = 'A', |
3755 | + antitexname = 'A', |
3756 | + line = 'wavy', |
3757 | + charge = 0, |
3758 | + LeptonNumber = 0, |
3759 | + GhostNumber = 0) |
3760 | + |
3761 | +Z = Particle(pdg_code = 23, |
3762 | + name = 'Z', |
3763 | + antiname = 'Z', |
3764 | + spin = 3, |
3765 | + color = 1, |
3766 | + mass = 'MZ', |
3767 | + width = 'WZ', |
3768 | + texname = 'Z', |
3769 | + antitexname = 'Z', |
3770 | + line = 'wavy', |
3771 | + charge = 0, |
3772 | + LeptonNumber = 0, |
3773 | + GhostNumber = 0) |
3774 | + |
3775 | +W__plus__ = Particle(pdg_code = 24, |
3776 | + name = 'W+', |
3777 | + antiname = 'W-', |
3778 | + spin = 3, |
3779 | + color = 1, |
3780 | + mass = 'MW', |
3781 | + width = 'WW', |
3782 | + texname = 'W+', |
3783 | + antitexname = 'W+', |
3784 | + line = 'wavy', |
3785 | + charge = 1, |
3786 | + LeptonNumber = 0, |
3787 | + GhostNumber = 0) |
3788 | + |
3789 | +W__minus__ = W__plus__.anti() |
3790 | + |
3791 | +G = Particle(pdg_code = 21, |
3792 | + name = 'G', |
3793 | + antiname = 'G', |
3794 | + spin = 3, |
3795 | + color = 8, |
3796 | + mass = 'ZERO', |
3797 | + width = 'ZERO', |
3798 | + texname = 'G', |
3799 | + antitexname = 'G', |
3800 | + line = 'curly', |
3801 | + charge = 0, |
3802 | + LeptonNumber = 0, |
3803 | + GhostNumber = 0) |
3804 | + |
3805 | +H = Particle(pdg_code = 25, |
3806 | + name = 'H', |
3807 | + antiname = 'H', |
3808 | + spin = 1, |
3809 | + color = 1, |
3810 | + mass = 'MH', |
3811 | + width = 'WH', |
3812 | + texname = '\\phi', |
3813 | + antitexname = '\\phi', |
3814 | + line = 'dashed', |
3815 | + charge = 0, |
3816 | + LeptonNumber = 0, |
3817 | + GhostNumber = 0) |
3818 | + |
3819 | +phi0 = Particle(pdg_code = 250, |
3820 | + name = 'phi0', |
3821 | + antiname = 'phi0', |
3822 | + spin = 1, |
3823 | + color = 1, |
3824 | + mass = 'MZ', |
3825 | + width = 'Wphi', |
3826 | + texname = 'phi0', |
3827 | + antitexname = 'phi0', |
3828 | + line = 'dashed', |
3829 | + GoldstoneBoson = True, |
3830 | + charge = 0, |
3831 | + LeptonNumber = 0, |
3832 | + GhostNumber = 0) |
3833 | + |
3834 | +phi__plus__ = Particle(pdg_code = 251, |
3835 | + name = 'phi+', |
3836 | + antiname = 'phi-', |
3837 | + spin = 1, |
3838 | + color = 1, |
3839 | + mass = 'MW', |
3840 | + width = 'Wphi2', |
3841 | + texname = '\\phi^+', |
3842 | + antitexname = '\\phi^+', |
3843 | + line = 'dashed', |
3844 | + GoldstoneBoson = True, |
3845 | + charge = 1, |
3846 | + LeptonNumber = 0, |
3847 | + GhostNumber = 0) |
3848 | + |
3849 | +phi__minus__ = phi__plus__.anti() |
3850 | + |
3851 | |
3852 | === added file 'models/uutt_sch_4fermion/vertices.py' |
3853 | --- models/uutt_sch_4fermion/vertices.py 1970-01-01 00:00:00 +0000 |
3854 | +++ models/uutt_sch_4fermion/vertices.py 2011-01-27 02:53:44 +0000 |
3855 | @@ -0,0 +1,347 @@ |
3856 | +# This file was automatically created by FeynRules $Revision: 302 $ |
3857 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
3858 | +# Date: Tue 31 Aug 2010 16:54:46 |
3859 | + |
3860 | + |
3861 | +from object_library import all_vertices, Vertex |
3862 | +import particles as P |
3863 | +import couplings as C |
3864 | +import lorentz as L |
3865 | + |
3866 | + |
3867 | +V_1 = Vertex(name = 'V_1', |
3868 | + particles = [ P.H, P.H, P.H ], |
3869 | + color = [ '1' ], |
3870 | + lorentz = [ L.SSS1 ], |
3871 | + couplings = {(0,0):C.GC_21}) |
3872 | + |
3873 | +V_2 = Vertex(name = 'V_2', |
3874 | + particles = [ P.G, P.G, P.G ], |
3875 | + color = [ 'f(1,2,3)' ], |
3876 | + lorentz = [ L.VVV1 ], |
3877 | + couplings = {(0,0):C.GC_4}) |
3878 | + |
3879 | +V_3 = Vertex(name = 'V_3', |
3880 | + particles = [ P.G, P.G, P.G, P.G ], |
3881 | + color = [ 'f(2,3,\'a1\')*f(\'a1\',1,4)', 'f(2,4,\'a1\')*f(\'a1\',1,3)', 'f(3,4,\'a1\')*f(\'a1\',1,2)' ], |
3882 | + lorentz = [ L.VVVV1, L.VVVV3, L.VVVV4 ], |
3883 | + couplings = {(1,1):C.GC_6,(2,0):C.GC_6,(0,2):C.GC_6}) |
3884 | + |
3885 | +V_4 = Vertex(name = 'V_4', |
3886 | + particles = [ P.A, P.W__minus__, P.W__plus__ ], |
3887 | + color = [ '1' ], |
3888 | + lorentz = [ L.VVV1 ], |
3889 | + couplings = {(0,0):C.GC_16}) |
3890 | + |
3891 | +V_5 = Vertex(name = 'V_5', |
3892 | + particles = [ P.W__minus__, P.W__plus__, P.H, P.H ], |
3893 | + color = [ '1' ], |
3894 | + lorentz = [ L.VVSS1 ], |
3895 | + couplings = {(0,0):C.GC_10}) |
3896 | + |
3897 | +V_6 = Vertex(name = 'V_6', |
3898 | + particles = [ P.W__minus__, P.W__plus__, P.H ], |
3899 | + color = [ '1' ], |
3900 | + lorentz = [ L.VVS1 ], |
3901 | + couplings = {(0,0):C.GC_22}) |
3902 | + |
3903 | +V_7 = Vertex(name = 'V_7', |
3904 | + particles = [ P.A, P.A, P.W__minus__, P.W__plus__ ], |
3905 | + color = [ '1' ], |
3906 | + lorentz = [ L.VVVV2 ], |
3907 | + couplings = {(0,0):C.GC_18}) |
3908 | + |
3909 | +V_8 = Vertex(name = 'V_8', |
3910 | + particles = [ P.W__minus__, P.W__plus__, P.Z ], |
3911 | + color = [ '1' ], |
3912 | + lorentz = [ L.VVV1 ], |
3913 | + couplings = {(0,0):C.GC_7}) |
3914 | + |
3915 | +V_9 = Vertex(name = 'V_9', |
3916 | + particles = [ P.W__minus__, P.W__minus__, P.W__plus__, P.W__plus__ ], |
3917 | + color = [ '1' ], |
3918 | + lorentz = [ L.VVVV2 ], |
3919 | + couplings = {(0,0):C.GC_8}) |
3920 | + |
3921 | +V_10 = Vertex(name = 'V_10', |
3922 | + particles = [ P.A, P.W__minus__, P.W__plus__, P.Z ], |
3923 | + color = [ '1' ], |
3924 | + lorentz = [ L.VVVV5 ], |
3925 | + couplings = {(0,0):C.GC_17}) |
3926 | + |
3927 | +V_11 = Vertex(name = 'V_11', |
3928 | + particles = [ P.Z, P.Z, P.H, P.H ], |
3929 | + color = [ '1' ], |
3930 | + lorentz = [ L.VVSS1 ], |
3931 | + couplings = {(0,0):C.GC_20}) |
3932 | + |
3933 | +V_12 = Vertex(name = 'V_12', |
3934 | + particles = [ P.Z, P.Z, P.H ], |
3935 | + color = [ '1' ], |
3936 | + lorentz = [ L.VVS1 ], |
3937 | + couplings = {(0,0):C.GC_23}) |
3938 | + |
3939 | +V_13 = Vertex(name = 'V_13', |
3940 | + particles = [ P.W__minus__, P.W__plus__, P.Z, P.Z ], |
3941 | + color = [ '1' ], |
3942 | + lorentz = [ L.VVVV2 ], |
3943 | + couplings = {(0,0):C.GC_9}) |
3944 | + |
3945 | +V_14 = Vertex(name = 'V_14', |
3946 | + particles = [ P.d__tilde__, P.d, P.A ], |
3947 | + color = [ 'Identity(1,2)' ], |
3948 | + lorentz = [ L.FFV1 ], |
3949 | + couplings = {(0,0):C.GC_1}) |
3950 | + |
3951 | +V_15 = Vertex(name = 'V_15', |
3952 | + particles = [ P.s__tilde__, P.s, P.A ], |
3953 | + color = [ 'Identity(1,2)' ], |
3954 | + lorentz = [ L.FFV1 ], |
3955 | + couplings = {(0,0):C.GC_1}) |
3956 | + |
3957 | +V_16 = Vertex(name = 'V_16', |
3958 | + particles = [ P.b__tilde__, P.b, P.A ], |
3959 | + color = [ 'Identity(1,2)' ], |
3960 | + lorentz = [ L.FFV1 ], |
3961 | + couplings = {(0,0):C.GC_1}) |
3962 | + |
3963 | +V_17 = Vertex(name = 'V_17', |
3964 | + particles = [ P.e__plus__, P.e__minus__, P.A ], |
3965 | + color = [ '1' ], |
3966 | + lorentz = [ L.FFV1 ], |
3967 | + couplings = {(0,0):C.GC_3}) |
3968 | + |
3969 | +V_18 = Vertex(name = 'V_18', |
3970 | + particles = [ P.m__plus__, P.m__minus__, P.A ], |
3971 | + color = [ '1' ], |
3972 | + lorentz = [ L.FFV1 ], |
3973 | + couplings = {(0,0):C.GC_3}) |
3974 | + |
3975 | +V_19 = Vertex(name = 'V_19', |
3976 | + particles = [ P.tt__plus__, P.tt__minus__, P.A ], |
3977 | + color = [ '1' ], |
3978 | + lorentz = [ L.FFV1 ], |
3979 | + couplings = {(0,0):C.GC_3}) |
3980 | + |
3981 | +V_20 = Vertex(name = 'V_20', |
3982 | + particles = [ P.u__tilde__, P.u, P.A ], |
3983 | + color = [ 'Identity(1,2)' ], |
3984 | + lorentz = [ L.FFV1 ], |
3985 | + couplings = {(0,0):C.GC_2}) |
3986 | + |
3987 | +V_21 = Vertex(name = 'V_21', |
3988 | + particles = [ P.c__tilde__, P.c, P.A ], |
3989 | + color = [ 'Identity(1,2)' ], |
3990 | + lorentz = [ L.FFV1 ], |
3991 | + couplings = {(0,0):C.GC_2}) |
3992 | + |
3993 | +V_22 = Vertex(name = 'V_22', |
3994 | + particles = [ P.t__tilde__, P.t, P.A ], |
3995 | + color = [ 'Identity(1,2)' ], |
3996 | + lorentz = [ L.FFV1 ], |
3997 | + couplings = {(0,0):C.GC_2}) |
3998 | + |
3999 | +V_23 = Vertex(name = 'V_23', |
4000 | + particles = [ P.d__tilde__, P.d, P.G ], |
4001 | + color = [ 'T(3,2,1)' ], |
4002 | + lorentz = [ L.FFV1 ], |
4003 | + couplings = {(0,0):C.GC_5}) |
4004 | + |
4005 | +V_24 = Vertex(name = 'V_24', |
4006 | + particles = [ P.s__tilde__, P.s, P.G ], |
4007 | + color = [ 'T(3,2,1)' ], |
4008 | + lorentz = [ L.FFV1 ], |
4009 | + couplings = {(0,0):C.GC_5}) |
4010 | + |
4011 | +V_25 = Vertex(name = 'V_25', |
4012 | + particles = [ P.b__tilde__, P.b, P.G ], |
4013 | + color = [ 'T(3,2,1)' ], |
4014 | + lorentz = [ L.FFV1 ], |
4015 | + couplings = {(0,0):C.GC_5}) |
4016 | + |
4017 | +V_26 = Vertex(name = 'V_26', |
4018 | + particles = [ P.b__tilde__, P.b, P.H ], |
4019 | + color = [ 'Identity(1,2)' ], |
4020 | + lorentz = [ L.FFS1 ], |
4021 | + couplings = {(0,0):C.GC_24}) |
4022 | + |
4023 | +V_27 = Vertex(name = 'V_27', |
4024 | + particles = [ P.d__tilde__, P.d, P.Z ], |
4025 | + color = [ 'Identity(1,2)' ], |
4026 | + lorentz = [ L.FFV2, L.FFV3 ], |
4027 | + couplings = {(0,0):C.GC_12,(0,1):C.GC_14}) |
4028 | + |
4029 | +V_28 = Vertex(name = 'V_28', |
4030 | + particles = [ P.s__tilde__, P.s, P.Z ], |
4031 | + color = [ 'Identity(1,2)' ], |
4032 | + lorentz = [ L.FFV2, L.FFV3 ], |
4033 | + couplings = {(0,0):C.GC_12,(0,1):C.GC_14}) |
4034 | + |
4035 | +V_29 = Vertex(name = 'V_29', |
4036 | + particles = [ P.b__tilde__, P.b, P.Z ], |
4037 | + color = [ 'Identity(1,2)' ], |
4038 | + lorentz = [ L.FFV2, L.FFV3 ], |
4039 | + couplings = {(0,0):C.GC_12,(0,1):C.GC_14}) |
4040 | + |
4041 | +V_30 = Vertex(name = 'V_30', |
4042 | + particles = [ P.d__tilde__, P.u, P.W__minus__ ], |
4043 | + color = [ 'Identity(1,2)' ], |
4044 | + lorentz = [ L.FFV2 ], |
4045 | + couplings = {(0,0):C.GC_11}) |
4046 | + |
4047 | +V_31 = Vertex(name = 'V_31', |
4048 | + particles = [ P.s__tilde__, P.c, P.W__minus__ ], |
4049 | + color = [ 'Identity(1,2)' ], |
4050 | + lorentz = [ L.FFV2 ], |
4051 | + couplings = {(0,0):C.GC_11}) |
4052 | + |
4053 | +V_32 = Vertex(name = 'V_32', |
4054 | + particles = [ P.b__tilde__, P.t, P.W__minus__ ], |
4055 | + color = [ 'Identity(1,2)' ], |
4056 | + lorentz = [ L.FFV2 ], |
4057 | + couplings = {(0,0):C.GC_11}) |
4058 | + |
4059 | +V_33 = Vertex(name = 'V_33', |
4060 | + particles = [ P.u__tilde__, P.d, P.W__plus__ ], |
4061 | + color = [ 'Identity(1,2)' ], |
4062 | + lorentz = [ L.FFV2 ], |
4063 | + couplings = {(0,0):C.GC_11}) |
4064 | + |
4065 | +V_34 = Vertex(name = 'V_34', |
4066 | + particles = [ P.c__tilde__, P.s, P.W__plus__ ], |
4067 | + color = [ 'Identity(1,2)' ], |
4068 | + lorentz = [ L.FFV2 ], |
4069 | + couplings = {(0,0):C.GC_11}) |
4070 | + |
4071 | +V_35 = Vertex(name = 'V_35', |
4072 | + particles = [ P.t__tilde__, P.b, P.W__plus__ ], |
4073 | + color = [ 'Identity(1,2)' ], |
4074 | + lorentz = [ L.FFV2 ], |
4075 | + couplings = {(0,0):C.GC_11}) |
4076 | + |
4077 | +V_36 = Vertex(name = 'V_36', |
4078 | + particles = [ P.u__tilde__, P.u, P.G ], |
4079 | + color = [ 'T(3,2,1)' ], |
4080 | + lorentz = [ L.FFV1 ], |
4081 | + couplings = {(0,0):C.GC_5}) |
4082 | + |
4083 | +V_37 = Vertex(name = 'V_37', |
4084 | + particles = [ P.c__tilde__, P.c, P.G ], |
4085 | + color = [ 'T(3,2,1)' ], |
4086 | + lorentz = [ L.FFV1 ], |
4087 | + couplings = {(0,0):C.GC_5}) |
4088 | + |
4089 | +V_38 = Vertex(name = 'V_38', |
4090 | + particles = [ P.t__tilde__, P.t, P.G ], |
4091 | + color = [ 'T(3,2,1)' ], |
4092 | + lorentz = [ L.FFV1 ], |
4093 | + couplings = {(0,0):C.GC_5}) |
4094 | + |
4095 | +V_39 = Vertex(name = 'V_39', |
4096 | + particles = [ P.tt__plus__, P.tt__minus__, P.H ], |
4097 | + color = [ '1' ], |
4098 | + lorentz = [ L.FFS1 ], |
4099 | + couplings = {(0,0):C.GC_26}) |
4100 | + |
4101 | +V_40 = Vertex(name = 'V_40', |
4102 | + particles = [ P.t__tilde__, P.t, P.H ], |
4103 | + color = [ 'Identity(1,2)' ], |
4104 | + lorentz = [ L.FFS1 ], |
4105 | + couplings = {(0,0):C.GC_25}) |
4106 | + |
4107 | +V_41 = Vertex(name = 'V_41', |
4108 | + particles = [ P.e__plus__, P.e__minus__, P.Z ], |
4109 | + color = [ '1' ], |
4110 | + lorentz = [ L.FFV2, L.FFV4 ], |
4111 | + couplings = {(0,0):C.GC_12,(0,1):C.GC_15}) |
4112 | + |
4113 | +V_42 = Vertex(name = 'V_42', |
4114 | + particles = [ P.m__plus__, P.m__minus__, P.Z ], |
4115 | + color = [ '1' ], |
4116 | + lorentz = [ L.FFV2, L.FFV4 ], |
4117 | + couplings = {(0,0):C.GC_12,(0,1):C.GC_15}) |
4118 | + |
4119 | +V_43 = Vertex(name = 'V_43', |
4120 | + particles = [ P.tt__plus__, P.tt__minus__, P.Z ], |
4121 | + color = [ '1' ], |
4122 | + lorentz = [ L.FFV2, L.FFV4 ], |
4123 | + couplings = {(0,0):C.GC_12,(0,1):C.GC_15}) |
4124 | + |
4125 | +V_44 = Vertex(name = 'V_44', |
4126 | + particles = [ P.e__plus__, P.ve, P.W__minus__ ], |
4127 | + color = [ '1' ], |
4128 | + lorentz = [ L.FFV2 ], |
4129 | + couplings = {(0,0):C.GC_11}) |
4130 | + |
4131 | +V_45 = Vertex(name = 'V_45', |
4132 | + particles = [ P.m__plus__, P.vm, P.W__minus__ ], |
4133 | + color = [ '1' ], |
4134 | + lorentz = [ L.FFV2 ], |
4135 | + couplings = {(0,0):C.GC_11}) |
4136 | + |
4137 | +V_46 = Vertex(name = 'V_46', |
4138 | + particles = [ P.tt__plus__, P.vt, P.W__minus__ ], |
4139 | + color = [ '1' ], |
4140 | + lorentz = [ L.FFV2 ], |
4141 | + couplings = {(0,0):C.GC_11}) |
4142 | + |
4143 | +V_47 = Vertex(name = 'V_47', |
4144 | + particles = [ P.ve__tilde__, P.e__minus__, P.W__plus__ ], |
4145 | + color = [ '1' ], |
4146 | + lorentz = [ L.FFV2 ], |
4147 | + couplings = {(0,0):C.GC_11}) |
4148 | + |
4149 | +V_48 = Vertex(name = 'V_48', |
4150 | + particles = [ P.vm__tilde__, P.m__minus__, P.W__plus__ ], |
4151 | + color = [ '1' ], |
4152 | + lorentz = [ L.FFV2 ], |
4153 | + couplings = {(0,0):C.GC_11}) |
4154 | + |
4155 | +V_49 = Vertex(name = 'V_49', |
4156 | + particles = [ P.vt__tilde__, P.tt__minus__, P.W__plus__ ], |
4157 | + color = [ '1' ], |
4158 | + lorentz = [ L.FFV2 ], |
4159 | + couplings = {(0,0):C.GC_11}) |
4160 | + |
4161 | +V_50 = Vertex(name = 'V_50', |
4162 | + particles = [ P.u__tilde__, P.u, P.Z ], |
4163 | + color = [ 'Identity(1,2)' ], |
4164 | + lorentz = [ L.FFV2, L.FFV5 ], |
4165 | + couplings = {(0,0):C.GC_13,(0,1):C.GC_14}) |
4166 | + |
4167 | +V_51 = Vertex(name = 'V_51', |
4168 | + particles = [ P.c__tilde__, P.c, P.Z ], |
4169 | + color = [ 'Identity(1,2)' ], |
4170 | + lorentz = [ L.FFV2, L.FFV5 ], |
4171 | + couplings = {(0,0):C.GC_13,(0,1):C.GC_14}) |
4172 | + |
4173 | +V_52 = Vertex(name = 'V_52', |
4174 | + particles = [ P.t__tilde__, P.t, P.Z ], |
4175 | + color = [ 'Identity(1,2)' ], |
4176 | + lorentz = [ L.FFV2, L.FFV5 ], |
4177 | + couplings = {(0,0):C.GC_13,(0,1):C.GC_14}) |
4178 | + |
4179 | +V_53 = Vertex(name = 'V_53', |
4180 | + particles = [ P.ve__tilde__, P.ve, P.Z ], |
4181 | + color = [ '1' ], |
4182 | + lorentz = [ L.FFV2 ], |
4183 | + couplings = {(0,0):C.GC_19}) |
4184 | + |
4185 | +V_54 = Vertex(name = 'V_54', |
4186 | + particles = [ P.vm__tilde__, P.vm, P.Z ], |
4187 | + color = [ '1' ], |
4188 | + lorentz = [ L.FFV2 ], |
4189 | + couplings = {(0,0):C.GC_19}) |
4190 | + |
4191 | +V_55 = Vertex(name = 'V_55', |
4192 | + particles = [ P.vt__tilde__, P.vt, P.Z ], |
4193 | + color = [ '1' ], |
4194 | + lorentz = [ L.FFV2 ], |
4195 | + couplings = {(0,0):C.GC_19}) |
4196 | + |
4197 | +V_56 = Vertex(name = 'V_56', |
4198 | + particles = [ P.u__tilde__, P.u__tilde__, P.t, P.t ], |
4199 | + color = [ 'K6(-1,1,2)*K6Bar(-1,3,4)' ], |
4200 | + lorentz = [ L.FFFF1 ], |
4201 | + couplings = {(0,0):C.GC_27}) |
4202 | + |
4203 | |
4204 | === added file 'models/uutt_sch_4fermion/write_param_card.py' |
4205 | --- models/uutt_sch_4fermion/write_param_card.py 1970-01-01 00:00:00 +0000 |
4206 | +++ models/uutt_sch_4fermion/write_param_card.py 2011-01-27 02:53:44 +0000 |
4207 | @@ -0,0 +1,65 @@ |
4208 | + |
4209 | +__date__ = "3 june 2010" |
4210 | +__author__ = 'olivier.mattelaer@uclouvain.be' |
4211 | + |
4212 | +class ParamCardWriter(object): |
4213 | + |
4214 | + header = \ |
4215 | + """######################################################################\n""" + \ |
4216 | + """## PARAM_CARD AUTOMATICALY GENERATED BY THE UFO #####################\n""" + \ |
4217 | + """######################################################################\n""" |
4218 | + |
4219 | + def __init__(self, filename, list_of_parameters=None): |
4220 | + """write a valid param_card.dat""" |
4221 | + |
4222 | + if not list_of_parameters: |
4223 | + from parameters import all_parameters |
4224 | + list_of_parameters = [param for param in all_parameters if \ |
4225 | + param.nature=='external'] |
4226 | + |
4227 | + self.fsock = open(filename, 'w') |
4228 | + self.fsock.write(self.header) |
4229 | + |
4230 | + self.write_card(list_of_parameters) |
4231 | + |
4232 | + |
4233 | + def write_card(self, all_ext_param): |
4234 | + """ """ |
4235 | + |
4236 | + |
4237 | + |
4238 | + # list all lhablock |
4239 | + all_lhablock = set([param.lhablock for param in all_ext_param]) |
4240 | + |
4241 | + # ordonate lhablock alphabeticaly |
4242 | + list(all_lhablock).sort() |
4243 | + |
4244 | + for lhablock in all_lhablock: |
4245 | + self.write_block(lhablock) |
4246 | + [self.write_param(param, lhablock) for param in all_ext_param if \ |
4247 | + param.lhablock == lhablock] |
4248 | + def write_block(self, name): |
4249 | + """ write a comment for a block""" |
4250 | + |
4251 | + self.fsock.writelines( |
4252 | + """\n###################################""" + \ |
4253 | + """\n## INFORMATION FOR %s""" % name.upper() +\ |
4254 | + """\n###################################\n""" |
4255 | + ) |
4256 | + if name!='DECAY': |
4257 | + self.fsock.write("""Block %s \n""" % name) |
4258 | + |
4259 | + def write_param(self, param, lhablock): |
4260 | + |
4261 | + lhacode=' '.join(['%3s' % key for key in param.lhacode]) |
4262 | + if lhablock != 'DECAY': |
4263 | + text = """ %s %e # %s \n""" % (lhacode, param.value, param.name ) |
4264 | + else: |
4265 | + text = '''DECAY %s %e \n''' % (lhacode, param.value) |
4266 | + self.fsock.write(text) |
4267 | + |
4268 | + |
4269 | +if '__main__' == __name__: |
4270 | + ParamCardWriter('./param_card.dat') |
4271 | + print 'done' |
4272 | + |
4273 | |
4274 | === added directory 'models/uutt_tch_4fermion' |
4275 | === added file 'models/uutt_tch_4fermion/__init__.py' |
4276 | --- models/uutt_tch_4fermion/__init__.py 1970-01-01 00:00:00 +0000 |
4277 | +++ models/uutt_tch_4fermion/__init__.py 2011-01-27 02:53:44 +0000 |
4278 | @@ -0,0 +1,15 @@ |
4279 | + |
4280 | +import particles |
4281 | +import couplings |
4282 | +import lorentz |
4283 | +import parameters |
4284 | +import vertices |
4285 | +import write_param_card |
4286 | + |
4287 | + |
4288 | +all_particles = particles.all_particles |
4289 | +all_vertices = vertices.all_vertices |
4290 | +all_couplings = couplings.all_couplings |
4291 | +all_lorentz = lorentz.all_lorentz |
4292 | +all_parameters = parameters.all_parameters |
4293 | +all_functions = function_library.all_functions |
4294 | |
4295 | === added file 'models/uutt_tch_4fermion/couplings.py' |
4296 | --- models/uutt_tch_4fermion/couplings.py 1970-01-01 00:00:00 +0000 |
4297 | +++ models/uutt_tch_4fermion/couplings.py 2011-01-27 02:53:44 +0000 |
4298 | @@ -0,0 +1,122 @@ |
4299 | +# This file was automatically created by FeynRules $Revision: 302 $ |
4300 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
4301 | +# Date: Tue 31 Aug 2010 16:54:46 |
4302 | + |
4303 | + |
4304 | +from object_library import all_couplings, Coupling |
4305 | + |
4306 | +from function_library import complexconjugate, re, im, csc, sec, acsc, asec |
4307 | + |
4308 | + |
4309 | + |
4310 | +GC_1 = Coupling(name = 'GC_1', |
4311 | + value = '-(ee*complex(0,1))/3.', |
4312 | + order = {'QED':1}) |
4313 | + |
4314 | +GC_2 = Coupling(name = 'GC_2', |
4315 | + value = '(2*ee*complex(0,1))/3.', |
4316 | + order = {'QED':1}) |
4317 | + |
4318 | +GC_3 = Coupling(name = 'GC_3', |
4319 | + value = '-(ee*complex(0,1))', |
4320 | + order = {'QED':1}) |
4321 | + |
4322 | +GC_4 = Coupling(name = 'GC_4', |
4323 | + value = '-G', |
4324 | + order = {'QCD':1}) |
4325 | + |
4326 | +GC_5 = Coupling(name = 'GC_5', |
4327 | + value = 'complex(0,1)*G', |
4328 | + order = {'QCD':1}) |
4329 | + |
4330 | +GC_6 = Coupling(name = 'GC_6', |
4331 | + value = 'complex(0,1)*G**2', |
4332 | + order = {'QCD':2}) |
4333 | + |
4334 | +GC_7 = Coupling(name = 'GC_7', |
4335 | + value = 'cw*complex(0,1)*gw', |
4336 | + order = {'QED':1}) |
4337 | + |
4338 | +GC_8 = Coupling(name = 'GC_8', |
4339 | + value = '-(complex(0,1)*gw**2)', |
4340 | + order = {'QED':2}) |
4341 | + |
4342 | +GC_9 = Coupling(name = 'GC_9', |
4343 | + value = 'cw**2*complex(0,1)*gw**2', |
4344 | + order = {'QED':2}) |
4345 | + |
4346 | +GC_10 = Coupling(name = 'GC_10', |
4347 | + value = '(ee**2*complex(0,1))/(2.*sw**2)', |
4348 | + order = {'QED':2}) |
4349 | + |
4350 | +GC_11 = Coupling(name = 'GC_11', |
4351 | + value = '(ee*complex(0,1))/(sw*cmath.sqrt(2))', |
4352 | + order = {'QED':1}) |
4353 | + |
4354 | +GC_12 = Coupling(name = 'GC_12', |
4355 | + value = '-(cw*ee*complex(0,1))/(2.*sw)', |
4356 | + order = {'QED':1}) |
4357 | + |
4358 | +GC_13 = Coupling(name = 'GC_13', |
4359 | + value = '(cw*ee*complex(0,1))/(2.*sw)', |
4360 | + order = {'QED':1}) |
4361 | + |
4362 | +GC_14 = Coupling(name = 'GC_14', |
4363 | + value = '-(ee*complex(0,1)*sw)/(6.*cw)', |
4364 | + order = {'QED':1}) |
4365 | + |
4366 | +GC_15 = Coupling(name = 'GC_15', |
4367 | + value = '(ee*complex(0,1)*sw)/(2.*cw)', |
4368 | + order = {'QED':1}) |
4369 | + |
4370 | +GC_16 = Coupling(name = 'GC_16', |
4371 | + value = 'complex(0,1)*gw*sw', |
4372 | + order = {'QED':1}) |
4373 | + |
4374 | +GC_17 = Coupling(name = 'GC_17', |
4375 | + value = '-2*cw*complex(0,1)*gw**2*sw', |
4376 | + order = {'QED':2}) |
4377 | + |
4378 | +GC_18 = Coupling(name = 'GC_18', |
4379 | + value = 'complex(0,1)*gw**2*sw**2', |
4380 | + order = {'QED':2}) |
4381 | + |
4382 | +GC_19 = Coupling(name = 'GC_19', |
4383 | + value = '(cw*ee*complex(0,1))/(2.*sw) + (ee*complex(0,1)*sw)/(2.*cw)', |
4384 | + order = {'QED':1}) |
4385 | + |
4386 | +GC_20 = Coupling(name = 'GC_20', |
4387 | + value = 'ee**2*complex(0,1) + (cw**2*ee**2*complex(0,1))/(2.*sw**2) + (ee**2*complex(0,1)*sw**2)/(2.*cw**2)', |
4388 | + order = {'QED':2}) |
4389 | + |
4390 | +GC_21 = Coupling(name = 'GC_21', |
4391 | + value = '-6*complex(0,1)*lam*v', |
4392 | + order = {'QED':1}) |
4393 | + |
4394 | +GC_22 = Coupling(name = 'GC_22', |
4395 | + value = '(ee**2*complex(0,1)*v)/(2.*sw**2)', |
4396 | + order = {'QED':1}) |
4397 | + |
4398 | +GC_23 = Coupling(name = 'GC_23', |
4399 | + value = 'ee**2*complex(0,1)*v + (cw**2*ee**2*complex(0,1)*v)/(2.*sw**2) + (ee**2*complex(0,1)*sw**2*v)/(2.*cw**2)', |
4400 | + order = {'QED':1}) |
4401 | + |
4402 | +GC_24 = Coupling(name = 'GC_24', |
4403 | + value = '-((complex(0,1)*yb)/cmath.sqrt(2))', |
4404 | + order = {'QED':1}) |
4405 | + |
4406 | +GC_25 = Coupling(name = 'GC_25', |
4407 | + value = '-((complex(0,1)*yt)/cmath.sqrt(2))', |
4408 | + order = {'QED':1}) |
4409 | + |
4410 | +GC_26 = Coupling(name = 'GC_26', |
4411 | + value = '-((complex(0,1)*ytau)/cmath.sqrt(2))', |
4412 | + order = {'QED':1}) |
4413 | + |
4414 | +# 4-fermion coupling is 2*g^2*prop for t-channel (due to FS symmetry) |
4415 | +GC_27 = Coupling(name = 'GC_27', |
4416 | + value = 'complex(0,1)*GSUT**2/MSut**2', |
4417 | + order = {'NP':2}) |
4418 | +GC_28 = Coupling(name = 'GC_28', |
4419 | + value = '-complex(0,1)*GSUT**2/MSut**2', |
4420 | + order = {'NP':2}) |
4421 | |
4422 | === added file 'models/uutt_tch_4fermion/function_library.py' |
4423 | --- models/uutt_tch_4fermion/function_library.py 1970-01-01 00:00:00 +0000 |
4424 | +++ models/uutt_tch_4fermion/function_library.py 2011-01-27 02:53:44 +0000 |
4425 | @@ -0,0 +1,54 @@ |
4426 | +# This file is part of the UFO. |
4427 | +# |
4428 | +# This file contains definitions for functions that |
4429 | +# are extensions of the cmath library, and correspond |
4430 | +# either to functions that are in cmath, but inconvenient |
4431 | +# to access from there (e.g. z.conjugate()), |
4432 | +# or functions that are simply not defined. |
4433 | +# |
4434 | +# |
4435 | + |
4436 | +__date__ = "22 July 2010" |
4437 | +__author__ = "claude.duhr@durham.ac.uk" |
4438 | + |
4439 | +import cmath |
4440 | +from object_library import all_functions, Function |
4441 | + |
4442 | +# |
4443 | +# shortcuts for functions from cmath |
4444 | +# |
4445 | + |
4446 | +complexconjugate = Function(name = 'complexconjugate', |
4447 | + arguments = ('z',), |
4448 | + expression = 'z.conjugate()') |
4449 | + |
4450 | + |
4451 | +re = Function(name = 're', |
4452 | + arguments = ('z',), |
4453 | + expression = 'z.real') |
4454 | + |
4455 | +im = Function(name = 'im', |
4456 | + arguments = ('z',), |
4457 | + expression = 'z.imag') |
4458 | + |
4459 | +# New functions (trigonometric) |
4460 | + |
4461 | +sec = Function(name = 'sec', |
4462 | + arguments = ('z',), |
4463 | + expression = '1./cmath.cos(z)') |
4464 | + |
4465 | +asec = Function(name = 'asec', |
4466 | + arguments = ('z',), |
4467 | + expression = 'cmath.acos(1./z)') |
4468 | + |
4469 | +csc = Function(name = 'csc', |
4470 | + arguments = ('z',), |
4471 | + expression = '1./cmath.sin(z)') |
4472 | + |
4473 | +acsc = Function(name = 'acsc', |
4474 | + arguments = ('z',), |
4475 | + expression = 'cmath.asin(1./z)') |
4476 | + |
4477 | + |
4478 | + |
4479 | + |
4480 | |
4481 | === added file 'models/uutt_tch_4fermion/lorentz.py' |
4482 | --- models/uutt_tch_4fermion/lorentz.py 1970-01-01 00:00:00 +0000 |
4483 | +++ models/uutt_tch_4fermion/lorentz.py 2011-01-27 02:53:44 +0000 |
4484 | @@ -0,0 +1,79 @@ |
4485 | +# This file was automatically created by FeynRules $Revision: 302 $ |
4486 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
4487 | +# Date: Tue 31 Aug 2010 16:54:46 |
4488 | + |
4489 | + |
4490 | +from object_library import all_lorentz, Lorentz |
4491 | + |
4492 | +from function_library import complexconjugate, re, im, csc, sec, acsc, asec |
4493 | + |
4494 | + |
4495 | + |
4496 | +SSS1 = Lorentz(name = 'SSS1', |
4497 | + spins = [ 1, 1, 1 ], |
4498 | + structure = '1') |
4499 | + |
4500 | +FFS1 = Lorentz(name = 'FFS1', |
4501 | + spins = [ 2, 2, 1 ], |
4502 | + structure = 'Identity(1,2)') |
4503 | + |
4504 | +FFV1 = Lorentz(name = 'FFV1', |
4505 | + spins = [ 2, 2, 3 ], |
4506 | + structure = 'Gamma(3,2,1)') |
4507 | + |
4508 | +FFV2 = Lorentz(name = 'FFV2', |
4509 | + spins = [ 2, 2, 3 ], |
4510 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1)') |
4511 | + |
4512 | +FFV3 = Lorentz(name = 'FFV3', |
4513 | + spins = [ 2, 2, 3 ], |
4514 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1) - 2*Gamma(3,2,\'s1\')*ProjP(\'s1\',1)') |
4515 | + |
4516 | +FFV4 = Lorentz(name = 'FFV4', |
4517 | + spins = [ 2, 2, 3 ], |
4518 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1) + 2*Gamma(3,2,\'s1\')*ProjP(\'s1\',1)') |
4519 | + |
4520 | +FFV5 = Lorentz(name = 'FFV5', |
4521 | + spins = [ 2, 2, 3 ], |
4522 | + structure = 'Gamma(3,2,\'s1\')*ProjM(\'s1\',1) + 4*Gamma(3,2,\'s1\')*ProjP(\'s1\',1)') |
4523 | + |
4524 | +VVS1 = Lorentz(name = 'VVS1', |
4525 | + spins = [ 3, 3, 1 ], |
4526 | + structure = 'Metric(1,2)') |
4527 | + |
4528 | +VVV1 = Lorentz(name = 'VVV1', |
4529 | + spins = [ 3, 3, 3 ], |
4530 | + structure = 'P(3,1)*Metric(1,2) - P(3,2)*Metric(1,2) - P(2,1)*Metric(1,3) + P(2,3)*Metric(1,3) + P(1,2)*Metric(2,3) - P(1,3)*Metric(2,3)') |
4531 | + |
4532 | +VVSS1 = Lorentz(name = 'VVSS1', |
4533 | + spins = [ 3, 3, 1, 1 ], |
4534 | + structure = 'Metric(1,2)') |
4535 | + |
4536 | +VVVV1 = Lorentz(name = 'VVVV1', |
4537 | + spins = [ 3, 3, 3, 3 ], |
4538 | + structure = 'Metric(1,4)*Metric(2,3) - Metric(1,3)*Metric(2,4)') |
4539 | + |
4540 | +VVVV2 = Lorentz(name = 'VVVV2', |
4541 | + spins = [ 3, 3, 3, 3 ], |
4542 | + structure = 'Metric(1,4)*Metric(2,3) + Metric(1,3)*Metric(2,4) - 2*Metric(1,2)*Metric(3,4)') |
4543 | + |
4544 | +VVVV3 = Lorentz(name = 'VVVV3', |
4545 | + spins = [ 3, 3, 3, 3 ], |
4546 | + structure = 'Metric(1,4)*Metric(2,3) - Metric(1,2)*Metric(3,4)') |
4547 | + |
4548 | +VVVV4 = Lorentz(name = 'VVVV4', |
4549 | + spins = [ 3, 3, 3, 3 ], |
4550 | + structure = 'Metric(1,3)*Metric(2,4) - Metric(1,2)*Metric(3,4)') |
4551 | + |
4552 | +VVVV5 = Lorentz(name = 'VVVV5', |
4553 | + spins = [ 3, 3, 3, 3 ], |
4554 | + structure = 'Metric(1,4)*Metric(2,3) - (Metric(1,3)*Metric(2,4))/2. - (Metric(1,2)*Metric(3,4))/2.') |
4555 | + |
4556 | +FFFF1 = Lorentz(name = 'FFFF1', |
4557 | + spins = [ 2, 2, 2, 2 ], |
4558 | + structure = 'Identity(1,2)*Identity(3,4)') |
4559 | + |
4560 | +FFFF2 = Lorentz(name = 'FFFF2', |
4561 | + spins = [ 2, 2, 2, 2 ], |
4562 | + structure = 'Identity(1,4)*Identity(3,2)') |
4563 | + |
4564 | |
4565 | === added file 'models/uutt_tch_4fermion/object_library.py' |
4566 | --- models/uutt_tch_4fermion/object_library.py 1970-01-01 00:00:00 +0000 |
4567 | +++ models/uutt_tch_4fermion/object_library.py 2011-01-27 02:53:44 +0000 |
4568 | @@ -0,0 +1,191 @@ |
4569 | +## |
4570 | +## |
4571 | +## Feynrules Header |
4572 | +## |
4573 | +## |
4574 | +## |
4575 | +## |
4576 | +## |
4577 | + |
4578 | +import cmath |
4579 | + |
4580 | + |
4581 | +class FRBaseClass(object): |
4582 | + """The class from which all FeynRules classes are derived.""" |
4583 | + |
4584 | + require_args = [] |
4585 | + |
4586 | + def __init__(self, *args, **options): |
4587 | + assert(len(self.require_args) == len (args)) |
4588 | + |
4589 | + for i, name in enumerate(self.require_args): |
4590 | + setattr(self, name, args[i]) |
4591 | + |
4592 | + for (option, value) in options.items(): |
4593 | + setattr(self, option, value) |
4594 | + |
4595 | + def get(self, name): |
4596 | + return getattr(self, name) |
4597 | + |
4598 | + def set(self, name, value): |
4599 | + setattr(self, name, value) |
4600 | + |
4601 | + def get_all(self): |
4602 | + """Return a dictionary containing all the information of the object""" |
4603 | + return self.__dict__ |
4604 | + |
4605 | + def __str__(self): |
4606 | + return self.name |
4607 | + |
4608 | + |
4609 | + def __repr__(self): |
4610 | + replacements = [ |
4611 | + ('+','__plus__'), |
4612 | + ('-','__minus__'), |
4613 | + ('@','__at__'), |
4614 | + ('!','__exclam__'), |
4615 | + ('?','__quest__'), |
4616 | + ('*','__star__'), |
4617 | + ('~','__tilde__') |
4618 | + ] |
4619 | + text = self.name |
4620 | + for orig,sub in replacements: |
4621 | + text = text.replace(orig,sub) |
4622 | + return text |
4623 | + |
4624 | + |
4625 | + |
4626 | +all_particles = [] |
4627 | + |
4628 | + |
4629 | + |
4630 | +class Particle(FRBaseClass): |
4631 | + """A standard Particle""" |
4632 | + |
4633 | + require_args=['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge'] |
4634 | + |
4635 | + require_args_all = ['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge', 'propagating', 'goldstoneboson'] |
4636 | + |
4637 | + def __init__(self, pdg_code, name, antiname, spin, color, mass, width, texname, |
4638 | + antitexname, line, charge , propagating=True, goldstoneboson=False, **options): |
4639 | + |
4640 | + args= (pdg_code, name, antiname, spin, color, mass, width, texname, |
4641 | + antitexname, line, float(charge)) |
4642 | + |
4643 | + FRBaseClass.__init__(self, *args, **options) |
4644 | + |
4645 | + global all_particles |
4646 | + all_particles.append(self) |
4647 | + |
4648 | + self.propagating = propagating |
4649 | + self.goldstoneboson= goldstoneboson |
4650 | + |
4651 | + self.selfconjugate = (name == antiname) |
4652 | + |
4653 | + def anti(self): |
4654 | + if self.selfconjugate: |
4655 | + raise Exception('%s has no anti particle.' % self.name) |
4656 | + outdic = {} |
4657 | + for k,v in self.__dict__.iteritems(): |
4658 | + if k not in self.require_args_all: |
4659 | + outdic[k] = -v |
4660 | + if self.color in [1,8]: |
4661 | + newcolor = self.color |
4662 | + else: |
4663 | + newcolor = -self.color |
4664 | + |
4665 | + return Particle(-self.pdg_code, self.antiname, self.name, self.spin, newcolor, self.mass, self.width, |
4666 | + self.antitexname, self.texname, self.line, -self.charge, self.propagating, self.goldstoneboson, **outdic) |
4667 | + |
4668 | + |
4669 | + |
4670 | +all_parameters = [] |
4671 | + |
4672 | +class Parameter(FRBaseClass): |
4673 | + |
4674 | + require_args=['name', 'nature', 'type', 'value', 'texname'] |
4675 | + |
4676 | + def __init__(self, name, nature, type, value, texname, lhablock=None, lhacode=None): |
4677 | + |
4678 | + args = (name,nature,type,value,texname) |
4679 | + |
4680 | + FRBaseClass.__init__(self, *args) |
4681 | + |
4682 | + args=(name,nature,type,value,texname) |
4683 | + |
4684 | + global all_parameters |
4685 | + all_parameters.append(self) |
4686 | + |
4687 | + if (lhablock is None or lhacode is None) and nature == 'external': |
4688 | + raise Exception('Need LHA information for external parameter "%s".' % name) |
4689 | + self.lhablock = lhablock |
4690 | + self.lhacode = lhacode |
4691 | + |
4692 | +all_vertices = [] |
4693 | + |
4694 | +class Vertex(FRBaseClass): |
4695 | + |
4696 | + require_args=['name', 'particles', 'color', 'lorentz', 'couplings'] |
4697 | + |
4698 | + def __init__(self, name, particles, color, lorentz, couplings, **opt): |
4699 | + |
4700 | + args = (name, particles, color, lorentz, couplings) |
4701 | + |
4702 | + FRBaseClass.__init__(self, *args, **opt) |
4703 | + |
4704 | + args=(particles,color,lorentz,couplings) |
4705 | + |
4706 | + global all_vertices |
4707 | + all_vertices.append(self) |
4708 | + |
4709 | +all_couplings = [] |
4710 | + |
4711 | +class Coupling(FRBaseClass): |
4712 | + |
4713 | + require_args=['name', 'value', 'order'] |
4714 | + |
4715 | + def __init__(self, name, value, order, **opt): |
4716 | + |
4717 | + args =(name, value, order) |
4718 | + FRBaseClass.__init__(self, *args, **opt) |
4719 | + global all_couplings |
4720 | + all_couplings.append(self) |
4721 | + |
4722 | + |
4723 | + |
4724 | +all_lorentz = [] |
4725 | + |
4726 | +class Lorentz(FRBaseClass): |
4727 | + |
4728 | + require_args=['name','spins','structure'] |
4729 | + |
4730 | + def __init__(self, name, spins, structure, **opt): |
4731 | + args = (name, spins, structure) |
4732 | + FRBaseClass.__init__(self, *args, **opt) |
4733 | + |
4734 | + global all_lorentz |
4735 | + all_lorentz.append(self) |
4736 | + |
4737 | + |
4738 | +all_functions = [] |
4739 | + |
4740 | +class Function(object): |
4741 | + |
4742 | + def __init__(self, name, arguments, expression): |
4743 | + |
4744 | + global all_functions |
4745 | + all_functions.append(self) |
4746 | + |
4747 | + self.name = name |
4748 | + self.arguments = arguments |
4749 | + self.expr = expression |
4750 | + |
4751 | + def __call__(self, *opt): |
4752 | + |
4753 | + for i, arg in enumerate(self.arguments): |
4754 | + exec('%s = %s' % (arg, opt[i] )) |
4755 | + |
4756 | + return eval(self.expr) |
4757 | + |
4758 | + |
4759 | + |
4760 | |
4761 | === added file 'models/uutt_tch_4fermion/parameters.py' |
4762 | --- models/uutt_tch_4fermion/parameters.py 1970-01-01 00:00:00 +0000 |
4763 | +++ models/uutt_tch_4fermion/parameters.py 2011-01-27 02:53:44 +0000 |
4764 | @@ -0,0 +1,237 @@ |
4765 | +# This file was automatically created by FeynRules $Revision: 302 $ |
4766 | +# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008) |
4767 | +# Date: Tue 31 Aug 2010 16:54:46 |
4768 | + |
4769 | + |
4770 | + |
4771 | +from object_library import all_parameters, Parameter |
4772 | + |
4773 | + |
4774 | +from function_library import complexconjugate, re, im, csc, sec, acsc, asec |
4775 | + |
4776 | +aEWM1 = Parameter(name = 'aEWM1', |
4777 | + nature = 'external', |
4778 | + type = 'real', |
4779 | + value = 132.50698, |
4780 | + texname = '\\text{aEWM1}', |
4781 | + lhablock = 'SMINPUTS', |
4782 | + lhacode = [ 1 ]) |
4783 | + |
4784 | +Gf = Parameter(name = 'Gf', |
4785 | + nature = 'external', |
4786 | + type = 'real', |
4787 | + value = 0.0000116639, |
4788 | + texname = 'G_f', |
4789 | + lhablock = 'SMINPUTS', |
4790 | + lhacode = [ 2 ]) |
4791 | + |
4792 | +aS = Parameter(name = 'aS', |
4793 | + nature = 'external', |
4794 | + type = 'real', |
4795 | + value = 0.118, |
4796 | + texname = '\\text{aS}', |
4797 | + lhablock = 'SMINPUTS', |
4798 | + lhacode = [ 3 ]) |
4799 | + |
4800 | +ymb = Parameter(name = 'ymb', |
4801 | + nature = 'external', |
4802 | + type = 'real', |
4803 | + value = 4.2, |
4804 | + texname = '\\text{ymb}', |
4805 | + lhablock = 'YUKAWA', |
4806 | + lhacode = [ 5 ]) |
4807 | + |
4808 | +ymt = Parameter(name = 'ymt', |
4809 | + nature = 'external', |
4810 | + type = 'real', |
4811 | + value = 164.5, |
4812 | + texname = '\\text{ymt}', |
4813 | + lhablock = 'YUKAWA', |
4814 | + lhacode = [ 6 ]) |
4815 | + |
4816 | +ymtau = Parameter(name = 'ymtau', |
4817 | + nature = 'external', |
4818 | + type = 'real', |
4819 | + value = 1.777, |
4820 | + texname = '\\text{ymtau}', |
4821 | + lhablock = 'YUKAWA', |
4822 | + lhacode = [ 15 ]) |
4823 | + |
4824 | +MTA = Parameter(name = 'MTA', |
4825 | + nature = 'external', |
4826 | + type = 'real', |
4827 | + value = 1.777, |
4828 | + texname = '\\text{MTA}', |
4829 | + lhablock = 'MASS', |
4830 | + lhacode = [ 15 ]) |
4831 | + |
4832 | +MT = Parameter(name = 'MT', |
4833 | + nature = 'external', |
4834 | + type = 'real', |
4835 | + value = 174.3, |
4836 | + texname = '\\text{MT}', |
4837 | + lhablock = 'MASS', |
4838 | + lhacode = [ 6 ]) |
4839 | + |
4840 | +MB = Parameter(name = 'MB', |
4841 | + nature = 'external', |
4842 | + type = 'real', |
4843 | + value = 4.7, |
4844 | + texname = '\\text{MB}', |
4845 | + lhablock = 'MASS', |
4846 | + lhacode = [ 5 ]) |
4847 | + |
4848 | +MZ = Parameter(name = 'MZ', |
4849 | + nature = 'external', |
4850 | + type = 'real', |
4851 | + value = 91.188, |
4852 | + texname = '\\text{MZ}', |
4853 | + lhablock = 'MASS', |
4854 | + lhacode = [ 23 ]) |
4855 | + |
4856 | +MH = Parameter(name = 'MH', |
4857 | + nature = 'external', |
4858 | + type = 'real', |
4859 | + value = 120., |
4860 | + texname = '\\text{MH}', |
4861 | + lhablock = 'MASS', |
4862 | + lhacode = [ 25 ]) |
4863 | + |
4864 | +WT = Parameter(name = 'WT', |
4865 | + nature = 'external', |
4866 | + type = 'real', |
4867 | + value = 1.50833649, |
4868 | + texname = '\\text{WT}', |
4869 | + lhablock = 'DECAY', |
4870 | + lhacode = [ 6 ]) |
4871 | + |
4872 | +WZ = Parameter(name = 'WZ', |
4873 | + nature = 'external', |
4874 | + type = 'real', |
4875 | + value = 2.44140351, |
4876 | + texname = '\\text{WZ}', |
4877 | + lhablock = 'DECAY', |
4878 | + lhacode = [ 23 ]) |
4879 | + |
4880 | +WW = Parameter(name = 'WW', |
4881 | + nature = 'external', |
4882 | + type = 'real', |
4883 | + value = 2.04759951, |
4884 | + texname = '\\text{WW}', |
4885 | + lhablock = 'DECAY', |
4886 | + lhacode = [ 24 ]) |
4887 | + |
4888 | +WH = Parameter(name = 'WH', |
4889 | + nature = 'external', |
4890 | + type = 'real', |
4891 | + value = 0.00575308848, |
4892 | + texname = '\\text{WH}', |
4893 | + lhablock = 'DECAY', |
4894 | + lhacode = [ 25 ]) |
4895 | + |
4896 | +aEW = Parameter(name = 'aEW', |
4897 | + nature = 'internal', |
4898 | + type = 'real', |
4899 | + value = '1/aEWM1', |
4900 | + texname = '\\text{aEW}') |
4901 | + |
4902 | +G = Parameter(name = 'G', |
4903 | + nature = 'internal', |
4904 | + type = 'real', |
4905 | + value = '2*cmath.sqrt(aS)*cmath.sqrt(cmath.pi)', |
4906 | + texname = 'G') |
4907 | + |
4908 | +MW = Parameter(name = 'MW', |
4909 | + nature = 'internal', |
4910 | + type = 'real', |
4911 | + value = 'cmath.sqrt(MZ**2/2. + cmath.sqrt(MZ**4/4. - (aEW*cmath.pi*MZ**2)/(Gf*cmath.sqrt(2))))', |
4912 | + texname = 'M_W') |
4913 | + |
4914 | +ee = Parameter(name = 'ee', |
4915 | + nature = 'internal', |
4916 | + type = 'real', |
4917 | + value = '2*cmath.sqrt(aEW)*cmath.sqrt(cmath.pi)', |
4918 | + texname = 'e') |
4919 | + |
4920 | +sw2 = Parameter(name = 'sw2', |
4921 | + nature = 'internal', |
4922 | + type = 'real', |
4923 | + value = '1 - MW**2/MZ**2', |
4924 | + texname = '\\text{sw2}') |
4925 | + |
4926 | +cw = Parameter(name = 'cw', |
4927 | + nature = 'internal', |
4928 | + type = 'real', |
4929 | + value = 'cmath.sqrt(1 - sw2)', |
4930 | + texname = 'c_w') |
4931 | + |
4932 | +sw = Parameter(name = 'sw', |
4933 | + nature = 'internal', |
4934 | + type = 'real', |
4935 | + value = 'cmath.sqrt(sw2)', |
4936 | + texname = 's_w') |
4937 | + |
4938 | +g1 = Parameter(name = 'g1', |
4939 | + nature = 'internal', |
4940 | + type = 'real', |
4941 | + value = 'ee/cw', |
4942 | + texname = 'g_1') |
4943 | + |
4944 | +gw = Parameter(name = 'gw', |
4945 | + nature = 'internal', |
4946 | + type = 'real', |
4947 | + value = 'ee/sw', |
4948 | + texname = 'g_w') |
4949 | + |
4950 | +v = Parameter(name = 'v', |
4951 | + nature = 'internal', |
4952 | + type = 'real', |
4953 | + value = '(2*MW*sw)/ee', |
4954 | + texname = 'v') |
4955 | + |
4956 | +lam = Parameter(name = 'lam', |
4957 | + nature = 'internal', |
4958 | + type = 'real', |
4959 | + value = 'MH**2/(2.*v**2)', |
4960 | + texname = '\\text{lam}') |
4961 | + |
4962 | +yb = Parameter(name = 'yb', |
4963 | + nature = 'internal', |
4964 | + type = 'real', |
4965 | + value = '(ymb*cmath.sqrt(2))/v', |
4966 | + texname = '\\text{yb}') |
4967 | + |
4968 | +yt = Parameter(name = 'yt', |
4969 | + nature = 'internal', |
4970 | + type = 'real', |
4971 | + value = '(ymt*cmath.sqrt(2))/v', |
4972 | + texname = '\\text{yt}') |
4973 | + |
4974 | +ytau = Parameter(name = 'ytau', |
4975 | + nature = 'internal', |
4976 | + type = 'real', |
4977 | + value = '(ymtau*cmath.sqrt(2))/v', |
4978 | + texname = '\\text{ytau}') |
4979 | + |
4980 | +muH = Parameter(name = 'muH', |
4981 | + nature = 'internal', |
4982 | + type = 'real', |
4983 | + value = 'cmath.sqrt(lam*v**2)', |
4984 | + texname = '\\mu ') |
4985 | + |
4986 | +GSUT = Parameter(name = 'GSUT', |
4987 | + nature = 'external', |
4988 | + type = 'real', |
4989 | + value = 0.1, |
4990 | + texname = '\\text{GSUT}', |
4991 | + lhablock = 'BSMINPUTS', |
4992 | + lhacode = [ 1 ]) |
4993 | + |
4994 | +MSut = Parameter(name = 'MSut', |
4995 | + nature = 'external', |
4996 | + type = 'real', |
4997 | + value = 1.e5, |
4998 | + texname = '\\text{Mut}', |
4999 | + lhablock = 'BSMINPUTS', |
5000 | + lhacode = [ 2 ]) |
thanks for the merging, this will help a lot (since the diff is more clear now :-) )