All

[2]:
from pyfeyn2.feynmandiagram import FeynmanDiagram, Leg, Propagator, Vertex
from pyfeyn2.render.all import AllRender
from pyfeyn2.render.latex.dot import feynman_adjust_points
import pyfeyn2
print(pyfeyn2.__version__)
[3]:
fd = FeynmanDiagram()
v1 = Vertex("v1").with_xy(-1, 0)
v2 = Vertex("v2").with_xy(1, 0)
p1 = Propagator("p1").connect(v1, v2).with_type("gluon")
l1 = Leg("l1").with_target(v1).with_xy(-2, 1).with_type("gluon").with_incoming()
l2 = Leg("l2").with_target(v1).with_xy(-2, -1).with_type("gluon").with_incoming()
l3 = Leg("l3").with_target(v2).with_xy(2, 1).with_type("gluon").with_outgoing()
l4 = Leg("l4").with_target(v2).with_xy(2, -1).with_type("gluon").with_outgoing()
p1.with_source(v1)
p1.with_target(v2)
fd.propagators.append(p1)
fd.vertices.extend([v1, v2])
fd.legs.extend([l1, l2, l3, l4])
[4]:
ar = AllRender(fd)
ar.render(subfigure=True)
../../_images/renderers_all_All_3_0.png
[5]:
ar.render(subfigure=False)
pyx:
../../_images/renderers_all_All_4_1.png
feynmp:
../../_images/renderers_all_All_4_3.png
tikz:
../../_images/renderers_all_All_4_5.png
dot:
../../_images/renderers_all_All_4_7.png
feynman:
../../_images/renderers_all_All_4_9.png
mpl:
../../_images/renderers_all_All_4_11.png
ascii:









*                                      *
 OO                                 OOO
   OO                              O
     OO                         OOO
       OO                      O
         *OOOOOOOOOOOOOOOOOOO*O
       OO                      O
     OO                         OOO
   OO                              O
 OO                                 OOO
*                                      *











../../_images/renderers_all_All_4_13.png
unicode:









*                                      *
 OO                                 OOO
   OO                              O
     OO                         OOO
       OO                      O
         *OOOOOOOOOOOOOOOOOOO*O
       OO                      O
     OO                         OOO
   OO                              O
 OO                                 OOO
*                                      *











../../_images/renderers_all_All_4_15.png
[ ]: