Skip to main content

MadGraPy

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 (on Ubuntu: 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 madgrapy

(optional) Install madgraph from its GitHub

If you don't have already madgraph installed, you can do it by the following:

git clone https://github.com/mg5amcnlo/mg5amcnlo.git
cd mg5amcnlo
git switch 3.x
rm -rf bin/*.py

Test it with

./mg5amcnlo/bin/mg5_aMC

How to run a simple process

You can find a example Jupyter notebook inside the notebooks folder. To generate a simple script and run it, you can do

from madgrapy import madpy_generate_script, madpy_run

# Write the script
full_script_str, mg5_script_path, workdir_process = madpy_generate_script(process = "p p > t t~", models = "sm", process_name="my_first_mg5run")

# Run
mg5_script_complete_path = madpy_run(madgraph_path="/path/to/madgraph/folder", process_name = "my_first_mg5run", mg5_script_folder_path = f".")

Metadata

Release files for madgrapy 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for madgrapy 0.2.0
File Size Uploaded
madgrapy-0.2.0.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for madgrapy 0.2.0
File Interpreter ABI Platform
madgrapy-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / madgrapy-0.2.0.tar.gz

Download URL madgrapy-0.2.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
c8c3d2818348a24138df41965b5376ac1e1bb8599a6dff7f51818701337c1c6e
BLAKE2b-256 checksum
How to use checksums
84914cd39f8120876e75696f129711669aa1734f8269ee153674115ce2f60bd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release files / madgrapy-0.2.0-py3-none-any.whl

Download URL madgrapy-0.2.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37f2e40c3807c4b30f90464e8bcaef4430e24d36bcd56a329d4143996b719316
BLAKE2b-256 checksum
How to use checksums
b49fd98ad67c41966fe4ba1fae0febeba66805b29433362120348a0692c25ac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page