How do you do crossed lines using tikz-feynman?

Let's recall how one solves this in feynmp. There you can use phantoms to add invisible propagators, and \fmffreeze to freeze the diagram at some point. We can do the analogous things in tikz-feynman. phantom gets mapped to opacity=0, and in a way \fmffreeze is emulated by putting the additional stuff in an overlay picture such that it does not influence the layout algorithm. rubout, which I implemented in a suggested alternative to your diagrams, is also very much inspired by feynmp, which IMHO still produces the most aesthetically pleasing Feynman diagrams.

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{tikz-feynman}
\tikzset{rubout/.style={preaction={draw=white,line width=3pt}}}
\begin{document}

\subsection*{Your diagram}
\feynmandiagram[horizontal=i1 to a]{
f1[particle=\(\Bar{\psi}\)]--[anti fermion, momentum=\(p_2\)]b--[scalar, momentum=\(p_2'\)]f2[particle=\(\phi\)],
i1[particle=\(\psi\)]--[fermion, momentum=\(p_1\)]a--[scalar, momentum=\(p_1'\)]i2[particle=\(\phi\)],
b--[anti fermion, reversed momentum=\(p_1-p_1'\)]a,
i1--[opacity=0]f1,
i2--[opacity=0]f2,
};

\subsection*{Your diagram crossed}
\feynmandiagram[horizontal=i1 to a,remember picture]{
f1[particle=\(\Bar{\psi}\)]--[anti fermion, momentum=\(p_2\)]b--[opacity=0]f2[particle=\(\phi\)],
i1[particle=\(\psi\)]--[fermion, momentum=\(p_1\)]a--[opacity=0]i2[particle=\(\phi\)],
b--[anti fermion, reversed momentum'=\(p_1-p_2'\)]a,
i1--[opacity=0]f1,
i2--[opacity=0]f2,
};

\begin{tikzpicture}[overlay,remember picture]
\begin{feynman}
\path (b) -- (i2) coordinate[midway] (b1)
(a) -- (f2) coordinate[midway] (a1);
\diagram*{
(b) --[scalar] (b1) -- [scalar,momentum'={\(p_1'\)}] (i2),
(a) --[scalar] (a1) -- [scalar,momentum={\(p_2'\)}] (f2)
};
\end{feynman}
\end{tikzpicture}

\newpage

\subsection*{An alternative to your diagram}
\feynmandiagram[horizontal=i1 to i2]{
f1[particle=\(\Bar{\psi}\)]--[anti fermion, momentum=\(p_2\)]b--[scalar,
momentum'=\(p_2'\)]f2[particle=\(\phi\)],
i1[particle=\(\psi\)]--[fermion, momentum=\(p_1\)]a--[scalar, momentum=\(p_1'\)]i2[particle=\(\phi\)],
b--[anti fermion, reversed momentum'=\(p_1-p_1'\)]a,
};

\subsection*{An alternative to your diagram crossed}
\feynmandiagram[horizontal=i1 to i2,remember picture]{
f1[particle=\(\Bar{\psi}\)]--[anti fermion, momentum=\(p_2\)]b--[scalar,
opacity=0]f2[particle=\(\phi\)],
i1[particle=\(\psi\)]--[fermion, momentum=\(p_1\)]a--[scalar,opacity=0]i2[particle=\(\phi\)],
b--[anti fermion, reversed momentum'=\(p_1-p_2'\)]a,
};

\begin{tikzpicture}[overlay,remember picture]
\begin{feynman}
\path (b) -- (i2) coordinate[midway] (b1)
(a) -- (f2) coordinate[midway] (a1);
\diagram*{
(b) --[scalar] (b1) -- [scalar,momentum={\(p_1'\)}] (i2),
(a) --[scalar,rubout] (a1) -- [scalar,momentum'={\(p_2'\)}] (f2)
};
\end{feynman}
\end{tikzpicture}

\end{document}

enter image description here


If I understand correctly, processing with Lualatex.

\documentclass{article}
\usepackage{amsmath} 
\usepackage{tikz-feynman}

\begin{document}

\begin{center}
\feynmandiagram[horizontal=i1 to a]{
i1[particle=\(\psi\)]--[fermion, momentum=\(p_1\)]a--[scalar, momentum=\(p_1'\)]i2[particle=\(\phi\)],
f1[particle=\(\Bar{\psi}\)]--[anti fermion, momentum=\(p_2\)]b--[scalar, momentum=\(p_2'\)]f2[particle=\(\phi\)],
b--[anti fermion,reversed momentum=\(p_1-p_1'\)]a,
i1--[opacity=0]f1,
i2--[opacity=0]f2,
};
\hspace*{5mm}
\feynmandiagram[horizontal=i1 to a]{
f1[particle=\(\Bar{\psi}\)]--[anti fermion, momentum=\(p_2\)]b--[scalar]a1--[scalar, momentum'=\(p_2'\)]f2[particle=\(\phi\)],
i1[particle=\(\psi\)]--[fermion, momentum=\(p_1\)]a--[scalar]a1--[scalar, momentum=\(p_1'\)]i2[particle=\(\phi\)],
b--[anti fermion]a,
i1--[opacity=0]f1,
i2--[opacity=0]f2,
};

\end{center}
\vspace*{1cm}
\begin{center}
\feynmandiagram [layered layout, horizontal=a to b] {
% 
i1 [particle=\(\psi\)]
-- [fermion, momentum=\(p_1\)] a
-- [scalar] b
-- [scalar, momentum=\(p_1'\)] f1 [particle=\(\phi\)],
i2 [particle=\(\psi\)]
-- [anti fermion, momentum=\(p_2\)] c
-- [scalar] d
-- [scalar, momentum=\(p_2'\)] f2 [particle=\(\phi\)],
% 
{ [same layer] a -- [fermion] c },
{ [same layer] b -- [opacity=0] d},
};
\end{center}

\end{document}

Output:

enter image description here

And with option xscale=1.5

\documentclass{article}
\usepackage{amsmath} 
\usepackage{tikz-feynman}

\begin{document}

\begin{center}
\feynmandiagram [layered layout, horizontal=a to b,xscale=1.5] {
% 
i1 [particle=\(\psi\)]
-- [fermion, momentum=\(p_1\)] a
-- [scalar] b
-- [scalar, momentum=\(p_1'\)] f1 [particle=\(\phi\)],
i2 [particle=\(\psi\)]
-- [anti fermion, momentum=\(p_2\)] c
-- [scalar] d
-- [scalar, momentum=\(p_2'\)] f2 [particle=\(\phi\)],
% 
{ [same layer] a -- [fermion] c },
{ [same layer] b -- [opacity=0] d},
};
\end{center}


\end{document}

output: enter image description here

Tags:

Tikz Feynman