Changes between Version 6 and Version 7 of Density


Ignore:
Timestamp:
Oct 24, 2025, 11:39:15 AM (5 days ago)
Author:
Durupt
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Density

    v6 v7  
    2222}}}
    2323
    24 The user is then asked to edit the different cards needed for the run. The information for the density matrices computation is given in the reweight_card. Examples for different benchmark processes are given in https://arxiv.org/abs/2510.17730.
     24The user is then asked to edit the different cards needed for the run. The information for the density matrices computation is given in the reweight_card. Examples for different benchmark processes are given in https://arxiv.org/abs/2510.17730. At the end of the run, the density matrix for each event is written in the Les Houches Event (LHE) file.
     25
     26==How to read the density matrices in the LHE file
     27The LHE file can be read with the parser lhe_parser.py available in MadGraph. An example of code that would parse the density matrix value for each event is:
     28
     29{{{
     30import sys
     31sys.path.append('PATH TO MADGRAPH')
     32import madgraph.various.Density_functions as dens
     33import madgraph.various.lhe_parser as lhe_parser
     34
     35lhe_path = os.path.join('PATH TO MADGRAPH', Data_Path)
     36for event in lhe_parser.EventFile(lhe_path):
     37    density = event.density
     38    square_density = dens.square_matrix(density)
     39
     40}}}
     41
     42With this code, for each event of the file, you read the value `density` which contains the independent coefficients of the density matrix. The utility function `square_matrix` allows to write it in the usual matrix form needed for further analysis.
     43