Michael Borinsky

feyngen & feyncop

What is it?

feyngen is a program to generate Feynman graphs for the use in perturbative calculations of quantum field theory.

feyncop is a program to calculate the coproduct of Feynman graphs in the scope of the Hopf algebra of Feynman graphs.

The established nauty package is used to ensure high performance.

The theoretical foundation of the programs with details to validation and implementation is outlined in my paper: M. Borinsky, Feynman graph generation and calculations in the Hopf algebra of Feynman graphs, Computer Physics Communications, Volume 185, Issue 12, December 2014, Pages 3317–3330. Please cite this article if you would like to refer to the programs.

Download & Manual

The source code for both programs can be downloaded from github. A pre-built version and a separate manual for both programs are also available. Note, that the pre-built version is compiled for 64bit Linux operating systems. I would recommend to compile the programs yourself, to guarantee that they actually run properly on your computer architecture.


To use either of the programs Python 2.7 with development files must be installed on your machine. For information on how to install Python please consult http://www.python.org/ .

Additionally if you do not use the pre-built version, the nauty package by Brendan McKay is needed. The newest version can be downloaded from http://pallini.di.uniroma1.it/ .


This step can be skipped if you want to use the pre-built version.

Copy the feyncop and nauty archives into the same directory and extract them:

$ tar xzf feyncop.tar.gz
$ tar xzf nautyXXXX.tar.gz

Where XXXX are some letters representing the current nauty version.

Next, change the name of the folder containing the nauty package:

$ mv nautyXXXX/ nauty/

and build the nauty package:

$ cd nauty/
$ ./configure && make
$ cd ../

Now, feyncop and feyngen can be build:

$ cd feyncop/
$ make

The two python programs feyngen and feyncop in the feyncop/ directory should know be working as expected.

An overview of the parameters of the two programs is displayed with

$ ./feyngen --help


$ ./feyncop --help



To test feyngen run,

$ ./feyngen 2 -j2

in the feyncop/ directory.

The output should be:

phi4_j2_h2 :=

Corresponding to the sum of all 2-point, 2-loop diagrams in phi^4 theory.

To test feyncop run,

$ ./feyngen 2 -j2 -p | ./feyncop -u

the output should be:

phi4_j2_h2_red_cop_unlab :=
+ 1/4 * T[ G[[0,0],[1,0],[2,0]], G[[0,0],[1,0],[2,0]] ]
+ 3/4 * T[ G[[1,0],[1,0],[2,0],[3,0],[4,1],[5,1]], G[[0,0],[1,0],[2,0]] ]

This output corresponds to the coproduct of the sum of all 1PI, 2-point, 2-loop diagrams in phi^4 theory.