Skip to main content

A Python interface to run MadGraph

Project description

MadPy

A simple Python interface to run MadGraph

How to use this module

Requirements:

  • Python 3.6+
  • MadGraph 3.6+
  • AND Python 2.7 (for MadDM compatibility)
  • AND MadGraph 2.9 (for MadDM compatibility)
  • ghostscript

sudo apt-get install ghostscript

(Optional) Create a virtual env

python3 -m venv my_virtualenv
source my_virtualenv/bin/activate

Install with pip

pip install madpy

Install madgraph from its GitHub

git clone https://github.com/mg5amcnlo/mg5amcnlo.git
cd mg5amcnlo
git switch 3.x

rm -rf bin/*.py

Download MadGraph 2.9.24 (to run MadDM v3.2, to be updated soon)

wget https://github.com/mg5amcnlo/mg5amcnlo/archive/refs/tags/v2.9.24.tar.gz
tar -xvf v2.9.24.tar.gz
cd mg5amcnlo-2.9.24

Run mg5 with

./bin/mg5_aMC

Install MadDM v3.2

In order to install MadDM v3.2

First, run MG5 with and then the following command

./bin/mg5_aMC
install maddm
install pythia

!!! important "Python3 compatibility" Up to now, MadDM doesn't have compatibility with Python3, so you need to have Python2.7 installed.

And run maddm with:

python2.7 bin/maddm.py

After that, you can follow the tutorial to learn MadDM basic features

Run Simplified DM model scan

MadDM> import model eDMsimp_s_spin0
MadDM> define darkmatter xd
MadDM> generate direct
MadDM> output SCAN_example
MadDM> launch SCAN_example

TODO:

  • Update this guide when MadDM v3.3 is released.

[Experimental] Run MadDM beta with Python3 compatibility

Clone the MadDM repository

git clone https://github.com/maddmhep/maddm.git
cd maddm
git switch rc/3.3
cp -R . ../mg5amcnlo-2.9.24/PLUGIN/maddm
cp -R maddm ../mg5amcnlo-2.9.24/bin/maddm.py

Install LHAPDF

wget https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.X.Y.tar.gz -O LHAPDF-6.X.Y.tar.gz
# ^ or use a web browser to download, which will get the filename correct
tar xf LHAPDF-6.X.Y.tar.gz
cd LHAPDF-6.X.Y
## Changes 
export PYTHON_VERSION=3.10
export PYTHON=/opt/apps/python/3.10/bin/python3.10
./configure  --prefix=/opt/apps/python/3.10
make
make install

Troubleshooting

find /opt/apps/python/3.10 -name "libpython3.10.so.1.0" export LD_LIBRARY_PATH=/opt/apps/python/3.10/lib:$LD_LIBRARY_PATH echo "/opt/apps/python/3.10/lib" | sudo tee /etc/ld.so.conf.d/python310.conf sudo ldconfig

file /opt/modulefiles/lhapdf/6.5.5

#%Module1.0
prepend-path PATH /opt/apps/lhapdf/bin
prepend-path LD_LIBRARY_PATH /opt/apps/lhapdf/lib
prepend-path PYTHONPATH /opt/apps/lhapdf/lib/python3.10/site-packages

MadGraph FAQ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

madgrapy-0.0.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

madgrapy-0.0.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file madgrapy-0.0.1.tar.gz.

File metadata

  • Download URL: madgrapy-0.0.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for madgrapy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fd5bc83af6dc44460755539bb94112bacc4fbab5582e243679acf84adc115f91
MD5 23e75c576fac99e0ab740923b38f99de
BLAKE2b-256 10e593ccafd749226201a969a38a94e141043c894f46007d049fd0d6ba5dc254

See more details on using hashes here.

File details

Details for the file madgrapy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: madgrapy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for madgrapy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a30ad193ee34aad3b79741c975fda6e55222b880139d05b5c4f94f276f6e0367
MD5 faacd8e306de892a4129d3e6dfb6909b
BLAKE2b-256 fc1111a2e212e2d2c04948b8408bd1bc854124375ca0d4f7c352eaf849b50caa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page