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