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

Class Amplitude

source code

            object --+        
                     |        
                  dict --+    
                         |    
base_objects.PhysicsObject --+
                             |
                            Amplitude
Known Subclasses:

Amplitude: process + list of diagrams (ordered) Initialize with a process, then call generate_diagrams() to generate the diagrams for the amplitude

Nested Classes [hide private]

Inherited from base_objects.PhysicsObject: PhysicsObjectError

Instance Methods [hide private]
 
default_setup(self)
Default values for all properties
source code
new empty dictionary

__init__(self, argument=None)
Allow initialization with Process
source code
 
filter(self, name, value)
Filter for valid amplitude property values.
source code
D[k] if k in D, else d
get(self, name)
Get the value of the property name.
source code
 
get_sorted_keys(self)
Return diagram property names as a nicely sorted list.
source code
 
get_number_of_diagrams(self)
Returns number of diagrams for this amplitude
source code
 
get_amplitudes(self)
Return an AmplitudeList with just this amplitude.
source code
 
nice_string(self, indent=0)
Returns a nicely formatted string of the amplitude content.
source code
 
nice_string_processes(self, indent=0)
Returns a nicely formatted string of the amplitude process.
source code
 
get_ninitial(self)
Returns the number of initial state particles in the process.
source code
 
has_loop_process(self)
Returns wether this amplitude has a loop process.
source code
 
generate_diagrams(self, returndiag=False, diagram_filter=False)
Generate diagrams.
source code
 
apply_squared_order_constraints(self, diag_list)
Applies the user specified squared order constraints on the diagram list in argument.
source code
 
apply_user_filter(self, diag_list)
Applies the user specified squared order constraints on the diagram list in argument.
source code
 
create_diagram(self, vertexlist)
Return a Diagram created from the vertex list.
source code
 
convert_dgleg_to_leg(self, vertexdoublelist)
In LoopAmplitude, it converts back all DGLoopLegs into Legs.
source code
 
copy_leglist(self, legs)
Simply returns a copy of the leg list.
source code
 
reduce_leglist(self, curr_leglist, max_multi_to1, ref_dict_to0, is_decay_proc=False, coupling_orders=None)
Recursive function to reduce N LegList to N-1 For algorithm, see doc for generate_diagrams.
source code
 
reduce_orders(self, coupling_orders, model, vertex_id_list)
Return False if the coupling orders for any coupling is < 0, otherwise return the new coupling orders with the vertex orders subtracted.
source code
 
combine_legs(self, list_legs, ref_dict_to1, max_multi_to1)
Recursive function.
source code
 
merge_comb_legs(self, comb_lists, ref_dict_to1)
Takes a list of allowed leg combinations as an input and returns a set of lists where combinations have been properly replaced (one list per element in the ref_dict, so that all possible intermediate particles are included).
source code
 
get_combined_legs(self, legs, leg_vert_ids, number, state)
Create a set of new legs from the info given.
source code
 
get_combined_vertices(self, legs, vert_ids)
Allow for selection of vertex ids.
source code
 
trim_diagrams(self, decay_ids=[], diaglist=None)
Reduce the number of legs and vertices used in memory.
source code

Inherited from base_objects.PhysicsObject: __getitem__, __repr__, __str__, is_valid_prop, set

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

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

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

default_setup(self)

source code 

Default values for all properties

Overrides: base_objects.PhysicsObject.default_setup

__init__(self, argument=None)
(Constructor)

source code 

Allow initialization with Process

Returns:
new empty dictionary

Overrides: object.__init__

filter(self, name, value)

source code 

Filter for valid amplitude property values.

Overrides: base_objects.PhysicsObject.filter

get(self, name)

source code 

Get the value of the property name.

Returns: D[k] if k in D, else d
Overrides: dict.get

get_sorted_keys(self)

source code 

Return diagram property names as a nicely sorted list.

Overrides: base_objects.PhysicsObject.get_sorted_keys

get_amplitudes(self)

source code 

Return an AmplitudeList with just this amplitude. Needed for DecayChainAmplitude.

generate_diagrams(self, returndiag=False, diagram_filter=False)

source code 
Generate diagrams. Algorithm:

1. Define interaction dictionaries:
  * 2->0 (identity), 3->0, 4->0, ... , maxlegs->0
  * 2 -> 1, 3 -> 1, ..., maxlegs-1 -> 1 

2. Set flag from_group=true for all external particles.
   Flip particle/anti particle for incoming particles.

3. If there is a dictionary n->0 with n=number of external
   particles, create if possible the combination [(1,2,3,4,...)] 
   with *at least two* from_group==true. This will give a
   finished (set of) diagram(s) (done by reduce_leglist)

4. Create all allowed groupings of particles with at least one
   from_group==true (according to dictionaries n->1):
   [(1,2),3,4...],[1,(2,3),4,...],...,
                  [(1,2),(3,4),...],...,[(1,2,3),4,...],... 
   (done by combine_legs)

5. Replace each group with a (list of) new particle(s) with number 
   n = min(group numbers). Set from_group true for these
   particles and false for all other particles. Store vertex info.
   (done by merge_comb_legs)

6. Stop algorithm when at most 2 particles remain.
   Return all diagrams (lists of vertices).

7. Repeat from 3 (recursion done by reduce_leglist)

8. Replace final p=p vertex

Be aware that the resulting vertices have all particles outgoing,
so need to flip for incoming particles when used.

SPECIAL CASE: For A>BC... processes which are legs in decay
chains, we need to ensure that BC... combine first, giving A=A
as a final vertex. This case is defined by the Process
property is_decay_chain = True.
This function can also be called by the generate_diagram function
of LoopAmplitudes, in which case the generated diagrams here must not
be directly assigned to the 'diagrams' attributed but returned as a
DiagramList by the function. This is controlled by the argument
returndiag.

create_diagram(self, vertexlist)

source code 

Return a Diagram created from the vertex list. This function can be overloaded by daughter classes.

convert_dgleg_to_leg(self, vertexdoublelist)

source code 

In LoopAmplitude, it converts back all DGLoopLegs into Legs. In Amplitude, there is nothing to do.

copy_leglist(self, legs)

source code 

Simply returns a copy of the leg list. This function is overloaded in LoopAmplitude so that a DGLoopLeg list is returned. The DGLoopLeg has some additional parameters only useful during loop diagram generation

reduce_orders(self, coupling_orders, model, vertex_id_list)

source code 

Return False if the coupling orders for any coupling is < 0, otherwise return the new coupling orders with the vertex orders subtracted. If coupling_orders is not given, return None (which counts as success). WEIGHTED is a special order, which corresponds to the sum of order hierarchies for the couplings. We ignore negative constraints as these cannot be taken into account on the fly but only after generation.

combine_legs(self, list_legs, ref_dict_to1, max_multi_to1)

source code 
Recursive function. Take a list of legs as an input, with
the reference dictionary n-1->1, and output a list of list of
tuples of Legs (allowed combinations) and Legs (rest). Algorithm:

1. Get all n-combinations from list [123456]: [12],..,[23],..,[123],..

2. For each combination, say [34]. Check if combination is valid.
   If so:

   a. Append [12[34]56] to result array

   b. Split [123456] at index(first element in combination+1),
      i.e. [12],[456] and subtract combination from second half,
      i.e.: [456]-[34]=[56]. Repeat from 1. with this array

3. Take result array from call to 1. (here, [[56]]) and append
   (first half in step b - combination) + combination + (result
   from 1.) = [12[34][56]] to result array

4. After appending results from all n-combinations, return
   resulting array. Example, if [13] and [45] are valid
   combinations:
    [[[13]2456],[[13]2[45]6],[123[45]6]] 

merge_comb_legs(self, comb_lists, ref_dict_to1)

source code 

Takes a list of allowed leg combinations as an input and returns a set of lists where combinations have been properly replaced (one list per element in the ref_dict, so that all possible intermediate particles are included). For each list, give the list of vertices corresponding to the executed merging, group the two as a tuple.

get_combined_legs(self, legs, leg_vert_ids, number, state)

source code 

Create a set of new legs from the info given. This can be overloaded by daughter classes.

get_combined_vertices(self, legs, vert_ids)

source code 

Allow for selection of vertex ids. This can be overloaded by daughter classes.

trim_diagrams(self, decay_ids=[], diaglist=None)

source code 

Reduce the number of legs and vertices used in memory. When called by a diagram generation initiated by LoopAmplitude, this function should not trim the diagrams in the attribute 'diagrams' but rather a given list in the 'diaglist' argument.