[Tex/LaTex] Tikz, decorations

decorationsdiagramsfeynmantikz-pgf

I use tikz as a general purpose drawing package because of its flexibility etc… I need to draw some Feynman diagrams like these:

Feynman diagrams with vector loops

I tried to draw arc like

\begin{tikzpicture}
 \draw [decorate, decoration={snake}] (0,0) arc (180:0:2);
\end{tikzpicture}

but the result is ugly looking:

Ugly looking result with Tikz

Googleing I found some interesting link:

Other question

but

1) I tried to compile and the result was different:

Link result

2) As you can see in the first image I posted, I need arbitrary angle arc and, in the solution presented in the link, it seems possible to draw only semicircles

3) The code is not elegant at all: in particular, using this solution drawing a solid e arc or a snakeish arc requires complete different source code.

I was thinking if it is possible simply to stop the arc when it reaches the specified (final) angle, without any regard to the decoration.

Best Answer

All the three Feynman diagrams shown in the question can be realized with a few lines of code using the new TikZ-Feynman package (see also the project page).

Here is the code to produce all of them. You must compile with lualatex in order to take advantage of the automatic positioning of the vertices.

\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\tikzfeynmanset{compat=1.0.0}
\begin{document}
% first diagram
\feynmandiagram [layered layout, horizontal=a to d] {
  a [particle=\(\mu\)] -- [photon] b [dot],
  b -- [anti fermion, half left, edge label=\(k\)] c [dot] --
  [half left, fermion, edge label=\(k + q\)] b,
  c -- [photon] d [particle=\(\nu\)],
};

% second diagram
\feynmandiagram [layered layout, horizontal=a to d] {
  a -- b [dot] -- [fermion,edge label'=\(p + k\)] c [dot] -- d [particle=\(p\)],
  b -- [photon, half left, edge label=\(k\)] c,
};

% third diagram
\begin{tikzpicture}
  \begin{feynman}
    \vertex (a) {\(\mu\)};
    \vertex [right=of a] (b);
    \vertex [above right=of b] (u1);
    \vertex [above right=of u1] (u2) {\(p'\)};
    \vertex [below right=of b] (d1);
    \vertex [below right=of d1] (d2) {\(p\)};

    \diagram*{
      (a) -- [photon, edge label'=\(q\)] (b),
      (b) -- [fermion, edge label=\(k+q\)] (u1) -- [fermion] (u2),
      (b) -- [anti fermion, edge label'=\(k\)] (d1) -- [anti fermion] (d2),
      (d1) -- [photon, half right, edge label'=\(p - k\)] (u1),
    };
  \end{feynman}
\end{tikzpicture}
\end{document}

enter image description here

enter image description here

enter image description here