TransWikia.com

How to draw Bethe-Salpeter equation using tikz-Feynman?

TeX - LaTeX Asked by jwyan1126 on March 22, 2021

I’m a beginner of tikz-feynman. I’d like to ask how to draw the Bethe-Salpeter equation using the package Tikz-Feynman as shown in the following? The standard tutorial from the official website doesn’t contain a similar kind of diagram. Thanks in advance.

BSE diagram

2 Answers

In the future, please do not post a picture asking "how to draw this?". Please, provide some code that you have tried to write to show people on this site what particular technical point you are struggling with.

I don't know how to use the feynman packages so here is a solution using the pics for TikZ. It is a bit verbose and might be optimized, but I don't know how. Indeed, the grids are hard coded because the patterns provided by the pattern library are not positioned correctly inside the shape. Anyway, here is the code:

documentclass{standalone}

usepackage{tikz}
    usetikzlibrary{calc}
    usetikzlibrary{decorations.markings}
    usetikzlibrary{positioning}
    usetikzlibrary{arrows.meta}

tikzset{%
    Feynman vertical/.style args = {#1}{%
        path picture = {
            draw
                let
                    p1 = ($(path picture bounding box.north east) - (path picture bounding box.south west)$),
                    n1 = {veclen(x1, 0)},
                in
                    foreach x in {0,...,#1} {
                        ($(path picture bounding box.south west) + ({x*n1/#1}, 0)$) 
                            -- ($(path picture bounding box.north west) + ({x*n1/#1}, 0)$)
                    };
        }
    },
    Feynman hatch/.style 2 args = {%
        path picture = {
            draw
            let
                p1 = ($(path picture bounding box.north east) - (path picture bounding box.south west)$),
                n1 = {veclen(x1, 0)},
                n2 = {veclen(0, y1)},
            in
                foreach x in {0,...,#1} {
                    ($(path picture bounding box.south west) + ({x*n1/#1}, 0)$) 
                    -- ($(path picture bounding box.north west) + ({x*n1/#1}, 0)$)
                }
                foreach x in {0,...,#2} {
                    ($(path picture bounding box.south west) + (0, {x*n2/#2})$) 
                    -- ($(path picture bounding box.south east) + (0, {x*n2/#2})$)
                };
        }
    },
    pics/my Feynman diagram/.style n args = {4}{%
        code = {%
            node[
                label = above:{#1},
            ] (1) at (0, 0) {};
            node[
                label = above:{#2},
                on grid,
                right = 4cm of 1
            ] (2) {};
            node[
                label = above:{#3},
                on grid,
                below = 2cm of 1
            ] (3) {};
            node[
                label = above:{#4},
                on grid,
                below = 2cm of 2
            ] (4) {};
            
            node[
                rectangle,
                draw,
                pic actions,
                minimum width = 2cm,
                minimum height = 2cm,
            ] (square) at ($(1.center)!0.5!(4.center)$) {};
            draw[%
                Circle-Circle,
                decoration = {%
                    markings,
                    mark = at position 0.09 with{%
                        arrowreversed[scale = 1.5]{latex}
                    },
                    mark = at position 0.839 with{%
                        arrowreversed[scale = 1.5]{latex}
                    }
                },
                postaction = {decorate}
            ] (1.center) -- (2.center);
            draw[%
                Circle-Circle,
                decoration = {%
                    markings,
                    mark = at position 0.161 with{%
                        arrow[scale = 1.5]{latex}
                    },
                    mark = at position .91 with{%
                        arrow[scale = 1.5]{latex}
                    }
                },
                postaction = {decorate}
            ] (3.center) -- (4.center);
        }
    }
}

begin{document}
    
    begin{tikzpicture}
                
        draw[
            double,
            decoration = {%
                markings,
                mark = at position 0.425 with{%
                    arrowreversed[scale = 1]{latex}
                },
            },
            postaction = {decorate}
        ] (15.9, 0) -- (18.1, 0);
        draw[
            double,
            decoration = {%
                markings,
                mark = at position 0.575 with{%
                    arrow[scale = 1]{latex}
                },
            },
            postaction = {decorate}
        ] (15.9, -2) -- (18.1, -2);             
        draw (0, 0) pic[Feynman hatch = {20}{20}] {my Feynman diagram = {$1$}{$4$}{$3$}{$2$}};
        draw (6, 0) pic[Feynman vertical = {20}] {my Feynman diagram = {$1$}{$4$}{$3$}{$2$}};
        
        node at (5, -1) {$=$};
        node at (11, -1) {$+$};
        
        draw (12, 0) pic[Feynman vertical = {20}] {my Feynman diagram = {$1$}{$4'$}{$3$}{$2'$}};
        draw (18, 0) pic[Feynman hatch = {20}{20}] {my Feynman diagram = {$1'$}{$4$}{$3'$}{$2$}};
        
    end{tikzpicture}
    
end{document}

which yields:

enter image description here

Correct answer by KersouMan on March 22, 2021

Just mine it is not a true answer but a suggestion. I have seen tikz-feynmann, feynman, etc. packages and your picture is very hardy to draw and it is necessary to use a lot of time. I humble to suggest to use Mathcha (https://www.mathcha.io/editor) considering that there is not any MWE. There is just a starting point, because I think that your drawing not is done with LaTeX but with external program. After an humble suggestion. You can select vertical line and to create a vertical grid. I have done some of the vertical lines into the rectangle.

documentclass[a4paper,12pt]{article}
usepackage{tikz}
begin{document}
tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Grid [id:dp050710141198379466] 
draw  [draw opacity=0] (157.75,146) -- (81.75,146) -- (81.75,90.91) -- (157.75,90.91) -- cycle ; draw   (157.75,146) -- (157.75,90.91)(152.75,146) -- (152.75,90.91)(147.75,146) -- (147.75,90.91)(142.75,146) -- (142.75,90.91)(137.75,146) -- (137.75,90.91)(132.75,146) -- (132.75,90.91)(127.75,146) -- (127.75,90.91)(122.75,146) -- (122.75,90.91)(117.75,146) -- (117.75,90.91)(112.75,146) -- (112.75,90.91)(107.75,146) -- (107.75,90.91)(102.75,146) -- (102.75,90.91)(97.75,146) -- (97.75,90.91)(92.75,146) -- (92.75,90.91)(87.75,146) -- (87.75,90.91)(82.75,146) -- (82.75,90.91) ; draw   (157.75,146) -- (81.75,146)(157.75,141) -- (81.75,141)(157.75,136) -- (81.75,136)(157.75,131) -- (81.75,131)(157.75,126) -- (81.75,126)(157.75,121) -- (81.75,121)(157.75,116) -- (81.75,116)(157.75,111) -- (81.75,111)(157.75,106) -- (81.75,106)(157.75,101) -- (81.75,101)(157.75,96) -- (81.75,96)(157.75,91) -- (81.75,91) ; draw    ;
%Straight Lines [id:da8796742553374359] 
draw    (38.5,146) -- (197,146) ;
%Straight Lines [id:da7418470204062146] 
draw    (40,91) -- (203,91) ;
%Shape: Triangle [id:dp5355715554922158] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (182.5,145.83) -- (166.75,149.12) -- (166.75,141.25) -- cycle ;
%Shape: Triangle [id:dp4419608441364373] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (163.75,90.54) -- (179.5,87.25) -- (179.5,95.13) -- cycle ;
%Shape: Circle [id:dp6683259397550181] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (194.5,146) .. controls (194.5,143.51) and (196.51,141.5) .. (199,141.5) .. controls (201.49,141.5) and (203.5,143.51) .. (203.5,146) .. controls (203.5,148.49) and (201.49,150.5) .. (199,150.5) .. controls (196.51,150.5) and (194.5,148.49) .. (194.5,146) -- cycle ;
%Shape: Circle [id:dp6688169767236045] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (194,91) .. controls (194,88.51) and (196.01,86.5) .. (198.5,86.5) .. controls (200.99,86.5) and (203,88.51) .. (203,91) .. controls (203,93.49) and (200.99,95.5) .. (198.5,95.5) .. controls (196.01,95.5) and (194,93.49) .. (194,91) -- cycle ;

%Shape: Triangle [id:dp13879421950135273] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (57.75,90.54) -- (73.5,87.25) -- (73.5,95.13) -- cycle ;
%Shape: Triangle [id:dp5597483621320856] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (74.5,145.83) -- (58.75,149.12) -- (58.75,141.25) -- cycle ;
%Shape: Circle [id:dp1895078155864982] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (31,91) .. controls (31,88.51) and (33.01,86.5) .. (35.5,86.5) .. controls (37.99,86.5) and (40,88.51) .. (40,91) .. controls (40,93.49) and (37.99,95.5) .. (35.5,95.5) .. controls (33.01,95.5) and (31,93.49) .. (31,91) -- cycle ;
%Shape: Circle [id:dp3554568913446312] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (29.5,146) .. controls (29.5,143.51) and (31.51,141.5) .. (34,141.5) .. controls (36.49,141.5) and (38.5,143.51) .. (38.5,146) .. controls (38.5,148.49) and (36.49,150.5) .. (34,150.5) .. controls (31.51,150.5) and (29.5,148.49) .. (29.5,146) -- cycle ;
%Shape: Rectangle [id:dp7959619866531342] 
draw   (316,91) -- (391,91) -- (391,146) -- (316,146) -- cycle ;
%Straight Lines [id:da7024988435600825] 
draw    (316,90) -- (316.5,147) ;
%Straight Lines [id:da45533264265815454] 
draw    (383,91) -- (383,146) ;
%Straight Lines [id:da5454213977328088] 
draw    (387,91) -- (387,146) ;
%Straight Lines [id:da4951170094128672] 
draw    (320,91) -- (320,146) ;
%Straight Lines [id:da08155165705769307] 
draw    (379,90) -- (379,145) ;
%Straight Lines [id:da7100493757071882] 
draw    (324,91) -- (324,146) ;
%Straight Lines [id:da695751770201078] 
draw    (268.5,146) -- (427,146) ;
%Straight Lines [id:da7988836981009606] 
draw    (270,91) -- (433,91) ;
%Shape: Triangle [id:dp20499709756019535] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (412.5,145.83) -- (396.75,149.12) -- (396.75,141.25) -- cycle ;
%Shape: Triangle [id:dp10671876541257652] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (393.75,90.54) -- (409.5,87.25) -- (409.5,95.13) -- cycle ;
%Shape: Circle [id:dp461347621490265] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (424.5,146) .. controls (424.5,143.51) and (426.51,141.5) .. (429,141.5) .. controls (431.49,141.5) and (433.5,143.51) .. (433.5,146) .. controls (433.5,148.49) and (431.49,150.5) .. (429,150.5) .. controls (426.51,150.5) and (424.5,148.49) .. (424.5,146) -- cycle ;
%Shape: Circle [id:dp639507151669934] 
draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (424,91) .. controls (424,88.51) and (426.01,86.5) .. (428.5,86.5) .. controls (430.99,86.5) and (433,88.51) .. (433,91) .. controls (433,93.49) and (430.99,95.5) .. (428.5,95.5) .. controls (426.01,95.5) and (424,93.49) .. (424,91) -- cycle ;



% Text Node
draw (29,67.4) node [anchor=north west][inner sep=0.75pt]    {$1$};
% Text Node
draw (30,153.9) node [anchor=north west][inner sep=0.75pt]    {$3$};
% Text Node
draw (239,107.4) node [anchor=north west][inner sep=0.75pt]    {$=$};
% Text Node
draw (203.5,153.9) node [anchor=north west][inner sep=0.75pt]    {$4$};
% Text Node
draw (204,71.9) node [anchor=north west][inner sep=0.75pt]    {$2$};
% Text Node
draw (434,71.9) node [anchor=north west][inner sep=0.75pt]    {$2$};
% Text Node
draw (433.5,153.9) node [anchor=north west][inner sep=0.75pt]    {$4$};


end{tikzpicture}

end{document}

enter image description here

Answered by Sebastiano on March 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP