I need to type the expression below
I am thinking of using tikzpicture inside the eqnarray environment. Although I am not quite sure which way would be the best to get this done. Can someone please give some feedback on this? Thanks!
- 54,118
- 463
1 Answers
For these simple diagrams the tikz-feynman package might be a bit overkill.
You only have three types of diagrams with a variance of nodes:
.no node,owhite with border,*filled and, maybe,+for the diamond shaped at the bottom of the loop.
All three have possibily one label at always the same place.
With a few styles these can achieved with plain TikZ.
amsmath's \text macro helps scale font-sizes in superscripts, this avoids implementing our own \mathchoicer as long as we define lengths in terms of font dependent units (em and ex, see the definition of every diagram).
The third argment (i.e. the second mandatory one) in each command is the content of the label.
The second one describes the list of nodes. For the line diagram these need to contain two tokens, for the loop three and for the cross five.
They describe the nodes from left to right from top to bottom.
That means that
\tfCross{.+o*o}{X}
Code
\documentclass[varwidth]{standalone}
\usepackage{mathtools}
\DeclarePairedDelimiter\p()
\DeclarePairedDelimiter\brak[]
\usepackage{tikz}
\tikzset{
feynman/.cd,
every diagram/.style={x=+1.3em, y=+1.3em, baseline=+-.5ex},
label/.style={anchor=north west,inner sep=+.2em, scale=.707,
node font=\everymath\expandafter{\the\everymath\scriptstyle}},
node/.style={shape=circle, inner sep=+0pt, minimum size=+2pt, node contents=},
node ./.style={feynman/node, shape=coordinate},
node o/.style={feynman/node, fill=white, draw},
node */.style={feynman/node, fill, draw},
node +/.style={
feynman/node, fill, draw, shape=rectangle, rotate=45, minimum size=+1pt},
loop/.style n args={4}{insert path={
(0,0) node[feynman/label]{$#4$} node[feynman/node #1] -- ++(right:1)
arc[start angle=-90, delta angle=360, radius=.5] node[feynman/node #2]
-- ++(right:1) node[feynman/node #3]}},
cross diagram/.style={
/tikz/feynman/label/.append style={anchor=south east, inner sep=+.2pt}},
cross/.style n args={6}{insert path={
(225:.707) node[feynman/label]{$#6$} node[feynman/node #4]
-- (45:.707) node[midway,feynman/node #3] node[feynman/node #2]
(135:.707) node[feynman/node #1] -- (-45:.707) node[feynman/node #5]}},
line/.style n args={3}{insert path={
(0,0) node[feynman/label]{$#3$} node[feynman/node #1]
-- (right:.8) node[feynman/node #2]}}}
\newcommand*\tfInt[4]{%
\text{\tikz[feynman/every diagram,feynman/#1 diagram/.try,#2]
\draw[feynman/#1={#3{#4}}];}}
\newcommand*\tfLoop[1][]{\tfInt{loop}{#1}}
\newcommand*\tfCross[1][]{\tfInt{cross}{#1}}
\newcommand*\tfLine[1][]{\tfInt{line}{#1}}
\begin{document}
\begin{multline}
\frac{\hbar}{i} \frac{\delta}{\delta J(x_1)} W\brak J
= \frac{\hbar}{i} \frac{\delta}{\delta J(x_1)}
\brak[\bigg]{1+\frac{g}{4!}
\p[\bigg] { 6 \,\tfLoop{o+o}{x_1} + \tfCross{oo*oo}{} }}
e^{\frac 12 \tfLine{oo}{}} \\
= \brak[\bigg]{
\frac{g}{4!}
\p[\bigg] { 6 \cdot 2 \,\tfLoop{.+o}{x_1} + 4 \,\tfCross{oo*.o}{x_1}}
+ \p[\bigg] {1 + \frac{g}{4!}
\p[\bigg]{6 \,\tfLoop{o+o}{x_1} + \tfCross{oo*oo}{}}}
\tfLine{.*}{x_1}
} e^{\frac 12 \tfLine{oo}{}} \\
= \brak[\bigg]{
\tfLine{.o}{x_1} + \frac{g}{4!} \p[\bigg]{
12 \,\tfLoop{.+o}{x_1} + 4 \,\tfCross{oo*.o}{x_1}
+ 6 \,\tfLoop{o+o}{} \, \tfLine{.*}{x_1}
+ \tfCross{oo*oo}{} \, \tfLine{.*}{x_1}
}
} e^{\frac 12 \tfLine{oo}{}}
\end{multline}
\end{document}
Output
- 119,821
-
@rrbrbirlbel, Thanks for your answer. How can one add a diagram with two circles touching each other, (link: https://physics.stackexchange.com/questions/295607/feynman-diagrams-for-phi4-theory-up-to-order-g2). Also, is there any way to make circles and the internal lines thick? – felix Feb 17 '23 at 03:02
-
@felix If you want only the lines thicker but not the nodes, you can add
thickto theevery diagramstyle andthin(the default) to thenodestyle. My solution is still rather inflexible. I suggest to create a new style for this. (We might be able to create a\tfLoopmacro that adds another loop and node based on a key but it gets complicated parsing the whole thing.) – Qrrbrbirlbel Feb 17 '23 at 10:40


eqnarray. Have you seen thetikz-feynmanpackage? The [tag:tikz-feynman] has a few examples. Though, I see only three kinds of diagrams so those could just simply be drawn with bare TikZ as well. – Qrrbrbirlbel Feb 16 '23 at 11:31equationenvironment since it fits on one line – Willoughby Feb 16 '23 at 11:57