2

I'm plotting automatically generated and laid-out (by tikz-feynman's default spring layout) QED feynman diagrams.

I'm looking to improve the look of the "tadpoles" i.e the vertices where both fermion arcs are attached to the same vertex.

This image shows the options I'm aware of/have considered (the last one a "work in progress"): Tadpoles

Self-contained code to produce those is below (works with Debian 11's texlive's lualatex).

The first row shows use of loop. Which I'm not sure is actually part of tikz-feynman as its not mentioned in the documentation and I've just seen it used in other people's examples. That can look good when oriented opposite the photon arc, but so far as I know it needs the angles to be set manually... is there any way of automatically getting the loop to be opposite the incoming photon, bearing in mind I'm not controlling the positioning of anything explicitly and leaving it up to tikz-feynman's layout?

The second row shows simply setting the tadpole vertex to an empty circle. That'd actually be pretty good if I could make the circle a bit bigger and put an arrowhead on it somewhere.

The third row is the start of an attempt to do just that, by defining a tadpole style for a vertex.

Here's the code to produce the above plot. What I'm ideally looking for is what I should be filling out the \tikzfeynmanset{tadpole/.style={... with to get a white-filled black circle with no text label, a specified size and an arrowhead somewhere on it. However at this point I'm completely out of my depth with tikz and how this stuff interacts with tikz-feynman. Thanks for any help or pointers.

Code for above plot:

\documentclass[a4paper]{minimal}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,decorations,backgrounds,calc,er,patterns}

\usepackage[compat=1.1.0]{tikz-feynman}

% First groping towards a custom "tadpole" style.
\tikzfeynmanset{
  tadpole/.style={
    /tikz/shape=circle,
    /tikz/minimum size=5mm,
    /tikz/draw=black,
    /tikz/fill=white,
    /tikz/decoration={name=none}
  }
}

% Tweak table appearance
\setlength{\tabcolsep}{1cm}
\renewcommand{\arraystretch}{2.0}

\begin{document}

\begin{center}
  \begin{tabular}{ccc}

    \parbox{3cm}{Using \texttt{loop}:\\Looks reasonable, but needs manual orientation.}

    &

    \parbox{3cm}{
      \resizebox{!}{3cm}{
        \begin{tikzpicture}
          \begin{feynman}
            \diagram[small,vertical=out to in]{
              in [desired at={(0,-1)}],
              in -- [fermion] a [dot],
              a [dot] -- [photon] b [dot],
              b [dot] -- [out=315,in=45,loop] b [dot],
              a [dot] -- [fermion] out,
              out [desired at={(0,1)}]
            };
          \end{feynman}
        \end{tikzpicture}
      }
    }
    
    &

    \parbox{3cm}{
      \resizebox{!}{3cm}{
        \begin{tikzpicture}
          \begin{feynman}
            \diagram[small,vertical'=out to in]{
              in [desired at={(0,-1)}],
              in -- [fermion] a [dot],
              a [dot] -- [photon] b [dot],
              b [dot] -- [out=315,in=45,loop] b [dot],
              a [dot] -- [fermion] out,
              out [desired at={(0,1)}]
            };
          \end{feynman}
        \end{tikzpicture}
      }
    }
    
    \\ & & \\

    \parbox{3cm}{Using \texttt{empty dot}:\\Would be better if bigger, and with an arrow.}
    
    &

    \parbox{3cm}{
      \resizebox{!}{3cm}{
        \begin{tikzpicture}
          \begin{feynman}
            \diagram[small,vertical=out to in]{
              in [desired at={(0,-1)}],
              in -- [fermion] a [dot],
              a [dot] -- [photon] b [empty dot],
              a [dot] -- [fermion] out,
              out [desired at={(0,1)}]
            };
          \end{feynman}
        \end{tikzpicture}
      }
    }
    
    &

    \parbox{3cm}{
      \resizebox{!}{3cm}{
        \begin{tikzpicture}
          \begin{feynman}
            \diagram[small,vertical'=out to in]{
              in [desired at={(0,-1)}],
              in -- [fermion] a [dot],
              a [dot] -- [photon] b [empty dot],
              a [dot] -- [fermion] out,
              out [desired at={(0,1)}]
            };
          \end{feynman}
        \end{tikzpicture}
      }
    }

    \\ & & \\

    \parbox{3cm}{Attempting to use a custom \texttt{tadpole} style:\\I've idea how to control the size and suppress label.}
    
    &

    \parbox{3cm}{
      \resizebox{!}{3cm}{
        \begin{tikzpicture}
          \begin{feynman}
            \diagram[small,vertical=out to in]{
              in [desired at={(0,-1)}],
              in -- [fermion] a [dot],
              a [dot] -- [photon] b [tadpole],
              a [dot] -- [fermion] out,
              out [desired at={(0,1)}]
            };
          \end{feynman}
        \end{tikzpicture}
      }
    }
    
    &

    \parbox{3cm}{
      \resizebox{!}{3cm}{
        \begin{tikzpicture}
          \begin{feynman}
            \diagram[small,vertical'=out to in]{
              in [desired at={(0,-1)}],
              in -- [fermion] a [dot],
              a [dot] -- [photon] b [tadpole],
              a [dot] -- [fermion] out,
              out [desired at={(0,1)}]
            };
          \end{feynman}
        \end{tikzpicture}
      }
    }

  \end{tabular}
\end{center}

\end{document}

1 Answer 1

1
\documentclass[tikz, border=1cm]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\usetikzlibrary{arrows.meta}

\newcommand{\tadradius}{3mm}
\newcommand{\tadangle}{90}
\tikzset{
tadpole/.style={
circle,
minimum size=2*\tadradius,
inner sep=0,
append after command={
\pgfextra
\draw[-{Stealth[length=4pt, sep=0pt -1]}] (\tikzlastnode) +(\tadangle:\tadradius) arc[start angle=\tadangle, end angle=\tadangle-360, radius=\tadradius];
\endpgfextra
}}}

\begin{document}

\begin{tikzpicture}
\begin{feynman}
\diagram[small,vertical=out to in]{
in [desired at={(0,-1)}],
in -- [fermion] a [dot],
a [dot] -- [photon] b [tadpole],
a [dot] -- [fermion] out,
out [desired at={(0,1)}]
};
\end{feynman}
\end{tikzpicture}

\begin{tikzpicture}
\begin{feynman}
\diagram[small,vertical'=out to in]{
in [desired at={(0,-1)}],
in -- [fermion] a [dot],
a [dot] -- [photon] b [tadpole],
a [dot] -- [fermion] out,
out [desired at={(0,1)}]
};
\end{feynman}
\end{tikzpicture}

\end{document}

Two feynman diagrams with circles with arrow

Edit:

If the loop is a fermion, you should change the arrow tip to Triangle to mimic tikz-feynman arrows. But why not use the packages own notation like this:

\documentclass[tikz, border=1cm]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}

\begin{tikzpicture}
\begin{feynman}
\diagram[small, vertical=out to in]{
in [desired at={(0,-1)}],
in -- [fermion] a [dot],
a [dot] -- [photon] b  -- [half left] bm -- [fermion, half left] b,
a [dot] -- [fermion] out,
out [desired at={(0,1)}]
};
\end{feynman}
\end{tikzpicture}
  
\end{document}

Feynman diagram with fermion loop

Edit: For completeness, here is the tadpole style without label:

\documentclass[tikz, border=1cm]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\usetikzlibrary{arrows.meta, bending}

\newcommand{\tadradius}{3mm}
\newcommand{\tadangle}{90}
\tikzset{
tadpole/.style={
particle={},
circle,
minimum size=2*\tadradius,
inner sep=0,
append after command={
\pgfextra
\draw[-{Triangle[width=3pt, length=4pt, sep=0pt -1]}] (\tikzlastnode) +(\tadangle+10:\tadradius) arc[start angle=\tadangle+10, end angle=\tadangle-360, radius=\tadradius];
\endpgfextra
}}}

\begin{document}

\begin{tikzpicture}
\begin{feynman}
\diagram[small,vertical=out to in]{
in [desired at={(0,-1)}],
in -- [fermion] a [dot],
a [dot] -- [photon] b [tadpole],
a [dot] -- [fermion] out,
out [desired at={(0,1)}]
};
\end{feynman}
\end{tikzpicture}

\end{document}

Feynman diagram with fermion loop

6
  • I do not know if the "b" should be there or not. If not, you can add particle={} to the tadpole style. Sep 17 at 8:28
  • Thanks; just tried that second idea first... it simply hadn't occurred to me to just introduce an "extra" vertex to build the loop onto! It works quite well and the loops feel well integrated... they just seem a bit too big for what they are though - examples at i.imgur.com/IsixiLr.png and i.imgur.com/5UoY7QR.png . Unless there's some way of shrinking them relative to the other structure (that keeps them reasonably circular) my instinct is the other approach will work better; I'm more just looking for something which "caps" otherwise dangling photons. Will try that next...
    – timday
    Sep 17 at 12:39
  • Try \diagram[small, vertical=out to in]{ in [desired at={(0,-1)}], in -- [fermion] a [dot], a [dot] -- [photon] b -- [half left] bm[xshift=5mm] -- [fermion, half left] b, a [dot] -- [fermion] out, out [desired at={(0,1)}] }; Sep 17 at 13:15
  • Interesting, but the effect of that depends on the orientation of the loop and I have loops with all sorts of orientations (see the linked .png in previous comment) laid out automatically. It seems to me that's what's really needed is a way of specifying that the natural distance b -- bm should be say half or a third of what it normally is for other links... but it's not clear to me if that can somehow be passed through to the underlying tikz graph or spring layout algorithm.
    – timday
    Sep 17 at 16:01
  • 1
    Ask a new question about that - I will be happy to look into it. Also remember to accept this answer. Sep 17 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.