Trees | Indices | Help |
---|
|
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 import madgraph.various.misc as misc 25 26 import madgraph.core.color_amp as color_amp 27 import madgraph.core.color_algebra as color_algebra 28 import madgraph.core.diagram_generation as diagram_generation 29 import madgraph.loop.loop_diagram_generation as loop_diagram_generation 30 import madgraph.core.base_objects as base_objects 31 32 33 #=============================================================================== 34 # ColorBasis 35 #===============================================================================37 """ Same class as its mother ColorBasis except that it can also handle 38 LoopAmplitudes.""" 3917341 """ Defines the instance attribute compute_loop_nc. 42 The compute_loop_nc sets wheter independent tracking of Nc power coming 43 from the color loop trace is necessary or not (it is time consuming).""" 44 45 self.compute_loop_nc = compute_loop_nc4648 """ Add a color delta in the right representation (depending on the 49 color charge carried by the L-cut particle whose number are given in 50 the loop_numbers argument) to close the loop color trace.""" 51 52 # But for T3 and T6 for example, we must make sure to add a delta with 53 # the first index in the fundamental representation. 54 if lcut_charge<0: 55 lcut_numbers.reverse() 56 if abs(lcut_charge)==1: 57 # No color carried by the lcut particle, there is nothing to do. 58 return 59 elif abs(lcut_charge)==3: 60 closingCS=color_algebra.ColorString(\ 61 [color_algebra.T(lcut_numbers[1],lcut_numbers[0])]) 62 elif abs(lcut_charge)==6: 63 closingCS=color_algebra.ColorString(\ 64 [color_algebra.T6(lcut_numbers[1],lcut_numbers[0])]) 65 elif abs(lcut_charge)==8: 66 closingCS=color_algebra.ColorString(\ 67 [color_algebra.Tr(lcut_numbers[1],lcut_numbers[0])], 68 fractions.Fraction(2, 1)) 69 else: 70 raise color_amp.ColorBasis.ColorBasisError, \ 71 "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 max_CS_loop_diag_Nc_power = max(cs.Nc_power \ 89 for cs in color_algebra.ColorFactor([CS]).full_simplify()) 90 # We can now set the power of Nc brought by the potential loop 91 # color trace to the corresponding attribute of this ColorStructure 92 CS.loop_Nc_power = max_CS_loop_diag_Nc_power - \ 93 max_CS_lcut_diag_Nc_power 94 else: 95 # When not computing loop_nc (whcih is typically used for now 96 # only when doing LoopInduced + Madevent, we set the 97 # CS.loop_Nc_power None so that it will cause problems if used. 98 CS.loop_Nc_power = None99101 """Returns a list of colorize dict for all loop diagrams in amplitude. 102 Also update the _list_color_dict object accordingly.""" 103 104 list_color_dict = [] 105 106 if not isinstance(amplitude,loop_diagram_generation.LoopAmplitude): 107 raise color_amp.ColorBasis.ColorBasisError, \ 108 'LoopColorBasis is used with an amplitude which is not a LoopAmplitude' 109 for diagram in amplitude.get('loop_diagrams'): 110 111 colorize_dict = self.colorize(diagram, 112 amplitude.get('process').get('model')) 113 if diagram['type']>0: 114 # We close here the color loop for loop diagrams (R2 have 115 # negative 'type') by adding a delta in the two color indices of 116 # loop_leg_numbers. 117 starting_leg=diagram.get_starting_loop_line() 118 finishing_leg=diagram.get_finishing_loop_line() 119 lcut_charge=amplitude['process']['model'].get_particle(\ 120 starting_leg.get('id')).get_color() 121 lcut_numbers=[starting_leg.get('number'),\ 122 finishing_leg.get('number')] 123 self.closeColorLoop(colorize_dict,lcut_charge,lcut_numbers) 124 125 list_color_dict.append(colorize_dict) 126 127 # Now let's treat the UVCT diagrams as well 128 for diagram in amplitude.get('loop_UVCT_diagrams'): 129 colorize_dict = self.colorize(diagram, 130 amplitude.get('process').get('model')) 131 list_color_dict.append(colorize_dict) 132 133 self._list_color_dict = list_color_dict 134 135 return list_color_dict136138 """Returns a list of colorize dict for all born diagrams in amplitude. 139 Also update the _list_color_dict object accordingly """ 140 141 list_color_dict = [] 142 143 if not isinstance(amplitude,loop_diagram_generation.LoopAmplitude): 144 raise color_amp.ColorBasis.ColorBasisError, \ 145 'LoopColorBasis is used with an amplitude which is not a LoopAmplitude' 146 147 for diagram in amplitude.get('born_diagrams'): 148 colorize_dict = self.colorize(diagram, 149 amplitude.get('process').get('model')) 150 list_color_dict.append(colorize_dict) 151 152 self._list_color_dict = list_color_dict 153 154 return list_color_dict155157 """Build the a color basis object using information contained in 158 amplitude (otherwise use info from _list_color_dict). 159 Returns a list of color """ 160 161 self.create_born_color_dict_list(amplitude) 162 for index, color_dict in enumerate(self._list_color_dict): 163 self.update_color_basis(color_dict, index)164166 """Build the loop color basis object using information contained in 167 amplitude (otherwise use info from _list_color_dict). 168 Returns a list of color.""" 169 170 self.create_loop_color_dict_list(amplitude) 171 for index, color_dict in enumerate(self._list_color_dict): 172 self.update_color_basis(color_dict, index)
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Jul 1 19:18:45 2015 | http://epydoc.sourceforge.net |