# How do you do crossed lines using tikz-feynman?

I am trying to draw the Feynman diagram where the momenta are crossed over on the final state particles from the diagram encoded here.

\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,
};


I tried adding another vertex as follows, but it leaves a kink in the lines. Is there another way of doing this?

\feynmandiagram[horizontal=i1 to a]{
i1[particle=$$\psi$$]--[fermion, momentum=$$p_1$$]a--[scalar]a1--[scalar, momentum=$$p_1'$$]i2[particle=$$\phi$$],
f1[particle=$$\Bar{\psi}$$]--[anti fermion, momentum=$$p_2$$]b--[scalar]a1--[scalar, momentum'=$$p_2'$$]f2[particle=$$\phi$$],
b--[anti fermion]a,
i1--[opacity=0]f1,
i2--[opacity=0]f2,
};


Edit:

I am trying to make the second diagram have straight, scalar lines which cross

• I personally draw, if I use this package, the diagrams without the layout algorithms, i.e. place the vertices by hand. According to my experience most diagrams are actually not easy to obtain with these layout mechanisms, which, after all, were not designed to draw Feynman graphs. Plus you cannot upload them to the arXiv, which currently does not support lualatex. So I recommend placing the vertices by hand.
– user194703
Nov 6, 2019 at 21:46

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}

\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,
};

\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

\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}


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:

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: