Package madgraph :: Package loop :: Module loop_color_amp
[hide private]
[frames] | no frames]

Source Code for Module madgraph.loop.loop_color_amp

  1  ################################################################################ 
  2  # 
  3  # Copyright (c) 2009 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   
 16  """Classes, methods and functions required to write QCD color information  
 17  for a loop diagram and build a color basis, and to square a QCD color string for 
 18  squared diagrams and interference terms.""" 
 19   
 20  import copy 
 21  import fractions 
 22  import operator 
 23  import re 
 24   
 25  import madgraph.core.color_amp as color_amp 
 26  import madgraph.core.color_algebra as color_algebra 
 27  import madgraph.core.diagram_generation as diagram_generation 
 28  import madgraph.loop.loop_diagram_generation as loop_diagram_generation 
 29  import madgraph.core.base_objects as base_objects 
 30   
 31   
 32  #=============================================================================== 
 33  # ColorBasis 
 34  #=============================================================================== 
35 -class LoopColorBasis(color_amp.ColorBasis):
36 """ Same class as its mother ColorBasis except that it can also handle 37 LoopAmplitudes.""" 38
39 - def closeColorLoop(self, colorize_dict, lcut_charge, lcut_numbers):
40 """ Add a color delta in the right representation (depending on the 41 color charge carried by the L-cut particle whose number are given in 42 the loop_numbers argument) to close the loop color trace """ 43 44 # But for T3 and T6 for example, we must make sure to add a delta with 45 # the first index in the fundamental representation. 46 if lcut_charge<0: 47 lcut_numbers.reverse() 48 if abs(lcut_charge)==1: 49 # No color carried by the lcut particle, there is nothing to do. 50 return 51 elif abs(lcut_charge)==3: 52 closingCS=color_algebra.ColorString(\ 53 [color_algebra.T(lcut_numbers[1],lcut_numbers[0])]) 54 elif abs(lcut_charge)==6: 55 closingCS=color_algebra.ColorString(\ 56 [color_algebra.T6(lcut_numbers[1],lcut_numbers[0])]) 57 elif abs(lcut_charge)==8: 58 closingCS=color_algebra.ColorString(\ 59 [color_algebra.Tr(lcut_numbers[1],lcut_numbers[0])], 60 fractions.Fraction(2, 1)) 61 else: 62 raise color_amp.ColorBasis.ColorBasisError, \ 63 "L-cut particle has an unsupported color representation %s" % lcut_charge 64 65 # Append it to all color strings for this diagram. 66 for CS in colorize_dict.values(): 67 CS.product(closingCS)
68
69 - def create_loop_color_dict_list(self, amplitude):
70 """Returns a list of colorize dict for all loop diagrams in amplitude. 71 Also update the _list_color_dict object accordingly """ 72 73 list_color_dict = [] 74 75 if not isinstance(amplitude,loop_diagram_generation.LoopAmplitude): 76 raise color_amp.ColorBasis.ColorBasisError, \ 77 'LoopColorBasis is used with an amplitude which is not a LoopAmplitude' 78 for diagram in amplitude.get('loop_diagrams'): 79 80 colorize_dict = self.colorize(diagram, 81 amplitude.get('process').get('model')) 82 if diagram['type']>0: 83 # We close here the color loop for loop diagrams (R2 have 84 # negative 'type') by adding a delta in the two color indices of 85 # loop_leg_numbers. 86 starting_leg=diagram.get_starting_loop_line() 87 finishing_leg=diagram.get_finishing_loop_line() 88 lcut_charge=amplitude['process']['model'].get_particle(\ 89 starting_leg.get('id')).get_color() 90 lcut_numbers=[starting_leg.get('number'),\ 91 finishing_leg.get('number')] 92 self.closeColorLoop(colorize_dict,lcut_charge,lcut_numbers) 93 94 list_color_dict.append(colorize_dict) 95 96 # Now let's treat the UVCT diagrams as well 97 for diagram in amplitude.get('loop_UVCT_diagrams'): 98 colorize_dict = self.colorize(diagram, 99 amplitude.get('process').get('model')) 100 list_color_dict.append(colorize_dict) 101 102 self._list_color_dict = list_color_dict 103 104 return list_color_dict
105
106 - def create_born_color_dict_list(self, amplitude):
107 """Returns a list of colorize dict for all born diagrams in amplitude. 108 Also update the _list_color_dict object accordingly """ 109 110 list_color_dict = [] 111 112 if not isinstance(amplitude,loop_diagram_generation.LoopAmplitude): 113 raise color_amp.ColorBasis.ColorBasisError, \ 114 'LoopColorBasis is used with an amplitude which is not a LoopAmplitude' 115 116 for diagram in amplitude.get('born_diagrams'): 117 colorize_dict = self.colorize(diagram, 118 amplitude.get('process').get('model')) 119 list_color_dict.append(colorize_dict) 120 121 self._list_color_dict = list_color_dict 122 123 return list_color_dict
124
125 - def build_born(self, amplitude):
126 """Build the a color basis object using information contained in 127 amplitude (otherwise use info from _list_color_dict). 128 Returns a list of color """ 129 130 self.create_born_color_dict_list(amplitude) 131 for index, color_dict in enumerate(self._list_color_dict): 132 self.update_color_basis(color_dict, index)
133
134 - def build_loop(self, amplitude):
135 """Build the loop color basis object using information contained in 136 amplitude (otherwise use info from _list_color_dict). 137 Returns a list of color """ 138 139 self.create_loop_color_dict_list(amplitude) 140 for index, color_dict in enumerate(self._list_color_dict): 141 self.update_color_basis(color_dict, index)
142