Feynman diagram with TikZ-Feynman

Click For Summary
SUMMARY

This discussion focuses on creating Feynman diagrams using the TikZ-Feynman package in LaTeX. Users encountered issues with drawing self-loops in ##\lambda \phi^4## theory and were advised to utilize the LuaLaTeX compiler instead of PDFLaTeX for proper functionality. The recommended code structure for drawing diagrams includes specific commands like \texttt{\textbackslash feynmandiagram} and \texttt{\textbackslash tikzfeynmanset}. Additionally, users were encouraged to explore the TikZ-Feynman documentation for advanced techniques.

PREREQUISITES
  • Familiarity with LaTeX document preparation system
  • Understanding of TikZ-Feynman package (version 1.0.0 or later)
  • Knowledge of LuaLaTeX compiler usage
  • Basic concepts of Feynman diagrams and quantum field theory
NEXT STEPS
  • Learn how to configure TikZ-Feynman settings using \texttt{\textbackslash tikzfeynmanset}
  • Explore advanced diagram features in the TikZ-Feynman documentation
  • Investigate the differences between PDFLaTeX and LuaLaTeX compilers
  • Study the integration of SVG graphics with LaTeX for enhanced diagram capabilities
USEFUL FOR

Researchers, physicists, and students in quantum field theory, as well as LaTeX users looking to create complex Feynman diagrams efficiently.

Gaussian97
Homework Helper
Messages
683
Reaction score
412
TL;DR
How can I write a loop in ##\phi^4## theory with TikZ-Feynman?
Hi, I'm learning how to draw Feynman diagrams in LaTeX using the TikZ-Feynman package, but in https://arxiv.org/ftp/arxiv/papers/1601/1601.05437.pdf I don't see if it's possible to draw loops in ##\lambda \phi^4## theory, how can I draw a loop that goes from one vertex to itself?

Thanks
 
  • Like
Likes   Reactions: JD_PM
Physics news on Phys.org
Well, it's ok but it's not what I was looking.
By now I can create a loop, for example with the code

Code:
\begin{tikzpicture}
  \tikzfeynmanset{
  every vertex = {dot}
  }
  \begin{feynman}[small]
    \vertex (a1) {};
    \vertex[right=1.5cm of a1] (a2);
    \vertex[right=1.5cm of a2] (a3) {};
    \vertex[above=0.6cm of a2] (b);

    \diagram* {
      (a1) --[scalar] (a2) --[half left] (b) --[half left] (a2) --[scalar] (a3),
    };
    \path (b)--++(90:0.3) coordinate (A);
    \draw (A) circle(0.3);
  \end{feynman}
\end{tikzpicture}

I draw
1584268036622.png


But I wonder if there is a better way to do it.
 
The node-to-node closed circuits don't have to be radially circular, but what's been presented here to you is not inconsistent with what apparently you asked for -- analogously, just as ##\TeX## requires you to be very specific in your commands, we need you to be very specific in saying what you're seeking, if we're to be optimally helpfully or assistively responsive.
 
Yes, I know they don't have to be, it's not this what matters, I did it circular because I like it.
Sorry for the ambiguous question, my question is, can I do the same I did but without doing this \path and \draw, only with the TikZ-Feynman commands?
Something like adding (b) --[loop] (b)

Thanks for your time.
 
Gaussian97 said:
Yes, I know they don't have to be, it's not this what matters, I did it circular because I like it.
Sorry for the ambiguous question, my question is, can I do the same I did but without doing this \path and \draw, only with the TikZ-Feynman commands?
Something like adding (b) --[loop] (b)

Thanks for your time.
I don't see why you're reluctant to use \path and \draw, and furthermore, if you're interested in more sophisticated than usual ##\LaTeX## graphics, I suggest that you might see how SVG can be brought in -- maybe have a look at https://wiki.inkscape.org/wiki/index.php/LaTeX
 
Hi!

I am aimed to learn how to draw Feynman Diagrams using ##\TeX## from scratch and I am looking for some advice :smile:

The document shared by @Gaussian97 really helps. I am trying to reproduce the first of the diagrams (section 2.2, A First Diagram).

I naively followed the following steps:

1) Adding the package \usepackage{tikz-feynman} and \tikzfeynmanset{compat=1.0.0} as a warning.

2) Then I simply copy-pasted the code for the first of the diagrams

Code:
\feynmandiagram[horizontal=a to b] {
    i1 -- [fermion] a -- [fermion] i2,
    a -- [photon] b,
    f1 -- [fermion] b -- [fermion] f2,
};

But the output was

kqkqkqkq.png

Instead of the beautiful looking

lqaqsdjwx.png


What am I missing?

Any advice is very welcomed.

Thank you! :biggrin:
 
Hello @JD_PM, I'm not an expert at all in this kind of things but I had the same problem the first time I tried to use tikz-feynman, I don't know if this will work for you but I'll tell you how I fix it (if it doesn't work then I have no idea).

In my case, the problem is that I was using the PDFLaTeX compiler (which was the default option), but to use some functionalities of tikz-feynman you must use the LuaLaTeX compiler.

Here's how I discovered the problem and how I fixed it (in case it helps you)

In my case, I use TexMaker as the editor to write LaTeX documents. In it, you can look at the log and usually it gives a message when something is wrong (In any case, look if you have some document named "Name_of_the_document.log" and open it with the notepad), I got the following message:
Package tikz-feynman Warning: LuaTeX is required if you wish to have vertices automatically placed. You can disable this warning by setting /tikzfeynman/warn luatex=false on input line 50.

Then I found that, in fact, the first line of the log was
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.7) (preloaded format=pdflatex 2020.8.21)

And found that, when I click the Run button (that for me was some kind of magic that make appear a pdf with the things I wrote) it was really doing two things: PdfLaTeX + View PDF (which I assume are some kind of commands)

After looking into the options of the editor I finally found that there was the option of compiling using LuaLaTeX, and after doing that (and the View PDF) i finally got the diagram correctly and my log file start with
This is LuaHBTeX, Version 1.12.0 (MiKTeX 20.7) (format=lualatex 2020.8.22)
and there was no Package tikz-feynman Warning

Hope it helps you
 
  • Informative
Likes   Reactions: JD_PM

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 0 ·
Replies
0
Views
6K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K