Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Drawing Feynman diagrams with Feynmf

  1. Apr 25, 2007 #1

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    I have posted a question on the Tutorial subforum because there was already a thread on that subject but I figured that people here may be more likely to be able to help me out

    https://www.physicsforums.com/showthread.php?p=1313121#post1313121

    Thanks!

    Patrick
     
  2. jcsd
  3. Apr 25, 2007 #2

    Hans de Vries

    User Avatar
    Science Advisor


    I've got the JaxoDraw visual Feynman diagram editor working with MiKTeX and WinEdt.
    http://jaxodraw.sourceforge.net/

    It takes a lot of patience and about half a day. I should have taken notes during the process..
    People going through the process could leave their step-by-step notes here to help others!!



    Some things I remember:

    1) Read the readme files patiently.

    2) Google for stuff you seem to be missing during the process.

    3) You need to download JAVA stuff from sun.com. make sure it's the
    developers environment needed compile things.

    4) Use the Cygwin setup program to add a handfull of extra packets needed.

    5) You can start "setup.exe" by clicking on a link on the main page of cygwin.com.

    6) I needed several utilities just to compile. I had to google for them and install them.

    7) You need the axodraw.sty file in the latex directory

    8) With WinEdt I needed an alternative way to produce pdf files:
    a) LATeX the tex file
    b) do a: dvi->ps
    c) finally do a: ps -> pdf
    otherwise it complains it can not do "Postscript specials". It will generate
    the pdf normally but the Feynman diagrams are missing.

    I think a had a case of a missing file in the Java environment which
    I found in another directory. I found it rather quick though.


    Regards, Hans.
     
    Last edited: Apr 25, 2007
  4. Apr 25, 2007 #3

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member


    Wow.
    Thank you very much for all the information. That sounds like quite an adventure. I will try this if I can't figure out Feynmf . I am using TeXnicCenter to latex stuff, I guess things should work the same way as fo ryou.

    A quick question: you used Cygwin to download packages, but are you running things within Cygwin? (If I reclal, Cygwin is a Unix emulator running under Windows, right?) Are you running MikTeX under Cygwin? (I hope my questions make some sense)

    Thank you very much for taking the time to post all that information!

    Patrick
     
  5. Apr 25, 2007 #4

    Hans de Vries

    User Avatar
    Science Advisor

    I couldn't get Feynmf working either....

    I run WinEdt and JaxoDraw under windows.

    JaxoDraw is a Java application and you can download the Java compiler
    from sun.com for free.



    Yes,

    Many developers use Cygwin and gcc to and you need it to compile tools all
    the time. MiKTeX is one of them. I'm hoping I'm not confusing things here.
    it has been a while ago and I installed several other packets in the mean
    time. You can start with compiling Jaxodraw with Java and see what you
    need further.

    I use Cygwin gcc for c programs and I use the GNU GSL library for the
    complete list of mathematical functions. In results from Feynman diagrams
    you'll find functions like the Rieman Zeta function and the Poly Logarithm
    (Di-Logarithm) You'll find all of these and much more in the GSL library.

    Cygwin is rather easy to install and you can add/remove all kinds of
    packets (including the GSL library) very conveniently with "setup.exe"
    at the main page of cygwin.com. This program also shows you exactly
    what you have and haven't installed.

    http://www.cygwin.com/
    http://www.gnu.org/software/gsl/
    http://functions.wolfram.com/

    http://www.miktex.org/
    http://www.winedt.com/
    http://jaxodraw.sourceforge.net/
    http://www.nikhef.nl/~t68/axodraw/


    Regards, Hans
     
  6. Apr 25, 2007 #5

    Hans de Vries

    User Avatar
    Science Advisor

    Hmm,

    It seems there is a precompiled version of Jaxodraw now for Windows:

    http://jaxodraw.sourceforge.net/download/index.html

    Better try this first then!


    Regards, Hans
     
  7. Apr 25, 2007 #6
    I am quite surprised. Under Linux I never had any problem.

    Many experimentalists use ROOT software, which is able to produce Feynman diagrams in an interactive manner, after which you can produce the code which is very similar to LaTeX actually.

    Most theoreticians use JaxoDraw to draw Feynman diagrams. It also works interactively. Although I am by no way fan of WYSIWYG, I must admit that this interactivity feature is a strength in that case. But only to learn how to write the code. When one write that kind of code often, one find its more convenient to switch back to batch mode.
     
  8. Apr 25, 2007 #7

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Thank you for all your help! I will check this out!

    I am afraid to show my deep ignorance, but what is WinEdt? WHat is it used for?

    thansk for this link!
     
  9. Apr 25, 2007 #8

    Hans de Vries

    User Avatar
    Science Advisor

    WinEdt is the shareware Latex editor I use:

    http://www.winedt.com/

    Latex is the main target but you can edit other file types as well.

    http://www.winedt.com/snap.html


    Regard, Hans
     
  10. Apr 26, 2007 #9

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Thanks again for the help.

    I installed the precompiled version and it works....up to a point. I can draw things and save in postscript format (and then look at the result using ghostview). But when I ask to save as an eps file (in order to then put it inside a Latex file), it does not work. jaxodraw saves the file but as a postscript file, not an eps file.

    I have tried to save as a Latex file, but then when I tried to compile it looks for a xcolor.sty file which I tried to install but I could not unzip :rofl: You know how problems are with computers...one things leads to another to another ....

    ANyway, I wanted to know how you include your Feynman diagrams in your TeX files: you save as eps or you use the TeX code with the axodraw.sty package?


    Thanks again

    Patrick
     
  11. Apr 26, 2007 #10

    Hans de Vries

    User Avatar
    Science Advisor

    I do an export (File menu) to Latex and copy and past the result in my Latex
    files. This makes your document a single file which is easier and you can still
    edit things like the TeX labels.


    Regards, Hans
     
  12. Apr 26, 2007 #11

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Ok. Thank you. You load the package axodraw.sty and xcolor.sty?

    Thanks a lot, your help is very much appreciated.
     
  13. Apr 26, 2007 #12

    Hans de Vries

    User Avatar
    Science Advisor

    I've got these near the top of my Latex files:


    Code (Text):
    \usepackage{axodraw}
    %\usepackage{pstricks}
    \usepackage{color}
    And I paste the Latex export output from Jaxodraw in the document.

    I've got only axodraw.sty in my Latex directory.
    http://www.nikhef.nl/~t68/axodraw/

    If I comment out "color" then it doesn't work. pstricks.sty must
    be somewhere in the MiKTeX distribution. It doesn't matter if
    I comment it out here.


    I found an explanation here about pstricks:

    http://www.ursoswald.ch/LaTeXGraphics/overview/overview.html

    which shows why I need to do the conversion in three steps to get the
    Feynman diagrams included in the pdf. The direct conversion leaves them out.

    Tex --> DVI --> PS --> PDF

    The direct conversion omits the Feynman diagrams. see figure 1.
    I don't care much about the three steps because they are just three
    clicks on buttons close to each other in my editor. see here:
    http://www.winedt.com/snap.html (LaTeX, dvi-->ps, ps-->pdf)
    Mostly I use the direct conversion. When I'm editing formulas I
    don't care about Feynman diagrams.


    I prefer to do it this way but you can also try to let Jaxodraw export JPG
    or PNG pictures instead of LaTeX code and include the picture like this:

    Code (Text):
    \begin{figure}[h]
    \scalebox{1.0}{\includegraphics{my_picture.jpg}}
                  \caption{my_picture_text}
    \label{fig:my_picure_label}              
    \end{figure}


    Regards, Hans
     
    Last edited: Apr 26, 2007
  14. Apr 27, 2007 #13
    Two comments about FeynMF :

    1) When compiling your .tex file into .pdf and you've got FeynMF pictures, compile it twice. I've found on both Linux and Windows that compiliing it once results in all the diagrams becoming giant capital Greek deltas, [tex]\Delta[/tex] (oh the joys of anomalous bugs!), in a similar thing to the way the contents page is often blank when you recompile, unless you compile twice.

    2) The labels on FeynMF are awful. I know how to code in elaborate diagrams, with lovely loops and wiggles etc but when I put in labels, they appear at random places all over the diagram! I can't actually label particles! If anyone knows of a way around this, could they enlighten me please? I much prefer the diagrams of FeynMF over Jaxodraw and the code for FeynMF is nicer, but for the labels!!!

    I'd recommend the LEd tex editing program for Windows. It does predictive text.
     
  15. Apr 27, 2007 #14

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    That worked!!!:tongue2:
    Thank you

    (for anybody else interested:

    I had to include the line \usepackage{graphicx} at the top of my file

    And to center, one may put the line \centering just after the line \begin{figure}
    }

    Thank you very much for all the help.

    I still wnat to include the graphics latex code directly but I will have to figure out how to install the xcolor package and pstricks (I am using TeXnicCenter for which those packages are not provided )
     
  16. Apr 27, 2007 #15

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    A simple question: I draw fermions lines along the shape of arc of circles. No matter what i do, the arrows is always shown pointing counterclockwise. I sthere any trick to reverse its direction? (not in the latex code itself since I am saving as a jpg but while drawing the diagram itself on the screen)

    Thank you!
     
  17. Apr 28, 2007 #16

    Hans de Vries

    User Avatar
    Science Advisor

    Not that I've seen. You can change line thickness and the arrow size but not
    the direction of the arrow here:

    Options ---> preferences ---> behavior ---> Objects.

    For loops it doesn't matter. The arcs used most are the photon and gluon
    which do not have an arrow. Maybe there's a way buy I didn't find it.


    Regards, Hans.
     
  18. Apr 28, 2007 #17

    nrqed

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Ok, Thank you again for your help. I needed to set the direction because I am trying to draw a diagram showing the contour used for a contour integral but I can't get the arrows in the arcs to point where I want them to point.

    A related question: is it possible to add arrows to the gluon and photon lines ? That would be useful to indicate the flow of four-momentum.

    Thank you again for all the help you have provided!!!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Drawing Feynman diagrams with Feynmf
  1. Feynman Diagram (Replies: 2)

  2. Feynman Diagram (Replies: 11)

  3. Feynman diagram (Replies: 1)

Loading...