Closed martin-ueding closed 8 years ago
Thanks for the feedback, I'm glad you have found this package useful :)
Firstly, the graph can be flipped around by using horizontal'=v1 to v2
instead of horizontal=v1 to v2
. The extra '
tells the graphing algorithm to flip the graph around that line, so this should fix your fermion line to be going up.
As for the momentum labels, there is the key momentum/label distance
which can move the momentum label further away; however, due to the way Ti_k_Z draws the graph, it doesn't work on a per-arrow basis when used inside a graph and has to be set globally. When I get around to it, I want to fix this and implement a similar syntax to the way labels are created (something like momentum={[label sep=0.5cm] \(k\)}
). Your code also illustrates another bug: the momentum arrows override the way the line is draw and remove the effect of bend left
unfortunately (something else I have to fix).
Finally, regarding the fermion lines not being bent by the scalar: unfortunately this can't be achieved with the algorithm as it is (at least, to my knowledge). Ti_k_Z-Feynman builds on the existing graphing algorithms from Ti_k_Z and for me to support this, I would need to rework the underlying algorithms to work more intimately with Ti_k_Z-Feynman (which I may do at some point in the future, but it's definitely not a priority). A workaround is to not draw the scalar edge in the graph itself, but draw it afterwards (though I find the
Here is a minimal working example to illustrate the fixes:
\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\begin{document}
\begin{tikzpicture}[momentum/label distance=0.5cm]
\graph[feynman, horizontal'=v1 to v2]{
a
-- [fermion, momentum'=\(p\)] h1
-- [fermion, momentum=\(k\)] v1
-- [fermion, momentum={\(k' = k + q\)}] h2
-- [fermion, momentum'=\(p'\)] b
;
h1 -- [scalar, momentum'=\(p - k\)] h2;
v2 -- [photon, momentum=\(q\)] v1;
};
\end{tikzpicture}
\begin{tikzpicture}[momentum/label distance=0.5cm]
\graph[feynman, horizontal'=v1 to v2]{
a
-- [fermion, momentum'=\(p\)] h1
-- [fermion, momentum=\(k\)] v1
-- [fermion, momentum=\(k + q\)] h2
-- [fermion, momentum'=\(p'\)] b
;
v2 -- [photon, momentum=\(q\)] v1;
};
\draw[scalar, momentum'=\(p - k\)] (h1) to (h2);
\end{tikzpicture}
\end{document}
I have exams finishing on the 9th of November, so I won't be able to fix these bugs until then; however, I certainly intend to get version 1 of Ti_k_Z-Feynman complete soon afterwards :)
Thanks for the suggestions! Those helped me enough to get a nice looking graph. Good luck with your exams!
I want to build a Feynman diagram with a scalar vertex correction in first order. It does look kind of okay:
There a couple of things that I'd like to improve:
label distance
to something like15em
and nothing changed. How can I give those labels more space?Is there something I can change in my code? If not, could you perhaps improve the otherwise very promising package?
My code:
The
\four
is some fancy four-vector using boldmath but should not break anything. The snippet is in my homework solutions project.