JP-Ellis / tikz-feynman

Feynman Diagrams with TikZ
http://www.jpellis.me/projects/tikz-feynman
Other
148 stars 20 forks source link

tadpoles #23

Open mreininghaus opened 8 years ago

mreininghaus commented 8 years ago

I intend to draw a tadpole diagram, i.e. a propagator from one vertex to itself. I'd find it straight forward to do this with \feynmandiagram{ i1 -- [gluon] v1, v1 -- [gluon] v1;}; but the loop is not drawn. Of course a workaround is to add a second vertex \feynmandiagram{ i1 -- [gluon] v1, v1 -- [gluon, half left] v2, v2 -- [gluon, half left] v1; }; but that looks rather unpleasant in the case of gluons. If there is another way, I'd be happy to hear about it.

JP-Ellis commented 8 years ago

Hi,

You can draw tadpoles by using the loop option from Ti_k_Z, or alternatively by using the arc path construction from Ti_k_Z. The loop version will result in a tear-drop shape, whilst the arc option can draw a perfect circle, so it is up to you which one you prefer.

\documentclass[tikz]{standalone}

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

\begin{document}
\feynmandiagram [horizontal=a to b] {
  a -- [fermion] b -- [out=45, in=-45, loop, min distance=2cm] b,
};

\begin{tikzpicture}
  \begin{feynman}
    \diagram [horizontal=a to b] {
      a -- [fermion] b,
    };
    \draw (b) arc [start angle=180, end angle=-180, radius=0.7cm];
  \end{feynman}
\end{tikzpicture}
\end{document}

23-0 23-1

and if you add the gluon style to both: 23-0 23-1

mreininghaus commented 8 years ago

Hi, that's much better, thank you. You should list these examples in the documentation. Is it possible to set the angles relative to the incoming line? This would be great when the tadpole is only a part of a more extensive diagram with an initially unknown orientation.

JP-Ellis commented 8 years ago

Sorry for the late reply. I suspect it won't be possible to create a tadpole in an initially unknown orientation, but I'll have a look and come back to you if it is possible.

Turgon-Aran-Gondolin commented 4 years ago

The first method seems not working in \diagram*. MWE:

\documentclass[tikz]{standalone}

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

\begin{document}
    \begin{tikzpicture}[transform shape,scale=1,baseline=($(a)!0.5!(exa)$.base)]
        \begin{feynman}
            \node[dot] (a);
            \node[right=2in of a,dot] (b);
            \vertex[below=2in of a] (exa);
            \vertex at ($(a)!0.5!(b)$) (o12);
            \vertex at ($(exa)!0.5!(a)$) (a12);
            \vertex at ($(o12)!0.5!(a12)$) (g12);
            \diagram*{
                (a12) --[gluon] (g12);
                (g12) --[gluon] (o12);
                (g12) --[gluon, out=45,in=-45,loop, min distance=2cm] (g12);
            };
        \end{feynman}
    \end{tikzpicture}
\end{document}
Scriptering commented 2 weeks ago

On the low chance that @Turgon-Aran-Gondolin is still having this problem or for others with this issue, this appears to be fixed by removing the brackets around the vertices. i.e.

(g12) --[gluon, out=45,in=-45,loop, min distance=2cm] (g12);

becoming

g12 --[gluon, out=45,in=-45,loop, min distance=2cm] g12;

Turgon-Aran-Gondolin commented 2 weeks ago

On the low chance that @Turgon-Aran-Gondolin is still having this problem or for others with this issue, this appears to be fixed by removing the brackets around the vertices. i.e.

(g12) --[gluon, out=45,in=-45,loop, min distance=2cm] (g12);

becoming

g12 --[gluon, out=45,in=-45,loop, min distance=2cm] g12;

Thanks for the reply so many years later :)

Although I completely forgot what my original question was about, upon some quick testing, your solution indeed works. Why does removing the bracket make the magic happen?