External vertices
It is easy to define the external vertices in feynmp by using one or more these five commands:
\fmfleft,\fmfright,\fmftop,\fmfbottom,\fmfsurround.
For example:
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(100,80) % dimensions (WH)
\fmfcurved % redundant
% define external vertices
\fmfleft{l1,l2,l3,l4}
\fmfright{r1,r2,r3,r4}
% draw circles at points with labels
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l1,l.a=45}{l1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l2,l.a=0}{l2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l3,l.a=0}{l3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l4,l.a=-45}{l4}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r1,l.a=135}{r1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r2,l.a=180}{r2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r3,l.a=180}{r3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r4,l.a=-135}{r4}
\end{fmfgraph*}
\end{fmffile}
\end{document}
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(100,80) % dimensions (WH)
\fmfcurved % redundant
% define external vertices
\fmftop{t1,t2,t3,t4}
\fmfbottom{b1,b2,b3,b4}
% draw circles at points with labels
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t1,l.a=-45}{t1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t2,l.a=-90}{t2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t3,l.a=-90}{t3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t4,l.a=-135}{t4}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b1,l.a=45}{b1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b2,l.a=90}{b2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b3,l.a=90}{b3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b4,l.a=135}{b4}
\end{fmfgraph*}
\end{fmffile}
\end{document}
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(100,80) % dimensions (WH)
\fmfcurved % redundante
% define external vertices
\fmfsurround{v1,v2,v3,v4,v5,v6,v7}
% draw circles at points with labels
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v1,l.a=180}{v1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v2,l.a=-130}{v2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v3,l.a=-50}{v3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v4,l.a=-20}{v4}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v5,l.a=20}{v5}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v6,l.a=80}{v6}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v7,l.a=120}{v7}
\end{fmfgraph*}
\end{fmffile}
\end{document}
The external vertices are by default positioned on a curve. One can set this behavior explicitly with \fmfcurved, In code example above it is redundant, but it can be used if one wants to turn off the behavior of \fmfstraight (see next) in the same diagram.
One can set the external vertices on a straight line along the edges for the rectangular frame with \fmfstraight instead. Below is an illustration of \fmfstraight.
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(100,80) % dimensions (WH)
\fmfstraight
% define external vertices
\fmfleft{l1,l2,l3,l4}
\fmfright{r1,r2,r3,r4}
% draw circles at points with labels
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l1,l.a=45}{l1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l2,l.a=0}{l2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l3,l.a=0}{l3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=l4,l.a=-45}{l4}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r1,l.a=135}{r1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r2,l.a=180}{r2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r3,l.a=180}{r3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=r4,l.a=-135}{r4}
\end{fmfgraph*}
\end{fmffile}
\end{document}
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(100,80) % dimensions (WH)
\fmfstraight
% define external vertices
\fmftop{t1,t2,t3,t4}
\fmfbottom{b1,b2,b3,b4}
% draw circles at points with labels
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t1,l.a=-45}{t1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t2,l.a=-90}{t2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t3,l.a=-90}{t3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=t4,l.a=-135}{t4}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b1,l.a=45}{b1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b2,l.a=90}{b2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b3,l.a=90}{b3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=b4,l.a=135}{b4}
\end{fmfgraph*}
\end{fmffile}
\end{document}
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(100,80) % dimensions (WH)
\fmfstraight
% define external vertices
\fmfsurround{v1,v2,v3,v4,v5,v6,v7}
% draw circles at points with labels
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v1,l.a=180}{v1}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v2,l.a=-130}{v2}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v3,l.a=-50}{v3}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v4,l.a=-20}{v4}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v5,l.a=20}{v5}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v6,l.a=80}{v6}
\fmfv{d.sh=circle,d.f=full,d.si=4,l.d=5,label=v7,l.a=120}{v7}
\end{fmfgraph*}
\end{fmffile}
\end{document}
Internal vertices
External vertices are fixed with \fmfleft etc. Internal vertices, on the other hand, are automatically placed when lines are drawn between with \fmf. Below we will see some examples of how to use tension or \fmfforce to gain more control over placements. The tutorial on intermediate mode and MetaPost will show even more powerful examples.
Below is one of the most basic examples of how one can draw a simple t-channel Feynman diagram of Bhabha scattering (electron-positron scattering) with the feynmp package:
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,60) % dimensions (WH)
% external vertices
\fmfleft{i2,i1}
\fmfright{o2,o1}
% main
\fmf{fermion}{i1,v1,o1}
\fmf{fermion}{o2,v2,i2}
\fmf{photon}{v1,v2} % t-channel
\end{fmfgraph*}
\end{fmffile}
\end{document}
Note that the figure on the left column has some extra labels highlighted in red for illustrative purposes. Press the big “RUN LATEX HERE” button to get the actual result of the code example.
Tension
Even though internal vertices are automatically placed, tension can be used to effectively move internal vertices, or equivalently, make lines short or longer.
Below is a simple example of how one can use tension to make lines between vertices shorter (tension>1) or longer (tension<1). The default tension is 1.
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,60) % dimensions (WH)
% external vertices
\fmfleft{i2,i1}
\fmfright{o2,o1}
% main
\fmf{fermion,tension=2}{i1,v1} % make shorter
\fmf{fermion}{v1,o1}
\fmf{fermion}{v2,i2}
\fmf{fermion,tension=2}{o2,v2} % make shorter
\fmf{photon,tension=0.5}{v1,v2} % make longer
\end{fmfgraph*}
\end{fmffile}
\end{document}
One can shorten the tension keyword to just t for those in a hurry:
\fmf{photon,t=0.5}{v1,v2}
Using tension to pull internal vertices
How can you have more control over the line length and positions of the internal vertices?
Imagine you want to make a 1 → 2 → 4 decay like H → WW → 4f. Some may prefer the last four lines to have the same length as shown below:
There are several ways of achieving this. Below is a step-by-step tutorial to explain how you can take advantage of tension to pull internal decay vertices with the invisible phantom lines.
Step 1. Draw the diagram as you naively would. Make sure you know the location of the vertices, or visualize them with \fmfv (see above):
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,120) % dimensions (WH)
% external vertices
\fmfleft{i1}
\fmfright{o4,o3,o2,o1}
% main
\fmf{fermion}{o1,v1,o2}
\fmf{fermion}{o3,v2,o4}
\fmf{dashes,tension=1.5}{i1,v}
% decay
\fmf{boson}{v,v1}
\fmf{boson}{v,v2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
Step 2. This was pretty straightforward, but perhaps you prefer the fermion lines to be equal in length. This can be achieved by drawing help lines that pull back the vertices of the W boson decays. They act as a skeleton. Normally you would use the invisible phantom lines, but let’s start with the visible dashes to understand what we are doing. We remove the H → WW lines for now, because they also pull to the left the vertices and ruin the balance:
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,120) % dimensions (WH)
% external vertices
\fmfleft{i2,i1,i0}
\fmfright{o4,o3,o2,o1}
% skeleton
\fmf{dashes}{i0,v1}
\fmf{dashes,tension=0.4}{v1,v2}
\fmf{dashes}{i2,v2}
% main
\fmf{fermion}{o1,v1,o2}
\fmf{fermion}{o3,v2,o4}
\end{fmfgraph*}
\end{fmffile}
\end{document}
Step 3. Notice that the endpoints of the outgoing fermion lines are not horizontally aligned. This is solved by including the command \fmfstraight:
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,120) % dimensions (WH)
% external vertices
\fmfstraight
\fmfleft{i2,i1,i0}
\fmfright{o4,o3,o2,o1}
% skeleton
\fmf{dashes}{i0,v1}
\fmf{dashes,tension=0.4}{v1,v2}
\fmf{dashes}{i2,v2}
% main
\fmf{fermion}{o1,v1,o2}
\fmf{fermion}{o3,v2,o4}
\end{fmfgraph*}
\end{fmffile}
\end{document}
Step 4. Use \fmffreeze to freeze this part of the diagram. This will fix the vertices in place and prevent the next lines we add from ruining this balance. Then put back the rest (H → WW) after \fmffreeze.
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,120) % dimensions (WH)
% external vertices
\fmfstraight
\fmfleft{i2,i1,i0}
\fmfright{o4,o3,o2,o1}
% skeleton
\fmf{dashes}{i0,v1}
\fmf{dashes,tension=0.4}{v1,v2}
\fmf{dashes}{i2,v2}
% main
\fmf{fermion}{o1,v1,o2}
\fmf{fermion}{o3,v2,o4}
\fmffreeze
\fmf{dashes,tension=1.5}{i1,v}
% decay
\fmf{boson}{v,v1}
\fmf{boson}{v,v2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
Step 5. Now simply replace dashed with phantom to make the help lines invisible.
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,120) % dimensions (WH)
% external vertices
\fmfstraight
\fmfleft{i2,i1,i0}
\fmfright{o4,o3,o2,o1}
% skeleton
\fmf{phantom}{i0,v1}
\fmf{phantom,tension=0.4}{v1,v2}
\fmf{phantom}{i2,v2}
% main
\fmf{fermion}{o1,v1,o2}
\fmf{fermion}{o3,v2,o4}
\fmffreeze
\fmf{dashes,tension=1.5}{i1,v}
% decay
\fmf{boson}{v,v1}
\fmf{boson}{v,v2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
Using \fmfforce for exact (x,y) placement
Puzzling with vertices, phantom lines, and tension can be a lot of fun, but also time consuming. For the impatient with little time, you could also force the vertex at an exact location using \fmfforce. Note however that the feynMF manual states it should be used as a last resort only.
In our previous H → WW → 4f example, one can place the vertex v1 at a certain (x,y) position as follows:
\fmfforce{(0.75w,0.80h)}{v}
This places v1 at the x position that is 40% of the width from the left, and at the y position that is 70% of the height from the bottom. Note that the coordinates in the first argument are actually an expression in MetaPost, which is explained in the tutorial on intermediate mode.
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,120) % dimensions (WH)
% external vertices
\fmfstraight
\fmfleft{i1}
\fmfright{o4,o3,o2,o1}
\fmfforce{(.75w,.83h)}{v1}
\fmfforce{(.75w,.17h)}{v2}
% main
\fmf{fermion}{o1,v1,o2}
\fmf{fermion}{o3,v2,o4}
\fmf{dashes,tension=1.5}{i1,v}
% decay
\fmf{boson}{v,v1}
\fmf{boson}{v,v2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
The tutorial on intermediate mode will also show more elaborate operations in MetaPost one can do like vectorially adding points or interpolating or extrapolating between them. Below is a solution that computes the point between o1 and o2, and adds a horizontal offset of 25% the width to the left:
\fmfforce{ 0.5*(vloc(__o1)+vloc(__o2)) + (-0.25w,0) }{v}
Full working example:
\documentclass[11pt,border=4pt]{standalone}
\usepackage{feynmp-auto}
\begin{document}
\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(120,120) % dimensions (WH)
% external vertices
\fmfstraight
\fmfleft{i1}
\fmfright{o4,o3,o2,o1}
\fmfforce{0.5*(vloc(__o1)+vloc(__o2))+(-0.25w,0)}{v1}
\fmfforce{0.5*(vloc(__o3)+vloc(__o4))+(-0.25w,0)}{v2}
% main
\fmf{fermion}{o1,v1,o2}
\fmf{fermion}{o3,v2,o4}
\fmf{dashes,tension=1.5}{i1,v}
% decay
\fmf{boson}{v,v1}
\fmf{boson}{v,v2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
Full code
The example figures above were generated with the following code: vertices-external.tex, tension-simple.tex, tension-HWW.tex, fmfforce-HWW.tex.















