Based on Sebastiano's answer and on this answer, I could get a better, yet not complete, result.
I had to:
- compile with lulatex
- remove the
feynman environment from within tikzpicture
- I defined a
photon1/.style={decorate, decoration={snake}, draw=black} style in \tikzset (I tried to modify wave amplitude=0.3mm and wave count=10 but I could not get these equal to the photon style).
I still need to:
- make the two photons look the same
- rotate the bubble and align it on top of the photon edge (I now added another point
e, probably one can fix it just with the right option on d)
- add two arrows to the bubble
Below there is the updated version of the code.
Thank you
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}
\usepackage{tikz-feynman}
\tikzfeynmanset{compat=1.1.0}
% adapted from https://tex.stackexchange.com/a/160358/21344; changed photon style
\tikzset{
fermion/.style={draw=black, postaction={decorate},decoration={markings,mark=at position .55 with {\arrow{Latex}}}},
vertex/.style={draw,shape=circle,fill=black,minimum size=2pt,inner sep=0pt},
photon/.style={wavy semicircle,wave amplitude=0.3mm,wave count=10},
photon1/.style={decorate, decoration={snake}, draw=black}
}
% adapted from https://tex.stackexchange.com/a/89003/21344; swapped atan args
\newif\ifmirrorsemicircle
\tikzset{
wave amplitude/.initial=0.2cm,
wave count/.initial=8,
mirror semicircle/.is if=mirrorsemicircle,
mirror semicircle=false,
wavy semicircle/.style={
to path={
let \p1 = (\tikztostart),
\p2 = (\tikztotarget),
\n1 = {veclen(\y2-\y1,\x2-\x1)},
\n2 = {atan2(\x2-\x1,\y2-\y1))} in
plot [
smooth,
samples=(\pgfkeysvalueof{/tikz/wave count}+0.5)8+1, % Calculate the number of samples needed, so the samples are in sync with the wave and fall on the extrema
domain=0:1,
shift={($(\p1)!0.5!(\p2)$)}
] ({ % Polar coordinates: Angle...
(\x180-\n2 + 180 + \ifmirrorsemicircle 1 \else -1 \fi * 90%
}:{ % ... and radius
(%
\n1/2+\pgfkeysvalueof{/tikz/wave amplitude} * %
sin(
\x * 360 * (\pgfkeysvalueof{/tikz/wave count} + 0.5%
)%
)%
})
} (\tikztotarget)
}
}
\begin{document}
\begin{tikzpicture}
\coordinate (i);
\coordinate[vertex, right=of i] (v1);
\coordinate[vertex, right=of v1] (v2);
\coordinate[right=of v2] (o);
\draw (i) -- (v1);
\draw[fermion] (v1) -- (v2);
\draw[photon] (v1) to (v2);
\draw (v2) -- (o);
\end{tikzpicture}
\begin{tikzpicture}
\coordinate (a);
\coordinate[vertex, right=of a] (b);
\coordinate[vertex, right=of b] (c);
\coordinate[vertex, above=of b] (d);
\coordinate[vertex, above=of d] (e);
\draw [fermion] (a) -- (b);
\draw [fermion] (b) -- (c);
\draw [photon1] (b) to (d);
\draw [arc arrow={to pos 0.0 with length 1mm}] (e) arc(0:360:0.4);
\end{tikzpicture}
\end{document}
arc arrowisn't a standard style, and I'd also thinktopshould beabove. – Torbjørn T. Jul 15 '20 at 18:19