Skip to content

cohsh/feynman-diagram-generator

Repository files navigation

Feynman Diagram Generator

  • This project is a simple Feynman diagram generator written in C++ using the Boost Graph Library.
  • At the moment, only undirected diagrams corresponding to the one-electron self-energy with electron-phonon interactions can be output.

Prerequisites

Ensure you have the following installed on your system:

  • CMake (version 3.13 or higher)
  • A C++ compiler (e.g., g++, clang)
  • Boost library
  • Graphviz (for generating graphical output)

Install dependencies

Debian-based systems:

sudo apt update
sudo apt install cmake g++ libboost-all-dev graphviz

Arch Linux:

sudo pacman -S cmake boost graphviz

macOS (with Homebrew):

brew install cmake boost graphviz

Usage

  1. Clone the repository:
git clone [email protected]:cohsh/feynman-diagram-generator.git
cd feynman-diagram-generator
  1. Create a build directory and run CMake:
cmake -S . -B build
  1. Build the project:
make
  1. Run the executable ($n=1,2$ is the order of diagrams):
./generate_graph.sh n

This will generate dot/graph_*.dot and png/graph_*.png files.