home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Os2 / GRAFICOS / Gle / FEYN.DOC < prev    next >
Encoding:
Text File  |  1995-01-01  |  11.5 KB  |  269 lines

  1.        feyn.gle - a package for drawing Feynman diagrams
  2.                    A.Grozin
  3.  
  4. It is often necessary to produce publication quality Feynman diagrams. 
  5. I know at least 3 tools intended for this purpose. The LaTeX package 
  6. FEYNMAN by M.J.S.Levine [1] constructs diagrams from characters 
  7. available in LaTeX fonts. It is therefore not enough flexible: it 
  8. permits a few slopes of lines, photon wavelengths and amplitudes, etc. 
  9. It requires to write a rather lengthy source to produce a moderately 
  10. complex diagram. The package Axodraw by J.A.M.Vermaseren [2] is much 
  11. more flexible. It is intended for use in LaTeX documents which will be 
  12. translated to PostScript by dvips, and directly generates PostScript 
  13. source for diagrams. From my point of view, it still misses several 
  14. useful features; and it hardly allows one to produce graphics formats 
  15. other than PostScript. Finally, there is FEYNMAN application in the 
  16. Instant TeX package on NeXT. It has a nice graphical user interface, 
  17. though it is not always easy to select a desired element by mouse in a 
  18. complicated diagram. In addition to this, it is platform-specific.
  19.  
  20. Due to these reasons, I have written a package of procedures for 
  21. drawing Feynman diagrams in the gle programming language. This language 
  22. is sufficiently convenient for programming, though it misses several 
  23. important features (the absence of local variables and the limitation 
  24. on a number of global variables are two most striking examples). A gle 
  25. source for a diagram can be used to produce graphic files in various 
  26. formats, either directly or with straightforward conversions. Preview 
  27. is nearly instant, so that it is easy to tune parameters of a diagram 
  28. by trial and error. It is also easy to include various geometric 
  29. calculations with square roots, arctangents, etc. to a gle program 
  30. (this is difficult in TeX packages and impossible in the NeXT graphics 
  31. environment).
  32.  
  33. To use the package in your gle program, write the line
  34.         include feyn.gle
  35. near the beginning. The package uses many variables beginning from F
  36. for internal purposes. To avoid conflicts, don't use variables beginning
  37. from this letter in your program. Please ignore error messages "Wrong 
  38. end" which may be produced occasionally. They are due to a bug in gle, 
  39. and don't influence a resulting diagram.
  40.  
  41. To draw a fermion (solid) line from (x1,y1) to (x2,y2), use
  42.         amove x1 y1
  43.     @Fermion x2 y2
  44. After that, the pen is left at (x2,y2), so that
  45.         @Fermion x3 y3
  46. will draw line from (x2,y2) to (x3,y3). The line width can be 
  47. controlled by set lwidth.
  48.         amove x1 y1
  49.         @Fermion2 x2 y2 x3 y3
  50. draws an arc from (x1,y1) via (x2,y2) to (x3,y3). For such an arc to be 
  51. uniquely defined, all three points must be different from each other. 
  52. In order to draw a complete circle, you should call Fermion2 twice.
  53.  
  54. Procedures for other kinds of lines are similar to the ones considered 
  55. above: they can draw a straight line from the current point to a given 
  56. point (x,y), or an arc from the current point via (x2,y2) to (x3,y3). 
  57. They leave the pen at the end point of the line. The call
  58.         @Double x y
  59. draws a double line from the current point to (x,y). The half-distance 
  60. between lines is determined by the variable DoubleA. The call
  61.         @Dash x y
  62. draws a dashed line to (x,y). The period of the dashed line is DashL, 
  63. and its fraction DashF is filled. For example, if you want dashes to be 
  64. twice as long as empty spaces between then, you should set DashF = 2/3.
  65.  
  66. A photon line is drawn by
  67.         @Photon x y
  68. Its half-wavelength is PhotonL, and amplitude - PhotonA. If you want 
  69. the waves to be in the opposite side, just change the sign of PhotonA.
  70. Sometimes you may want both the first half-wave and the last one to be, 
  71. say, to the left, while the line produced by Photon has an even number 
  72. of half-waves. In such a case, you can add an extra half-wave by 
  73. setting PhotonN = +1, or eliminate one half-wave by setting PhotonN = 
  74. -1. This variable is reset back to 0 after each call. The call
  75.         @Zigzag x y
  76. produces a zigzag line, often used for a vector boson. This procedure 
  77. is controlled by the same parameters PhotonL, PhotonA, PhotonN.
  78.  
  79. A gluon line is drawn by
  80.         @Gluon x y
  81. Its wavelength is twice PhotonL, and its amplitude is PhotonA (a gluon 
  82. line always contains an integer number of periods, and PhotonN is not 
  83. used). The shape of a gluon line is controlled by the winding 
  84. coefficient GluonW. Wiggles become narrower when you decrease GluonW 
  85. from its default value 1, and degenerate to edges at 1/pi; at GluonW = 
  86. 0, a gluon line looks like a photon one. When you increase GluonW, 
  87. wiggles become wider, and touch each other at GluonW = 1.46529 (this is 
  88. 1/(pi*sin(x)), where x is the root of x+cot(x)=3*pi/2); beyond this 
  89. value they overlap. You may often wish to change the sign of PhotonA 
  90. so that wiggles will be to the opposite side. For example, gluon loops 
  91. usually look better when wiggles are inside; if an arc curves to the 
  92. left, this would require a negative PhotonA.
  93.  
  94. You can put an arrow at the middle of the last drawn line of any kind 
  95. by the call
  96.         @Arrow 0.5
  97. Similarly, the calls
  98.         @Arrow 1/3
  99.     @Arrow 2/3
  100. will produce two arrows, at 1/2 and 2/3 of the line length from the 
  101. beginning. The position of an arrow is that of its tip. The length of 
  102. arrow wings is ArrowL; if it's negative, the arrow will point in a 
  103. direction opposite to that of the line. Half-width of arrow is ArrowA.
  104. The arrow can be displaced in the transverse direction by setting 
  105. ArrowD non-zero, but this is rarely needed. After drawing an arrow, the 
  106. pen will be positioned again at the end of the line, so that you can 
  107. draw another line from this point.
  108.  
  109. A separate arrow near the middle of the last drawn line may be drawn by
  110.         @Mom 0.5
  111. It is often used for indication of the momentum flowing through the 
  112. line. The arrow is at the transverse distance MomD from the line, and 
  113. has half-length MomL. ArrowL and ArrowA are used as parameters of the 
  114. arrow wings. You will often need to change the sign of MomD to draw an 
  115. arrow to the other side from the line. In order to get an arrow 
  116. pointing in the opposite direction, you need to change signs of both 
  117. MomL and ArrowL. A similar call
  118.         @DMom 0.5
  119. produces a double arrow (with half-distance between lines DoubleA). 
  120. Such arrows can be used, e.g., to indicate spin projections.
  121.  
  122. Probably, a better way to understand how to use feyn.gle is to look at 
  123. the file ftest.gle containing some examples. Send comments and bug reports
  124. to A.Grozin@open.ac.uk
  125.  
  126. References
  127. [1] M.J.S.Levine, Comp. Phys. Comm. 58 (1990) 181.
  128. [2] J.A.M.Vermaseren. Comp. Phys. Comm. 83 (1994) 45.
  129.  
  130.                    Appendix
  131.  
  132. All procedures and variables exported by the package are described below.
  133. Following the wise saying "Don't throw away debugging tools from your 
  134. program after debugging is complete, because it is not complete" I 
  135. retained a primitive debugging procedure; you can use it if something 
  136. goes wrong.
  137.  
  138. ================================ Fermion =================================
  139. @Fermion x y
  140. draws fermion line from the current point to x,y
  141.  
  142. @Fermion2 x1 y1 x2 y2
  143. draws fermion line along the arc from the current point via x1,y1 to x2,y2
  144. ==========================================================================
  145.  
  146. ================================ Double ==================================
  147. @Double x y
  148. draws double line from the current point to x,y
  149.  
  150. @Double2 x1 y1 x2 y2
  151. draws double line along the arc from the current point via x1,y1 to x2,y2
  152.  
  153. DoubleA (default 0.05)
  154. half-distance between lines
  155. ==========================================================================
  156.  
  157. ================================ Dashed ==================================
  158. @Dash x y
  159. draws dashed line from the current point to x,y
  160.  
  161. @Dash2 x1 y1 x2 y2
  162. draws dashed line along the arc from the current point via x1,y1 to x2,y2
  163.  
  164. DashL (default 0.3)
  165. period of the dashed line
  166.  
  167. DashF (default 0.5)
  168. fraction of the period that is filled
  169. ==========================================================================
  170.  
  171. ================================ Photon ==================================
  172. @Photon x y
  173. draws photon line from the current point to x,y
  174.  
  175. @Photon2 x1 y1 x2 y2
  176. draws photon line along the arc from the current point via x1,y1 to x2,y2
  177.  
  178. PhotonL (default 0.1)
  179. half-period of the photon line
  180.  
  181. PhotonA (default 0.1)
  182. amplitude of the photon line. When positive, the first half-wave is to the
  183. left, when negative - to the right.
  184.  
  185. PhotonN (default 0)
  186. change of the number of half-periods as calculated from PhotonL. Set to 0
  187. after each call. 
  188. ==========================================================================
  189.  
  190. ================================ Zigzag ==================================
  191. @Zigzag x y
  192. draws zigzag line from the current point to x,y
  193.  
  194. @Zigzag2 x1 y1 x2 y2
  195. draws zigzag line along the arc from the current point via x1,y1 to x2,y2
  196.  
  197. PhotonL, PhotonA, and PhotonN are used
  198. ==========================================================================
  199.  
  200. ================================ Gluon ===================================
  201. @Gluon x y
  202. draws gluon line from the current point to x,y
  203.  
  204. @Gluon2 x1 y1 x2 y2
  205. draws gluon line along the arc from the current point via x1,y1 to x2,y2
  206.  
  207. PhotonL and PhotonA are used
  208.  
  209. GluonW (default 1)
  210. winding coefficient. Wiggles are wider when it is increased and narrower
  211. when it is decreased
  212. ==========================================================================
  213.  
  214. ================================ Arrow ===================================
  215. @Arrow f
  216. draws arrow on the last line of any sort, at the fraction of length f
  217. from the beginning
  218.  
  219. ArrowL (default 0.5)
  220. length of the arrow wings. When negative, arrow points backwards
  221.  
  222. ArrowA (default 0.2)
  223. half-width of the arrow
  224.  
  225. ArrowD (default 0, rarely needed)
  226. transverse displacement of the arrow from the line. When positive - to the
  227. left, when negative - to the right
  228. ==========================================================================
  229.  
  230. ================================ Momentum ================================
  231. @Mom f
  232. draws an arrow for indication of momentum near the last line, at the
  233. fraction of length f from the beginning
  234.  
  235. ArrowL and ArrowA are used
  236.  
  237. MomL (default 0.75)
  238. half-length of the arrow
  239.  
  240. MomD (default 0.5)
  241. transverse displacement of the arrow from the line. When positive - to the
  242. left, when negative - to the right
  243. ==========================================================================
  244.  
  245. ========================= Double momentum arrow ==========================
  246. @DMom f
  247. draws a double arrow near the last line, at the fraction of length f from
  248. the beginning
  249.  
  250. DoubleA, MomL, MomD, ArrowL, and ArrowA are used
  251. ==========================================================================
  252.  
  253. ================================ Debugging ===============================
  254. @fdebug l "name" variable
  255. primitive debugging tool. If Debug>=l then writes the name and the value
  256. of the variable at DebugX,DebugY and increments DebugY by DebugD. If
  257. @fdebug is used inside begin {translate|rotate|scale} ... end, its output
  258. will be {translated|rotated|scaled}, and may be outside the screen.
  259.  
  260. Debug (default 0)
  261. level of debugging output
  262.  
  263. DebugX (default 1)
  264. DebugY (default 1)
  265. initial coordinates for debugging output
  266.  
  267. DebugD (default 1)
  268. y increment for debugging output. If positive, later output is higher
  269. ==========================================================================