Package madgraph :: Package core :: Module color_amp :: Class ColorBasis
[hide private]
[frames] | no frames]

Class ColorBasis

source code

object --+    
         |    
      dict --+
             |
            ColorBasis

The ColorBasis object is a dictionary created from an amplitude. Keys are the different color structures present in the amplitude. Values have the format (diag,(index c1, index c2,...), coeff, is_imaginary, Nc_power) where diag is the diagram index, (index c1, index c2,...) the list of indices corresponding to the chose color parts for each vertex in the diagram, coeff the corresponding coefficient (a fraction), is_imaginary if this contribution is real or complex, and Nc_power the Nc power.

Nested Classes [hide private]
  ColorBasisError
Exception raised if an error occurs in the definition or the execution of a color basis object.
Instance Methods [hide private]
 
colorize(self, diagram, model)
Takes a diagram and a model and outputs a dictionary with keys being color coefficient index tuples and values a color string (before simplification).
source code
 
add_vertex(self, vertex, diagram, model, repl_dict, res_dict, min_index, id0_rep=[])
Update repl_dict, res_dict and min_index for normal vertices.
source code
 
update_color_basis(self, colorize_dict, index)
Update the current color basis by adding information from the colorize dictionary (produced by the colorize routine) associated to diagram with index index.
source code
 
create_color_dict_list(self, amplitude)
Returns a list of colorize dict for all diagrams in amplitude.
source code
 
build(self, amplitude=None)
Build the a color basis object using information contained in amplitude (otherwise use info from _list_color_dict).
source code
new empty dictionary

__init__(self, *args)
Initialize a new color basis object, either empty or filled (0 or 1 arguments).
source code
 
__str__(self)
Returns a nicely formatted string for display
source code
 
_invert_dict(self, mydict)
Helper method to invert dictionary dict
source code
 
color_flow_decomposition(self, repr_dict, ninitial)
Returns the color flow decomposition of the current basis, i.e.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Static Methods [hide private]
 
get_color_flow_string(my_color_string, octet_indices)
Return the color_flow_string (i.e., composed only of T's with 2 indices) associated to my_color_string.
source code
Class Variables [hide private]
  _canonical_dict = {}
  _list_color_dict = []

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

add_vertex(self, vertex, diagram, model, repl_dict, res_dict, min_index, id0_rep=[])

source code 

Update repl_dict, res_dict and min_index for normal vertices. Returns the min_index reached and the result dictionary in a tuple. If the id0_rep list is not None, perform the requested replacement on the last leg number before going further.

update_color_basis(self, colorize_dict, index)

source code 

Update the current color basis by adding information from the colorize dictionary (produced by the colorize routine) associated to diagram with index index. Keep track of simplification results for maximal optimization.

create_color_dict_list(self, amplitude)

source code 

Returns a list of colorize dict for all diagrams in amplitude. Also update the _list_color_dict object accordingly

build(self, amplitude=None)

source code 

Build the a color basis object using information contained in amplitude (otherwise use info from _list_color_dict). Returns a list of color

__init__(self, *args)
(Constructor)

source code 

Initialize a new color basis object, either empty or filled (0 or 1 arguments). If one arguments is given, it's interpreted as an amplitude.

Returns:
new empty dictionary

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

Returns a nicely formatted string for display

Overrides: object.__str__

get_color_flow_string(my_color_string, octet_indices)
Static Method

source code 

Return the color_flow_string (i.e., composed only of T's with 2 indices) associated to my_color_string. Take a list of the external leg color octet state indices as an input. Returns only the leading N contribution!

color_flow_decomposition(self, repr_dict, ninitial)

source code 

Returns the color flow decomposition of the current basis, i.e. a list of dictionaries (one per color basis entry) with keys corresponding to external leg numbers and values tuples containing two color indices ( (0,0) for singlets, (X,0) for triplet, (0,X) for antitriplet and (X,Y) for octets). Other color representations are not yet supported here (an error is raised). Needs a dictionary with keys being external leg numbers, and value the corresponding color representation.