Automatic Drawing of Topologies and Diagrams¶
Info
The drawing module is in principle fully functional, but not fully tuned. Flaws like part of the drawing reaching outside of the bounding box, imperfect layout, etc. are to be expected currently.
Since the easiest method to examine Feynman diagrams is by inspecting them visually, FeynGraph provides functions for the automatic layouting and drawing of topologies and diagrams. FeynGraph currently supports two formats:
- TikZ: per-diagram output of a standalone
.tikzfile which can be directly imported in a LaTeX document via TikZ or modified withTikZiT. This requires the additionalfeyngraph.tikzdefsandfeyngraph.tikzstylesfiles which are distributed in<prefix>/share/FeynGraph. - SVG: per-diagram output of a standalone
.svgfile or a single.svgfile with large canvas containing multiple diagrams in a grid.
Drawing functions are provided by the Topology and Diagram(View) objects for drawing of a single diagram and by the respective container objects for drawing of multiple diagrams.
Example
Example
Tip
The Python types implement the _repr_svg_ method, therefore the respective objects are drawn automatically when using a Jupyter notebook. Only the first 100 topologies/diagrams of a container object are drawn with the _repr_svg_ method.