Debian Codegraph @

texmf-dist/fonts/source/public/feyn/feyn.mf

raw
1 % This is the metafont for the feynfont font, release 0.4.3, 2022 July 20
2 %
3 % Copyright 1991, 1994, 2001, 2002, 2005, 2008-10, Norman Gray.
4 % See the file LICENCE for licence details.
5 %
6 % Mercurial revision 0a471f8ed572, 2022-07-20 11:23 +0100, tag 0.4.3 + 0
7 %
8 %
9 %
10 % When I look at the property list of the generated TFM (using
11 % tftopl) it starts with `(FAMILY CMR)': but this isn't in the cmr
12 % family. I can't find anything in cmbase.mf which would cause
13 % this. Perhaps I need to read the Metafont Book more closely.
14
15
16 mode_setup; font_setup;
17
18 % a# is the position of the characters above the baseline.
19 a# := on_math_axis * math_axis#; % math_axis is defined by cmr
20
21 % Feyn macros
22 input feynmac;
23
24 define_pixels (module,bigarrow,littlearrow,blobr,a);
25 define_blacker_pixels (linewidth,thinlinewidth);
26
27 pickup pencircle scaled linewidth;
28 diagram_pen := savepen;
29
30 % general definitions
31 phangle := 75; % photon angle
32
33 squash := 0.75; % the amount by which some loops are squashed
34
35 % The caller must set the following parameters to values such as these
36 %boson_wiggles := 4; %this must be an even number
37 %boson_wiggles_loop_small := 4;
38 %boson_wiggles_loop_normal := 6;
39 %boson_wiggles_loop_large := 8;
40
41
42 % All the character positions between 0 and hex"7F"
43 % have characters in them. Not all of these characters are ones
44 % which should appear on paper; some (such as `s' or `l') only
45 % appear in ligatures, and others shouldn't appear at all. If,
46 % however, there are no characters in these positions, some DVI
47 % readers (including TFtoPL and OzTeX for example) complain about a
48 % `bad TFM file'. These locations are therefore occupied by the
49 % character generated by the errorchar macro, which is 0pt wide, and
50 % 1module# high. This character doesn't generate any real error,
51 % but the glyph will be manifestly peculiar on paper.
52 %
53 % Add code to extra_beginchar so that we keep a record of all the
54 % characters that we generate, so that we can generate an errochar
55 % character for each of the codepoints that we've skipped. `charcode'
56 % is defined in the expansion of beginchar()
57
58 numeric donechar[];
59 string donecharerror;
60 donecharerror := "Duplicate character";
61 extra_beginchar := extra_beginchar & "if known donechar[charcode]: errmessage donecharerror; fi donechar[charcode] := 1;";
62
63 path charpath, charpathb;
64
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 %
67 % Digits 0x30--0x39. Obtain these from the cmr source file: romand.mf.
68 input romand;
69
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 %
72 % Fermions
73
74 def path_fermion (expr scale_sharp, ang) =
75 begingroup
76 save scale;
77 scale := hround(scale_sharp*hppp);
78 if ang > 0: % slopes upward
79 (0,a) .. (scale*(cosd ang), scale*(abs sind ang)+a)
80 else :
81 (0,scale*(abs sind ang)+a) .. (scale*(cosd ang), a)
82 fi
83 endgroup
84 enddef;
85
86 threechars ("f", "fermion",
87 path_fermion(2module#, 0), 0.5, 2module#, 0, 0,
88 (0,0.1module), "top");
89
90 begingroup % make closed fermion loop, for phi^4 theory
91 clearxy;
92 save height;
93 height# := 2module#;
94 define_pixels(height);
95 z2 = (0, height); %top of loop
96 y1 = y3 = 2y2/3;
97 x1+x3 = 0;
98 x1-x3 = 2height/3;
99 charpath := origin .. z1 .. z2 .. z3 .. origin;
100 threechars ("k", "fermion loop",
101 charpath shifted (0,a), 2,
102 0, 2module#, 0,
103 0, "top");
104 endgroup;
105
106 beginchar (hex"21", module#, 0, 0);
107 "short fermion";
108 pen;
109 draw path_fermion(module#, 0);
110 endchar;
111
112
113 % The following characters are in boxes the same vertical size as the black
114 % bit of the character, but they project out of the top by an amount equal to
115 % the height of the math axis, and are that same height clear of the bottom
116 % of the box.
117 %
118 %%%% -90 <= ang <= +90, or all hell will break loose
119
120 threechars ("e", "upward fermion",
121 path_fermion(2module#, 45), 0.5,
122 2module#*(cosd 45), 2module#*(abs sind 45), 0,
123 0, "ulft");
124
125 threechars ("d", "downward fermion",
126 path_fermion(2module#, -45), 0.5,
127 2module#*(cosd -45), 2module#*(abs sind -45), 0,
128 0, "urt");
129
130 threechars ("b", "vertically upward fermion",
131 path_fermion(2module#, 90), 0.5,
132 2module#*(cosd 90), 2module#*(abs sind 90), 0,
133 0, "urt");
134
135 charpath := path_fermion(2module#, 0);
136 beginchar("m", 2module#, 0, 0); "massive fermion";
137 pen;
138 draw charpath shifted (0,linewidth);
139 draw charpath shifted (0,-linewidth);
140 annotate_at(point 0.5 of charpath shifted (0,linewidth), "top");
141 endchar;
142
143 beginchar("M", 2module#, 0, 0); "r-arrowed massive fermion";
144 pen;
145 draw charpath shifted (0,linewidth);
146 draw charpath shifted (0,-linewidth);
147 drawarrow (bigarrow, point 0.5 of charpath, 0);
148 annotate_at(point 0.5 of charpath shifted (0,linewidth), "top");
149 endchar;
150
151 beginchar(byte"m"-hex"60", 2module#, 0, 0); "l-arrowed massive fermion";
152 pen;
153 draw charpath shifted (0,linewidth);
154 draw charpath shifted (0,-linewidth);
155 drawarrow (bigarrow, point 0.5 of charpath, 180);
156 annotate_at(point 0.5 of charpath shifted (0,linewidth), "top");
157 endchar;
158
159 charpath := path_fermion(module#, 0);
160 beginchar(hex"23", module#, 0, 0); "short massive fermion";
161 pen;
162 draw charpath shifted (0,linewidth);
163 draw charpath shifted (0,-linewidth);
164 %drawarrow (littlearrow, point 0.5 of charpath, 0);
165 annotate_at(point 0.5 of charpath shifted (0,linewidth), "top");
166 endchar;
167
168 begingroup
169 clearxy;
170 save width;
171 width# := 4module#;
172 define_pixels(width);
173 x2-x0 = 2(x1-x0) = width;
174 x1 = 0;
175 y0 = y2 = 0;
176 y1 = 2squash*module;
177 charpath := z0 .. z1 .. z2;
178
179 threechars("l", "fermion loop",
180 charpath shifted (0,a), 1,
181 0, 2squash*module#+a#, 0,
182 0, "top");
183 threechars("n", "fermion loop, inverted",
184 charpath yscaled -1 shifted (0,a), 1,
185 0, a#, 0,
186 0, "bot");
187 threechars("o", "fermion loop, small",
188 charpath scaled 0.66667 shifted (0,0.66667a), 1,
189 0, module#+a#, 0,
190 0, "top");
191 threechars("w", "fermion loop, small, inverted",
192 charpath xscaled 0.66667 yscaled -0.66667 shifted(0,0.66667a), 1,
193 0, module#+a#, 0,
194 0, "bot");
195 endgroup;
196
197
198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
199 %
200 % Gauge bosons
201 %
202
203 def path_boson (expr scale_sharp, ang, taper) =
204 begingroup
205 save scale;
206 clearxy;
207 scale := hround(scale_sharp*hppp);
208 x1 = 0;
209 x99 = scale*(cosd ang);
210 if ang > 0 : % slopes upward
211 y1 = a;
212 y99 = scale*(abs sind ang) + a;
213 else :
214 y1 = scale*(abs sind ang) + a;
215 y99 = a;
216 fi
217 for i = 3 upto boson_wiggles:
218 z[i] - z[i-1] = z2-z1;
219 endfor
220 z99 - z[boson_wiggles] = z2-z1;
221 def ::(expr b) = {dir (ang+b)} looselink {dir (ang-b)} enddef;
222
223 z1 ::(phangle)z2
224 for i = 3 step 2 until boson_wiggles:
225 ::(-phangle) z[i] ::(phangle)z[i+1]
226 endfor
227 if taper <> 0 :
228 {dir (ang-phangle)} .. tension 1 and 0.8 .. {dir (ang+phangle/2)}
229 else :
230 ::(-phangle)
231 fi
232 z99
233 endgroup
234 enddef;
235
236 % the following is a simpler version of the above, without the
237 % boson_wiggles, to document what it's supposed to be doing
238 def path_boson_orig (expr scale_sharp, ang, taper) =
239 begingroup
240 save scale;
241 clearxy;
242 scale := hround(scale_sharp*hppp);
243 x1 = 0; x5 = scale*(cosd ang);
244 if ang > 0 : % slopes upward
245 y1 = a;
246 y5 = scale*(abs sind ang) + a;
247 else :
248 y1 = scale*(abs sind ang) + a;
249 y5 = a;
250 fi
251 z2-z1 = z3-z2 = z4-z3 = z5-z4;
252 def ::(expr b) = {dir (ang+b)} looselink {dir (ang-b)} enddef;
253
254 z1 ::(phangle) z2 ::(-phangle) z3 ::(phangle) z4
255 if taper <> 0 :
256 {dir (ang-phangle)} .. tension 1 and 0.8 .. {dir (ang+phangle/2)}
257 else :
258 ::(-phangle)
259 fi
260 z5
261 endgroup
262 enddef;
263
264 threechars ("g", "gluon",
265 path_boson(2module#, 0, 0), boson_wiggles/2,
266 2module#, 0, 0,
267 (0, 0.2module), "top");
268 threechars ("u", "upward gluon",
269 path_boson(2module#, 45, 0), boson_wiggles/2,
270 2module#*(cosd 45), 2module#*(abs sind 45), 0,
271 0, "ulft");
272 threechars ("v", "downward gluon",
273 path_boson(2module#, -45, 0), boson_wiggles/2,
274 2module#*(cosd -45), 2module#*(abs sind -45), 0,
275 0, "urt");
276 threechars (hex"7D",
277 "vertical gluon",
278 path_boson(2module#, 90, 1), boson_wiggles/2,
279 0, 2module#, 0,
280 0, "urt");
281
282 % plus or minus phangle, depending on whether n is odd or even
283 def pm_angle(expr n) =
284 if odd n: -1 else: 1 fi*phangle
285 enddef;
286
287 % a gluon quarter loop, in the upper-right quadrant:
288 % wid: radius of loop in modules
289 % nopts: number of points
290 % inv: if 1, the loop goes from the axis to the top;
291 % if 0, from the top down to the axis
292 % negang: if 1, negate the photon angle (so it wiggles oppositely);
293 % if 0, don't
294 % taper: if 1 or 3, the line tapers as it approaches the axis
295 % if 2 or 3, the line tapers as it approaches the top
296 % if 0, the line does not taper
297 % (I can't help feeling this macro has become more complicated than it
298 % really need be...)
299 def path_quadloop (expr wid, nopts, inv, negang, taper) =
300 begingroup
301 save halfwidth, myangle;
302 clearxy;
303 halfwidth# := wid*module#;
304 define_pixels(halfwidth);
305 myangle = if negang <> 0: -phangle else: phangle fi;
306 z0 = (halfwidth, 0); % z0 is on the axis
307 for x = 1 upto nopts:
308 z[x] = z0 rotated (x*90/nopts);
309 endfor
310 if inv = 0:
311 def ::(expr p,ang) = p{p rotated(-90-ang)} looselink enddef;
312 if (taper = 2) or (taper = 3):
313 z[nopts]{dir(0-myangle/2)} .. tension 0.8 and 1 ..
314 else:
315 ::(z[nopts], pm_angle(nopts+negang))
316 fi
317 for x=nopts-1 downto 2:
318 ::(z[x], pm_angle(x+negang))
319 endfor
320 if (taper = 1) or (taper = 3):
321 z[1]{z[1] rotated(-90+myangle)} .. tension 1 and 0.8 .. {dir -(90+myangle/2)}
322 else:
323 ::(z[1], pm_angle(1+negang))
324 fi
325 z0
326 else:
327 def ::(expr p,ang) = looselink {p rotated (90+ang)}p enddef;
328 if (taper = 1) or (taper = 3):
329 z0 {dir (90+myangle/2)} .. tension 0.8 and 1 .. z[1]{z[1] rotated(90-myangle)}
330 else:
331 z0{dir (90+myangle)}
332 ::(z[1], pm_angle(1+negang))
333 fi
334 for x=1 upto nopts-1:
335 ::(z[x], pm_angle(x+negang))
336 endfor
337 if (taper = 2) or (taper = 3):
338 .. tension 0.8 and 1 .. {z[nopts] rotated (90+myangle/2)}z[nopts]
339 else:
340 ::(z[nopts], pm_angle(nopts+negang))
341 fi
342 fi
343 endgroup
344 enddef;
345
346 % next_odd: evaluate to the next odd number greater than or equal to n
347 def next_odd(expr n) =
348 (2*floor(n/2)+1)
349 enddef;
350
351 threechars ("q", "gluon, quadrant 1",
352 path_quadloop(2, boson_wiggles_loop_normal, 1, 0, 3) xscaled -1 shifted (0,a),
353 next_odd(2boson_wiggles_loop_normal/3),
354 0, 2module#, 0, % height is 2module#, not 2module#+a#, so that
355 % they line up OK in \Diagram
356 0, "ulft");
357 threechars ("r", "gluon, quadrant 2",
358 path_quadloop(2, boson_wiggles_loop_normal, 0, 0, 3) shifted (0,a),
359 next_odd(boson_wiggles_loop_normal/2),
360 0, 2module#, 0,
361 0, "urt");
362 threechars ("s", "gluon, quadrant 3",
363 path_quadloop(2, boson_wiggles_loop_normal, 0, 1, 3) yscaled -1 shifted (0,a),
364 next_odd(boson_wiggles_loop_normal/2),
365 0, a#, a#-2module#,
366 0, "lrt");
367 threechars ("t", "gluon, quadrant 4",
368 path_quadloop(2, boson_wiggles_loop_normal, 1, 1, 3) scaled -1 shifted (0,a),
369 next_odd(2boson_wiggles_loop_normal/3),
370 0, a#, a#-2module#,
371 0, "llft");
372
373 % The two loops following have the annotation off-centre, to keep
374 % it clear of the wiggles. Would it look better being "top" and "bot"
375 % again, but with a non-zero offset in the second-last argument?
376 % These two are vertically squashed so that they take up less than 2
377 % modules vertically, which means in turn that {gl glu} can sit in a
378 % two-loop diagram without crashing into the baseline.
379 threechars ("y", "gluon half loop",
380 ((path_quadloop(2, boson_wiggles_loop_normal, 1, 0, 1) xscaled -1)
381 .. path_quadloop(2, boson_wiggles_loop_normal, 0, 0, 1)) yscaled squash shifted (0,a),
382 boson_wiggles_loop_normal+1,
383 0, 2squash*module#+a#, 0,
384 0, "urt");
385 threechars ("z", "gluon half loop, inverted",
386 ((path_quadloop(2, boson_wiggles_loop_normal, 1, 1, 1) scaled -1)
387 .. (path_quadloop(2, boson_wiggles_loop_normal, 0, 1, 1) yscaled -1)) yscaled squash shifted (0,a),
388 boson_wiggles_loop_normal+1,
389 0, a#, a#-2module#,
390 0, "llft");
391
392 % Small and large boson half loops are at positions which are not characters.
393 % That's OK -- they can still be accessed by ligatures.
394 % 7b='{', 7c='|'
395 threechars (hex"7B", "large gluon half loop",
396 ((path_quadloop(2.66667, boson_wiggles_loop_large, 1, 0, 1) xscaled -1)
397 .. path_quadloop(2.66667, boson_wiggles_loop_large, 0, 0, 1)) shifted (0,a),
398 1.5boson_wiggles_loop_large,
399 0, 2.66667module#+a#, 0,
400 0, "urt");
401 threechars (hex"7C", "small gluon half loop",
402 ((path_quadloop(1.3333, boson_wiggles_loop_small, 1, 0, 1) xscaled -1)
403 .. path_quadloop(1.3333, boson_wiggles_loop_small, 0, 0, 1)) shifted (0,a),
404 1.5boson_wiggles_loop_small,
405 0, 1.3333module#+a#, 0,
406 0, "llft");
407
408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
409 %
410 % Ghosts
411
412 ghost_points = 2(boson_wiggles + 1); % should be at least 8?
413 def draw_ghost(expr a, b, apos) =
414 begingroup
415 % pattern for ghost_points=10: "-_--_--_--_-"
416 clearxy;
417 z1 = a; z[ghost_points] = b;
418 z2-z1 = z[ghost_points]-z[ghost_points-1];
419 for i = 2 step 2 until (ghost_points-1):
420 z2-z1 = z[i+1]-z[i];
421 endfor
422 z4-z3 = 2(z2-z1);
423 for i = 5 step 2 until (ghost_points-2):
424 z4-z3 = z[i+1]-z[i];
425 endfor
426 pen;
427 draw z1--z2; draw z[ghost_points-1]--z[ghost_points];
428 for i = 3 step 2 until (ghost_points-2):
429 draw z[i]--z[i+1];
430 endfor
431 annotate_at(0.5[z1,z[ghost_points]], apos);
432 endgroup
433 enddef;
434 % the following is a simpler version of the above, without the
435 % ghost_points parameter, to document what it's supposed to be doing
436 def draw_ghost_orig(expr a, b, apos) =
437 begingroup
438 clearxy;
439 z1 = a; z10 = b;
440 z4-z3 = 2(z2-z1);
441 z4-z3 = z6-z5 = z8-z7;
442 z2-z1 = z3-z2 = z5-z4 = z7-z6 = z9-z8 = z10-z9;
443 pen;
444 draw z1..z2; draw z3..z4; draw z5..z6; draw z7..z8; draw z9..z10;
445 annotate_at(0.5[z5,z6], apos);
446 endgroup
447 enddef;
448
449 beginchar ("h", 2module#, 0, 0); "ghost";
450 pen;
451 draw_ghost((0,a), (w,a), "top");
452 endchar;
453 beginchar (byte "h"-hex"20", 2module#, 0, 0); "r-arrowed ghost";
454 pen;
455 draw_ghost((0,a), (w,a), "top");
456 drawarrow (littlearrow, .5[(0,a), (w,a)], 0);
457 endchar;
458 beginchar (byte "h"-hex"60", 2module#, 0, 0); "l-arrowed ghost";
459 pen;
460 draw_ghost((0,a), (w,a), "top");
461 drawarrow (littlearrow, .5[(0,a), (w,a)], 180);
462 endchar;
463 beginchar ("i", 2module#*(cosd 45), 2module#*(sind 45), 0); "upward ghost";
464 pen;
465 draw_ghost((0,a), (w,h+a), "ulft");
466 endchar;
467 beginchar (byte"i"-hex"20", 2module#*(cosd 45), 2module#*(sind 45), 0);
468 "r-arrowed upward ghost";
469 pen;
470 draw_ghost((0,a), (w,h+a), "ulft");
471 drawarrow (littlearrow, .5[(0,a), (w,h+a)], 45);
472 endchar;
473 beginchar (byte"i"-hex"60", 2module#*(cosd 45), 2module#*(sind 45), 0);
474 "l-arrowed upward ghost";
475 pen;
476 draw_ghost((0,a), (w,h+a), "ulft");
477 drawarrow (littlearrow, .5[(0,a), (w,h+a)], 45+180);
478 endchar;
479 beginchar ("j", 2module#*(cosd 45), 2module#*(sind 45), 0);
480 "downward ghost";
481 pen;
482 draw_ghost((0,h+a), (w,a), "urt");
483 endchar;
484 beginchar (byte"j"-hex"20", 2module#*(cosd 45), 2module#*(sind 45), 0);
485 "r-arrowed downward ghost";
486 pen;
487 draw_ghost((0,h+a), (w,a), "urt");
488 drawarrow (littlearrow, .5[(0,a), (w,h+a)], -45);
489 endchar;
490 beginchar (byte"j"-hex"60", 2module#*(cosd 45), 2module#*(sind 45), 0);
491 "l-arrowed downward ghost";
492 pen;
493 draw_ghost((0,h+a), (w,a), "urt");
494 drawarrow (littlearrow, .5[(0,a), (w,h+a)], -45+180);
495 endchar;
496
497 % ghost loops
498 begingroup
499 clearxy; clearit; % clear current picture
500 picture ghostloop;
501 pair refpt, arrowpoint;
502 refpt := (-2module, 0);
503 for i=0 upto 23:
504 z[i] = refpt rotated -(i/24*180) yscaled squash shifted (0,a);
505 endfor
506 arrowpoint := z[12];
507 transform below;
508 below := identity rotatedaround ((0,a), 180);
509 pen;
510 for i=0 step 2 until 22:
511 draw z[i]--z[i+1];
512 endfor
513 ghostloop := currentpicture; clearit;
514 beginchar (hex"7E", 0, 2squash*module#+a#, 0); "ghost loop";
515 addto currentpicture also ghostloop;
516 annotate_at(arrowpoint, "top");
517 endchar;
518 beginchar (hex"7E"-hex"20", 0, 2squash*module#+a#, 0); "r-arrowed ghost loop";
519 addto currentpicture also ghostloop;
520 drawarrow(littlearrow, arrowpoint, 0);
521 annotate_at(arrowpoint, "top");
522 endchar;
523 beginchar (hex"7E"-hex"60", 0, 2squash*module#+a#, 0); "l-arrowed ghost loop";
524 addto currentpicture also ghostloop;
525 drawarrow(littlearrow, arrowpoint, 180);
526 annotate_at(arrowpoint, "top");
527 endchar;
528 beginchar (hex"7F", 0, a#, 0); "ghost loop, inverted";
529 addto currentpicture also ghostloop transformed below;
530 annotate_at(arrowpoint transformed below, "top");
531 endchar;
532 beginchar (hex"7F"-hex"20", 0, a#, 0); "r-arrowed ghost loop, inverted";
533 addto currentpicture also ghostloop transformed below;
534 drawarrow(littlearrow, arrowpoint transformed below, 0);
535 annotate_at(arrowpoint transformed below, "top");
536 endchar;
537 beginchar (hex"7F"-hex"60", 0, a#, 0); "l-arrowed ghost loop, inverted";
538 addto currentpicture also ghostloop transformed below;
539 drawarrow(littlearrow, arrowpoint transformed below, 180);
540 annotate_at(arrowpoint transformed below, "top");
541 endchar;
542 endgroup;
543
544 beginchar (hex"22", module#, 0, 0); "short ghost";
545 pen;
546 z1 = (0,a); z6 = (w,a);
547 z4-z3 = 2(z2-z1);
548 z2-z1 = z3-z2 = 1/2(z4-z3) = z5-z4 = z6-z5;
549 draw z1..z2; draw z3..z4; draw z5..z6;
550 annotate_at(0.5[z3,z4], "top")
551 endchar;
552
553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
554 %
555 % Odds and sods
556
557 beginchar (hex"60", 2module#, 0, 0);
558 "spacer";
559 endchar;
560
561 beginchar (hex"40", module#, 0, 0);
562 "short spacer";
563 endchar;
564
565 beginchar ("c", 2blobr#, blobr# + a#, blobr#); "complete vertex";
566 pen;
567 draw (0,a) .. (w,a) .. cycle;
568 annotate_at((w/2,w/2+a), "top");
569 endchar;
570
571 %beginchar ("d", module#/2, 0, 0); "weeny fermion";
572 % pen;
573 % draw (0,a)..(w,a);
574 %endchar;
575 %
576 %beginchar ("k", module#/2, 0, 0); "weeny massive fermion";
577 % pen;
578 % y1 - a = y2 - a = a - y3 = a - y4 = module#/3.5;
579 % x1 = x3 = 0;
580 % x2 = x4 = w;
581 % draw z1--z2;
582 % draw z3--z4;
583 %endchar;
584 %
585 %beginchar ("l", module#, 0, 0); "short massive fermion";
586 % pen;
587 % y1 - a = y2 - a = a - y3 = a - y4 = module#/3.5;
588 % x1 = x3 = 0;
589 % x2 = x4 = w;
590 % draw z1--z2;
591 % draw z3--z4;
592 %endchar;
593
594 %beginchar ("n", 4module#, 2module#-a#, 2module#-a#);
595 % pen; "fermion loop";
596 % z0 = (0,a); z1 = (w,a);
597 % draw z0{dir phangle} ..tension 1.15.. {dir -phangle}z1;
598 % draw z0{dir -phangle} ..tension 1.15.. {dir phangle}z1;
599 %endchar;
600
601
602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
603 %
604 % Other symbols
605
606 garrow("a", 0, 1);
607 garrow(hex"03", 180, 1);
608
609 beginchar ("p", 2blobr#, blobr# + a#, blobr# - a#);
610 pen; "proper vertex";
611 picture p[];
612 pair t[];
613 fill (-blobr, 0) .. (blobr, 0) .. cycle;
614 p1 := currentpicture; clearit;
615 draw (-blobr, 0) .. (blobr, 0) .. cycle;
616 p2 := currentpicture; clearit;
617 t1 = 5/6[origin, (0,blobr)] shifted (-blobr, 0);
618 t7 = 5/6[origin, (0,blobr)] shifted (+blobr, 0);
619 forsuffixes s = 2,3,4,5,6 :
620 t[s] = t[s-1] shifted (0, -blobr/3);
621 t[s+6] = t[s+5] shifted (0, -blobr/3);
622 endfor
623 forsuffixes s = 1,2,3,4,5,6,7,8,9,10,11,12 :
624 z[s] = t[s] rotated 45;
625 endfor
626 forsuffixes s = 1,2,3,4,5,6 :
627 draw z[s] -- z[s+6];
628 endfor
629 addto currentpicture also p1;
630 cull currentpicture keeping (2,2); % & the two pictures
631 addto currentpicture also p2;
632 currentpicture := currentpicture shifted (blobr,a);
633 labels (range 1 thru 12);
634 annotate_at((blobr,blobr+a), "top");
635 endchar;
636
637 beginchar ("P", 2blobr#, blobr#+a#, blobr#-a#); % see complete vertex "c"
638 pen; "proper vertex 2";
639 fill (0,a) .. (w,a) .. cycle;% withcolor black;
640 annotate_at((w/2,w/2+a), "top");
641 endchar;
642
643 beginchar ("x", 0, a#, -a#); "counterterm";
644 pen;
645 -x1 = -x2 = x3 = x4;
646 y1 = -y2 = y3 = -y4;
647 z3 = (2blobr/3, 0) rotated 45;
648 draw z1 .. z4;
649 draw z2 .. z3;
650 currentpicture := currentpicture shifted (0,a);
651 annotate_at(0.5[z1,z3] shifted (0,a), "top");
652 endchar;
653
654 beginchar (hex"20", module#, a#, 0); "space block";
655 pen;
656 message "spacer: width=" & decimal w & ", height=" & decimal h;
657 draw origin--(w,h);
658 draw (0,h)--(w,0);
659 endchar;
660
661
662 % Now generate an errorchar() in each of the code positions we've skipped
663 for n = 0 upto hex"7F":
664 if not known(donechar[n]):
665 beginchar (n, 0, module#, 0); errorchar(h); endchar;
666 fi
667 endfor
668
669
670 % Construct the ligature tables.
671 ligtable "a" : % arrow
672 "A" =: "a", % right-arrow, for symmetry
673 "V" =: hex"03"; % left-arrow
674
675 ligtable "f" : % fermion
676 "A" =: "F", % right-arrowed
677 "V" =: hex"06", % left-arrowed
678 "u" =: "e", % upward
679 "d" =: "d", % downward
680 "v" =: "b", % vertical
681 "s" =: hex"21", % short
682 "l" =: "l", % loop
683 "0" =: hex"60"; % spacer
684
685 ligtable "e" : % upward fermion, fe
686 "A" =: "E", % arrowed
687 "V" =: hex"05";
688
689 ligtable "d" : % downward fermion, fd
690 "A" =: "D",
691 "V" =: hex"04";
692
693 ligtable "b" : % vertical fermion, fv
694 "A" =: "B",
695 "V" =: hex"02";
696
697 ligtable hex"21" : % short fermion
698 "0" =: hex"40"; % short spacer
699
700 ligtable "k" : % fermion closed loop
701 "A" =: "K", % arrowed
702 "V" =: hex"0b";
703
704 ligtable "l" : % fermion loop
705 "u" =: "n", % upside down
706 "o" =: "k", % closed loop (for scalar theory)
707 "S" =: "o", % small
708 "A" =: "L",
709 "V" =: hex"0C";
710
711 ligtable "g" : % gluon
712 "A" =: "G",
713 "V" =: hex"07",
714 "u" =: "u",
715 "d" =: "v",
716 "v" =: oct"175",
717 "l" =: "y", % gluon half-loop
718 "1" =: "q", % gluon quarter-loop, 1st quadrant (upper-left)
719 "2" =: "r", % 2nd
720 "3" =: "s", % 3rd
721 "4" =: "t"; % 4th
722
723 ligtable "m" : % massive fermion
724 "A" =: "M",
725 "V" =: hex"0D",
726 "s" =: hex"23";
727
728 ligtable "n" : % inverted fermion
729 "A" =: "N",
730 "V" =: hex"0E";
731
732 ligtable "o" : % fermion loop small
733 "u" =: "w", % upside down
734 "A" =: "O",
735 "V" =: hex"0F";
736
737 ligtable "q" : % gluon, 1st quadrant
738 "A" =: "Q",
739 "V" =: hex"11";
740
741 ligtable "r" : % gluon, 2nd quadrant
742 "A" =: "R",
743 "V" =: hex"12";
744
745 ligtable "s" : % gluon, 3rd quadrant
746 "A" =: "S",
747 "V" =: hex"13";
748
749 ligtable "t" : % gluon, 4th quadrant
750 "A" =: "T",
751 "V" =: hex"14";
752
753 ligtable "u" : % upward gluon
754 "A" =: "U",
755 "V" =: hex"15";
756
757 ligtable "v" : % downward gluon
758 "A" =: "V",
759 "V" =: hex"16";
760
761 ligtable "w" : % fermion loop, small, upside-down
762 "A" =: "W",
763 "V" =: oct"027";
764
765 ligtable oct"175" : % vertical gluon
766 "A" =: oct"135",
767 "V" =: oct"035";
768
769 ligtable "y" : % gluon half-loop
770 "A" =: "Y",
771 "V" =: hex"19",
772 "B" =: hex"7B", % large
773 "S" =: hex"7C", % small
774 "u" =: "z"; % ...upside down
775
776 ligtable hex"7B" : % large gluon half loop
777 "A" =: hex"5B",
778 "V" =: hex"1B";
779
780 ligtable hex"7C" : % small gluon half loop
781 "A" =: hex"5C",
782 "V" =: hex"1C";
783
784 ligtable "z" : % upside-down gluon loop
785 "A" =: "Z",
786 "V" =: hex"1A";
787
788 ligtable "h" : % ghost
789 "A" =: "H",
790 "V" =: hex"08",
791 "u" =: "i", % upward
792 "d" =: "j", % downward
793 "s" =: hex"22", % short
794 "l" =: hex"7E"; % ghost loop
795
796 ligtable hex"7E" : % ghost loop
797 "A" =: hex"5E", % r-arrowed
798 "V" =: hex"1E", % l-arrowed
799 "u" =: hex"7F"; % upside down
800
801 ligtable hex"7F" : % ghost loop inverted
802 "A" =: hex"5F", % r-arrowed
803 "V" =: hex"1F"; % l-arrowed
804
805 ligtable "i" : % upward ghost
806 "A" =: "I",
807 "V" =: hex"09";
808
809 ligtable "j" : % downward ghost
810 "A" =: "J",
811 "V" =: hex"0A";