Overleaf
Reimplementation of diagrams from https://www.overleaf.com/learn/latex/Feynman_diagrams
[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
[2]:
v1 = Vertex().with_xy(-1, 0)
v2 = Vertex().with_xy(1, 0)
fd = FeynmanDiagram().add(
v1,
v2,
Propagator().connect(v1, v2).with_type("photon").put_style('opacity',0.2).with_style_property('color','red').with_momentum("$k$"),
Leg().with_target(v1).with_xy(-2, 1).with_type("fermion").with_incoming().with_label("$e^{+}$").with_style_property('opacity',0.2),
Leg().with_target(v1).with_xy(-2, -1).with_type("fermion").with_incoming().with_label("$e^{-}$").with_style_property('opacity',0.2),
Leg().with_target(v2).with_xy(2, 1).with_type("fermion").with_outgoing().with_label("$\\mu^+$").with_style_property('opacity',0.2),
Leg().with_target(v2).with_xy(2, -1).with_type("fermion").with_outgoing().with_label("$\\mu^-$").with_style_property('opacity',0.9),
)
ar = AllRender(fd)
ar.render()
/tmp/ipykernel_484/3445839438.py:7: DeprecatedWarning: put_style is deprecated as of 0.0.0.
Propagator().connect(v1, v2).with_type("photon").put_style('opacity',0.2).with_style_property('color','red').with_momentum("$k$"),
tikz:

pyx:

feynmp:

feynman:

dot:

mermaid:
asciipdf:

unicodepdf:

madgraph:

root:

Info in <TCanvas::SaveSource>: C++ Macro file: /tmp/tmpnaab_9_v.tex has been generated
Info in <TCanvas::Print>: TeX file /tmp/tmp96oc6ou1.tex has been created
[3]:
v1 = Vertex().with_xy(-1, 0)
v2 = Vertex().with_xy(1, 0)
fd = FeynmanDiagram().add(
v1,
v2,
Propagator().connect(v1, v2).with_type("fermion"),
Leg().with_target(v1).with_xy(-2, 1).with_type("fermion").with_incoming(),
Leg().with_target(v1).with_xy(-2, -1).with_type("photon").with_incoming(),
Leg().with_target(v2).with_xy(2, 1).with_type("fermion").with_outgoing(),
Leg().with_target(v2).with_xy(2, -1).with_type("photon").with_outgoing(),
)
ar = AllRender(fd)
ar.render()
tikz:

pyx:

feynmp:

feynman:

dot:

mermaid:
asciipdf:

unicodepdf:

madgraph:

root:

Info in <TCanvas::SaveSource>: C++ Macro file: /tmp/tmpqgl5e966.tex has been generated
Info in <TCanvas::Print>: TeX file /tmp/tmpy2n93fur.tex has been created
[4]:
v1 = Vertex().with_xy(-2, -2)
v2 = Vertex().with_xy(2, -2)
i1 = Vertex().with_xy(-2, 2)
o1 = Vertex().with_xy(2, 2)
o2 = Vertex().with_xy(2, 1)
o3 = Vertex().with_xy(2, 0)
p1 = Vertex().with_xy(0, 2)
p2 = Vertex().with_xy(1, 1)
fd = FeynmanDiagram().add(
v1,
v2,
Propagator().connect(v1,v2).with_type("fermion").with_label("$d$").with_tension(0),
Leg().with_target(v1).with_point(v1).with_type("phantom").with_incoming(),
Leg().with_target(v2).with_point(v2).with_type("phantom").with_outgoing(),
i1,p1,p2,o1,o2,o3,
Propagator().connect(p2,p1).with_type("boson").with_label(r"$W^{+}$"),
Leg(label=r"$\bar{b}$").with_target(p1).with_point(i1).with_type("fermion").with_incoming(),
Leg(label=r"$\bar{c}$").with_target(p1).with_point(o1).with_type("fermion").with_outgoing(),
Leg(label=r"$c$").with_target(p2).with_point(o2).with_type("fermion").with_outgoing(),
Leg(label=r"$\bar{s}$").with_target(p2).with_point(o3).with_type("fermion").with_outgoing()
)
ar = AllRender(fd)
ar.render()
tikz:

pyx:

feynmp:

feynman:

dot:

mermaid:
asciipdf:

unicodepdf:

madgraph:

root:

Info in <TCanvas::SaveSource>: C++ Macro file: /tmp/tmpsaj8ngxb.tex has been generated
Info in <TCanvas::Print>: TeX file /tmp/tmp6_je8lvq.tex has been created
[ ]:
[ ]:
[ ]: