Package madgraph :: Package core :: Module diagram_generation :: Class DiagramTag
[hide private]
[frames] | no frames]

Class DiagramTag

source code

object --+
         |
        DiagramTag
Known Subclasses:

Class to tag diagrams based on objects with some __lt__ measure, e.g.
PDG code/interaction id (for comparing diagrams from the same amplitude),
or Lorentz/coupling/mass/width (for comparing AMPs from different MEs).
Algorithm: Create chains starting from external particles:
1 \        / 6
2 /\______/\ 7
3_ /  |   \_ 8
4 /   5    \_ 9
            \ 10
gives ((((9,10,id910),8,id9108),(6,7,id67),id910867)
       (((1,2,id12),(3,4,id34)),id1234),
       5,id91086712345)
where idN is the id of the corresponding interaction. The ordering within
chains is based on chain length (depth; here, 1234 has depth 3, 910867 has
depth 4, 5 has depht 0), and if equal on the ordering of the chain elements.
The determination of central vertex is based on minimizing the chain length
for the longest subchain. 
This gives a unique tag which can be used to identify diagrams
(instead of symmetry), as well as identify identical matrix elements from
different processes.

Nested Classes [hide private]
  DiagramTagError
Exception for any problems in DiagramTags
Instance Methods [hide private]
 
__init__(self, diagram, model=None, ninitial=2)
Initialize with a diagram.
source code
 
get_external_numbers(self)
Get the order of external particles in this tag
source code
 
diagram_from_tag(self, model)
Output a diagram from a DiagramTag.
source code
 
__eq__(self, other)
Equal if same tag
source code
 
__ne__(self, other) source code
 
__str__(self)
str(x)
source code
 
__lt__(self, other) source code
 
__gt__(self, other) source code
 
__repr__(self)
str(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
vertices_from_link(cls, link, model, first_vertex=False)
Recursively return the leg corresponding to this link and the list of all vertices from all previous links
source code
 
legPDGs_from_vertex_id(cls, vertex_id, model)
Returns the list of external PDGs of the interaction corresponding to this vertex_id.
source code
 
leg_from_legs(cls, legs, vertex_id, model)
Return a leg from a leg list and the model info
source code
 
vertex_from_link(cls, legs, vertex_id, model)
Return a vertex given a leg list and a vertex id
source code
Static Methods [hide private]
 
leg_from_link(link)
Return a leg from a link
source code
 
id_from_vertex_id(vertex_id)
Return the numerical vertex id from a link.vertex_id
source code
 
loop_info_from_vertex_id(vertex_id)
Return the loop_info stored in this vertex id.
source code
 
reorder_permutation(perm, start_perm)
Reorder a permutation with respect to start_perm.
source code
 
link_from_leg(leg, model)
Returns the default end link for a leg: ((id, state), number).
source code
 
vertex_id_from_vertex(vertex, last_vertex, model, ninitial)
Returns the default vertex id: just the interaction id Note that in the vertex id, like the leg, only the first entry is taken into account in the tag comparison, while the second is for storing information that is not to be used in comparisons and the third for additional info regarding the shrunk loop vertex.
source code
 
flip_vertex(new_vertex, old_vertex, links)
Returns the default vertex flip: just the new_vertex
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, diagram, model=None, ninitial=2)
(Constructor)

source code 

Initialize with a diagram. Create DiagramTagChainLinks according to the diagram, and figure out if we need to shift the central vertex.

Overrides: object.__init__

diagram_from_tag(self, model)

source code 

Output a diagram from a DiagramTag. Note that each daughter class must implement the static functions id_from_vertex_id (if the vertex id is something else than an integer) and leg_from_link (to pass the correct info from an end link to a leg).

loop_info_from_vertex_id(vertex_id)
Static Method

source code 

Return the loop_info stored in this vertex id. Notice that the IdentifyME tag does not store the loop_info, but should normally never need access to it.

reorder_permutation(perm, start_perm)
Static Method

source code 

Reorder a permutation with respect to start_perm. Note that both need to start from 1.

link_from_leg(leg, model)
Static Method

source code 

Returns the default end link for a leg: ((id, state), number). Note that the number is not taken into account if tag comparison, but is used only to extract leg permutations.

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

str(x)

Overrides: object.__repr__
(inherited documentation)