我想在费曼图中添加彩色流线,如下例所示:
代码如下:
\documentclass[class=minimal,border=20pt]{standalone}
\usepackage{feynmf}
\begin{document}
\begin{fmffile}{diagram}
\begin{fmfgraph*}(150, 150)
\fmfleft{i}
\fmfright{o1,o2}
\fmf{fermion}{i,v,o1}
\fmf{gluon}{v,o2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
答案1
这是一个产生与您想要的结果非常相似的代码:
\documentclass[class=minimal,border=20pt]{standalone}
\usepackage{feynmp}
\newcommand{\LFermionFlow}[7][X]
% Usage: see \LFermionFlow[Deformation]{Node1}{Node2}{Length}{Shift x}{Shift y}{color}
{
\fmffreeze
\fmf{phantom}{#2,#2FFNode#3}
\fmf{phantom,tension=#4}{#2FFNode#3,#3FFNode#2}
\fmf{phantom}{#3FFNode#2,#3}
\fmffreeze
\fmfshift{#5,#6}{#2FFNode#3,#3FFNode#2}
\fmffreeze
\if X#1 {
\fmf{fermion,width=0.5,fore=#7,left=0.3}{#2FFNode#3,#3FFNode#2}
}
\else
{
\fmf{fermion,width=0.5,fore=#7,left=#1}{#2FFNode#3,#3FFNode#2}
}
\fi
}
\newcommand{\RFermionFlow}[7][X]
% Usage: see \RFermionFlow[Deformation]{Node1}{Node2}{Length}{Shift x}{Shift y}{color}
{
\fmffreeze
\fmf{phantom}{#2,#2FFNode#3}
\fmf{phantom,tension=#4}{#2FFNode#3,#3FFNode#2}
\fmf{phantom}{#3FFNode#2,#3}
\fmffreeze
\fmfshift{#5,#6}{#2FFNode#3,#3FFNode#2}
\fmffreeze
\if X#1 {
\fmf{fermion,width=0.5,fore=#7,right=0.3}{#2FFNode#3,#3FFNode#2}
}
\else
{
\fmf{fermion,width=0.5,fore=#7,right=#1}{#2FFNode#3,#3FFNode#2}
}
\fi
}
\begin{document}
\begin{fmffile}{diagram}
\begin{fmfgraph*}(150, 150)
\fmfleft{i}
\fmfright{o1,o2}
\fmf{fermion,label=$~$}{i,v,o1}
\fmf{gluon,label=$~$}{v,o2}
\fmffreeze
\RFermionFlow{i}{o2}{0.5}{0.5}{0}{blue}
\RFermionFlow{o2}{o1}{0.5}{0.5}{0}{red}
\end{fmfgraph*}
\end{fmffile}
\end{document}
我把流线的角去掉了。
当然,这里这不是费米子流(该命令最初就是为此设计的),但它也许也可以用作“颜色流”。