Skip to content

Draw your Feynman diagrams automatically using QGRAF and TikZ-Feynman

Notifications You must be signed in to change notification settings

hepcpt/qgraf-xml-drawer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QGRAF Diagram Drawer

Dependencies

This code uses QGRAF and tikz-feynman

Use

The program qgraf-xml-drawer is a Python program for drawing Feynman diagrams. The code translates QGRAF diagrams into a LuaLaTeX file using tikz-feynman to draw them after compilation

QGRAF

The program is provided with a QGRAF style file called xmldraw.sty. Any set of feynman rules compatible with QGRAF can be handled and the output should be put in the package folder to be processed.

LuaLaTeX Generation

The user is required to modify the code to adapt it to their situation.

  • The QGRAF output file name should be provided by modifying the variable INPUTS in the file drawer.py.
  • The particle dictionnary pt in drawer.py should also be modified to contain the list of particles and anti-particles appearing in the diagrams. Each key in the dictionnary is the name of the particle as defined in QGRAF and the associated value should be the associated propagator type as defined in tikz-feynman.

Once this is defined, run the code using python drawer.py and compile the output using lualatex main.tex. The diagrams ared drawn in main.pdf.

Limitations

The code is designed to make loop diagrams look nice. At the moment, it returns a ValueError if two vertices are joined by 4 or more propagators.

Citing

This code is citeable using the following DOI:

DOI

About

Draw your Feynman diagrams automatically using QGRAF and TikZ-Feynman

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 66.7%
  • TeX 33.3%