36
37
""" Same class as its mother ColorBasis except that it can also handle
40
def __init__(self, compute_loop_nc = False):
41
""" 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)."""
45
self.compute_loop_nc = compute_loop_nc
39
47
def closeColorLoop(self, colorize_dict, lcut_charge, lcut_numbers):
40
48
""" Add a color delta in the right representation (depending on the
41
49
color charge carried by the L-cut particle whose number are given in
42
the loop_numbers argument) to close the loop color trace """
50
the loop_numbers argument) to close the loop color trace."""
44
52
# But for T3 and T6 for example, we must make sure to add a delta with
45
53
# the first index in the fundamental representation.
62
70
raise color_amp.ColorBasis.ColorBasisError, \
63
71
"L-cut particle has an unsupported color representation %s" % lcut_charge
65
73
# Append it to all color strings for this diagram.
66
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.
67
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
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 = None
69
100
def create_loop_color_dict_list(self, amplitude):
70
101
"""Returns a list of colorize dict for all loop diagrams in amplitude.
71
Also update the _list_color_dict object accordingly """
102
Also update the _list_color_dict object accordingly."""
73
104
list_color_dict = []
134
165
def build_loop(self, amplitude):
135
166
"""Build the loop color basis object using information contained in
136
167
amplitude (otherwise use info from _list_color_dict).
137
Returns a list of color """
168
Returns a list of color."""
139
170
self.create_loop_color_dict_list(amplitude)
140
171
for index, color_dict in enumerate(self._list_color_dict):