scailfin / MG5aMC_PythonMEs

Plugin for MadGraph5_aMC allowing for output Matrix Elements in a TensorFlow-friendly format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MG5aMC_PythonMEs

GitHub Actions Status: CI

This code is intended as a plugin to the High Energy Physics code MadGraph5_aMC@NLO (v2.8.1+). It offers a new output mode for the standalone computation of Matrix Elements of scattering amplitudes. This special MG5aMC_PythonMEs format is in pure Python.

Usage

Copy the MG5aMC_PythonMEs directory into the PLUGIN folder located in the root directory of your MG5aMC distribution (v2.8.1+).

cp -r MG5aMC_PythonMEs <MG5aMC_root_dir>/PLUGIN/

This can be done by simply just running the Python installer

$ python install.py

The MG5aMC example script tests/test_MG5aMC_PythonMEs.mg5 can then simply be run as follows (from within the root directory of MG5aMC):

$ mg5_aMC --mode=MG5aMC_PythonMEs tests/test_MG5aMC_PythonMEs.mg5

The Python/TensorFlow code for this example selection of Matrix Elements will be generated in the folder MG5aMC_PythonMEs_output_example and its usage should be self-explanatory from reading the driver script at MG5aMC_PythonMEs_output_example/check_sa.py.

Further Development

Over time, the goal is to adapt this plugin so that its output can be directly incorporated in ML engines, such as in a TensorFlow computational graph.

To this effect the current repository provides the additional format TF for the output command. For now, this output behaves exactly identically to the Python output format (see by yourself by running test_MG5aMC_TFMEs.mg5), but uses separate daughter classes and templates (suffixed with TF) which are ready to be specialised as needed for the output code to be directly inserted in TensorFlow. In particular the driving script template check_sa_TF.py should be turned into a demo Jupyter notebook demonstrating the integration within TensorFlow.

Note that for now the independent parameters of the model are hard-coded to their default value in the parameters.py script. Eventually we may want to add a facility for reading an SLHA input card, but this is not needed for now.

About

Plugin for MadGraph5_aMC allowing for output Matrix Elements in a TensorFlow-friendly format


Languages

Language:Python 98.8%Language:Makefile 0.8%Language:Dockerfile 0.2%Language:Shell 0.2%