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  from __future__ import absolute_import 
 21  import copy 
 22  import fractions 
 23  import operator 
 24  import re 
 25  import madgraph.various.misc as misc 
 26   
 27  import madgraph.core.color_amp as color_amp 
 28  import madgraph.core.color_algebra as color_algebra 
 29  import madgraph.core.diagram_generation as diagram_generation 
 30  import madgraph.loop.loop_diagram_generation as loop_diagram_generation 
 31  import madgraph.core.base_objects as base_objects 
 32   
 33   
 34  #=============================================================================== 
 35  # ColorBasis 
 36  #=============================================================================== 
37 -class LoopColorBasis(color_amp.ColorBasis):
38 """ Same class as its mother ColorBasis except that it can also handle 39 LoopAmplitudes.""" 40
41 - def __init__(self, compute_loop_nc = False):
42 """ Defines the instance attribute compute_loop_nc. 43 The compute_loop_nc sets wheter independent tracking of Nc power coming 44 from the color loop trace is necessary or not (it is time consuming).""" 45 46 self.compute_loop_nc = compute_loop_nc
47
48 - def closeColorLoop(self, colorize_dict, lcut_charge, lcut_numbers):
49 """ Add a color delta in the right representation (depending on the 50 color charge carried by the L-cut particle whose number are given in 51 the loop_numbers argument) to close the loop color trace.""" 52 53 # But for T3 and T6 for example, we must make sure to add a delta with 54 # the first index in the fundamental representation. 55 if lcut_charge<0: 56 lcut_numbers.reverse() 57 if abs(lcut_charge)==1: 58 # No color carried by the lcut particle, there is nothing to do. 59 return 60 elif abs(lcut_charge)==3: 61 closingCS=color_algebra.ColorString(\ 62 [color_algebra.T(lcut_numbers[1],lcut_numbers[0])]) 63 elif abs(lcut_charge)==6: 64 closingCS=color_algebra.ColorString(\ 65 [color_algebra.T6(lcut_numbers[1],lcut_numbers[0])]) 66 elif abs(lcut_charge)==8: 67 closingCS=color_algebra.ColorString(\ 68 [color_algebra.Tr(lcut_numbers[1],lcut_numbers[0])], 69 fractions.Fraction(2, 1)) 70 else: 71 raise color_amp.ColorBasis.ColorBasisError("L-cut particle has an unsupported color representation %s" % lcut_charge) 72 73 # Append it to all color strings for this diagram. 74 for CS in colorize_dict.values(): 75 # The double full_simplify() below brings significantly slowdown 76 # so that it should be used only when loop_Nc_power is actuall used. 77 if self.compute_loop_nc: 78 # We first compute the NcPower of this ColorString before 79 # *before* the loop color flow is sewed together. 80 max_CS_lcut_diag_Nc_power = max(cs.Nc_power \ 81 for cs in color_algebra.ColorFactor([CS]).full_simplify()) 82 # We add here the closing color structure. 83 CS.product(closingCS) 84 if self.compute_loop_nc: 85 # Now compute the Nc power *after* the loop color flow is sewed 86 # together and again compute the overall maximum power of Nc 87 # appearing in this simplified sewed structure. 88 simplified_cs = color_algebra.ColorFactor([CS]).full_simplify() 89 if not simplified_cs: 90 # It can be that the color structure simplifies to zero. 91 CS.loop_Nc_power = 0 92 continue 93 94 max_CS_loop_diag_Nc_power = max(cs.Nc_power \ 95 for cs in simplified_cs) 96 # We can now set the power of Nc brought by the potential loop 97 # color trace to the corresponding attribute of this ColorStructure 98 CS.loop_Nc_power = max_CS_loop_diag_Nc_power - \ 99 max_CS_lcut_diag_Nc_power 100 else: 101 # When not computing loop_nc (whcih is typically used for now 102 # only when doing LoopInduced + Madevent, we set the 103 # CS.loop_Nc_power to None so that it will cause problems if used. 104 CS.loop_Nc_power = None
105
106 - def create_loop_color_dict_list(self, amplitude):
107 """Returns a list of colorize dict for all loop 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('LoopColorBasis is used with an amplitude which is not a LoopAmplitude') 114 for diagram in amplitude.get('loop_diagrams'): 115 116 colorize_dict = self.colorize(diagram, 117 amplitude.get('process').get('model')) 118 if diagram['type']>0: 119 # We close here the color loop for loop diagrams (R2 have 120 # negative 'type') by adding a delta in the two color indices of 121 # loop_leg_numbers. 122 starting_leg=diagram.get_starting_loop_line() 123 finishing_leg=diagram.get_finishing_loop_line() 124 lcut_charge=amplitude['process']['model'].get_particle(\ 125 starting_leg.get('id')).get_color() 126 lcut_numbers=[starting_leg.get('number'),\ 127 finishing_leg.get('number')] 128 self.closeColorLoop(colorize_dict,lcut_charge,lcut_numbers) 129 130 list_color_dict.append(colorize_dict) 131 132 # Now let's treat the UVCT diagrams as well 133 for diagram in amplitude.get('loop_UVCT_diagrams'): 134 colorize_dict = self.colorize(diagram, 135 amplitude.get('process').get('model')) 136 list_color_dict.append(colorize_dict) 137 138 self._list_color_dict = list_color_dict 139 140 return list_color_dict
141
142 - def create_born_color_dict_list(self, amplitude):
143 """Returns a list of colorize dict for all born diagrams in amplitude. 144 Also update the _list_color_dict object accordingly """ 145 146 list_color_dict = [] 147 148 if not isinstance(amplitude,loop_diagram_generation.LoopAmplitude): 149 raise color_amp.ColorBasis.ColorBasisError('LoopColorBasis is used with an amplitude which is not a LoopAmplitude') 150 151 for diagram in amplitude.get('born_diagrams'): 152 colorize_dict = self.colorize(diagram, 153 amplitude.get('process').get('model')) 154 list_color_dict.append(colorize_dict) 155 156 self._list_color_dict = list_color_dict 157 158 return list_color_dict
159
160 - def build_born(self, amplitude):
161 """Build the a color basis object using information contained in 162 amplitude (otherwise use info from _list_color_dict). 163 Returns a list of color """ 164 165 self.create_born_color_dict_list(amplitude) 166 for index, color_dict in enumerate(self._list_color_dict): 167 self.update_color_basis(color_dict, index)
168
169 - def build_loop(self, amplitude):
170 """Build the loop color basis object using information contained in 171 amplitude (otherwise use info from _list_color_dict). 172 Returns a list of color.""" 173 174 self.create_loop_color_dict_list(amplitude) 175 for index, color_dict in enumerate(self._list_color_dict): 176 self.update_color_basis(color_dict, index)
177