Package madgraph :: Package core :: Module helas_objects :: Class HelasMatrixElement
[hide private]
[frames] | no frames]

Class HelasMatrixElement

source code

            object --+        
                     |        
                  dict --+    
                         |    
base_objects.PhysicsObject --+
                             |
                            HelasMatrixElement

HelasMatrixElement: list of processes with identical Helas calls, and the list of HelasDiagrams associated with the processes.

If initiated with an Amplitude, HelasMatrixElement calls generate_helas_diagrams, which goes through the diagrams of the Amplitude and generates the corresponding Helas calls, taking into account possible fermion flow clashes due to Majorana particles. The optional optimization argument determines whether optimization is used (optimization = 1, default), for maximum recycling of wavefunctions, or no optimization (optimization = 0) when each diagram is written independently of all previous diagrams (this is useful for running with restricted memory, e.g. on a GPU). For processes with many diagrams, the total number or wavefunctions after optimization is ~15% of the number of amplitudes (diagrams).

By default, it will also generate the color information (color basis and color matrix) corresponding to 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
 
filter(self, name, value)
Filter for valid diagram property values.
source code
 
get_sorted_keys(self)
Return particle property names as a nicely sorted list.
source code
D[k] if k in D, else d
get(self, name)
Get the value of the property name.
source code
new empty dictionary

__init__(self, amplitude=None, optimization=1, decay_ids=[], gen_color=True)
Constructor for the HelasMatrixElement.
source code
 
__eq__(self, other)
Comparison between different matrix elements, to allow check for identical processes.
source code
 
__ne__(self, other)
Overloading the nonequality operator, to make comparison easy
source code
 
generate_helas_diagrams(self, amplitude, optimization=1, decay_ids=[])
Starting from a list of Diagrams from the diagram generation, generate the corresponding HelasDiagrams, i.e., the wave functions and amplitudes.
source code
 
insert_decay_chains(self, decay_dict)
Iteratively insert decay chains decays into this matrix element.
source code
 
insert_decay(self, old_wfs, decay, numbers, got_majoranas)
Insert a decay chain matrix element into the matrix element.
source code
 
update_later_mothers(self, wf, new_wf, later_wfs, later_wf_arrays)
Update mothers for all later wavefunctions
source code
 
replace_wavefunctions(self, old_wf, new_wfs, diagrams, numbers)
Recursive function to replace old_wf with new_wfs, and multiply all wavefunctions or amplitudes that use old_wf
source code
 
replace_single_wavefunction(self, old_wf, new_wf)
Insert decay chain by simply modifying wavefunction.
source code
 
identical_decay_chain_factor(self, decay_chains)
Calculate the denominator factor from identical decay chains
source code
 
calculate_fermionfactors(self)
Generate the fermion factors for all diagrams in the matrix element
source code
 
calculate_identical_particle_factor(self)
Calculate the denominator factor for identical final state particles
source code
 
get_base_amplitude(self)
Generate a diagram_generation.Amplitude from a HelasMatrixElement.
source code
 
getmothers(self, legs, number_to_wavefunctions, external_wavefunctions, wavefunctions, diagram_wavefunctions)
Generate list of mothers from number_to_wavefunctions and external_wavefunctions
source code
 
get_num_configs(self)
Get number of diagrams, which is always more than number of configs
source code
 
get_number_of_wavefunctions(self)
Gives the total number of wavefunctions for this ME
source code
 
get_all_wavefunctions(self)
Gives a list of all wavefunctions for this ME
source code
 
get_all_amplitudes(self)
Gives a list of all amplitudes for this ME
source code
 
get_external_wavefunctions(self)
Gives the external wavefunctions for this ME
source code
 
get_number_of_amplitudes(self)
Gives the total number of amplitudes for this ME
source code
 
get_nexternal_ninitial(self)
Gives (number or external particles, number of incoming particles)
source code
 
get_helicity_combinations(self)
Gives the number of helicity combinations for external wavefunctions
source code
 
get_helicity_matrix(self)
Gives the helicity matrix for external wavefunctions
source code
 
get_denominator_factor(self)
Calculate the denominator factor due to: Averaging initial state color and spin, and identical final state particles
source code
 
get_color_amplitudes(self)
Return a list of (coefficient, amplitude number) lists, corresponding to the JAMPs for this matrix element.
source code
 
get_used_lorentz(self)
Return a list of (lorentz_name, conjugate, outgoing) with all lorentz structures used by this HelasMatrixElement.
source code
 
get_used_couplings(self)
Return a list with all couplings used by this HelasMatrixElement.
source code
 
get_mirror_processes(self)
Return a list of processes with initial states interchanged if has mirror processes
source code

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

Inherited from dict: __cmp__, __contains__, __delitem__, __ge__, __getattribute__, __gt__, __iter__, __le__, __len__, __lt__, __new__, __setitem__, __sizeof__, clear, copy, fromkeys, 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]
 
check_equal_decay_processes(decay1, decay2)
Check if two single-sided decay processes (HelasMatrixElements) are equal.
source code
 
check_equal_wavefunctions(wf1, wf2)
Recursive function to check if two wavefunctions are equal.
source code
 
sorted_mothers(arg)
Gives a list of mother wavefunctions sorted according to
source code
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

filter(self, name, value)

source code 

Filter for valid diagram property values.

Overrides: base_objects.PhysicsObject.filter

get_sorted_keys(self)

source code 

Return particle property names as a nicely sorted list.

Overrides: base_objects.PhysicsObject.get_sorted_keys

get(self, name)

source code 

Get the value of the property name.

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

__init__(self, amplitude=None, optimization=1, decay_ids=[], gen_color=True)
(Constructor)

source code 

Constructor for the HelasMatrixElement. In particular allows generating a HelasMatrixElement from an Amplitude, with automatic generation of the necessary wavefunctions

Returns:
new empty dictionary

Overrides: object.__init__

__eq__(self, other)
(Equality operator)

source code 

Comparison between different matrix elements, to allow check for identical processes.

Overrides: dict.__eq__

__ne__(self, other)

source code 

Overloading the nonequality operator, to make comparison easy

Overrides: dict.__ne__

generate_helas_diagrams(self, amplitude, optimization=1, decay_ids=[])

source code 

Starting from a list of Diagrams from the diagram generation, generate the corresponding HelasDiagrams, i.e., the wave functions and amplitudes. Choose between default optimization (= 1, maximum recycling of wavefunctions) or no optimization (= 0, no recycling of wavefunctions, useful for GPU calculations with very restricted memory).

Note that we need special treatment for decay chains, since the end product then is a wavefunction, not an amplitude.

insert_decay_chains(self, decay_dict)

source code 
Iteratively insert decay chains decays into this matrix
element.        
* decay_dict: a dictionary from external leg number
  to decay matrix element.

insert_decay(self, old_wfs, decay, numbers, got_majoranas)

source code 
Insert a decay chain matrix element into the matrix element.
* old_wfs: the wavefunctions to be replaced.
  They all correspond to the same external particle, but might
  have different fermion flow directions
* decay: the matrix element for the decay chain
* numbers: the present wavefunction and amplitude number,
  to allow for unique numbering
  
Note that:
1) All amplitudes and all wavefunctions using the decaying wf
   must be copied as many times as there are amplitudes in the
   decay matrix element
2) In the presence of Majorana particles, we must make sure
   to flip fermion flow for the decay process if needed.

The algorithm is the following:
1) Multiply the diagrams with the number of diagrams Ndiag in
   the decay element
2) For each diagram in the decay element, work on the diagrams
   which corresponds to it
3) Flip fermion flow for the decay wavefunctions if needed
4) Insert all auxiliary wavefunctions into the diagram (i.e., all 
   except the final wavefunctions, which directly replace the
   original final state wavefunctions)
4) Replace the wavefunctions recursively, so that we always replace
   each old wavefunctions with Namp new ones, where Namp is
   the number of amplitudes in this decay element
   diagram. Do recursion for wavefunctions which have this
   wavefunction as mother. Simultaneously replace any
   amplitudes which have this wavefunction as mother.

replace_wavefunctions(self, old_wf, new_wfs, diagrams, numbers)

source code 
Recursive function to replace old_wf with new_wfs, and
multiply all wavefunctions or amplitudes that use old_wf

* old_wf: The wavefunction to be replaced
* new_wfs: The replacing wavefunction
* diagrams - the diagrams that are relevant for these new
  wavefunctions.
* numbers: the present wavefunction and amplitude number,
  to allow for unique numbering

replace_single_wavefunction(self, old_wf, new_wf)

source code 

Insert decay chain by simply modifying wavefunction. This is possible only if there is only one diagram in the decay.

get_base_amplitude(self)

source code 

Generate a diagram_generation.Amplitude from a HelasMatrixElement. This is used to generate both color amplitudes and diagram drawing.

get_color_amplitudes(self)

source code 

Return a list of (coefficient, amplitude number) lists, corresponding to the JAMPs for this matrix element. The coefficients are given in the format (fermion factor, color coeff (frac), imaginary, Nc power).

check_equal_decay_processes(decay1, decay2)
Static Method

source code 

Check if two single-sided decay processes (HelasMatrixElements) are equal.

Note that this has to be called before any combination of processes has occured.

Since a decay processes for a decay chain is always generated such that all final state legs are completely contracted before the initial state leg is included, all the diagrams will have identical wave function, independently of the order of final state particles.

Note that we assume that the process definitions have all external particles, corresponding to the external wavefunctions.

check_equal_wavefunctions(wf1, wf2)
Static Method

source code 

Recursive function to check if two wavefunctions are equal. First check that mothers have identical pdg codes, then repeat for all mothers with identical pdg codes.

sorted_mothers(arg)
Static Method

source code 

Gives a list of mother wavefunctions sorted according to

  1. The order of the particles in the interaction
  2. Cyclic reordering of particles in same spin group
  3. Fermions ordered IOIOIO... according to the pairs in the interaction.