Package aloha :: Module aloha_object
[hide private]
[frames] | no frames]

Source Code for Module aloha.aloha_object

   1  ################################################################################ 
   2  # 
   3  # Copyright (c) 2010 The MadGraph5_aMC@NLO Development team and Contributors 
   4  # 
   5  # This file is a part of the MadGraph5_aMC@NLO project, an application which  
   6  # automatically generates Feynman diagrams and matrix elements for arbitrary 
   7  # high-energy processes in the Standard Model and beyond. 
   8  # 
   9  # It is subject to the MadGraph5_aMC@NLO license which should accompany this  
  10  # distribution. 
  11  # 
  12  # For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch 
  13  # 
  14  ################################################################################ 
  15  ##   Diagram of Class 
  16  ## 
  17  ##    Variable <--- aloha_lib.Variable  
  18  ##               | 
  19  ##               +- LorentzObject <--- Gamma 
  20  ##                                  | 
  21  ##                                  +- Sigma 
  22  ##                                  | 
  23  ##                                  +- P 
  24  ## 
  25  ##    list <--- AddVariable    
  26  ##           | 
  27  ##           +- MultVariable  <--- MultLorentz  
  28  ##            
  29  ##    list <--- LorentzObjectRepresentation <-- ConstantObject 
  30  ## 
  31  ################################################################################ 
  32  from __future__ import division 
  33  from __future__ import absolute_import 
  34  import aloha.aloha_lib as aloha_lib 
  35  import aloha 
  36  import cmath 
  37  from six.moves import range 
38 39 #=============================================================================== 40 # P (Momenta) 41 #=============================================================================== 42 -class L_P(aloha_lib.LorentzObject):
43 """ Helas Object for an Impulsion """ 44 45 contract_first = 1 46
47 - def __init__(self, name, lorentz1, particle):
48 self.particle = particle 49 aloha_lib.LorentzObject.__init__(self, name,[lorentz1], [],['P%s'%particle]) 50 aloha_lib.KERNEL.add_tag((name,))
51
52 - def create_representation(self):
53 self.sub0 = aloha_lib.DVariable('P%s_0' % self.particle) 54 self.sub1 = aloha_lib.DVariable('P%s_1' % self.particle) 55 self.sub2 = aloha_lib.DVariable('P%s_2' % self.particle) 56 self.sub3 = aloha_lib.DVariable('P%s_3' % self.particle) 57 58 self.representation= aloha_lib.LorentzObjectRepresentation( 59 {(0,): self.sub0, (1,): self.sub1, \ 60 (2,): self.sub2, (3,): self.sub3}, 61 self.lorentz_ind, [])
62
63 64 -class P(aloha_lib.FactoryLorentz):
65 """ Helas Object for an Impulsion """ 66 67 object_class = L_P 68 69 #def __init__(self, lorentz1, particle): 70 @classmethod
71 - def get_unique_name(self, lorentz1, particle):
72 return '_P^%s_%s' % (particle, lorentz1)
73
74 75 76 #=============================================================================== 77 # PBar (Momenta = (E, -Px, -Py, -Pz) 78 #=============================================================================== 79 -class L_PBar(aloha_lib.LorentzObject):
80 """ Helas Object for an Impulsion """ 81 82 contract_first = 1 83
84 - def __init__(self, name, lorentz1, particle):
85 self.particle = particle 86 aloha_lib.LorentzObject.__init__(self, name,[lorentz1], [],['PB%s'%particle]) 87 aloha_lib.KERNEL.add_tag((name,))
88
89 - def create_representation(self):
90 self.sub0 = aloha_lib.DVariable('P%s_0' % self.particle) 91 self.sub1 = aloha_lib.DVariable('P%s_1' % self.particle) 92 self.sub2 = aloha_lib.DVariable('P%s_2' % self.particle) 93 self.sub3 = aloha_lib.DVariable('P%s_3' % self.particle) 94 95 self.representation= aloha_lib.LorentzObjectRepresentation( 96 {(0,): self.sub0, (1,): -self.sub1, \ 97 (2,): -self.sub2, (3,): -self.sub3}, 98 self.lorentz_ind, [])
99
100 101 -class PBar(aloha_lib.FactoryLorentz):
102 """ Helas Object for an Impulsion """ 103 104 object_class = L_PBar 105 106 #def __init__(self, lorentz1, particle): 107 @classmethod
108 - def get_unique_name(self, lorentz1, particle):
109 return '_PB^%s_%s' % (particle, lorentz1)
110
111 #=============================================================================== 112 # P (Momenta) 113 #=============================================================================== 114 -class L_PVec(aloha_lib.LorentzObject):
115 """ Helas Object for an Impulsion """ 116 117 contract_first = 1 118
119 - def __init__(self, name, lorentz1, particle):
120 self.particle = particle 121 aloha_lib.LorentzObject.__init__(self, name,[lorentz1], [],['PVec%s'%particle]) 122 aloha_lib.KERNEL.add_tag((name,))
123
124 - def create_representation(self):
125 #self.sub0 = aloha_lib.DVariable('P%s_0' % self.particle) 126 self.sub1 = aloha_lib.DVariable('P%s_1' % self.particle) 127 self.sub2 = aloha_lib.DVariable('P%s_2' % self.particle) 128 self.sub3 = aloha_lib.DVariable('P%s_3' % self.particle) 129 130 self.representation= aloha_lib.LorentzObjectRepresentation( 131 {(0,): 0, (1,): self.sub1, \ 132 (2,): self.sub2, (3,): self.sub3}, 133 self.lorentz_ind, [])
134
135 136 -class PVec(aloha_lib.FactoryLorentz):
137 """ Helas Object for an Impulsion """ 138 139 object_class = L_PVec 140 141 #def __init__(self, lorentz1, particle): 142 @classmethod
143 - def get_unique_name(self, lorentz1, particle):
144 return '_Pvec^%s_%s' % (particle, lorentz1)
145
146 147 148 #=============================================================================== 149 # Three Norm 150 #=============================================================================== 151 -class L_Tnorm(aloha_lib.LorentzObject):
152 """ Helas Object for DSQRT(Px^2+Py^2+pz^2) """ 153
154 - def __init__(self, name, particle):
155 self.particle = particle 156 aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['|p%s|' % particle])
157
158 - def create_representation(self):
159 mass = aloha_lib.DVariable('Tnorm%s' % self.particle) 160 161 self.representation = aloha_lib.LorentzObjectRepresentation( 162 mass, self.lorentz_ind, self.spin_ind)
163
164 -class Tnorm(aloha_lib.FactoryLorentz):
165 166 object_class = L_Tnorm 167 168 @classmethod
169 - def get_unique_name(self, particle):
170 return '_tnorm_%s' % particle
171
172 #=============================================================================== 173 # |p| + pz 174 #=============================================================================== 175 -class L_TnormZ(aloha_lib.LorentzObject):
176 """ Helas Object for DSQRT(Px^2+Py^2+pz^2) + PZ """ 177
178 - def __init__(self, name, particle):
179 self.particle = particle 180 aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['|p%s|_z' % particle])
181
182 - def create_representation(self):
183 mass = aloha_lib.DVariable('TnormZ%s' % self.particle) 184 185 self.representation = aloha_lib.LorentzObjectRepresentation( 186 mass, self.lorentz_ind, self.spin_ind)
187
188 -class TnormZ(aloha_lib.FactoryLorentz):
189 190 object_class = L_TnormZ 191 192 @classmethod
193 - def get_unique_name(self, particle):
194 return '_tnormz_%s' % particle
195
196 #=============================================================================== 197 # DSQRT(E+- |p|) 198 #=============================================================================== 199 -class L_FermionWP(aloha_lib.LorentzObject):
200 """ Helas Object for DSQRT(Px^2+Py^2+pz^2) """ 201
202 - def __init__(self, name, particle):
203 self.particle = particle 204 aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['FWP_%s' % particle])
205
206 - def create_representation(self):
207 mass = aloha_lib.DVariable('FWP%s' % self.particle) 208 209 self.representation = aloha_lib.LorentzObjectRepresentation( 210 mass, self.lorentz_ind, self.spin_ind)
211
212 -class FermionWP(aloha_lib.FactoryLorentz):
213 214 object_class = L_FermionWP 215 216 @classmethod
217 - def get_unique_name(self, particle):
218 return '_FermionWP_%s' % particle
219
220 #=============================================================================== 221 # DSQRT(E+- |p|) 222 #=============================================================================== 223 -class L_FermionWM(aloha_lib.LorentzObject):
224 """ Helas Object for DSQRT(Px^2+Py^2+pz^2) """ 225
226 - def __init__(self, name, particle):
227 self.particle = particle 228 aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['FWM_%s' % particle])
229
230 - def create_representation(self):
231 mass = aloha_lib.DVariable('FWM%s' % self.particle) 232 233 self.representation = aloha_lib.LorentzObjectRepresentation( 234 mass, self.lorentz_ind, self.spin_ind)
235
236 -class FermionWM(aloha_lib.FactoryLorentz):
237 238 object_class = L_FermionWM 239 240 @classmethod
241 - def get_unique_name(self, particle):
242 return '_FermionWM_%s' % particle
243
244 245 #=============================================================================== 246 # Pslash 247 #=============================================================================== 248 -class L_PSlash(aloha_lib.LorentzObject):
249 """ Gamma Matrices """ 250 251 #gamma0 = [[0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0]] 252 #gamma1 = [[0, 0, 0, 1], [0, 0, 1, 0], [0, -1, 0, 0], [-1, 0, 0, 0]] 253 #gamma2 = [[0, 0, 0, -complex(0,1)],[0, 0, complex(0,1), 0], 254 # [0, complex(0,1), 0, 0], [-complex(0,1), 0, 0, 0]] 255 #gamma3 = [[0, 0, 1, 0], [0, 0, 0, -1], [-1, 0, 0, 0], [0, 1, 0, 0]] 256 # 257 #gamma = [gamma0, gamma1, gamma2, gamma3] 258
259 - def __init__(self, name, spin1, spin2, particle):
260 261 self.particle = particle 262 aloha_lib.LorentzObject.__init__(self,name,[], [spin1, spin2])
263
264 - def create_representation(self):
265 """create representation""" 266 p0 = aloha_lib.DVariable('P%s_0' % self.particle) 267 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 268 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 269 p3 = aloha_lib.DVariable('P%s_3' % self.particle) 270 271 272 gamma = { 273 (0, 0): 0, (0, 1): 0, (0, 2): p0-p3, (0, 3): -1*p1+1j*p2, 274 (1, 0): 0, (1, 1): 0, (1, 2): -1*p1-1j*p2, (1, 3): p0+p3, 275 (2, 0): p0+p3, (2, 1): p1-1j*p2, (2, 2): 0, (2, 3): 0, 276 (3, 0): p1+1j*p2, (3, 1): p0-p3, (3, 2): 0, (3, 3): 0} 277 278 279 self.representation = aloha_lib.LorentzObjectRepresentation(gamma, 280 self.lorentz_ind,self.spin_ind)
281
282 -class PSlash(aloha_lib.FactoryLorentz):
283 284 object_class = L_PSlash 285 286 @classmethod
287 - def get_unique_name(self, spin1, spin2, particle):
288 return '_P%s/_%s_%s' % (particle, spin1,spin2)
289
290 291 #=============================================================================== 292 # Mass 293 #=============================================================================== 294 -class L_Mass(aloha_lib.LorentzObject):
295 """ Helas Object for a Mass""" 296 297
298 - def __init__(self, name, particle):
299 self.particle = particle 300 aloha_lib.LorentzObject.__init__(self, name,[], [])
301
302 - def create_representation(self):
303 mass = aloha_lib.DVariable('M%s' % self.particle) 304 305 self.representation = aloha_lib.LorentzObjectRepresentation( 306 mass, self.lorentz_ind, self.spin_ind)
307
308 -class Mass(aloha_lib.FactoryLorentz):
309 310 object_class = L_Mass 311 312 @classmethod
313 - def get_unique_name(self, particle):
314 return '_M%s' % particle
315
316 #=============================================================================== 317 # Mass 318 #=============================================================================== 319 -class L_Coup(aloha_lib.LorentzObject):
320 """ Helas Object for a Mass""" 321 322
323 - def __init__(self, name, nb):
324 self.nb = nb 325 aloha_lib.LorentzObject.__init__(self, name,[], [])
326
327 - def create_representation(self):
328 coup = aloha_lib.Variable('COUP%s' % self.nb) 329 330 self.representation = aloha_lib.LorentzObjectRepresentation( 331 coup, self.lorentz_ind, self.spin_ind)
332
333 -class Coup(aloha_lib.FactoryLorentz):
334 335 object_class = L_Coup 336 337 @classmethod
338 - def get_unique_name(self, nb):
339 return 'coup%s' % nb
340
341 342 #=============================================================================== 343 # FCT 344 #=============================================================================== 345 -class L_FCT(aloha_lib.LorentzObject):
346 """ Helas Object for a Mass""" 347 348
349 - def __init__(self, name, id):
350 self.fctid = id 351 aloha_lib.LorentzObject.__init__(self, name,[], [])
352
353 - def create_representation(self):
354 var = aloha_lib.Variable('FCT%s' % self.fctid) 355 356 self.representation = aloha_lib.LorentzObjectRepresentation( 357 var, self.lorentz_ind, self.spin_ind)
358
359 -class FCT(aloha_lib.FactoryLorentz):
360 361 object_class = L_FCT 362 363 @classmethod
364 - def get_unique_name(self, name):
365 366 return '_FCT%s' % name
367
368 369 #=============================================================================== 370 # OverMass2 371 #=============================================================================== 372 -class L_OverMass2(aloha_lib.LorentzObject):
373 """ Helas Object for 1/M**2 """ 374
375 - def __init__(self, name, particle):
376 self.particle = particle 377 aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['OM%s' % particle])
378
379 - def create_representation(self):
380 mass = aloha_lib.DVariable('OM%s' % self.particle) 381 382 self.representation = aloha_lib.LorentzObjectRepresentation( 383 mass, self.lorentz_ind, self.spin_ind)
384
385 -class OverMass2(aloha_lib.FactoryLorentz):
386 387 object_class = L_OverMass2 388 389 @classmethod
390 - def get_unique_name(self, particle):
391 return '_OM2_%s' % particle
392
393 394 #=============================================================================== 395 # P (Momenta) 396 #=============================================================================== 397 -class L_PT(aloha_lib.LorentzObject):
398 """ Helas Object for an Impulsion """ 399 400 contract_first = 1 401
402 - def __init__(self, name, lorentz1, particle):
403 self.particle = particle 404 aloha_lib.LorentzObject.__init__(self, name,[lorentz1], [],['PT%s'%particle]) 405 aloha_lib.KERNEL.add_tag((name,))
406
407 - def create_representation(self):
408 #self.sub0 = aloha_lib.DVariable('P%s_0' % self.particle) 409 self.sub1 = aloha_lib.DVariable('P%s_1' % self.particle) 410 self.sub2 = aloha_lib.DVariable('P%s_2' % self.particle) 411 #self.sub3 = aloha_lib.DVariable('P%s_3' % self.particle) 412 413 self.representation= aloha_lib.LorentzObjectRepresentation( 414 {(0,): 0, (1,): self.sub1, \ 415 (2,): self.sub2, (3,): 0}, 416 self.lorentz_ind, [])
417
418 419 -class PT(aloha_lib.FactoryLorentz):
420 """ Helas Object for an Impulsion """ 421 422 object_class = L_PT 423 424 #def __init__(self, lorentz1, particle): 425 @classmethod
426 - def get_unique_name(self, lorentz1, particle):
427 return '_PT^%s_%s' % (particle, lorentz1)
428
429 430 431 432 #=============================================================================== 433 # Width 434 #=============================================================================== 435 -class L_Width(aloha_lib.LorentzObject):
436 """ Helas Object for an Impulsion """ 437 438
439 - def __init__(self, name, particle):
440 self.particle = particle 441 aloha_lib.LorentzObject.__init__(self, name, [], [])
442
443 - def create_representation(self):
444 width = aloha_lib.DVariable('W%s' % self.particle) 445 446 self.representation= aloha_lib.LorentzObjectRepresentation( 447 width, self.lorentz_ind, self.spin_ind)
448
449 -class Width(aloha_lib.FactoryLorentz):
450 451 object_class = L_Width 452 453 @classmethod
454 - def get_unique_name(self, particle):
455 return '_W%s' % particle
456
457 #=============================================================================== 458 # Param 459 #=============================================================================== 460 -class L_Param(aloha_lib.LorentzObject):
461 """ Object for a Model Parameter """ 462 463
464 - def __init__(self, Lname, name):
465 self.varname = name 466 aloha_lib.LorentzObject.__init__(self, name, [], [])
467
468 - def create_representation(self):
469 param = aloha_lib.Variable( self.varname, aloha_lib.ExtVariable) 470 471 self.representation= aloha_lib.LorentzObjectRepresentation( 472 param, [], [])
473
474 -class Param(aloha_lib.FactoryLorentz):
475 476 object_class = L_Param 477 478 @classmethod
479 - def get_unique_name(self, name):
480 if name == 'Pi': 481 KERNEL.has_pi = True 482 return 'Param_%s' % name
483
484 #=============================================================================== 485 # Scalar 486 #=============================================================================== 487 -class L_Scalar(aloha_lib.LorentzObject):
488 """ Helas Object for a Spinor""" 489 490
491 - def __init__(self, name, particle):
492 self.particle = particle 493 aloha_lib.LorentzObject.__init__(self, name, [], [])
494 495 496
497 - def create_representation(self):
498 rep = aloha_lib.Variable('S%s_1' % self.particle) 499 self.representation= aloha_lib.LorentzObjectRepresentation( 500 rep, [], [])
501
502 -class Scalar(aloha_lib.FactoryLorentz):
503 504 object_class = L_Scalar 505 506 @classmethod
507 - def get_unique_name(self,particle):
508 return '_S%s' % particle
509 #===============================================================================
510 # Spinor 511 #=============================================================================== 512 -class L_Spinor(aloha_lib.LorentzObject):
513 """ Helas Object for a Spinor""" 514 515 contract_first = 1 516
517 - def __init__(self, name, spin1, particle, prefactor=1):
518 self.particle = particle 519 aloha_lib.LorentzObject.__init__(self, name,[], [spin1])
520
521 - def create_representation(self):
522 self.sub0 = aloha_lib.Variable('F%s_1' % self.particle) 523 self.sub1 = aloha_lib.Variable('F%s_2' % self.particle) 524 self.sub2 = aloha_lib.Variable('F%s_3' % self.particle) 525 self.sub3 = aloha_lib.Variable('F%s_4' % self.particle) 526 527 self.representation= aloha_lib.LorentzObjectRepresentation( 528 {(0,): self.sub0, (1,): self.sub1, \ 529 (2,): self.sub2, (3,): self.sub3}, 530 [],self.spin_ind)
531
532 -class Spinor(aloha_lib.FactoryLorentz):
533 """ Helas Object for a Spinor""" 534 535 object_class = L_Spinor 536 537 @classmethod
538 - def get_unique_name(self,spin1, particle):
539 return '_F%s_%s' % (particle,spin1)
540
541 #=============================================================================== 542 # Vector 543 #=============================================================================== 544 -class L_Vector(aloha_lib.LorentzObject):
545 """ Helas Object for a Vector""" 546 547 contract_first = 1 548
549 - def __init__(self, name, lorentz, particle):
550 551 self.particle = particle 552 aloha_lib.LorentzObject.__init__(self, name, [lorentz], [])
553
554 - def create_representation(self):
555 self.sub0 = aloha_lib.Variable('V%s_1' % self.particle) 556 self.sub1 = aloha_lib.Variable('V%s_2' % self.particle) 557 self.sub2 = aloha_lib.Variable('V%s_3' % self.particle) 558 self.sub3 = aloha_lib.Variable('V%s_4' % self.particle) 559 560 self.representation= aloha_lib.LorentzObjectRepresentation( 561 {(0,): self.sub0, (1,): self.sub1, \ 562 (2,): self.sub2, (3,): self.sub3}, 563 self.lorentz_ind, [])
564
565 -class Vector(aloha_lib.FactoryLorentz):
566 567 object_class = L_Vector 568 569 @classmethod
570 - def get_unique_name(self, lor, particle):
571 return '_V%s_%s' % (particle, lor)
572
573 #=============================================================================== 574 # Spin3/2 575 #=============================================================================== 576 -class L_Spin3Half(aloha_lib.LorentzObject):
577 """ Helas Object for a Spin2""" 578
579 - def __init__(self, name, lorentz, spin, particle):
580 581 self.particle = particle 582 aloha_lib.LorentzObject.__init__(self, name, [lorentz], [spin])
583 584
585 - def create_representation(self):
586 587 self.sub00 = aloha_lib.Variable('R%s_1' % self.particle) 588 self.sub01 = aloha_lib.Variable('R%s_2' % self.particle) 589 self.sub02 = aloha_lib.Variable('R%s_3' % self.particle) 590 self.sub03 = aloha_lib.Variable('R%s_4' % self.particle) 591 592 self.sub10 = aloha_lib.Variable('R%s_5' % self.particle) 593 self.sub11 = aloha_lib.Variable('R%s_6' % self.particle) 594 self.sub12 = aloha_lib.Variable('R%s_7' % self.particle) 595 self.sub13 = aloha_lib.Variable('R%s_8' % self.particle) 596 597 self.sub20 = aloha_lib.Variable('R%s_9' % self.particle) 598 self.sub21 = aloha_lib.Variable('R%s_10' % self.particle) 599 self.sub22 = aloha_lib.Variable('R%s_11' % self.particle) 600 self.sub23 = aloha_lib.Variable('R%s_12' % self.particle) 601 602 self.sub30 = aloha_lib.Variable('R%s_13' % self.particle) 603 self.sub31 = aloha_lib.Variable('R%s_14' % self.particle) 604 self.sub32 = aloha_lib.Variable('R%s_15' % self.particle) 605 self.sub33 = aloha_lib.Variable('R%s_16' % self.particle) 606 607 rep = {(0,0): self.sub00, (0,1): self.sub01, (0,2): self.sub02, (0,3): self.sub03, 608 (1,0): self.sub10, (1,1): self.sub11, (1,2): self.sub12, (1,3): self.sub13, 609 (2,0): self.sub20, (2,1): self.sub21, (2,2): self.sub22, (2,3): self.sub23, 610 (3,0): self.sub30, (3,1): self.sub31, (3,2): self.sub32, (3,3): self.sub33} 611 612 613 self.representation= aloha_lib.LorentzObjectRepresentation( rep, \ 614 self.lorentz_ind, self.spin_ind)
615
616 -class Spin3Half(aloha_lib.FactoryLorentz):
617 618 object_class = L_Spin3Half 619 620 @classmethod
621 - def get_unique_name(self, lor, spin, part):
622 return 'Spin3Half%s^%s_%s' % (part, lor, spin)
623
624 #=============================================================================== 625 # Spin2 626 #=============================================================================== 627 -class L_Spin2(aloha_lib.LorentzObject):
628 """ Helas Object for a Spin2""" 629 630
631 - def __init__(self, name, lorentz1, lorentz2, particle):
632 633 self.particle = particle 634 aloha_lib.LorentzObject.__init__(self, name, [lorentz1, lorentz2], [])
635
636 - def create_representation(self):
637 638 self.sub00 = aloha_lib.Variable('T%s_1' % self.particle) 639 self.sub01 = aloha_lib.Variable('T%s_2' % self.particle) 640 self.sub02 = aloha_lib.Variable('T%s_3' % self.particle) 641 self.sub03 = aloha_lib.Variable('T%s_4' % self.particle) 642 643 self.sub10 = aloha_lib.Variable('T%s_5' % self.particle) 644 self.sub11 = aloha_lib.Variable('T%s_6' % self.particle) 645 self.sub12 = aloha_lib.Variable('T%s_7' % self.particle) 646 self.sub13 = aloha_lib.Variable('T%s_8' % self.particle) 647 648 self.sub20 = aloha_lib.Variable('T%s_9' % self.particle) 649 self.sub21 = aloha_lib.Variable('T%s_10' % self.particle) 650 self.sub22 = aloha_lib.Variable('T%s_11' % self.particle) 651 self.sub23 = aloha_lib.Variable('T%s_12' % self.particle) 652 653 self.sub30 = aloha_lib.Variable('T%s_13' % self.particle) 654 self.sub31 = aloha_lib.Variable('T%s_14' % self.particle) 655 self.sub32 = aloha_lib.Variable('T%s_15' % self.particle) 656 self.sub33 = aloha_lib.Variable('T%s_16' % self.particle) 657 658 rep = {(0,0): self.sub00, (0,1): self.sub01, (0,2): self.sub02, (0,3): self.sub03, 659 (1,0): self.sub10, (1,1): self.sub11, (1,2): self.sub12, (1,3): self.sub13, 660 (2,0): self.sub20, (2,1): self.sub21, (2,2): self.sub22, (2,3): self.sub23, 661 (3,0): self.sub30, (3,1): self.sub31, (3,2): self.sub32, (3,3): self.sub33} 662 663 664 self.representation= aloha_lib.LorentzObjectRepresentation( rep, \ 665 self.lorentz_ind, [])
666
667 -class Spin2(aloha_lib.FactoryLorentz):
668 669 object_class = L_Spin2 670 671 @classmethod
672 - def get_unique_name(self, lor1, lor2, part):
673 return 'Spin2^%s_%s_%s' % (part, lor1, lor2)
674
675 #=============================================================================== 676 # Gamma 677 #=============================================================================== 678 -class L_Gamma(aloha_lib.LorentzObject):
679 """ Gamma Matrices """ 680 681 #gamma0 = [[0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0]] 682 #gamma1 = [[0, 0, 0, 1], [0, 0, 1, 0], [0, -1, 0, 0], [-1, 0, 0, 0]] 683 #gamma2 = [[0, 0, 0, -complex(0,1)],[0, 0, complex(0,1), 0], 684 # [0, complex(0,1), 0, 0], [-complex(0,1), 0, 0, 0]] 685 #gamma3 = [[0, 0, 1, 0], [0, 0, 0, -1], [-1, 0, 0, 0], [0, 1, 0, 0]] 686 # 687 #gamma = [gamma0, gamma1, gamma2, gamma3] 688 gamma = { #Gamma0 689 (0, 0, 0): 0, (0, 0, 1): 0, (0, 0, 2): 1, (0, 0, 3): 0, 690 (0, 1, 0): 0, (0, 1, 1): 0, (0, 1, 2): 0, (0, 1, 3): 1, 691 (0, 2, 0): 1, (0, 2, 1): 0, (0, 2, 2): 0, (0, 2, 3): 0, 692 (0, 3, 0): 0, (0, 3, 1): 1, (0, 3, 2): 0, (0, 3, 3): 0, 693 #Gamma1 694 (1, 0, 0): 0, (1, 0, 1): 0, (1, 0, 2): 0, (1, 0, 3): 1, 695 (1, 1, 0): 0, (1, 1, 1): 0, (1, 1, 2): 1, (1, 1, 3): 0, 696 (1, 2, 0): 0, (1, 2, 1): -1, (1, 2, 2): 0, (1, 2, 3): 0, 697 (1, 3, 0): -1, (1, 3, 1): 0, (1, 3, 2): 0, (1, 3, 3): 0, 698 #Gamma2 699 (2, 0, 0): 0, (2, 0, 1): 0, (2, 0, 2): 0, (2, 0, 3): -1j, 700 (2, 1, 0): 0, (2, 1, 1): 0, (2, 1, 2): 1j, (2, 1, 3): 0, 701 (2, 2, 0): 0, (2, 2, 1): 1j, (2, 2, 2): 0, (2, 2, 3): 0, 702 (2, 3, 0): -1j, (2, 3, 1): 0, (2, 3, 2): 0, (2, 3, 3): 0, 703 #Gamma3 704 (3, 0, 0): 0, (3, 0, 1): 0, (3, 0, 2): 1, (3, 0, 3): 0, 705 (3, 1, 0): 0, (3, 1, 1): 0, (3, 1, 2): 0, (3, 1, 3): -1, 706 (3, 2, 0): -1, (3, 2, 1): 0, (3, 2, 2): 0, (3, 2, 3): 0, 707 (3, 3, 0): 0, (3, 3, 1): 1, (3, 3, 2): 0, (3, 3, 3): 0 708 } 709
710 - def __init__(self, name, lorentz, spin1, spin2):
711 aloha_lib.LorentzObject.__init__(self,name,[lorentz], [spin1, spin2])
712
713 - def create_representation(self):
714 715 self.representation = aloha_lib.LorentzObjectRepresentation(self.gamma, 716 self.lorentz_ind,self.spin_ind)
717
718 -class Gamma(aloha_lib.FactoryLorentz):
719 720 object_class = L_Gamma 721 722 @classmethod
723 - def get_unique_name(self, lor, spin1, spin2):
724 return 'Gamma^%s_%s_%s' % (lor, spin1, spin2)
725
726 727 #=============================================================================== 728 # Sigma 729 #=============================================================================== 730 -class L_Sigma(aloha_lib.LorentzObject):
731 """ Sigma Matrices """ 732 733 734 735 #zero = [[0,0,0,0]]*4 736 #i = complex(0,1) 737 #sigma01 = [[ 0, -i, 0, 0], [-i, 0, 0, 0], [0, 0, 0, i], [0, 0, i, 0]] 738 #sigma02 = [[ 0, -1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, -1, 0]] 739 #sigma03 = [[-i, 0, 0, 0], [0, i, 0, 0], [0, 0, i, 0], [0, 0, 0, -i]] 740 #sigma12 = [[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, -1]] 741 #sigma13 = [[0, i, 0, 0], [-i, 0, 0, 0], [0, 0, 0, i], [0, 0, -i, 0]] 742 #sigma23 = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] 743 #def inv(matrice): 744 # out=[] 745 # for i in range(4): 746 # out2=[] 747 # out.append(out2) 748 # for j in range(4): 749 # out2.append(-1*matrice[i][j]) 750 # return out 751 # 752 #sigma =[[zero, sigma01, sigma02, sigma03], \ 753 # [inv(sigma01), zero, sigma12, sigma13],\ 754 # [inv(sigma02), inv(sigma12), zero, sigma23],\ 755 # [inv(sigma03), inv(sigma13), inv(sigma23), zero]] 756 757 sigma={(0, 2, 0, 1): -0.5, (3, 1, 2, 0): 0, (3, 2, 3, 1): 0, (1, 3, 1, 3): 0, 758 (2, 3, 3, 2): 0.5, (2, 1, 3, 1): 0, (0, 2, 2, 1): 0, (3, 1, 0, 0): 0, 759 (2, 3, 3, 1): 0, (3, 3, 1, 2): 0, (3, 1, 0, 3): 0, (1, 1, 0, 3): 0, 760 (0, 1, 2, 2): 0, (3, 2, 3, 2): -0.5, (2, 1, 0, 1): 0, (3, 3, 3, 3): 0, 761 (1, 1, 2, 2): 0, (2, 2, 3, 2): 0, (2, 1, 2, 1): 0, (0, 1, 0, 3): 0, 762 (2, 1, 2, 2): -0.5, (1, 2, 2, 1): 0, (2, 2, 1, 3): 0, (0, 3, 1, 3): 0, 763 (3, 0, 3, 2): 0, (1, 2, 0, 1): 0, (3, 0, 3, 1): 0, (0, 0, 2, 2): 0, 764 (1, 2, 0, 2): 0, (2, 0, 0, 3): 0, (0, 0, 2, 1): 0, (0, 3, 3, 2): 0, 765 (3, 0, 1, 1): -0.5j, (3, 2, 0, 1): -0.5, (1, 0, 1, 0): 0.5j, (0, 0, 0, 1): 0, 766 (0, 2, 1, 1): 0, (3, 1, 3, 2): 0.5j, (3, 2, 2, 1): 0, (1, 3, 2, 3): 0.5j, 767 (1, 0, 3, 0): 0, (3, 2, 2, 2): 0, (0, 2, 3, 1): 0, (1, 0, 3, 3): 0, 768 (2, 3, 2, 1): 0, (0, 2, 3, 2): -0.5, (3, 1, 1, 3): 0, (1, 1, 1, 3): 0, 769 (1, 3, 0, 2): 0, (2, 3, 0, 1): 0.5, (1, 1, 1, 0): 0, (2, 3, 0, 2): 0, 770 (3, 3, 0, 3): 0, (1, 1, 3, 0): 0, (0, 1, 3, 3): 0, (2, 2, 0, 1): 0, 771 (2, 1, 1, 0): 0, (3, 3, 2, 2): 0, (2, 3, 1, 0): 0.5, (2, 2, 2, 3): 0, 772 (0, 3, 0, 3): 0, (0, 1, 1, 2): 0, (0, 3, 0, 0): -0.5j, (2, 3, 1, 1): 0, 773 (1, 2, 3, 0): 0, (2, 0, 1, 3): 0, (0, 0, 3, 1): 0, (0, 3, 2, 0): 0, 774 (2, 3, 1, 2): 0, (2, 0, 1, 0): -0.5, (1, 2, 1, 0): 0, (3, 0, 0, 2): 0, 775 (1, 0, 0, 2): 0, (0, 0, 1, 1): 0, (1, 2, 1, 3): 0, (2, 3, 1, 3): 0, 776 (2, 0, 3, 0): 0, (0, 0, 1, 2): 0, (1, 3, 3, 3): 0, (3, 2, 1, 0): -0.5, 777 (1, 3, 3, 0): 0, (1, 0, 2, 3): -0.5j, (0, 2, 0, 0): 0, (3, 1, 2, 3): -0.5j, 778 (3, 2, 3, 0): 0, (1, 3, 1, 0): -0.5j, (3, 2, 3, 3): 0, (0, 2, 2, 0): 0, 779 (2, 3, 3, 0): 0, (3, 3, 1, 3): 0, (0, 2, 2, 3): 0.5, (3, 1, 0, 2): 0, 780 (1, 1, 0, 2): 0, (3, 3, 1, 0): 0, (0, 1, 2, 3): 0.5j, (1, 1, 0, 1): 0, 781 (2, 1, 0, 2): 0, (0, 1, 2, 0): 0, (3, 3, 3, 0): 0, (1, 1, 2, 1): 0, 782 (2, 2, 3, 3): 0, (0, 1, 0, 0): 0, (2, 2, 3, 0): 0, (2, 1, 2, 3): 0, 783 (1, 2, 2, 2): 0.5, (2, 2, 1, 0): 0, (0, 3, 1, 2): 0, (0, 3, 1, 1): 0.5j, 784 (3, 0, 3, 0): 0, (1, 2, 0, 3): 0, (2, 0, 0, 2): 0, (0, 0, 2, 0): 0, 785 (0, 3, 3, 1): 0, (3, 0, 1, 0): 0, (2, 0, 0, 1): 0.5, (3, 2, 0, 2): 0, 786 (3, 0, 1, 3): 0, (1, 0, 1, 3): 0, (0, 0, 0, 0): 0, (0, 2, 1, 2): 0, 787 (3, 1, 3, 3): 0, (0, 0, 0, 3): 0, (1, 3, 2, 2): 0, (3, 1, 3, 0): 0, 788 (3, 2, 2, 3): -0.5, (1, 3, 2, 1): 0, (1, 0, 3, 2): -0.5j, (2, 3, 2, 2): 0, 789 (0, 2, 3, 3): 0, (3, 1, 1, 0): 0.5j, (1, 3, 0, 1): 0.5j, (1, 1, 1, 1): 0, 790 (2, 1, 3, 2): 0, (2, 3, 0, 3): 0, (3, 3, 0, 2): 0, (1, 1, 3, 1): 0, 791 (3, 3, 0, 1): 0, (2, 1, 3, 3): 0.5, (0, 1, 3, 2): 0.5j, (1, 1, 3, 2): 0, 792 (2, 1, 1, 3): 0, (3, 0, 2, 1): 0, (0, 1, 3, 1): 0, (3, 3, 2, 1): 0, 793 (2, 2, 2, 2): 0, (0, 1, 1, 1): 0, (2, 2, 2, 1): 0, (0, 3, 0, 1): 0, 794 (3, 0, 2, 2): -0.5j, (1, 2, 3, 3): -0.5, (0, 0, 3, 2): 0, (0, 3, 2, 1): 0, 795 (2, 0, 1, 1): 0, (2, 2, 0, 0): 0, (0, 3, 2, 2): 0.5j, (3, 0, 0, 3): 0, 796 (1, 0, 0, 3): 0, (1, 2, 1, 2): 0, (2, 0, 3, 1): 0, (1, 0, 0, 0): 0, 797 (0, 0, 1, 3): 0, (2, 0, 3, 2): 0.5, (3, 2, 1, 3): 0, (1, 3, 3, 1): 0, 798 (1, 0, 2, 0): 0, (2, 2, 0, 2): 0, (0, 2, 0, 3): 0, (3, 1, 2, 2): 0, 799 (1, 3, 1, 1): 0, (3, 1, 2, 1): 0, (2, 2, 0, 3): 0, (3, 0, 0, 1): 0, 800 (1, 3, 1, 2): 0, (2, 3, 3, 3): 0, (0, 2, 2, 2): 0, (3, 1, 0, 1): -0.5j, 801 (3, 3, 1, 1): 0, (1, 1, 0, 0): 0, (2, 1, 0, 3): 0, (0, 1, 2, 1): 0, 802 (3, 3, 3, 1): 0, (2, 1, 0, 0): -0.5, (1, 1, 2, 0): 0, (3, 3, 3, 2): 0, 803 (0, 1, 0, 1): -0.5j, (1, 1, 2, 3): 0, (2, 2, 3, 1): 0, (2, 1, 2, 0): 0, 804 (0, 1, 0, 2): 0, (1, 2, 2, 3): 0, (2, 0, 2, 1): 0, (2, 2, 1, 1): 0, 805 (1, 2, 2, 0): 0, (2, 2, 1, 2): 0, (0, 3, 1, 0): 0, (3, 0, 3, 3): 0.5j, 806 (2, 1, 3, 0): 0, (1, 2, 0, 0): 0.5, (0, 0, 2, 3): 0, (0, 3, 3, 0): 0, 807 (2, 0, 0, 0): 0, (3, 2, 0, 3): 0, (0, 3, 3, 3): -0.5j, (3, 0, 1, 2): 0, 808 (1, 0, 1, 2): 0, (3, 2, 0, 0): 0, (0, 2, 1, 3): 0, (1, 0, 1, 1): 0, 809 (0, 0, 0, 2): 0, (0, 2, 1, 0): 0.5, (3, 1, 3, 1): 0, (3, 2, 2, 0): 0, 810 (1, 3, 2, 0): 0, (1, 0, 3, 1): 0, (2, 3, 2, 3): 0.5, (0, 2, 3, 0): 0, 811 (3, 1, 1, 1): 0, (2, 3, 2, 0): 0, (1, 3, 0, 0): 0, (3, 1, 1, 2): 0, 812 (1, 1, 1, 2): 0, (1, 3, 0, 3): 0, (2, 3, 0, 0): 0, (2, 0, 2, 0): 0, 813 (3, 3, 0, 0): 0, (1, 1, 3, 3): 0, (2, 1, 1, 2): 0, (0, 1, 3, 0): 0, 814 (3, 3, 2, 0): 0, (2, 1, 1, 1): 0.5, (2, 0, 2, 2): 0, (3, 3, 2, 3): 0, 815 (0, 1, 1, 0): -0.5j, (2, 2, 2, 0): 0, (0, 3, 0, 2): 0, (3, 0, 2, 3): 0, 816 (0, 1, 1, 3): 0, (2, 0, 2, 3): -0.5, (1, 2, 3, 2): 0, (3, 0, 2, 0): 0, 817 (0, 0, 3, 3): 0, (1, 2, 3, 1): 0, (2, 0, 1, 2): 0, (0, 0, 3, 0): 0, 818 (0, 3, 2, 3): 0, (3, 0, 0, 0): 0.5j, (1, 2, 1, 1): -0.5, (1, 0, 0, 1): 0.5j, 819 (0, 0, 1, 0): 0, (2, 0, 3, 3): 0, (3, 2, 1, 2): 0, (1, 3, 3, 2): -0.5j, 820 (1, 0, 2, 1): 0, (3, 2, 1, 1): 0, (0, 2, 0, 2): 0, (1, 0, 2, 2): 0} 821
822 - def __init__(self, name, lorentz1, lorentz2, spin1, spin2):
823 aloha_lib.LorentzObject.__init__(self, name, [lorentz1, lorentz2], \ 824 [spin1, spin2])
825
826 - def create_representation(self):
827 828 self.representation = aloha_lib.LorentzObjectRepresentation(self.sigma, 829 self.lorentz_ind,self.spin_ind)
830
831 -class Sigma(aloha_lib.FactoryLorentz):
832 833 object_class = L_Sigma 834 835 @classmethod
836 - def get_unique_name(self, lorentz1, lorentz2, spin1, spin2):
837 return 'Sigma_[%s,%s]^[%s,%s]' % (spin1, spin2, lorentz1, lorentz2)
838
839 840 #=============================================================================== 841 # Gamma5 842 #=============================================================================== 843 -class L_Gamma5(aloha_lib.LorentzObject):
844 845 #gamma5 = [[-1, 0, 0, 0, 0], [0, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] 846 gamma5 = {(0,0): -1, (0,1): 0, (0,2): 0, (0,3): 0,\ 847 (1,0): 0, (1,1): -1, (1,2): 0, (1,3): 0,\ 848 (2,0): 0, (2,1): 0, (2,2): 1, (2,3): 0,\ 849 (3,0): 0, (3,1): 0, (3,2): 0, (3,3): 1} 850
851 - def __init__(self, name, spin1, spin2):
852 aloha_lib.LorentzObject.__init__(self, name, [], [spin1, spin2])
853
854 - def create_representation(self):
855 856 self.representation = aloha_lib.LorentzObjectRepresentation(self.gamma5, 857 self.lorentz_ind,self.spin_ind)
858
859 -class Gamma5(aloha_lib.FactoryLorentz):
860 861 object_class = L_Gamma5 862 863 @classmethod
864 - def get_unique_name(self, spin1, spin2):
865 return 'Gamma5_%s_%s' % (spin1, spin2)
866
867 #=============================================================================== 868 # Conjugate Matrices 869 #=============================================================================== 870 -class L_C(aloha_lib.LorentzObject):
871 872 #[0, -1, 0, 0] [1,0,0,0] [0,0,0,1],[0,0,-1,0] 873 874 Cmetrix = {(0,0): 0, (0,1): -1, (0,2): 0, (0,3): 0,\ 875 (1,0): 1, (1,1): 0, (1,2): 0, (1,3): 0,\ 876 (2,0): 0, (2,1): 0, (2,2): 0, (2,3): 1,\ 877 (3,0): 0, (3,1): 0, (3,2): -1, (3,3): 0} 878
879 - def __init__(self, name, spin_list):
880 881 # spin_list is automatically ordered. The sign for the symmetrization 882 # is set in the Factory routine 883 aloha_lib.LorentzObject.__init__(self, name, [], spin_list)
884 885
886 - def create_representation(self):
887 self.representation = aloha_lib.LorentzObjectRepresentation(self.Cmetrix, 888 self.lorentz_ind,self.spin_ind)
889
890 -class C(aloha_lib.FactoryLorentz):
891 892 object_class = L_C 893
894 - def __new__(cls, spin1, spin2):
895 896 spin_list = [spin1, spin2] 897 spin_list.sort() 898 sign = give_sign_perm(spin_list, [spin1, spin2]) 899 name = cls.get_unique_name(spin_list) 900 if sign == 1: 901 return aloha_lib.FactoryVar.__new__(cls, name, cls.object_class, spin_list) 902 else: 903 out = aloha_lib.FactoryVar.__new__(cls, name, cls.object_class, spin_list) 904 out.prefactor = -1 905 return out
906 907 @classmethod
908 - def get_unique_name(cls, spin_list):
909 return "C_%s_%s" % tuple(spin_list)
910
911 #=============================================================================== 912 # EPSILON 913 #=============================================================================== 914 #Helpfull function 915 -def give_sign_perm(perm0, perm1):
916 """Check if 2 permutations are of equal parity. 917 918 Assume that both permutation lists are of equal length 919 and have the same elements. No need to check for these 920 conditions. 921 """ 922 assert len(perm0) == len(perm1) 923 924 perm1 = list(perm1) ## copy this into a list so we don't mutate the original 925 perm1_map = dict((v, i) for i,v in enumerate(perm1)) 926 927 transCount = 0 928 for loc, p0 in enumerate(perm0): 929 p1 = perm1[loc] 930 if p0 != p1: 931 sloc = perm1_map[p0] # Find position in perm1 932 perm1[loc], perm1[sloc] = p0, p1 # Swap in perm1 933 perm1_map[p0], perm1_map[p1] = loc, sloc # Swap the map 934 transCount += 1 935 936 # Even number of transposition means equal parity 937 return -2 * (transCount % 2) + 1
938
939 # Practical definition of Epsilon 940 -class L_Epsilon(aloha_lib.LorentzObject):
941 """ The fully anti-symmetric object in Lorentz-Space """ 942
943 - def give_parity(self, perm):
944 """return the parity of the permutation""" 945 assert set(perm) == set([0,1,2,3]) 946 947 i1 , i2, i3, i4 = perm 948 #formula found on wikipedia 949 return -self.sign * ((i2-i1) * (i3-i1) *(i4-i1) * (i3-i2) * (i4-i2) *(i4-i3))/12
950 951 # DEFINE THE REPRESENTATION OF EPSILON 952
953 - def __init__(self, name, lorentz1, lorentz2, lorentz3, lorentz4):
954 955 lorentz_list = [lorentz1 , lorentz2, lorentz3, lorentz4] 956 #order_lor = list(lorentz_list) 957 #order_lor.sort() 958 959 #self.sign = give_sign_perm(order_lor, lorentz_list) 960 self.sign=1 961 aloha_lib.LorentzObject.__init__(self, name, lorentz_list, [])
962 963
964 - def create_representation(self):
965 966 if not hasattr(self, 'epsilon'): 967 # init all element to zero 968 epsilon = dict( ((l1, l2, l3, l4), 0) 969 for l1 in range(4) \ 970 for l2 in range(4) \ 971 for l3 in range(4) \ 972 for l4 in range(4)) 973 # update non trivial one 974 epsilon.update(dict( 975 ((l1, l2, l3, l4), self.give_parity((l1,l2,l3,l4))) 976 for l1 in range(4) \ 977 for l2 in range(4) if l2 != l1\ 978 for l3 in range(4) if l3 not in [l1,l2]\ 979 for l4 in range(4) if l4 not in [l1,l2,l3])) 980 981 L_Epsilon.epsilon = epsilon 982 983 self.representation = aloha_lib.LorentzObjectRepresentation(self.epsilon, 984 self.lorentz_ind,self.spin_ind)
985
986 987 -class Epsilon(aloha_lib.FactoryLorentz):
988 989 object_class = L_Epsilon 990 991 @classmethod
992 - def get_unique_name(cls,l1,l2,l3,l4):
993 return '_EPSILON_%s_%s_%s_%s' % (l1,l2,l3,l4)
994
995 996 #=============================================================================== 997 # Metric 998 #=============================================================================== 999 -class L_Metric(aloha_lib.LorentzObject):
1000 1001 metric = {(0,0): 1, (0,1): 0, (0,2): 0, (0,3): 0,\ 1002 (1,0): 0, (1,1): -1, (1,2): 0, (1,3): 0,\ 1003 (2,0): 0, (2,1): 0, (2,2): -1, (2,3): 0,\ 1004 (3,0): 0, (3,1): 0, (3,2): 0, (3,3): -1} 1005 1006 1007 #[[1, 0, 0,0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, -1]] 1008
1009 - def __init__(self, name, lorentz1, lorentz2):
1010 aloha_lib.LorentzObject.__init__(self,name,[lorentz1, lorentz2], [])
1011
1012 - def create_representation(self):
1013 1014 self.representation = aloha_lib.LorentzObjectRepresentation(self.metric, 1015 self.lorentz_ind,self.spin_ind)
1016
1017 -class Metric(aloha_lib.FactoryLorentz):
1018 1019 object_class = L_Metric 1020 1021 @classmethod
1022 - def get_unique_name(cls,l1,l2):
1023 1024 if str(l1)<str(l2): 1025 return '_ETA_%s_%s' % (l1,l2) 1026 else: 1027 return '_ETA_%s_%s' % (l2,l1)
1028 #===============================================================================
1029 # Identity 1030 #=============================================================================== 1031 -class L_Identity(aloha_lib.LorentzObject):
1032 1033 #identity = [[1, 0, 0,0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] 1034 identity = {(0,0): 1, (0,1): 0, (0,2): 0, (0,3): 0,\ 1035 (1,0): 0, (1,1): 1, (1,2): 0, (1,3): 0,\ 1036 (2,0): 0, (2,1): 0, (2,2): 1, (2,3): 0,\ 1037 (3,0): 0, (3,1): 0, (3,2): 0, (3,3): 1} 1038 1039
1040 - def __init__(self, name, spin1, spin2):
1041 aloha_lib.LorentzObject.__init__(self, name, [],[spin1, spin2])
1042
1043 - def create_representation(self):
1044 1045 self.representation = aloha_lib.LorentzObjectRepresentation(self.identity, 1046 self.lorentz_ind,self.spin_ind)
1047
1048 -class Identity(aloha_lib.FactoryLorentz):
1049 1050 object_class = L_Identity 1051 1052 @classmethod
1053 - def get_unique_name(self, spin1, spin2):
1054 return 'Id_%s_%s' % (spin1, spin2)
1055
1056 #=============================================================================== 1057 # IdentityL 1058 #=============================================================================== 1059 -class L_IdentityL(aloha_lib.LorentzObject):
1060 1061 #identity = [[1, 0, 0,0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] 1062 identity = {(0,0): 1, (0,1): 0, (0,2): 0, (0,3): 0,\ 1063 (1,0): 0, (1,1): 1, (1,2): 0, (1,3): 0,\ 1064 (2,0): 0, (2,1): 0, (2,2): 1, (2,3): 0,\ 1065 (3,0): 0, (3,1): 0, (3,2): 0, (3,3): 1} 1066 1067
1068 - def __init__(self, name, l1, l2):
1069 aloha_lib.LorentzObject.__init__(self, name, [l1,l2], [])
1070
1071 - def create_representation(self):
1072 1073 self.representation = aloha_lib.LorentzObjectRepresentation(self.identity, 1074 self.lorentz_ind,self.spin_ind)
1075
1076 -class IdentityL(aloha_lib.FactoryLorentz):
1077 1078 object_class = L_IdentityL 1079 1080 @classmethod
1081 - def get_unique_name(self, l1, l2):
1082 return 'IdL_%s_%s' % (l1, l2)
1083
1084 #=============================================================================== 1085 # ProjM 1086 #=============================================================================== 1087 -class L_ProjM(aloha_lib.LorentzObject):
1088 """ A object for (1-gamma5)/2 """ 1089 1090 #projm = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] 1091 projm= {(0,0): 1, (0,1): 0, (0,2): 0, (0,3): 0,\ 1092 (1,0): 0, (1,1): 1, (1,2): 0, (1,3): 0,\ 1093 (2,0): 0, (2,1): 0, (2,2): 0, (2,3): 0,\ 1094 (3,0): 0, (3,1): 0, (3,2): 0, (3,3): 0} 1095
1096 - def __init__(self,name, spin1, spin2):
1097 """Initialize the object""" 1098 aloha_lib.LorentzObject.__init__(self, name, [], [spin1, spin2])
1099
1100 - def create_representation(self):
1101 1102 self.representation = aloha_lib.LorentzObjectRepresentation(self.projm, 1103 self.lorentz_ind,self.spin_ind)
1104
1105 -class ProjM(aloha_lib.FactoryLorentz):
1106 1107 object_class = L_ProjM 1108 1109 @classmethod
1110 - def get_unique_name(self, spin1, spin2):
1111 return 'PROJM_%s_%s' % (spin1, spin2)
1112 #===============================================================================
1113 # ProjP 1114 #=============================================================================== 1115 -class L_ProjP(aloha_lib.LorentzObject):
1116 """A object for (1+gamma5)/2 """ 1117 1118 #projp = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] 1119 projp = {(0,0): 0, (0,1): 0, (0,2): 0, (0,3): 0,\ 1120 (1,0): 0, (1,1): 0, (1,2): 0, (1,3): 0,\ 1121 (2,0): 0, (2,1): 0, (2,2): 1, (2,3): 0,\ 1122 (3,0): 0, (3,1): 0, (3,2): 0, (3,3): 1} 1123
1124 - def __init__(self,name, spin1, spin2):
1125 """Initialize the object""" 1126 aloha_lib.LorentzObject.__init__(self, name, [], [spin1, spin2])
1127 1128
1129 - def create_representation(self):
1130 1131 self.representation = aloha_lib.LorentzObjectRepresentation(self.projp, 1132 self.lorentz_ind, self.spin_ind)
1133
1134 -class ProjP(aloha_lib.FactoryLorentz):
1135 1136 object_class = L_ProjP 1137 1138 @classmethod
1139 - def get_unique_name(self, spin1, spin2):
1140 1141 return 'PROJP_%s_%s' % (spin1, spin2)
1142
1143 #=============================================================================== 1144 # EPSL (longitudinal part of the epsilon normmaized to avoid denominator) 1145 #=============================================================================== 1146 -class L_EPSL(aloha_lib.LorentzObject):
1147 """ eps^mu_L (polarization vector) 1148 (kx**2+ky**2+kz**2, E*kz, E*ky, E*kz) 1149 the normalization 1/m *|\vec{k} is NOT include 1150 1151 """ 1152
1153 - def __init__(self, name, lor1, particle):
1154 1155 self.particle = particle 1156 aloha_lib.LorentzObject.__init__(self,name, [lor1], [])
1157
1158 - def create_representation(self):
1159 """create representation""" 1160 E = aloha_lib.DVariable('P%s_0' % self.particle) 1161 m = aloha_lib.DVariable('M%s' % self.particle) 1162 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1163 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1164 p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1165 1166 1167 norm = (p1**2+p2**2+p3**2) 1168 eps = { 1169 (0,): norm, 1170 (1,): p1*E, 1171 (2,): p2*E , 1172 (3,): p3*E , 1173 } 1174 # eps = { 1175 # (0,): norm-E*E, 1176 # (1,): 0, 1177 # (2,): 0 , 1178 # (3,): 0 , 1179 # } 1180 1181 self.representation = aloha_lib.LorentzObjectRepresentation(eps, 1182 self.lorentz_ind,self.spin_ind)
1183
1184 -class EPSL(aloha_lib.FactoryLorentz):
1185 1186 object_class = L_EPSL 1187 1188 @classmethod
1189 - def get_unique_name(self, lor1, particle):
1190 return '_EPSL%s_%s_' % (particle, lor1)
1191
1192 #=============================================================================== 1193 # EPSTR (transverse part of the epsilon normmalized to avoid denominator -- one of the eigenstate) 1194 # Real part 1195 #=============================================================================== 1196 -class L_EPST1(aloha_lib.LorentzObject):
1197 """ eps^mu_1 (polarization vector) 1198 (0, kx kz , ky kz, -k_T^2) 1199 the normalization 1/k_T / norm(k) is NOT include 1200 1201 """ 1202
1203 - def __init__(self, name, lor1, particle):
1204 1205 self.particle = particle 1206 aloha_lib.LorentzObject.__init__(self,name, [lor1], [])
1207
1208 - def create_representation(self):
1209 """create representation""" 1210 # E = aloha_lib.DVariable('P%s_0' % self.particle) 1211 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1212 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1213 p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1214 1215 1216 kT = (p1**2+p2**2) 1217 1218 eps = { 1219 (0,): 0, 1220 (1,): (p1)*(p3), 1221 (2,): p2*(p3), 1222 (3,): -kT , 1223 } 1224 # eps = { 1225 # (0,): norm-E*E, 1226 # (1,): 0, 1227 # (2,): 0 , 1228 # (3,): 0 , 1229 # } 1230 1231 self.representation = aloha_lib.LorentzObjectRepresentation(eps, 1232 self.lorentz_ind,self.spin_ind)
1233
1234 -class EPST1(aloha_lib.FactoryLorentz):
1235 1236 object_class = L_EPST1 1237 1238 @classmethod
1239 - def get_unique_name(self, lor1, particle):
1240 return '_EPST1%s_%s_' % (particle, lor1)
1241
1242 #=============================================================================== 1243 # EPSTI (transverse part of the epsilon normmalized to avoid denominator -- one of the eigenstate) 1244 # Imaginary part 1245 #=============================================================================== 1246 1247 -class L_EPST2(aloha_lib.LorentzObject):
1248 """ eps^mu_+ (polarization vector) 1249 (0, ky k_T , -i kx k_T, 0) 1250 1251 the normalization 1/(kT*norm(k)) is NOT include here 1252 as well as the k_T term (to avoid the square-root) 1253 1254 """ 1255
1256 - def __init__(self, name, lor1, particle):
1257 1258 self.particle = particle 1259 aloha_lib.LorentzObject.__init__(self,name, [lor1], [])
1260
1261 - def create_representation(self):
1262 """create representation""" 1263 # E = aloha_lib.DVariable('P%s_0' % self.particle) 1264 # m = aloha_lib.DVariable('M%s' % self.particle) 1265 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1266 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1267 # p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1268 1269 1270 eps = { 1271 (0,): 0, 1272 (1,): -p2, 1273 (2,): (p1), 1274 (3,): 0 , 1275 } 1276 # eps = { 1277 # (0,): norm-E*E, 1278 # (1,): 0, 1279 # (2,): 0 , 1280 # (3,): 0 , 1281 # } 1282 1283 self.representation = aloha_lib.LorentzObjectRepresentation(eps, 1284 self.lorentz_ind,self.spin_ind)
1285
1286 -class EPST2(aloha_lib.FactoryLorentz):
1287 1288 object_class = L_EPST2 1289 1290 @classmethod
1291 - def get_unique_name(self, lor1, particle):
1292 return '_EPST2%s_%s_' % (particle, lor1)
1293 #=============================================================================== 1294 # UFP U fermion plus component (first two component) 1295 # the denominator is include in the denominator of the propagator 1296 #=============================================================================== 1297 fsign = -1
1298 1299 -class L_UFP(aloha_lib.LorentzObject):
1300 """ 1301 1302 """ 1303
1304 - def __init__(self, name, spin1, particle):
1305 1306 self.particle = particle 1307 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1308 tags=['|p%s|_z' % particle, 1309 'FWP%s' % particle, 1310 'FWM%s' % particle])
1311
1312 - def create_representation(self):
1313 """create representation""" 1314 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1315 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1316 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1317 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1318 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1319 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1320 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1321 1322 1323 u = { 1324 (0,): fwm * normz, 1325 (1,): fwm * (fsign * p1 + complex(0,fsign)*p2), 1326 (2,): fwp * normz, 1327 (3,): fwp * (fsign* p1 + complex(0,fsign)*p2), 1328 } 1329 1330 1331 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1332 self.lorentz_ind,self.spin_ind)
1333
1334 1335 -class UFP(aloha_lib.FactoryLorentz):
1336 1337 object_class = L_UFP 1338 1339 @classmethod
1340 - def get_unique_name(self, spin1, particle):
1341 return '_UFP%s_%s_' % (particle, spin1)
1342
1343 -class L_UFM(aloha_lib.LorentzObject):
1344 """ 1345 1346 """ 1347
1348 - def __init__(self, name, spin1, particle):
1349 1350 self.particle = particle 1351 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1352 tags=['|p%s|_z' % particle, 1353 'FWP%s' % particle, 1354 'FWM%s' % particle])
1355
1356 - def create_representation(self):
1357 """create representation""" 1358 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1359 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1360 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1361 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1362 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1363 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1364 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1365 1366 1367 u = { 1368 (0,): fwp * (-1*fsign*p1 + complex(0,fsign)*p2), 1369 (1,): fwp * normz, 1370 (2,): fwm * (-1*fsign*p1 + complex(0,fsign)*p2), 1371 (3,): fwm * normz, 1372 } 1373 1374 1375 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1376 self.lorentz_ind,self.spin_ind)
1377
1378 -class UFM(aloha_lib.FactoryLorentz):
1379 1380 object_class = L_UFM 1381 1382 @classmethod
1383 - def get_unique_name(self, spin1, particle):
1384 return '_UFM%s_%s_' % (particle, spin1)
1385
1386 -class L_UFPC(aloha_lib.LorentzObject):
1387 """ 1388 1389 """ 1390
1391 - def __init__(self, name, spin1, particle):
1392 1393 self.particle = particle 1394 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1395 tags=['|p%s|_z' % particle, 1396 'FWP%s' % particle, 1397 'FWM%s' % particle])
1398
1399 - def create_representation(self):
1400 """create representation""" 1401 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1402 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1403 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1404 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1405 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1406 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1407 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1408 1409 1410 u = { 1411 (0,): fwp * normz, 1412 (1,): fwp * (fsign* p1 + complex(0,-fsign)*p2), 1413 (2,): fwm * normz, 1414 (3,): fwm * (fsign* p1 + complex(0,-fsign)*p2), 1415 } 1416 1417 1418 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1419 self.lorentz_ind,self.spin_ind)
1420
1421 -class UFPC(aloha_lib.FactoryLorentz):
1422 1423 object_class = L_UFPC 1424 1425 @classmethod
1426 - def get_unique_name(self, spin1, particle):
1427 return '_UFPC%s_%s_' % (particle, spin1)
1428
1429 -class L_UFMC(aloha_lib.LorentzObject):
1430 """ 1431 1432 """ 1433
1434 - def __init__(self, name, spin1, particle):
1435 1436 self.particle = particle 1437 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1438 tags=['|p%s|_z' % particle, 1439 'FWP%s' % particle, 1440 'FWM%s' % particle])
1441
1442 - def create_representation(self):
1443 """create representation""" 1444 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1445 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1446 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1447 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1448 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1449 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1450 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1451 1452 1453 u = { 1454 (0,): fwm * (-fsign*p1 + complex(0,-fsign)*p2), 1455 (1,): fwm * normz, 1456 (2,): fwp * (-fsign*p1 + complex(0,-fsign)*p2), 1457 (3,): fwp * normz, 1458 } 1459 1460 1461 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1462 self.lorentz_ind,self.spin_ind)
1463
1464 -class UFMC(aloha_lib.FactoryLorentz):
1465 1466 object_class = L_UFMC 1467 1468 @classmethod
1469 - def get_unique_name(self, spin1, particle):
1470 return '_UFMC%s_%s_' % (particle, spin1)
1471
1472 -class L_VFP(aloha_lib.LorentzObject):
1473 """ 1474 1475 """ 1476
1477 - def __init__(self, name, spin1, particle):
1478 1479 self.particle = particle 1480 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1481 tags=['|p%s|_z' % particle, 1482 'FWP%s' % particle, 1483 'FWM%s' % particle])
1484
1485 - def create_representation(self):
1486 """create representation""" 1487 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1488 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1489 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1490 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1491 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1492 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1493 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1494 1495 1496 u = { 1497 (0,): -1*fwp * (-1 *fsign * p1 + complex(0,fsign)*p2), 1498 (1,): -1*fwp * normz, 1499 (2,): 1*fwm * (-1 *fsign * p1 + complex(0,fsign)*p2), 1500 (3,): 1*fwm * normz, 1501 } 1502 1503 1504 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1505 self.lorentz_ind,self.spin_ind)
1506
1507 1508 -class VFP(aloha_lib.FactoryLorentz):
1509 1510 object_class = L_VFP 1511 1512 @classmethod
1513 - def get_unique_name(self, spin1, particle):
1514 return '_VFP%s_%s_' % (particle, spin1)
1515
1516 -class L_VFPC(aloha_lib.LorentzObject):
1517 """ 1518 1519 """ 1520
1521 - def __init__(self, name, spin1, particle):
1522 1523 self.particle = particle 1524 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1525 tags=['|p%s|_z' % particle, 1526 'FWP%s' % particle, 1527 'FWM%s' % particle])
1528
1529 - def create_representation(self):
1530 """create representation""" 1531 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1532 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1533 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1534 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1535 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1536 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1537 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1538 1539 1540 u = { 1541 (0,): fwm * (-1 *fsign * p1 + complex(0,-1*fsign)*p2), 1542 (1,): fwm * normz, 1543 (2,): -1*fwp * (-1 *fsign * p1 + complex(0,-1*fsign)*p2), 1544 (3,): -1*fwp * normz, 1545 } 1546 1547 1548 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1549 self.lorentz_ind,self.spin_ind)
1550
1551 1552 -class VFPC(aloha_lib.FactoryLorentz):
1553 1554 object_class = L_VFPC 1555 1556 @classmethod
1557 - def get_unique_name(self, spin1, particle):
1558 return '_VFPC%s_%s_' % (particle, spin1)
1559
1560 1561 -class L_VFM(aloha_lib.LorentzObject):
1562 """ 1563 1564 """ 1565
1566 - def __init__(self, name, spin1, particle):
1567 1568 self.particle = particle 1569 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1570 tags=['|p%s|_z' % particle, 1571 'FWP%s' % particle, 1572 'FWM%s' % particle])
1573
1574 - def create_representation(self):
1575 """create representation""" 1576 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1577 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1578 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1579 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1580 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1581 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1582 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1583 1584 1585 u = { 1586 (0,): fwm * normz, 1587 (1,): fwm * (fsign * p1 + complex(0,fsign)*p2), 1588 (2,): -1*fwp * normz, 1589 (3,): -1*fwp * (fsign * p1 + complex(0,fsign)*p2), 1590 } 1591 1592 1593 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1594 self.lorentz_ind,self.spin_ind)
1595
1596 1597 -class VFM(aloha_lib.FactoryLorentz):
1598 1599 object_class = L_VFM 1600 1601 @classmethod
1602 - def get_unique_name(self, spin1, particle):
1603 return '_VFM%s_%s_' % (particle, spin1)
1604
1605 -class L_VFMC(aloha_lib.LorentzObject):
1606 """ 1607 1608 """ 1609
1610 - def __init__(self, name, spin1, particle):
1611 1612 self.particle = particle 1613 aloha_lib.LorentzObject.__init__(self,name, [], [spin1], 1614 tags=['|p%s|_z' % particle, 1615 'FWP%s' % particle, 1616 'FWM%s' % particle])
1617
1618 - def create_representation(self):
1619 """create representation""" 1620 #E = aloha_lib.DVariable('P%s_0' % self.particle) 1621 p1 = aloha_lib.DVariable('P%s_1' % self.particle) 1622 p2 = aloha_lib.DVariable('P%s_2' % self.particle) 1623 #p3 = aloha_lib.DVariable('P%s_3' % self.particle) 1624 normz = aloha_lib.DVariable('TnormZ%s' % self.particle) 1625 fwp = aloha_lib.DVariable('FWP%s' % self.particle) 1626 fwm = aloha_lib.DVariable('FWM%s' % self.particle) 1627 1628 1629 u = { 1630 (0,): -1*fwp * normz, 1631 (1,): -1*fwp * (fsign * p1 + complex(0,-1*fsign)*p2), 1632 (2,): fwm * normz, 1633 (3,): fwm * (fsign * p1 + complex(0,-1*fsign)*p2), 1634 1635 } 1636 1637 1638 self.representation = aloha_lib.LorentzObjectRepresentation(u, 1639 self.lorentz_ind,self.spin_ind)
1640
1641 1642 -class VFMC(aloha_lib.FactoryLorentz):
1643 1644 object_class = L_VFMC 1645 1646 @classmethod
1647 - def get_unique_name(self, spin1, particle):
1648 return '_VFMC%s_%s_' % (particle, spin1)
1649
1650 #=============================================================================== 1651 # Denominator Propagator 1652 #=============================================================================== 1653 -class DenominatorPropagator(aloha_lib.LorentzObject):
1654 """The Denominator of the Propagator""" 1655
1656 - def __new__(cls, particle):
1657 1658 name = 'DenomP%s' % particle 1659 return aloha_lib.Variable.__new__(cls, name)
1660
1661 - def __init__(self, particle):
1662 if self: 1663 return 1664 self.particle = particle 1665 aloha_lib.LorentzObject.__init__(self, [], [])
1666
1667 - def get_unique_name(self,*args):
1668 return 'DenomP%s' % self.particle
1669 1670
1671 - def simplify(self):
1672 """Return the Denominator in a abstract way""" 1673 1674 mass = Mass(self.particle) 1675 width = Width(self.particle) 1676 denominator = P('i1', self.particle) * P('i1', self.particle) - \ 1677 mass * mass + complex(0,1) * mass* width 1678 1679 return denominator
1680
1681 - def create_representation(self):
1682 """Create the representation for the Vector propagator""" 1683 1684 object = self.simplify() 1685 self.representation = object.expand()
1686 1687 1688 #=============================================================================== 1689 # Numerator Propagator 1690 #=============================================================================== 1691 1692 1693 SpinorPropagatorout = lambda spin1, spin2, particle: -1 * (Gamma('mu', spin1, spin2) * \ 1694 P('mu', particle) - Mass(particle) * Identity(spin1, spin2)) 1695 1696 SpinorPropagatorin = lambda spin1, spin2, particle: (Gamma('mu', spin1, spin2) * \ 1697 P('mu', particle) + Mass(particle) * Identity(spin1, spin2)) 1698 1699 1700 VectorPropagator = lambda l1, l2, part: complex(0,1)*(-1 * Metric(l1, l2) + OverMass2(part) * \ 1701 Metric(l1,'I3')* P('I3', part) * P(l2, part)) 1702 1703 VectorPropagatorMassless= lambda l1, l2, part: complex(0,-1) * Metric(l1, l2) 1704 1705 1706 Spin3halfPropagatorin = lambda mu, nu, s1, s2, part: (\ 1707 -1/3 * (Gamma(mu,s1,-2) + Identity(s1, -2) * P(mu, part) * Mass(part) * OverMass2(part))* \ 1708 (PSlash(-2,-3, part) - Identity(-2,-3) * Mass(part)) * \ 1709 ( Gamma(nu, -3, s2)+ Mass(part) * OverMass2(part) * Identity(-3, s2) * P(nu, part) ) - \ 1710 (PSlash(s1,s2, part) + Mass(part) * Identity(s1,s2)) * (Metric(mu, nu) - OverMass2(part) * P(mu, part) * P(nu,part))) 1711 1712 1713 Spin3halfPropagatorout = lambda mu, nu, s1, s2, part: ( \ 1714 -1/3 * (Gamma(mu,s1,-2) - Identity(s1, -2) * P(mu, part) * Mass(part) * OverMass2(part))* \ 1715 (-1*PSlash(-2,-3, part) - Identity(-2,-3) * Mass(part)) * \ 1716 ( Gamma(nu, -3, s2)- Mass(part) * OverMass2(part) * Identity(-3, s2) * P(nu, part) ) - \ 1717 (-1*PSlash(s1,s2, part) 1718 + Mass(part) * Identity(s1,s2)) * (Metric(mu, nu) - OverMass2(part) * P(mu, part) * P(nu,part))) 1719 1720 1721 Spin3halfPropagatorMasslessOut = lambda mu, nu, s1, s2, part: Gamma(nu, s1,-1) * PSlash(-1,-2, part) * Gamma(mu,-2, s2) 1722 Spin3halfPropagatorMasslessIn = lambda mu, nu, s1, s2, part: -1 * Gamma(mu, s1,-1) * PSlash(-1,-2, part) * Gamma(nu,-2, s2) 1723 1724 1725 Spin2masslessPropagator = lambda mu, nu, alpha, beta: 1/2 *( Metric(mu, alpha)* Metric(nu, beta) +\ 1726 Metric(mu, beta) * Metric(nu, alpha) - Metric(mu, nu) * Metric(alpha, beta)) 1727 1728 1729 1730 Spin2Propagator = lambda mu, nu, alpha, beta, part: Spin2masslessPropagator(mu, nu, alpha, beta) + \ 1731 - 1/2 * OverMass2(part) * (Metric(mu,alpha)* P(nu, part) * P(beta, part) + \ 1732 Metric(nu, beta) * P(mu, part) * P(alpha, part) + \ 1733 Metric(mu, beta) * P(nu, part) * P(alpha, part) + \ 1734 Metric(nu, alpha) * P(mu, part) * P(beta , part) )+ \ 1735 1/6 * (Metric(mu,nu) + 2 * OverMass2(part) * P(mu, part) * P(nu, part)) * \ 1736 (Metric(alpha,beta) + 2 * OverMass2(part) * P(alpha, part) * P(beta, part)) 1737