Feynman diagram with TikZ-Feynman

Click For Summary

Discussion Overview

The discussion revolves around drawing Feynman diagrams using the TikZ-Feynman package in LaTeX, specifically focusing on creating loops in diagrams related to ##\lambda \phi^4## theory. Participants share their experiences, challenges, and techniques for achieving desired diagrammatic representations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant seeks guidance on drawing self-loops in Feynman diagrams using TikZ-Feynman, questioning whether it can be done without additional path and draw commands.
  • Another participant provides a link to a related question on drawing self-loops in undirected graphs using TikZ.
  • A participant shares a code snippet that successfully creates a loop but expresses a desire for a more straightforward method using TikZ-Feynman commands.
  • Some participants discuss the importance of specificity in questions to receive optimal assistance.
  • One participant suggests that using \path and \draw is acceptable and mentions exploring SVG for more advanced graphics.
  • A new participant describes their attempt to reproduce a specific Feynman diagram from a reference document but encounters issues with the output.
  • Another participant shares their experience of needing to switch from PDFLaTeX to LuaLaTeX to resolve issues with TikZ-Feynman functionality.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and experience with TikZ-Feynman, leading to multiple approaches and suggestions without a clear consensus on the best method for drawing loops or resolving output issues.

Contextual Notes

Some participants highlight the necessity of using LuaLaTeX for certain functionalities of TikZ-Feynman, indicating that the choice of compiler can affect the output of diagrams.

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