Pyfeyn
https://pyfeyn.hepforge.org/examples
[1]:
from feynml import FeynmanDiagram, Leg, Propagator, Vertex
from pyfeyn2.render.all import AllRender
from pyfeyn2.render.latex.tikzfeynman import TikzFeynmanRender
from pyfeyn2.auto.position import feynman_adjust_points
from pyfeyn2.auto.label import auto_label
from pyfeyn2.auto.bend import auto_bend
from feynml import Momentum
[2]:
v1 = Vertex().with_xy(-1, 0)
v2 = Vertex().with_xy(1, 0)
v3 = Vertex().with_xy(2, 1)
v4 = Vertex().with_xy(2, -1)
fd = FeynmanDiagram().add(
v1, v2, v3, v4,
Propagator().connect(v1, v2).with_type("boson").with_label("$\\gamma/Z$"),
Propagator(pdgid=1).connect(v2, v3),
Propagator(pdgid=-1).connect(v2,v4),
Propagator(name="g").connect(v3,v4).with_style("bend-direction : left"),
Leg(pdgid=11).with_target(v1).with_xy(-3, 2).with_incoming().with_style("momentum-arrow : true; momentum-arrow-sense : 1").with_momentum(Momentum(name="$\\vec p$")),
Leg(pdgid=-11).with_target(v1).with_xy(-3, -2).with_incoming(),
Leg(pdgid=1).with_target(v3).with_xy(3, 2).with_outgoing(),
Leg(pdgid=-1).with_target(v4).with_xy(3, -2).with_outgoing(),
)
auto_label(fd.propagators + fd.legs)
ar = AllRender(fd)
ar.render()
tikz:

pyx:

feynmp:

feynman:

dot:

mermaid:
asciipdf:

unicodepdf:

madgraph:

root:

Info in <TCanvas::SaveSource>: C++ Macro file: /tmp/tmpirofgrqd.tex has been generated
Info in <TCanvas::Print>: TeX file /tmp/tmpphtm9s41.tex has been created
[3]:
v1 = Vertex(x=-2,y=0)
v2 = Vertex(x= 2,y=0)
l1 = Leg(x=-4,y=0,pdgid=25)
l2 = Leg(x= 4,y=0,pdgid=25)
fd = FeynmanDiagram().add(
v1, v2,
Propagator(pdgid=6).connect(v1, v2),
Propagator(pdgid=-6).connect(v1, v2),
l1.with_target(v1).with_incoming(),
l2.with_target(v2).with_outgoing(),
)
auto_label(fd.propagators + fd.legs)
auto_bend(fd)
ar = AllRender(fd)
ar.render()
tikz:

pyx:

feynmp:

feynman:

dot:

mermaid:
asciipdf:

unicodepdf:

madgraph:

root:

Error in <TCanvas::Range>: illegal world coordinates range: x1=-4.400000, y1=0.000000, x2=4.400000, y2=0.000000
Info in <TCanvas::SaveSource>: C++ Macro file: /tmp/tmpwnvz1tx4.tex has been generated
Info in <TCanvas::Print>: TeX file /tmp/tmp82w82usj.tex has been created
[4]:
v1 = Vertex(x=-2,y=0)
v2 = Vertex(x= 2,y=0)
l1 = Leg(x=-4,y=0,pdgid=25)
l2 = Leg(x= 4,y=0,pdgid=25)
fd = FeynmanDiagram().add(
v1, v2,
Propagator(pdgid=6).connect(v1, v2),
Propagator(pdgid=-6).connect(v1, v2),
#l1.with_target(v1).with_incoming(),
#l2.with_target(v2).with_outgoing(),
)
auto_label(fd.propagators + fd.legs)
auto_bend(fd)
ar = AllRender(fd)
ar.render()
tikz:

pyx:

feynmp:

feynman:

dot:

mermaid:
asciipdf:

unicodepdf:

madgraph:

root:

Error in <TCanvas::Range>: illegal world coordinates range: x1=-2.200000, y1=0.000000, x2=2.200000, y2=0.000000
Info in <TCanvas::SaveSource>: C++ Macro file: /tmp/tmpuaegz_vt.tex has been generated
Info in <TCanvas::Print>: TeX file /tmp/tmpmqxqycro.tex has been created
[ ]:
[ ]:
[ ]: