我想绘制这样的 Hartree 图:
(实际上只有右侧,但这并不重要)
我的尝试最终结果是这样的:
\documentclass[tikz]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\feynmandiagram [horizontal=a to b] {
a -- [photon] b -- [out=45, in=-45, loop, min distance=2cm, fermion] b,
};
\feynmandiagram [horizontal=a to b] {
a --[photon] b -- [fermion, half left] c
-- [half left] b,
};
\end{document}
两个结果都很难看,因为这不是一个很好的圆圈,而且比例也不好(波浪线太长)。有人能帮帮我吗?
答案1
不使用自动放置算法通常更容易。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\coordinate (a);
\coordinate[left=1.5cm of a] (c);
\coordinate[right=3cm of a] (b);
\coordinate[right=1.5cm of b] (d);
\diagram* {
(a) -- [half left] (c) -- [fermion, half left] (a)
--[photon] (b) -- [half right] (d) -- [fermion, half right] (b)};
\end{feynman}
\end{tikzpicture}
\end{document}
并且只是为了好玩而用弯曲的箭。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\usetikzlibrary{arrows.meta,decorations.markings}
\usetikzlibrary{bending}
\tikzset{
arc arrow/.style args={%
to pos #1 with length #2}{
decoration={
markings,
mark=at position 0 with {\pgfextra{%
\pgfmathsetmacro{\tmpArrowTime}{#2/(\pgfdecoratedpathlength)}
\xdef\tmpArrowTime{\tmpArrowTime}}},
mark=at position {#1-\tmpArrowTime} with {\coordinate(@1);},
mark=at position {#1-2*\tmpArrowTime/3} with {\coordinate(@2);},
mark=at position {#1-\tmpArrowTime/3} with {\coordinate(@3);},
mark=at position {#1} with {\coordinate(@4);
\draw[-{Latex[length=#2,bend]}]
(@1) .. controls (@2) and (@3) .. (@4);},
},
postaction=decorate,
}
}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\coordinate (a);
\coordinate[right=3cm of a] (b);
\diagram* {
(a) --[photon] (b)};
\end{feynman}
\draw[arc arrow={to pos 0.3 with length 4mm}] (a) arc(0:360:1);
\draw[arc arrow={to pos 0.3 with length 4mm}] (b) arc(180:-180:1);
\end{tikzpicture}
\end{document}