One of the most important quantities in HEP are the gradients of the probabilities of a given particle collision final state ("Matrix Elments") with respect to theory parameters or phase-space coordinates.
The madjax
package aims to provide these in an easy to use Python-focused
framework through the use of the automatic differentiation jax
and by integrating
with the Matrix Element Calculator MadGraph
. It consists of two modules
- a
MadGraph
plugin to generate differentiable code - a Python module
madjax
that provides an easy to use interface
To get madjax
you can get the latest release from PyPI with
python -m pip install madjax
madjax
relies on MadGraph
for code generation using its plugin. The recommended
way to do this is to build a madjax
docker image
docker build --file docker/Dockerfile --tag madjax-hep/madjax:local .
# you can also just run make
It is also possible to use madjax
with a local MadGraph
install.
You just need to copy the contents of $(madjax-config)
into the MadGraph installation's PLUGIN/
directory
cp -r "$(madjax-config)" <path to MadGraph5 install directory>/PLUGIN/
If you only have one version of MadGraph
installed on your machine, the following may work
cp -r "$(madjax-config)" "$(grep mg5_path $(find / -type f -iname mg5_configuration.txt) | head -n 1 | awk '{print $(NF)}')/PLUGIN/"