home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d568 / schoonschip.lha / Schoonschip / SDocsAMI.LZH / SDocsAMI / Schipman.e < prev    next >
Text File  |  1991-06-14  |  213KB  |  5,522 lines

  1.  
  2.  
  3.             SCHOONSCHIP (*)
  4.          A Program For Symbol Handling.
  5.             M. Veltman
  6.  
  7.      0. DIFFERENCES WITH OLDER VERSIONS
  8.  
  9.      1. INTRODUCTION
  10.  
  11.      2. BASICS
  12.  
  13.      3. INPUT FACILITIES
  14.  
  15.      4. TYPE DEFINITION
  16.  
  17.      5. X, D AND T EXPRESSIONS
  18.  
  19.      6. FILES
  20.  
  21.      7. PRINT OPTIONS
  22.  
  23.      8. END LINE OPTIONS
  24.  
  25.      9. SUBSTITUTIONS
  26.  
  27.     10. PATTERNS
  28.  
  29.     11. CONDITIONAL SUBSTITUTIONS
  30.  
  31.     12. COMMANDS
  32.  
  33.     13. PARTICLE PHYSICS
  34.  
  35.     14. INTERNAL PROCEDURES
  36.  
  37.     15. CHARACTER SUMMATION
  38.  
  39.     16. GAMMA ALGEBRA
  40.  
  41.     17. R-INPUT
  42.  
  43.     18. STATEMENTS. CONDITIONAL INPUT READING.
  44.  
  45.     19. LARGE PROBLEM HANDLING
  46.  
  47.     20. FILE HANDLING COMMANDS
  48.  
  49.     21. SUMMARY
  50.  
  51.     APPENDIX A. COMMAND LINE OPTIONS
  52.  
  53.     APPENDIX B. COMPATIBILITY
  54.  
  55. First version: January 1964.
  56. Current version: June 1991.
  57.  
  58. *) Copyright (C) 1991 by Martinus J. G. Veltman.  This version of the
  59. Schoonschip manual may be freely copied on a not-for-profit basis.  All rights
  60. to other versions of the Schoonschip manual are reserved.
  61.  
  62. A more extensive, printed manual and updated information are available from:
  63.  
  64. David N. Williams
  65. 1238 Westport
  66. Ann Arbor, MI 48103
  67.  
  68. Email: 75706.3124@CompuServe.com
  69.  
  70.  
  71. 0. DIFFERENCES WITH OLDER VERSIONS.
  72.  
  73. This version of Schoonschip (Jan 1, 1989) differs considerably from the
  74. previous versions. Every effort has been made to avoid changing code
  75. that has been shown to work correctly, and also upward compatibility
  76. was considered very important. To be able to run known problems and to
  77. compare the results is an invaluable and very unique part of Schoonschip.
  78. In this way 25 years of experience are still very much part of this
  79. version.
  80.  
  81. Modern users tackle ever larger problems, and improvement of Schoonschip
  82. with respect to handling large problems was a high priority. There are
  83. several aspects to this situation. First, new methods to present and
  84. formulate a problem had to be considered. This has led to the introduction
  85. of a new concept, namely character summation. This allows very efficient
  86. generation of diagrams. As yet the main application seems to be high energy
  87. physics, but the concept appears to be of larger generality. More specific
  88. to high energy physics is gamma matrix algebra. Efficient methods to deal
  89. with gamma matrices in other then four dimensions have been incorporated.
  90. This allows application of dimensional regularization to problems with
  91. fermions.
  92.  
  93. Another important tool in handling large problems is the Freeze command.
  94. It existed in CDC versions of Schoonschip, and has now been implemented
  95. also in this version.
  96.  
  97. Last but not least the output sorting methods of Schoonschip have been
  98. vastly improved. The previous versions tended to generate very large
  99. disk files and consequently were quite time consuming. This seriously
  100. limited the magnitude of the problems that could be treated, especially
  101. on relatively small systems (PC's). It must be well understood: in
  102. principle there is no reason why Schoonschip should not run equally well
  103. on PC's as compared to mainframes. Of course, there is a difference
  104. due to the different CPU speeds, but that is often more then compensated
  105. by the fact that mainframes usually must deal with a multitude of users. And
  106. disk file handling is not necessarily slower on a PC. The main difference
  107. is that mainframes have essentially infinite disk space, but that advantage
  108. is rapidly disappearing as larger and larger disk systems become available
  109. to PC users. Right now the standard is about 20 Mb, but there are already
  110. very good and inexpensive systems with capacities in the 100 Mb range.
  111.  
  112. The new sorting methods give an improvement of one or two orders of
  113. magnitude in time and disk space for large problems (producing more then
  114. 1 Mb of disk files). Of course, 'reasonable' default parameters are
  115. build in, but for truly large problems things must be tailored to the
  116. specifics of the problem. It is suggested that the section on large
  117. files is read at least once, such as to give an idea of the situation;
  118. if the need arises one can go back and get the details.
  119.  
  120. Several new statements and commands have been implemented. Some of them
  121. replace older, more cumbersome forms. New statements:
  122.  
  123. Anti
  124. Beep
  125. Directory
  126. Digits
  127. Dostop
  128. Dryrun
  129. External
  130. Fortran
  131. Freeze
  132. Large
  133. Maximum
  134. Overflow
  135. Precision
  136. Progress
  137. Rationalize
  138. Round
  139. Silence
  140. Showl
  141. Synonym
  142. Nshow
  143. Traditional
  144.  
  145. Conditional input reading statements:
  146.  
  147. Goto
  148. Gotoif
  149. Gotoifn
  150.  
  151. New commands:
  152.  
  153. Absol
  154. Anti
  155. All
  156. Beep
  157. Dostop
  158. Expand
  159. Extern
  160. Gammas (=old Trick,Trace)
  161. Iall
  162. Ndotpr
  163. Order
  164. Print
  165. Stats
  166.  
  167. Slight modification:
  168.  
  169. Integ on CDC versions of Schoonschip truncated the numbers. Later versions
  170. rounded to nearest integer. The truncation has been re-instated, but
  171. the statement 'Round on' may be used to obtain rounding to nearest integer.
  172.  
  173. B list may now have vector names. All dot-products or vector components
  174.   relating to that vector are factored out.
  175.   In addition the Exclusive option is now available. If the first
  176.   argument in the B-list is the keyword Excl then the subsequent
  177.   names will be the only quantities that will be factored out. In this
  178.   case function names may appear in this B-list. A function not
  179.   mentioned in the list will not be factored out. Thus then functions
  180.   may appear inside the brackets in the output.
  181.   This Excl option has been provided in connection with the Freeze
  182.   command. Here a word of caution: avoid situations where a twice
  183.   occurring index becomes 'split', i.e. one appears outside and one
  184.   appears inside the brackets. In that case be sure that such an index
  185.   is not a created index.
  186.   A word of caution: using the Excl option functions may become reordered.
  187.  
  188. A D function with or without dummy arguments may now appear in the left hand
  189.   side of a substitution, although not combined with other factors.
  190.  
  191. The Count command has been slightly enhanced, allowing multiple counts with
  192. one command.
  193.  
  194. The Symme and Asymm commands have been slightly enhanced, allowing handling
  195. of groups of arguments.
  196.  
  197. The Spin command allows now vectors as arguments to identify spinors.
  198.  
  199. The substitution types
  200.  
  201. Id,Funct,a=...
  202. Id,Funct,p(mu~)=... 
  203.  
  204. may now have function names inbetween the keyword and the last argument.
  205. Then only those functions are considered. Example:
  206.  
  207. Id,Funct,Epf,p(mu~) = k(mu) + q(mu)
  208.  
  209.  
  210. All statements are summarized in the section on Statements. Commands are
  211. discussed in the section on Commands.
  212.  
  213. New notation:
  214.  
  215. Long names containing special symbols such as +, - etc may now be used for
  216. algebraic symbols. They must be enclosed in square brackets. Example:
  217. [a+2/3*b] is seen as a symbol with that name.
  218.  
  219. Entirely rewritten: section on Conditional substitutions.
  220.  
  221. new sections are:
  222.  Character summation
  223.  Gamma algebra
  224.  R-input
  225.  Statements. Conditional input reading.
  226.  Large problem handling
  227.  File handling commands
  228.  
  229. It is suggested that one reads (or tries to read) them at least once, to
  230. have some idea as to what is available.
  231.  
  232. Schoonschip has not been known to be so-called "user friendly", whatever
  233. that may mean. This concerns error reporting as well as syntax. Some, but not
  234. much has been done on error reporting. While important, and this is well
  235. recognized, it is not considered the highest priority. Concerning the syntax,
  236. a number of improvements has been made.
  237.  
  238. There are a few minor incompatibilities with older versions. Square brackets
  239. [] now have a new function, and cannot be used any more as regular brackets.
  240. The statements DELETE (for deleting blocks) and Printer (to request for
  241. line printer type output, i.e. longer line length) have been replaced by
  242. Bdelete and Lprinter. This because now no difference is made been between
  243. lower and upper case symbols for commands etc. Also, it has been attempted
  244. to make the commands recognizable by the first few (four at most) characters.
  245.  
  246. The condition code system has been thoroughly reviewed. Although quite
  247. powerful it was too cumbersome to handle. Instead there is now a system
  248. employing familiar concepts: IF, AND, OR, NOT, ELSE and ENDIF.
  249.  
  250. The handling of exponents has been modified. Before the addition was circular
  251. through 128 to -128. Now this is no more true. The result will be an overflow
  252. error message that can however be switched off (Overflow off statement).
  253.  
  254. Further there is a new, alternative, notation for gamma matrices.
  255.  
  256.  
  257. Acknowlegements. Thanks are due to Drs. E. Remiddi and J. Vermaseren for
  258. inspiring several of the improvements incorporated in this (and older !)
  259. Schoonschip versions.
  260.  
  261.  
  262. 1. INTRODUCTION.
  263.  
  264. Schoonschip is a program written in assembler language intended to help
  265. handling large algebraic expressions. Very little is build-in in the sense of
  266. function properties, or integral tables etc, but it offers many facilities to
  267. operate on expressions. Thus if the user knows the type of integrands that can
  268. occur it is easy to let the program do the actual integrations. Schoonschip
  269. never tries to think for the user, it just makes it possible to use the
  270. computer as a tool when doing algebra.
  271.  
  272. There are provisions for building up a library of Schoonschip statements.
  273. Blocks of statements, performing well defined operations (such as for example
  274. differentiation or integration) may be defined, stored, and when needed
  275. recalled with a single line. In this way a user can build up to his own needs.
  276.  
  277. In principle the system works as follows. An expression is given to Schoonschip
  278. and subsequently one gives instructions as to what to do. In first instance
  279. Schoonschip works out the given expression term by term, and next each term
  280. passes a series of levels. At each level the user has an opportunity to work on
  281. that term. The result is collected in an output storage area and identical
  282. terms are added. The result can be handled in a variety of ways: it can be
  283. returned to the input for a new round, or it can be written to disk for later
  284. use, etc. Of course, the result is normally printed as well.
  285.  
  286. This manual explains the available features by way of examples. Some knowledge
  287. of the way that Schoonschip works is of advantage, and at various points some
  288. details will be given. The manual is meant to be read having at the same type
  289. the file with examples at hand. This file is supposedly named Examples.e. To
  290. see then how example 5 works one types
  291.  
  292. Schip +5 Examples.e
  293.  
  294. If the output is larger than one screenful one may also specify an output file,
  295. either by the >fnam option or also by simply giving the name as second
  296. argument:
  297.  
  298. Schip +5 Examples.e outp
  299.  
  300. The file outp can then afterwards be inspected.
  301. Below the input text of these examples is reproduced also.
  302.  
  303. 2. BASICS.
  304.  
  305. The first example shows what is meant by working out the initial expression.
  306. The expression must be given on a line wich has a Z in the first column. The
  307. general convention is that a line with a blank or tab in column one is a
  308. continuation of the previous line.
  309.  
  310. Now the first example:
  311.  
  312. Example 1.
  313.  
  314. Z XX = (a + b)^2
  315.  
  316. The notation ^ implies exponentiation. Also ** (as in Fortran) may be used. XX
  317. is an invented name that identifies the expression if it is to be re-used, or
  318. written to disk etc. It may be part of another expression in later problems.
  319. All that Schoonschip does now is to work this out to a series of terms: a^2,
  320. a*b, b*a and b^2. Thus if nothing else is done this is what will go to the
  321. output. For algebraic variables (as a and b are taken to be by default)
  322. commutation is assumed, thus a*b is recognized to be the same as b*a. The way
  323. Schoonschip handles this is by rearranging every term, setting symbols in an
  324. internally well defined order. For quantities of the same kind this is
  325. generally the same order as that in which they appear in the input.
  326.  
  327. At this point no further instructions are given, and the program may proceed to
  328. do this work. To signal that all has been said a line with an * in column one
  329. must be given. The further content of the line instructs Schoonschip what to do
  330. next after this task has been performed. Right now the idea is to go on to
  331. another example, and the word 'begin' leads to this action. After this a, b and
  332. XX are lost.
  333.  
  334. *begin
  335.  
  336. For massive expressions it is often desirable to group terms in the output. For
  337. instance, they may be grouped with respect to the variable a and the exponent
  338. whith which it may occur. The way to do this is to give a list of quantities to
  339. be factored out on a line with as first character a B. At most 130 quantities
  340. allowed.
  341.  
  342. B a
  343.  
  344. Z XX= (a + b)^2
  345.  
  346. *end
  347.  
  348. This is about all control that the user has on the output format. Some
  349. additional facilities concern the way numbers are printed. By default
  350. Schoonschip tries to write every number as a rational fraction, but this is not
  351. always possible. Internally all numbers are represented as floating point
  352. numbers, with a 14 bit exponent and a 96 bit fraction. When printing
  353. Schoonschip tries to convert to a rational, using 70 bits as input. Then the
  354. rational is reconverted to a floating point number, and agreement to 84 bits is
  355. required. If that works the number is printed as a rational, otherwise as an
  356. integer or floating point number depending on the number. If printing as a
  357. floating point number the user has control over the number of decimal digits to
  358. be printed. Also the rationalization procedure can be influenced. This is done
  359. by means one or more of three statements:
  360.  
  361. Precision #
  362. Rationalization #
  363. Digits #
  364.  
  365. As often in the Schoonschip syntax only the first three (if no confusion
  366. possible two) characters of these statements are significant, and they may be
  367. in upper or lower case. Thus
  368.  
  369. PRE #
  370.  
  371. is acceptable instead of Precision.
  372.  
  373. The # represent numbers specifying decimal digits. If none is given the default
  374. is used. The number following Digits specifies the number of digits to be
  375. printed for floating point numbers. Default is 5. The number following
  376. Rationalization specifies how many decimal digits should be used (sum of
  377. numerator plus denominator digits) when attempting rationalization. Default is
  378. 22. If 0 is specified no rationalization attempt is made.  For other then the
  379. default value no check on the remaining digits is done. This may be used to
  380. find a rational approximation for some number.
  381.  
  382. Numbers are always a problem in symbol handling programs, and the approach
  383. chosen in Schoonschip has come out of many years of trying various
  384. possibilities. As already noted above, every number is put in a floating point
  385. format with a fraction of about 29 decimal digits (96 bits) and 14 bit
  386. exponent. In the course of the calculation one will loose precision and stray
  387. bits will accumulate in the least significant part of the number. Consequently
  388. cancellations will in general not be exact. Schoonschip assumes that two
  389. quantities cancel if 25 decimal digits (80 bits) of the coefficients cancel.
  390. This number can be changed by means of the Precision statement where # is the
  391. desired number of decimal digits. To be precise:  1.E15 + 1 - 1.E15  is 0 if 15
  392. is specified, and is 1 if 16 is given.
  393.  
  394. The above makes clear to what extend numbers are handled precisely. In general
  395. rationals will be converted properly if the sum of the decimal digits in
  396. numerator and denominator is less than 21.
  397.  
  398. A number may be given in various ways:
  399.  
  400. - without exponent or fraction:  1230, 17893
  401. - with fraction: 1.978, 33.127
  402. - with (signed) exponent: 12E13, 178E-17
  403. - with (signed) exponent and fraction: 23.47E15, 18.49E-200
  404. - in hexadecimal notation: 0x10ABC, 0xA4FFF
  405.  
  406. The latter two are the same as 68284 and 675839. The hexadecimal notation
  407. is actually needed in certain statements (the Directory statement).
  408.  
  409. Schoonschip will work out multiplications and divisions of numbers directly,
  410. thus 2/3 is immediately converted to 0.6666666...
  411.  
  412. The effect of the above statements as well as some other features are shown in
  413. the following example. An expression is given, printed, and re-directed to the
  414. input, and new instructions are given. Normally, when re-routing an expression
  415. to the input no output is printed, and one must explicitly asked for that by
  416. means of a line having a P in column one. Schoonschip reproduces such a line
  417. with an additional > sign. The re-direction is by means of the word 'yep' on
  418. the * line. Also the way comments may be given is illustrated. A ! implies
  419. simply end of line, and has no further effect. Also it should be noted that
  420. blanks and tabs are generally ignored (except for their function as first
  421. column character to indicate continuation).
  422.  
  423. Example 2.
  424.  
  425. P output    !Only the first two characters of 'output' are significant.
  426.  
  427. Digits 3
  428. Rationalization 3        ! 0 leads to no rationalization attempt.
  429.  
  430. Z XX=3.14 + 1/3*a1 + 7.1357689E20*a2    !E20 or E+20 implies 10^20.
  431.  
  432. *yep
  433.  
  434. Digits            !This restores to the default option, 5 digits.
  435. Rationalization        !Default: 22 digits, with check.
  436.  
  437. *end
  438.  
  439. The *end line implies termination after the problem has been worked out. As
  440. with most Schoonschip input, the * lines are format free, except that the *
  441. must be in column 1. But one may write for example * en  d .
  442.  
  443. 3. INPUT FACILITIES.
  444.  
  445. While little can be done to the output, there is great flexibility concerning
  446. input. Two basic features are available: BLOCK's and DO loops. A block is a set
  447. of lines that may recur with minor variations and that can be called with a
  448. single line. The structure is very much as macro's in assemblers. The DO-loops
  449. are similar to Fortran do-loops.
  450.  
  451. A block is delimited by two lines. The first line contains the word BLOCK in
  452. columns 1-5 followed by a name followed by arguments separa- ted by comma's and
  453. enclosed in curly brackets. The last line must contain the word ENDBLOCK in
  454. columns 1-8. When calling the block arguments are substituted, provided they
  455. were enclosed in quotation marks in the block definition. A block name may have
  456. 1-6 characters.
  457.  
  458. Example 3.
  459.  
  460. BLOCK text{xx,yy}
  461. C This argument is substituted in a call: 'xx'.
  462.   This not: xx.
  463.   Arguments can be glued together: 'xx''yy'.
  464. ENDBLOCK
  465.  
  466.   To call a block simply give the name with the arguments to be
  467. substituted. Be sure to start in column one, and to enclose arguments
  468. in curly brackets. An example of a call:
  469.  
  470. text{yes,sir}
  471.  
  472. A block remains known over *begin lines. It can be deleted by means of a line
  473. having the word BDELETE (four, if no confusion possible three characters
  474. significant, lower case accepted also) starting in column 1 followed by the
  475. name of the block to be deleted.
  476.  
  477. BDELETE text
  478.  
  479. Blocks are stored on disk in a file called tape9, and recalled as needed.
  480. Schoonschip keeps a list of names in memory. There is a simple way to delete
  481. entire lines when calling a block. A line with the character ~ in column one is
  482. totally ignored by Schoonschip, not even printed. Suppose we want in one case
  483. lines 1 and 2 of a block, and line 3 in another case. Example:
  484.  
  485. BLOCK lines{A,B}
  486. 'A'C line 1
  487. 'A'  line 2
  488. 'B'  line 3
  489. ENDBLOCK
  490.  
  491. Now call the blocks and use ~ to delete lines:
  492.  
  493. lines{,~}
  494.  
  495. lines{~,} 
  496.  
  497. Note that an empty argument leads to an empty substitution. Actually if the
  498. final argument(s) are empty it is not even necessary to type comma's. Thus 
  499. lines{~}  gives the same as the last example.
  500.  
  501. It may happen that one wants to call a block with some of the arguments
  502. containing a comma. In that case enclose that argument in curly brackets {}.
  503. When substituting Schoonschip peels away the outer layer of curly brackets. For
  504. example, text{{a, b}, and c} leads to:
  505.  
  506. C This argument is substituted in a call: a, b.
  507.   This not: xx.
  508.   Arguments can be glued together: a, b and c.
  509.  
  510. DO-loops are also delimited by two lines. The first line must have DO in
  511. columns 1-2 followed by  name=#,#,# . The word 'name' may have (as is generally
  512. the case with names in Schoonschip) up to 6 characters. The three numbers
  513. represent a range of numbers to be substituted for 'name' in the rest of the DO
  514. loop. The first two specify the range, the last the increment. The DO loop is
  515. terminated by a line containing the word ENDDO in columns 1-5. As in the case
  516. of blocks substitution is done if 'name' occurs enclosed in quotation marks:
  517.  
  518. DO var=1,7,2
  519. P input            !Normally only the first DO round is printed.
  520. C value of var: 'var'
  521. ENDDO
  522.  
  523. The numbers may also take negative values. Schoonschip handles this by
  524. attaching the prefix % to the number, which is interpreted as an intrinsic
  525. minus sign when encountered in front of a number. If it occurs elsewhere this %
  526. sign is part of whatever it occurs with.
  527.  
  528.  
  529. DO var=-1,1        !The third number is 1 by default.
  530. P input
  531. C value of var: 'var'.
  532. C This may be part of a name, for example XX'var', or an index,
  533.   for example YY(3+'var'). In the last case Schoonschip will interpret
  534.   the % sign as minus and correctly work out the number.
  535. ENDDO
  536.  
  537. The exit of a DO-loop may be forced prematurely at execution time, by means
  538. of the command Dostop (see substitutions and commands). This is a somewhat
  539. tricky affair, due to the fact that DO-loop expansion is strictly on the
  540. input level, while the Dostop command functions during execution, i.e. after
  541. input has been read up to a line with an * in column 1. Thus a Dostop command
  542. will have effect only after such a line. Therefore, normally, a forced exit
  543. should be effected only for DO-loops that have a line with an * as the last
  544. statement.
  545.  
  546. There exists also a Dostop statement which is effective just before execution.
  547. It serves to preset the Dostop flag, and at execution time the thus forced
  548. DO-exit may be nullified or set. Again, a *-line should be the last before the
  549. ENDDO. The syntax of this statement is:
  550.  
  551. Dostop on
  552.  
  553. or
  554.  
  555. Dostop off
  556.  
  557. This sets or clears the forced DO-loop exit flag. Both Dostop statement and
  558. command should normally occur within the same DO-loop. The statement should
  559. preferably occur just before the first substitution or command of the set in
  560. which the Dostop command occurs.
  561.  
  562. Blocks and DO loops may be nested, up to 10 levels deep. As is evident from the
  563. above, all this is strictly on the input level, and just pure character
  564. substitution (apart from the % sign). It is up to the user to make sure that
  565. sensible Schoonschip input results. Use the statements  P input  and  P ninput 
  566. to see or to suppress the actually generated text.
  567.  
  568. Since the same blocks may occur in many different problems it is useful to have
  569. the blocks stored in some file, and to let Schoonschip read them in before
  570. starting on some problem. This is possible, and is in fact not restricted to
  571. blocks. A line with the word  Read  in columns 1-4 followed by a file name
  572. causes Schoonschip to open that file and read it as normal input. As soon as a
  573. line with the word End in columns 1-3 is encountered Schoonschip switches back
  574. to the normal input file, specified in the call statement. Other files may be
  575. read subsequently, Schoonschip reads all blocks and whatever else, simply
  576. switching input. All blocks read are stored in tape9 and may be used in all
  577. subsequent problems. Restriction: a Read within a Read file is not allowed.
  578.  
  579. 4. TYPE DEFINITION.
  580.  
  581. In algebraic expressions different types of symbols may occur. The user must
  582. specify beforehand these symbols. The following types may occur: Algebraic
  583. symbols, Indices, Vectors, Functions and Expressions. These are defined on
  584. lines having A I V F or X in column one. Actually there are additional types of
  585. expressions, characterized by D or T in column 1, but we will discuss them
  586. later. Names may have up to six characters, both upper and lower case and
  587. numers allowed, although a name should be distinguishable from a number.
  588. Also the character _ (underscore) may be used in names. If it is not the
  589. first it is not included in the count. The underscore has a function in
  590. certain contexts, to be explained later.
  591.  
  592. A limited facility is present to handle large names. Sometimes large names
  593. containing other then the characters mentioned may be very useful by way of
  594. mnemonics. Such names can be used, but they must be enclosed in square
  595. brackets. They may contain just about any character except control characters
  596. (such as tab or linefeed) or square brackets themselves. Futhermore they can
  597. only be used for algebraic symbols.
  598.  
  599. Examples:
  600.  
  601. Abcd  abc_def 12A3  12_ab f1  f2  [a + b/3]
  602.  
  603. Illegal names:
  604.  
  605. Abcdefg  12E3
  606.  
  607. The last name would actually be understood as a number: 12 * 10^3.
  608.  
  609.  
  610. Generally, symbols are simple commuting variables that may have an exponent.
  611. Such exponents must be short integers, that is integers in the range -128 to
  612. +127 inclusive. The extreme values are taken in case of overflow, if error
  613. trapping on that has been suppressed with the Overflow statement.
  614.  
  615. Indices may occur as algebraic variables, but are really meant to be vector
  616. indices, or function arguments.
  617.  
  618. Functions are non-commuting quantities, with or without arguments. Of course,
  619. if they are commuting that can be handled too. But if they represent matrices
  620. (with or without indices as arguments) then they must be considered as
  621. non-commuting. In short, functions may be used to represent anything that is
  622. not any of the other types of symbols. Whatever calculational rules they obey
  623. must be given by the user.
  624.  
  625. Vectors are handled according to the standard rules of vector algebra. To
  626. achieve this dot-products may be formed, denoted by a capital D inbetween two
  627. vector names. Thus, if p and q are vectors then pDq denotes the dot-product
  628. between p and q. ASchoonschip follows the usual summation convention that twice
  629. occuring indices imply summation: p(i1)*p(i1) is interpreted by Schoonschip as
  630. pDq. Also the Kronecker delta is available: it is the special function D which
  631. is build-in. Here an example showing various rules:
  632.  
  633. Example 4.
  634.  
  635. A a1,a2,a3        !Algebraic symbol list.
  636. F f1,f2,f3        !Functions.
  637. I mu,nu            !Indices.
  638. V p,q,k            !Vectors.
  639.  
  640. Z XX = p(mu)*{ a3^-20*a1*q(mu) + a2*a1^7*D(mu,nu)*k(nu)
  641.  
  642.     + a3*f2(mu,k,q)*f1}        !Note the use of {}.
  643.  
  644.     + q(mu)*{a3*a2*a1 + f3*f2*f1}
  645.  
  646. *end
  647.  
  648. Note that functions are always treated as if they are on the B list. Also
  649. vectors not part of a dotproduct are factorized. Note also the re-arrangement
  650. of the symbols a1, a2 and a3, which is not done for functions such as f1, f2
  651. and f3. Note also that Schoonschip pays no attention to the fact that f2
  652. occurred both with and without arguments. As shown curly brackets may be used
  653. instead of the usual brackets, but they must be paired. Also the user must make
  654. sure that they cannot be confused with BLOCK definitions and calls. If some
  655. special character such as * + , etc occurs in front of the { no problem arises.
  656.  
  657. Functions and vectors may not have exponents. For functions this a mild
  658. restriction, because one can always add on an argument, and consider that to
  659. be the exponent.
  660.  
  661. Vectors may have a numerical arguments, for example p(3). This is taken to mean
  662. the third component of p, but only in some really formal sense, and Schoonschip
  663. has no objections against for example p(-3). The only restriction is that the
  664. number must be a short-short number, i.e. less then 32. These numbers are
  665. treated modulo 32, ranging from 0 to 31. Thus p(-3) becomes p(29). In the
  666. following something like p(3) will be called a vector component.  If an index
  667. occurs all by itself, not as argument of a vector or function, it is treated as
  668. an algebraic symbol. Thus one could have mu^3. Also vector components and
  669. dot-products may have an exponent.
  670.  
  671. Like Fortran, Schoonschip has default assignments for names not mentioned in
  672. any list. Things are pretty obvious in a case such as ff(a1,a2); but it is
  673. ambigous for a case like p(k). Is p a function or a vector? Again, like in
  674. Fortran, the default assignment for xx in a case like f(a1,xx) is an index if
  675. the first character of xx is in the range I-N or i-n, and else an algebraic
  676. symbol. It is always possible to see what Schoonschip guessed using the  P list
  677.  command. This causes a print-out of all the lists of all quantities in a given
  678. problem, but more about these commands later.
  679.  
  680. The rules for algebraic symbols are the usual ones. They are supposed to
  681. commute with themselves and everything else, including functions. They may
  682. appear with or without an exponent (must be short number), and may be preceeded
  683. by a /. This simply implies a reversal of sign of the exponent. Thus  a/b^3 =
  684. a*b^-3. The exponent may also be an expression in brackets, provided this
  685. expression, when encountered while working out the problem evaluates to a
  686. number. This number is then truncated and rounded to the nearest short integer.
  687. Thus  b^(2-2/3) becomes b^1 = b.
  688.  
  689. Overflow occurs ff the exponent of an algebraic expression exceeds 127 or is
  690. less than -128. In that case Schoonschip generates en error message. This may
  691. be suppressed with the Overflow statement:
  692.  
  693. Overflow off
  694.  
  695. In that case Schoonschip creates in the case of overflow (or underflow) the
  696. exponent 127 (or -128) representing infinity. The error trapping can be turned
  697. on again with the statement:
  698.  
  699. Overflow on
  700.  
  701. The Overflow statement may be given in the *fix section and the option given
  702. is then the default.
  703.  
  704. The rules for dot-products, vector components and indices not vector or
  705. function argument are precisely those of algebraic symbols.
  706.  
  707. The lists are also used to assign some further properties to the various
  708. objects. If complex conjugation occurs in a problem then the reality properties
  709. must be known. An algebraic symbol may be real (default), imaginary or complex.
  710. If it is complex then its complex conjugate must be designated. All this is
  711. done in the A-list. If a symbol in the A-list is followed by =i it is taken to
  712. be imaginary and the conjugate of the symbol is minus that symbol. A symbol may
  713. also be explicitly designated to be real by the assignment =r. If the symbol is
  714. followed by =c it is assumed that this is a complex symbol, and Schoonschip
  715. creates a new name, by appending C (capital C), and places this directly after
  716. this symbol:
  717.  
  718. A a1,a2=i,a3=c
  719.  
  720. implies a1 is real, a2 is imaginary (Conjg(a2)=-a2), a3 is complex, i.e.
  721. Conjg(a3)=a3C and Conjg(a3C)=a3. The symbol a3C is created by Schoonschip.
  722. If so desired it may be renamed by means of the statement
  723.  
  724. Oldnew a2C=xxx
  725.  
  726. where xxx stands for the new name. The Oldnew statement may actually be used to
  727. change any existing name, including the build-in names.
  728.  
  729. Indices, vector components and dot-products are taken to be real. Functions may
  730. also be real, imaginary or complex, and in addition "undefined", which will be
  731. explained below.
  732.  
  733. Except for =c the definitions can be overwritten, the last definition holds.
  734. This is useful with respect to build-in quantities of which one wishes to
  735. change the reality properties. Overriding with =c leads to the fact that the
  736. following symbol in the list is considered as the conjugate, which is fine if
  737. it was not defined something else before. On the other hand, redefining an =c
  738. assignment leaves its conjugate symbol as real, so that must then be redefined
  739. explicitly also if not real.
  740.  
  741. In addition one may assign a number to an algebraic symbol. This number must be
  742. between -32 and +32, and its function is to facilitate working with power
  743. series. If one assigns for example the number 4 to a symbol then it is assumed
  744. that powers of this symbol of 4 or higher can be ignored, and if a term
  745. containing the symbol to such a power is seen it is immediately set to zero.
  746. This is extremely useful if not indispensable when substituting series into
  747. series. Somewhat similar one may assign z to a vector; if then that vector
  748. occurs in a dot-product, with an index, or as vector-component it is also
  749. immediately set to zero. Such facilities are very important when dealing with
  750. large expressions. Function arguments are not considered with respect to zero
  751. setting. This is somewhat ambiguous for a case such as p(mu)*f1(...,mu,..) =
  752. f1(...,p,..); this ambiguity is to be resolved by the user, and seems not to
  753. offer any difficulties.
  754.  
  755. Warning. Assigning a number to a symbol in order to speed up things is not to
  756. be used if both negative and positive powers appear. Something like a^3 may
  757. be deleted before being multiplied with, say, a^-2 in case the number 2 was
  758. assigned to a.
  759.  
  760. Example 5.
  761.  
  762. A a1,a2=i,a3=c,a4=c,a5=i=3
  763. V p,q=z,k
  764.  
  765. Z XX = Conjg(a1 + a2 + a3 + a4 + a5)
  766. Z YY = Conjg(a3C + a4C)
  767. Z ZZ = (a1 + a5)^5
  768. Z AA = p(mu)*{p(mu) + q(mu)} + D(mu,3)*{p(mu) + q(mu)} + pDk 
  769.  
  770. Oldnew a4C=b4,k=K
  771.  
  772. *end
  773.  
  774. Note how a5^3 and higher has been eliminated. Note also that the vector k
  775. is replaced by K. The notation D(mu,3) is explained below.
  776.  
  777. The vector algebra rules are:
  778.     p(mu)*q(mu) = pDq
  779.     p(mu)*D(mu,nu)=p(nu)
  780.     D(mu,nu)*D(nu,la) = D(mu,la)
  781.     D(mu,mu) = n
  782. In the above mu, nu and la are supposedly indices defined in an I-list. The
  783. quantity n is the range of the indices, and may be a number, but also can
  784. be symbolic. Thus when working in 3-dimensional space n would be 3, in four
  785. dimensions n = 4. The default value is 4, since 1905. The way to specify
  786. this value is in the I-list. One writes the number behind the index:
  787.  
  788. I mu=3,nu=3,la=3
  789.  
  790. Obviously one is supposed not to mix indices of different range in a
  791. D-function. Schoonschip makes no check for that. If Schoonschip encounters
  792. D(mu,mu) the number found in the I-list is substituted. Also a symbol may be
  793. used, but it is restricted by the requirement that it may be only one character
  794. in length. When encounterd in an I list Schoonschip will immediately enter that
  795. symbol in the algebraic symbol list, and in addition the character followed by
  796. an underscore is entered.
  797.  
  798. I mu=N,nu=N,la=N
  799.  
  800. If Schoonschip now encounters for example  D(mu,mu)*D(la,la)  the result
  801. is N^2. The names N and N_ are entered in the symbol table. The name N_ is
  802. used extensively in Gamma algebra involving indices of range N.
  803.  
  804. As an extension of these well-known rules there is the additional convention
  805. that numbers and vectors may occur whenever indices may occur. Thus,
  806.  
  807.     p(q)  D(p,q)  D(p,3)  D(3,4)
  808.  
  809. are perfectly legal and they are worked out as one might guess:
  810.  
  811.     p(q) = pDq,    D(p,q) = pDq,    D(p,3) = p(3),
  812.  
  813. and finally, if n1 and n2 are numbers then D(n1,n2) = 1  if n1 = n2, and = 0
  814. if n1 not equal to n2.
  815.  
  816. These conventions imply a rule for D, namely that D(-x,y)=-D(x,y).
  817.  
  818. If an index occurs as argument of a function the treatment is conventional:
  819.  
  820.     D(mu,nu)*f(...,nu,..) = f(...,mu,..)
  821.  
  822. where now mu may be index, vector or number, and the logical extension:
  823.  
  824.     p(mu)*f(...,nu,..) = f(...,p,..),
  825.  
  826. etc.
  827.  
  828. Despite this simplicity there is a complication that is really quite a
  829. a problem. Consider the following expression:
  830.  
  831.     D(mu,nu)*f1(...,mu,..)*f2(...,nu,..)
  832.  
  833. There are two possible answers, namely
  834.  
  835.     f1(...,mu,..)*f2(...,mu,..)
  836. and
  837.     f1(...,nu,..)*f2(...,nu,..)
  838.  
  839. The answer is clearly not well defined. They should in fact be identified.
  840. If two such terms arrive in the output Schoonschip should add them up, to
  841. obtain 2*f1(...)*f2(...).
  842.  
  843. The solution to this problem is a renaming of indices. Indices that are
  844. summation indices appearing twice, and whose name is not really relevant
  845. may be declared in a Sum list:
  846.  
  847. Sum mu,nu
  848.  
  849. Now Schoonschip will in both cases rename the indices in the same way, and
  850. the result is identical. The Sum list must occur after the I-list. It is
  851. best placed near the line with an * in the first column. The indices
  852. appearing in a Sum list must be defined before, but not in the *fix section
  853. (explained later). The following example illustrates the Sum command:
  854.  
  855. Example 6.
  856.  
  857. I mu,nu,la,ka
  858.  
  859. Z  XX = D(mu,nu)*f1(a1,a2,mu)*f2(a3,a4,nu)
  860.       + f1(a1,a2,mu)*f2(a3,a4,nu)*D(mu,nu)
  861.  
  862. Z  YY = D(la,ka)*f1(a1,a2,la)*f2(a3,a4,ka)
  863.       + f1(a1,a2,la)*f2(a3,a4,ka)*D(la,ka)
  864.  
  865. Sum,la,ka
  866.  
  867. *end
  868.  
  869. Note how the indices la and ka are replaced by the invented name Naa.
  870.  
  871. Now functions. Functions may have arguments, which must be single quantities
  872. separated by comma's. There is an extension involving tables, explained later.
  873. An expression in brackets is also allowed as argument. As a special facility
  874. functions may have characters as argument. Only single characters are legal,
  875. and they are recognized by preceeding them with a ". Thus f1("A,"s) is legal.
  876. See for example section 3.4, Compo for applications. Finally one may have
  877. essentially numerical expressions. An essentially numerical expression is an
  878. expression that works out to a number at execution time. It may include
  879. most anything that works out to a number; it may even contain previously
  880. evaluated expressions, but such expressions must be 'Keep' files, enclosed in
  881. brackets, and be just one number. The number obtained will be truncated
  882. and rounded to the nearest short number. A function containing an expression in
  883. brackets as argument must somehow be replaced before it reaches the output
  884. store, because that is how long Schoonschip retaines the definition of
  885. expressions in brackets. This means that there must be an equation (rather, a
  886. substitution as they will be called) leading to a replacement of such a
  887. function before the line with a * in column one. Example of a function with
  888. legal arguments:
  889.  
  890.   f1(a1,p,q(3),"X,pDq,17-22,(23*a5-b5),f2)
  891.  
  892. This function must be replaced before the * line because of last but one
  893. argument. This is no such problem in the following case:
  894.  
  895.   f2(a3,7-2,pDq,"A)
  896.  
  897. It is not legal to start with numbers exceeding 127 in absolute value
  898. occurring all by themselves:
  899.  
  900.   f1(1E25)
  901.  
  902. is illegal and produces an error. But f1(2.34) is accepted and changed into
  903. f1(2). And
  904.  
  905.   f1(1-7E25)
  906.  
  907. is accepted but gives an overflow message at execution time. This is pretty
  908. academic, and it is mentioned only for completeness. For a full understanding
  909. it is necessary to know what is really going on inside Schoonschip. Numbers in
  910. a function argument must be short integers (in the range -128, 127). Thus if
  911. numerical expressions occur as function arguments they must be "integerized".
  912. There is an operational symbol for that, namely Integ. At input time
  913. Schoonschip analyzes this situation only very superficially, and when in doubt
  914. adds the Integ operator to the argument. This happens as soon as a / or * etc
  915. is seen. Thus f1(1E25-1) is translated to f1(Integ(1E25-1)). When this
  916. expression is seen at execution time the argument is normally rounded and
  917. truncated. Overflow occurs if the number is outside the range mentioned.
  918. Integ will by default truncate the number towards 0, i.e. 1.9 becomes 1
  919. and -1.9 becomes -1. Optionally this may be changed with the Round
  920. statement:
  921.  
  922. Round on
  923.  
  924. In that case the number is rounded to the nearest integer (i.e. 1.9 becomes
  925. 2, -1.9 beomes -2). The statement Round off resets to the default option,
  926. truncate. In all cases the floating point number is first rounded in the very
  927. last 10 bits, to allow for stray bits.
  928.  
  929. The consequence of this is that composite non-numerical arguments are
  930. to be avoided, for example  f1(3-a)  gives an error report, not at input
  931. time, but when executing. As it may well happen that the symbol a is a
  932. dummy to be replaced by a number to be specified during the calculation
  933. it must be treated this way, and can not be flagged at input time. This will
  934. become clear later.
  935.  
  936. With respect to complex conjugation the following rules are build in. When
  937. conjugating a product of functions Schoonschip
  938.     reverses the order of all functions;
  939.     conjugates those quantities whose reality properties are known,
  940.         including the function arguments;
  941.     postpones complex conjugation of functions that have been classified
  942.         as u (for undefined) in the F-list.
  943. In this context an expression in brackets is considered a u-function.
  944.  
  945. Example 7.
  946.  
  947. A a1,a2=i,a3=c
  948. F f1,f2=i,f3=c,f4=u
  949.  
  950. Z xx=Conjg{ f1(a1,a2,a3)*f2(a1,a2,a3,f3)*f4(a1,a2,a3) }
  951.  
  952. *end
  953.  
  954. A particular problem arises if an expression in brackets occurs as argument of
  955. a non-u-function. In such cases the expressions in brackets are conjugated,
  956. that is the operator Conjg is attached to such expressions. Unfortunately that
  957. is not possible for other types of symbols, thus if a u-function occurs as
  958. argument of a non-u-function subject to complex conjugation then Schoonschip
  959. stops. In such cases the function of which the u-function is an argument must
  960. be made u-type too, which is after all quite logical. A u-function will
  961. generally be replaced by something else later on, and then the complex
  962. conjugation can be worked out.
  963.  
  964. A number of functions is build-in, including their reality properties, and here
  965. a particular problem arises. The Epf function (the totally anti-symmetric Weyl
  966. tensor) is real in 3 dimensions, where it represents the cross-product of
  967. vectors, but it must be considered as imaginary in 4-dimensional Minkowski
  968. space (because one of the components must be 4). Generally, the default
  969. situation in Schoonschip is 4 dimensions, and thus Epf is considered as
  970. imaginary. This may be changed by mentioning Epf in the F-list with the
  971. option =r.
  972.  
  973. X-expressions are always considered as undefined with respect to complex
  974. conjugation. They are discussed later.
  975.  
  976. The build-in quantities are:
  977.  
  978. Algebraic symbols: i=i.
  979.  
  980. This is the usual i, and the relation i^2=-1 is build in, although it is
  981. not always applied instanteneously.
  982.  
  983. Functions: D,Epf=i,G=i,Gi,G5=i,G6=c,G7,Ug=c,Ubg,
  984.        DD,DB,DT,DS,DX,DK,DP,DF=u and DC.
  985.  
  986. Special rules are build-in for these functions. Some of these functions
  987. must not be used, because they serve special purposes. The function DD is used
  988. internally for all kinds of things.
  989.  
  990. The function D is the Kronecker delta function and has been explained
  991. before. The Epf is the Weyl tensor, and it may have any number of arguments.
  992. If it has 6 arguments it is assumed to be this tensor in 6-dimensional
  993. space. A special command that reduces products of Epf to at most one Epf
  994. is build in. Furthermore it is assumed that Epf is totally anti-symmetric
  995. in all its arguments, and also it is supposed to commute with all other
  996. functions. Both the D and Epf function are taken to be linear in their
  997. arguments, that is D(-x,y)=D(x,-y)=-D(x,y) and similarly for Epf.
  998.  
  999. The functions G, Gi, G5, G6, G7, Ug and Ubg refer to gamma matrices and
  1000. Dirac-spinors as occurring in relativistic quantum-mechanics. They will
  1001. be discussed in a special section. Users not interested in that subject
  1002. may forget about them. Inside Schoonschip they account for about 8% of
  1003. the code, not worth removing.
  1004.  
  1005. The functions DB, DT, DP, DK and DC are numerical functions that are very
  1006. useful in many situations. DB with one argument is the factorial, and
  1007. DB with two arguments is the binomial function. The definition is:
  1008.  
  1009.     DB(n) = n!
  1010.     DB(n,m) = n! /{m!(n-m)!}
  1011.  
  1012. Internally the calculation of the binomial function is word (=16 bits) bound,
  1013. and fails for DB(19,m), m=8,9,... and higher up.
  1014.  
  1015. The function DT is the theta-function, and is very useful to switch terms on
  1016. and off. It may have any number of numerical arguments and is 1 if all
  1017. arguments are positive including zero, and else is zero:
  1018.  
  1019.     DT(n1,n2,...) = 0 if one or more n1 negative, else DT =1.
  1020.  
  1021. The function DP is the permutation symbol. The arguments are permuted till they
  1022. are in ascending order, and the value of DP is zero if two arguments are equal,
  1023. and else +1 or -1 depending on the sign of the permutation:
  1024.  
  1025.     DP(n1,n2,n3,...) = +1, -1 or 0. Zero if two numbers equal;
  1026.                     1 if permutation to smallest first
  1027.                     is even;
  1028.                     -1 if that permutation is odd.
  1029.  
  1030. For example, DP(2,1) = -1.
  1031.  
  1032. The function DK is something like a numerical Kronecker delta. It is 1 if
  1033. the arguments are equal, else it is zero:
  1034.  
  1035.     DK(n1,n2) = 1 if n1=n2, else =0.
  1036.  
  1037. The fact that it is explicitly a numerical function makes it different from
  1038. the D function. For instance, DK may be part of a function argument
  1039. expression as in f1(...,4-2*DK(n1,n2),..)
  1040.  
  1041. The function DC is 1 if the sum of the arguments (it may have any number
  1042. of arguments) is zero, and else DC is zero. It is primarily intended for
  1043. situations where one has some conservation rule. It is also used in
  1044. connection with character handling, and then there are various rules.
  1045.  
  1046. The function DS is the summation function. Its application for character
  1047. summation will be explained in another section. Other than that it must
  1048. appear in the form:
  1049.  
  1050.     DS(J,J1,J2,( F(J) ),( H(J) ) )
  1051. or
  1052.     DS(J,J1,J2,( F(j) ) )
  1053.  
  1054. In here F and H are expressions that may depend on J. The quantities J1
  1055. and J2 must be numerical, and H must be a numerical expression. H is not
  1056. limited to short numbers. When working out this function Schoonschip makes
  1057. J run from J1 to J2 inclusive, and creates a sum of terms. Each term is of
  1058. the form
  1059.  
  1060.     F(J)*G(J)
  1061.  
  1062. where G(J) is defined by the first G to be one (thus G(J1)=1), and
  1063. subsequent G are equal to the product of the previous G and the numerical
  1064. expression H for that value of J. This sounds complicated, but is not. The
  1065. expression H simply defines a recurrence relation between the coefficients
  1066. of the sum. For example, 21 terms of series for e^x are given by:
  1067.  
  1068.     DS(J,0,20,(x^J),(1/J))
  1069.  
  1070. The recurrence relation G(J)=G(J-1)*H(J) for the coefficients gives 1/J!
  1071. as coefficient G(J) of the J'th term. This is a better way of handling
  1072. the factorial, both from an economical and numerical point of view, than
  1073. writing 1/J!, that is 1/(DB(J)).
  1074.  
  1075. There is an important restriction. If more than one DS function occurs
  1076. in an expression one must use different names for the summation variable
  1077. (J in the above example). Thus use J1, J2, etc.
  1078.  
  1079. Example 8.
  1080.  
  1081. Digits 20
  1082. Ratio 0
  1083.  
  1084. Z xx = DS(J,0,20,(1.),(1/J))
  1085.  
  1086. *begin
  1087.  
  1088. Digits
  1089. Ratio
  1090.  
  1091. Z yy = DS(J,0,4,(X^J),(1/J))
  1092.  
  1093. *end
  1094.  
  1095.  
  1096. 5. X, D AND T EXPRESSIONS.
  1097.  
  1098. So far only Z-expressions occurred in the examples. These expressions are to be
  1099. evaluated by Schoonschip. Other expressions may be defined and may be called
  1100. when they are needed. Such expressions are X and D expressions. One may have
  1101. up to 500 X expressions. As a simple example take the series for cos(x). The
  1102. equation for cos(x) is:
  1103.  
  1104.     cos(x) = { exp(i*x) + exp(-i*x) }/2
  1105.  
  1106. This series may be obtained as follows. First define exp(y) and then
  1107. write cos(x) in terms of this exponential (arbitrarily 6 terms are kept):
  1108.  
  1109. Example 9.
  1110.  
  1111. X EXP(y) = DS(J,0,6,(y^J),(1/J))
  1112.  
  1113. Z COS = { EXP{ (i*x) } + EXP{ -(i*x) } }/2
  1114.  
  1115. *end
  1116.  
  1117. Important rule: any X-expression must have been defined before it can be
  1118. referred to. It is permissible to have X-expressions appearing in an X-
  1119. expression provided that they were defined before.
  1120.  
  1121. The rules for arguments of X-expressions are the same as for functions,
  1122. which is why the argument i*x is enclosed in brackets. Here we see how
  1123. this is replaced in the right hand side of the EXP definition, so that
  1124. indeed this expression in brackets no more appears as function argument.
  1125. This method of defining COS may seem to be a waste, but in practice this
  1126. is used to define COS once and for all. It is namely possible to specify
  1127. an argument for the Z-expression, and to tell to Schoonschip not to throw
  1128. away this expression after printing it; then later on one may refer to
  1129. COS(x) as if it were also an X-expression. That will be discussed in the
  1130. section on files.
  1131.  
  1132. Arguments as appearing in the X-expression definition will often be called
  1133. dummies in the rest of this manual. They are to be replaced by the arguments
  1134. found in the call (in the Z-expression) at execution time. In other situations
  1135. some of the arguments may be dummies, others not, as we will see. In those
  1136. situations a dummy is to be followed by a wiggle: ~. In X and D expressions
  1137. and also in tables (T) all arguments are dummies and the wiggle needs not to
  1138. be given.
  1139.  
  1140. D-expressions are arrays of X-expressions. This may for example be used
  1141. to specify matrices. Everything is the same as for X-expressions, except
  1142. for the first argument. In calling a D-expression this argument must be a
  1143. number, and this number is then used to select the expression from the
  1144. array. Since the expressions in a X or D-expression may again be X or
  1145. D-expressions the possibilities are quite extensive. For example, let there
  1146. be a 3x3 matrix with the elements (a11,a12,a13),(a21,a22,a23),(a31,a32,a33)
  1147. in rows one, two and three. The first part of the following example produces
  1148. the determinant of that matrix:
  1149.  
  1150. Example 10.
  1151.  
  1152. B a11,a21,a31
  1153.  
  1154. D rc(n)=a11,a12,a13,
  1155.     a21,a22,a23,
  1156.     a31,a32,a33
  1157.  
  1158. X matrix(n,m)=rc(3*n+m-3)
  1159.  
  1160. Z xxx = DS{J1,1,3,(DS{J2,1,3,(DS{J3,1,3,
  1161.     { DP(J1,J2,J3)*matrix(J1,1)*matrix(J2,2)*matrix(J3,3) }
  1162.     } ) } ) }
  1163.  
  1164. *begin
  1165.  
  1166. As shown, an X or D-expression can have many arguments. In fact, X or
  1167. D-expressions may be arguments of X or D-expressions. Here one must follow an
  1168. important rule. To make it possible for Schoonschip to analyze the right hand
  1169. side of some expression correctly dummies must be of the same kind as later the
  1170. argument replacing the dummy is going to be. The same kind means generally
  1171. speaking one of the four cases: symbols with or without exponent, vectors
  1172. functions or Tables. Thus functions and expressions (and later files) are of
  1173. the same kind. Algebraic symbols must be used as standin for dotproducts,
  1174. vector-components and also for short numbers (less than 128 in magnitude, the
  1175. same kind that may appear as function argument). Functions may stand for X or
  1176. D-expressions, as shown also in the second part of this example. It is best to
  1177. play this for sure, and use as dummies really the same kind, i.e. X-expression
  1178. type for X-expressions or D-expressions, functions for functions etc. In the
  1179. example below the use of for instance  ra instead of  f1  in the definition of
  1180. the X-expression  matrix  is advised. Vector-components, dotproducts and
  1181. numbers are illegal as dummy. If they are to be substituted in an X-expression
  1182. use some algebraic symbol to represent them, as we did using n and m in these
  1183. examples.
  1184.  
  1185. In the second part of example 10 we define a general X-expression for
  1186. a determinant that may be called to compute the determinant of any matrix
  1187. occurring in a problem. Two determinants are computed.
  1188.  
  1189. F f1
  1190.  
  1191. B a11,a21,a31,b11,b21,b31
  1192.  
  1193. D ra(n)=a11,a12,a13,
  1194.     a21,a22,a23,
  1195.     a31,a32,a33
  1196.  
  1197. D rb(n)=b11,b12,b13,
  1198.     b21,b22,b23,
  1199.     b31,b32,b33
  1200.  
  1201. X matrix(n,m,f1)=f1(3*n+m-3)
  1202.  
  1203. X DET(f1) = DS{J1,1,3,(DS{J2,1,3,(DS{J3,1,3,
  1204.     { DP(J1,J2,J3)*matrix(J1,1,f1)*matrix(J2,2,f1)*matrix(J3,3,f1) }
  1205.     } ) } ) }
  1206.  
  1207. Z detb=DET(rb)
  1208.  
  1209. Z deta=DET(ra)
  1210.  
  1211. *begin
  1212.  
  1213. In the third part of this example it is shown how the X-expression DET
  1214. can be made into a D-expression giving determinants for 1x1, 2x2 and 3x3
  1215. matrices.
  1216.  
  1217. C Example 10.
  1218.  
  1219. F f1
  1220.  
  1221. B b11,b21,b31
  1222.  
  1223. D ra(n)=(a1-a2),0,
  1224.     0,(a1+a2)
  1225.  
  1226. D rb(n)=b11,b12,b13,
  1227.     b21,b22,b23,
  1228.     b31,b32,b33
  1229.  
  1230. D rc(n)=c11
  1231.  
  1232. X matrix(k,n,m,f1)=f1(k*n+m-k)
  1233.  
  1234. D DET(n,f1) =
  1235.    f1(1) ,
  1236.    DS{J1,1,2,(DS{J2,1,2,
  1237.      { DP(J1,J2)*matrix(n,J1,1,f1)*matrix(n,J2,2,f1) }
  1238.      } ) } ,
  1239.    DS{K1,1,3,(DS{K2,1,3,(DS{K3,1,3,
  1240.      { DP(K1,K2,K3)*matrix(n,K1,1,f1)*matrix(n,K2,2,f1)*matrix(n,K3,3,f1) }
  1241.     } ) } ) }
  1242.  
  1243. Z deta=DET(2,ra)
  1244.  
  1245. Z detb=DET(3,rb)
  1246.  
  1247. Z detc=DET(1,rc)
  1248.  
  1249. *end
  1250.  
  1251. Several remarks are in order. First, note how items in a D-expression array
  1252. must be enclosed in brackets if the expression contains more than one term.
  1253. The rule is that each entry must be one term only (an expression is a sum of
  1254. terms, each term is a product of factors). An expression enclosed in brackets
  1255. counts as one factor in a term. Secondly, there is the question of DS
  1256. arguments. For the first argument, the summation index, one must use different
  1257. variables for each DS function. Thus J1, J2 and J3 must not be used more than
  1258. once. This was mentioned before, and in this example it is relevant.
  1259.  
  1260. T-expressions or better Tables are for use as function arguments. There are
  1261. also 'character tables' to be discussed elsewhere. Tables represent an array of
  1262. quantities that may be selected as function argument and at execution time the
  1263. appropriate argument is selected on the basis of the value of the first
  1264. argument. The following example shows a complicated way of obtaining f(a) +
  1265. f(b) + f(c) :
  1266.  
  1267. Example 11.
  1268.  
  1269. T List(n)=a,b,c
  1270.  
  1271. F f
  1272.  
  1273. Z compl = DS(J,1,3,{ f(List(J)) } )
  1274.  
  1275. *begin
  1276.  
  1277. This is really the idea: to enable summing over a series of arguments that
  1278. can then be listed using a Table. The rules for entries in a Table are
  1279. simple: they must be valid function arguments. Tables can be nested,
  1280. allowing essentially matrices of arguments. The first argument of the
  1281. Table in the call selects an item from the corresponding Table list. If
  1282. that item is again a Table, then the second Table list is looked up with
  1283. the second argument determining which argument to take. And so on.
  1284. All arguments are treated as dummies, and Table entries may depend on
  1285. them. Since an expression enclosed in brackets may appear in the Table list
  1286. that allows for complicated constructions. If such expressions are essentially
  1287. numerical, and they must ultimately be converted to a short number the
  1288. oprator Integ must be placed in front of them. Also Conjg is allowed.
  1289.  
  1290. A x=c
  1291.  
  1292. T r1(n)=a11,a12,a13
  1293. T r2(n)=a21,a22,a23
  1294. T r3(n)=a31,a32,a33
  1295.  
  1296. T matr(n,m)=r1,r2,r3
  1297.  
  1298. T weird(n,a1,a2)=Conjg(a1+a2),Integ(3*a2)
  1299.  
  1300. X XX(a1,a2)=a2*a1
  1301.  
  1302. Z sqa13 = DS(J,1,3,{f1(matr(1,J))*f1(matr(J,3)} )
  1303.  
  1304. Z weirdo=XX(weird(1,x,7),weird(2,x,7))
  1305.  
  1306. *end
  1307.  
  1308. There is a subtlety here. Whatever follows Conjg, enclosed in brackets,
  1309. is considered an expression. It must not survive as function argument
  1310. beyond the * line. Thus if in weirdo we would have had f1 instead of
  1311. the X-expression XX then this would be illegal here.
  1312.  
  1313. General rule: anything that can occur as function argument can occur as
  1314. element in a Table list. This includes for example characters (notation: "X
  1315. is the character X). Be careful with numbers: they are treated like
  1316. function arguments, and non-integers are truncated.
  1317.  
  1318.  
  1319. 6. FILES.
  1320.  
  1321. Files very much resemble X-expressions, but there is one important difference.
  1322. A file contains the result of some Schoonschip calculation. A Z-line defines a
  1323. file, with the name as given on that line. A file may have arguments, can be
  1324. stored in a variety of ways, and can be part of a problem just as any
  1325. X-expression.
  1326.  
  1327. Schoonschip has been made with the assumption that files tend to be large.
  1328. Elaborate measures have been taken to handle the largest files. The number
  1329. of files that can be handled at any one time is limited to about 200.
  1330.  
  1331. To begin with, files are divided in local and common files. All the
  1332. Z-expressions that have been shown sofar are local. Local files are normally
  1333. lost over a * line, except over a *yep. A local file may be kept over a * line
  1334. provided that the word  next  is on that line, and provided that the file was
  1335. mentioned in a Keep list:
  1336.  
  1337. Z xxx(a,b)=(a+b)^2
  1338.  
  1339. Keep xxx
  1340.  
  1341. *next
  1342.  
  1343. Z yyy=xxx(c,d)
  1344.  
  1345. *begin
  1346.  
  1347. After a *begin the local files are all lost. Schoonschip treats local files
  1348. as efficiently as possible. They are kept in memory if there is room, if
  1349. they are too big they are stored on disk and recalled if needed.
  1350.  
  1351. Common files are kept untill explicitly deleted or till the *end line. They can
  1352. be written to disk for use in a later session. Schoonschip keeps all common
  1353. files in a sequential file on disk. Great care has been taken that such
  1354. expressions, when needed in a problem, are read with the least amount of
  1355. input/output activity. The user will normally see nothing of these read/ write
  1356. activities, but should still be aware of it when handling large problems.
  1357.  
  1358. Computer handled problems have the tendency to become large, that is simply in
  1359. the nature of the subject. Except for the simplest cases it is really quite
  1360. impossible for a computer to simplify an expression. While it is trivial to
  1361. simplify a^2+2*a*b+b^2 to (a+b)^2, it becomes an entirely different matter when
  1362. dealing with 1000 or more terms. Of course, with a little help from the user,
  1363. simplification can be done, on a rather primitive level. If one recognizes a
  1364. pattern such as shown above one substitutes a^2=apb^2-b^2-2*a*b, and the output
  1365. collapses to apb^2.
  1366.  
  1367. In addition to the classification local and common, files may be indexed
  1368. or non-indexed. This makes it possible to have arrays of files, much like
  1369. D-expressions. The way a file is defined to be indexed is as follows:
  1370.  
  1371. - A local file is defined to be indexed if on the defining Z-line the
  1372.   first argument of that file is a number in the range 0-32767. There are
  1373.   provisions for situations where this number is an expression, involving
  1374.   for instance DO-loop or BLOCK variables, but at execution time such
  1375.   expressions must work out to a number. Only numbers and DO-loop or
  1376.   block variables may appear in these expressions, and for these latter
  1377.   variables numbers must be substituted.
  1378.  
  1379. - A common file is defined to be indexed if it appears in the Common
  1380.   list with a subscript, preferably the number 0. The implication of
  1381.   that is not the existence of the file with the particular index zero,
  1382.   but rather that this filename represents a class of subscripted files.
  1383.  
  1384. Thus:
  1385.  
  1386. Common abc,Xyz,fgh(0),jkl
  1387.  
  1388. defines abc, Xyz, fgh and jkl to be common files, and fgh is an indexed
  1389. files. When in a subsequent Z-line such a filename occurs it is recognized
  1390. and at the end of the calculation the file is written to disk.
  1391.  
  1392. For local files the command Keep is of interest:
  1393.  
  1394. Keep aaa,bbb,ccc(1),eee
  1395.  
  1396. This line, which should occur shortly before a *next line, leads to keeping
  1397. of the files mentioned over the *next. For an indexed file one may either
  1398. explicitly mention an index (such as for ccc here) and then only that file
  1399. is kept. If there are several ccc files to be kept it is sufficient to
  1400. mention ccc without any index and then all ccc files are kept.
  1401.  
  1402. There are several other commands that relate to files. First, common files
  1403. may be written to a named disk file for use in a later problem. This may
  1404. be done with the command
  1405.  
  1406. Write xxx
  1407.  
  1408. All common files that exist at that moment are written (sequentially) to
  1409. a file named xxx. Thus xxx will in general contain many files. This
  1410. statement must be all by itself, and not be embedded in some problem.
  1411. In other words, before and after this Write line there must be a * line
  1412. not containing yep or next.
  1413.  
  1414. When one or more of the common files contained in xxx are needed one
  1415. may enter these files:
  1416.  
  1417. Enter xxx
  1418.  
  1419. This statement should preferably be the first statement of a Schoonschip
  1420. program. It must be before a *fix line, explained below. Schoonschip opens
  1421. the file xxx and enters all names in the common file table, and the files
  1422. themselves are copied to a diskfile local to Schoonschip (tape7). One may
  1423. have several Enter and Write statements. Note: do not confuse Enter and Read.
  1424. The latter is for reading normal Schoonschip text from some external file.
  1425.  
  1426. Common files may be deleted:
  1427.  
  1428. Delete abc,Xyz,fgh(3)
  1429.  
  1430. Again, the mentioning of fgh without any index leads to deletion of all
  1431. fgh files.
  1432.  
  1433. As the reader may guess it is quite a problem to keep all namelists straight
  1434. when common files are entered. Normally Schoonschip treats this problem only
  1435. when encountering such files in a given problem. Usually that will give no
  1436. problems, but difficulties may arise in connection with summation indices (see
  1437. Sum declaration). For this reason it may be necessary to enter the names
  1438. contained in that file before actually starting on the problem. The statement
  1439.  
  1440. Names abc,Xyz,...
  1441.  
  1442. is meant for this purpose. If this directive is not given, and Schoonschip
  1443. runs into problems then an error exit is taken, asking for the Names line.
  1444.  
  1445. Example 12 shows some very simple case. Note that the local file xxx
  1446. is lost over the *begin line, and xxx is taken to be a function. Similarly
  1447. for common file ccc after a delete. When this problem is run the file
  1448. fileC is created. Make sure that there is not already some file by that
  1449. name.
  1450.  
  1451. Example 12.
  1452.  
  1453. P lists
  1454.  
  1455. Common yyy,ccc(0)
  1456.  
  1457. Z xxx(a,b)=(a+b)^2
  1458. Z ccc(3,a,b)=(a+b)^3
  1459. Z ccc(4,a,b)=(a+b)^4
  1460.  
  1461. Keep xxx
  1462.  
  1463. *next
  1464.  
  1465. F f1,f2
  1466. V p
  1467.  
  1468. Z yyy(p)=xxx(c,d) + p(nu)*f2(mu)
  1469.  
  1470. Sum mu,nu
  1471.  
  1472. *begin
  1473. Write fileC
  1474. *begin
  1475.  
  1476. V q
  1477.  
  1478. Z zzz=a1*yyy(q)
  1479.  
  1480. Z Abc=xxx(a,b)
  1481.  
  1482. Delete ccc,yyy        !The actual delete occurs when this section is done.
  1483.  
  1484. *begin
  1485.  
  1486. Z xyz=ccc(3,e,f)
  1487.  
  1488. *end
  1489.  
  1490. The statement  P lists  at the beginning causes Schoonschip to print all
  1491. symbols known before execution. Also details such as reality properties or
  1492. dimensionality of indices is shown. For X, D, T expressions the type as well as
  1493. the nesting depth is shown. Also brackets count in this respect.
  1494.  
  1495. At this point it must once more be emphasized to be conscious of the use of
  1496. local and especially common files in a problem. If for example yyy is a rather
  1497. lengthy common file then things such as (yyy)^4 may lead to very lengthy
  1498. calculations. If yyy has 100 terms this gives rise to (100)^4 terms, i.e. 100
  1499. million terms that must be sorted. This will fill up all available disk-space,
  1500. to name something. And 100 terms is really not that much as these things go.
  1501. Just to avoid this kind of disaster Schoonschip has an output limit build in of
  1502. about 0.5 Megabyte per file used by Schoonschip. This limit may be changed by
  1503. means of the statement
  1504.  
  1505. Outlimit,#
  1506.  
  1507. where # is the new limit in bytes. What to do if really big expressions
  1508. must be evaluated will be discussed later. In this context an expression
  1509. is called big when it exceeds 50,000 terms.
  1510.  
  1511. 7. PRINT OPTIONS.
  1512.  
  1513. The following directives influence output. Only the first two characters
  1514. of the word following P are releveant.
  1515.  
  1516. P brackets    print working out of brackets
  1517. P heads        print in the output only the factors outside brackets (B-line)
  1518. P input        print input lines (default)
  1519. P lists        print lists of all symbols (vectors, functions etc.)
  1520. P ninput    do not print input lines
  1521. P nlists    do not print lists (default)
  1522. P noutput    print no output (default in *yep cases)
  1523. P nstats    print no statistics (default)
  1524. P output    print output (default, except in case of *yep)
  1525. P stats        print statistics
  1526.  
  1527. In addition the following directives affect output format:
  1528.  
  1529. Screen        try to keep lines less than 80 characters long (default)
  1530. Lprinter    go up to 130 characters/line
  1531.  
  1532. Printing of the individual files may be affected as well, but only if they
  1533. are currently being processed:
  1534.  
  1535. Print xxx,yyy,...    print files xxx,yyy,...
  1536. Nprint xxx,yyy,...    do not print xxx,yyy,...
  1537. Punch xxx,yyy,...    write xxx,yyy,... to a file named tape8 in fortran
  1538.             compatible form.
  1539.  
  1540. This last directive is useful if the output is to be used for further
  1541. numerical output in a fortran program, or for curve plotting etc.
  1542. Normally print options stay in effect untill cancelled. Exception: P heads.
  1543. The P output option, often used to force output printing in a *yep situation,
  1544. survives only one *yep.
  1545.  
  1546. 8. END LINE OPTIONS.
  1547.  
  1548. For the * line the following possibilities exist:
  1549.  
  1550. *fix        Do not start execution. All names and expressions defined
  1551.         before this statement remain valid till the *end line.
  1552. *yep        Start execution. Write the output to disk and feed in again
  1553.         as input.
  1554. *next        Start execution. Keep all namelists, and those local files
  1555.         mentioned in Keep lists. A Keep list extends over one
  1556.         *next only.
  1557. *begin        Start execution. After this start new problem. Disregard
  1558.         all names except those mentioned in the *fix section.
  1559. *end        Start execution. Stop after completion.
  1560.  
  1561. Not explained so far is the *fix option. This is used whenever names or
  1562. X, D or T expressions are to be defined that are valid for all following
  1563. problems, including those after a *begin. This *fix section must be the
  1564. very first section, and must not contain any Z expressions. If common
  1565. files are to be entered it must be in this section.
  1566.  
  1567. The sequence shown above reflects the general structure of any Schoonschip
  1568. program. First there is a *fix section, and then there may be several *yep,
  1569. *next and *begin lines before the final *end is encountered.
  1570.  
  1571. The *yep command is extremely useful, but can only be explained properly
  1572. later, after discussing substitutions. It is rather unique to Schoonschip,
  1573. and of crucial importance when dealing with large problems.
  1574.  
  1575. 9. SUBSTITUTIONS.
  1576.  
  1577. Most things discussed up to now essentially help to define expressions, but do
  1578. not really work on those expressions. The main tools for work on expressions
  1579. are what will be called substitutions and commands. A substitution basically
  1580. amounts to looking at an expression term-by-term, and if certain patterns match
  1581. something may be removed from the term, and something else substituted. This
  1582. basic tool, for the first time introduced in the 1964 Schoonschip version, is
  1583. the essential ingredient of symbol manipulation.
  1584.  
  1585. Thus in the first place there is pattern recognition, and secondly there
  1586. is a substitution. In this version (1984+), optionally, these two aspects can
  1587. be separated. One can first look for a pattern, set some flag indicating the
  1588. result of the inspection, and then at a later stage act on that flag.
  1589.  
  1590. Commands define certain operations to be done on the terms, and that are of
  1591. sufficient generality to warrant building in. For instance, there is a command
  1592. that allows the user to specify which functions are commuting with each other.
  1593. Schoonschip acts on that by setting these functions in an internally well
  1594. defined order, so that terms differing only by functions being placed in
  1595. different order become equal. Such an operation can also be done with
  1596. substitutions, but is more tedious.
  1597.  
  1598. An important concept in substitutions is the use of dummies. These quantities
  1599. have already been introduced before in connection with X, D and T expressions,
  1600. and here they become even more useful. Let us start with a simple example.
  1601. Imagine that some polynomial in x must be integrated, and let this polynomial
  1602. be quadratic:
  1603.  
  1604.     a*x^2 + b*x
  1605.  
  1606. to be integrated from x1 to x2. This integration amounts to using the rule x^n
  1607. => x^(n+1)/(n+1), and then putting the integration limits. This may be done as
  1608. a substitution. First look for x to any power (this is the pattern). Then
  1609. remove x and substitute by the appropriate expression which is the integral of
  1610. that x. The following example shows how this can be done:
  1611.  
  1612. Example 13.
  1613.  
  1614. Z integr = a*x^2 +b*x
  1615.  
  1616. Id,x^n~ = x2^(n+1)/(n+1) - x1^(n+1)/(n+1)
  1617.  
  1618. *begin
  1619.  
  1620. Schoonschip looks for the pattern "x to any power", and if found removes
  1621. that x and instead substitutes the right hand side of this substitution. The
  1622. value of the power found is substituted for n in that expression. Here n
  1623. is a dummy. To let Schoonschip know that it is a dummy the wiggle ~ must
  1624. follow directly behind it.
  1625.  
  1626. The notation Id refers to a name used often in the past for this operation,
  1627. namely "identity".
  1628.  
  1629. The matter to be discussed now is what kind of patterns can be specified.
  1630. As an example of the sort of complication that can arise take this integral
  1631. again. Suppose there had been a term without any x. What should Schoonschip
  1632. do? In this case that should be treated as x^0, but in many other cases such
  1633. terms must not be worked on. In the spirit of pattern recognition a term
  1634. without x is taken not to fit the pattern specified here, and such a term is
  1635. thus not worked on. 
  1636.  
  1637. But how now to go about that? A classic way to do that is to use an extra
  1638. symbol, that we will call dx here:
  1639.  
  1640. Z integr = (a*x^2 + b*x + c)*dx
  1641.  
  1642. Id,x^n~*dx = x2^(n+1)/(n+1) - x1^(n+1)/(n+1)
  1643.  
  1644. Al,dx = x2 - x1
  1645.  
  1646. *end
  1647.  
  1648. What happens is that if dx and as well x to any power excluding zero is
  1649. encountered then the first substitution is done. This leads also to the
  1650. removal of dx. If a term without any x (the c term) passes by the first
  1651. substitution is not done, and the dx survives. But then the second
  1652. substitution is performed. The notation Al is an abbreviation of "also",
  1653. but there is more to it, which will be explained below. Generally, Al can
  1654. be used with advantage for mutually exclusive patterns. One can not use
  1655. Al in case that the first substitution generates a pattern that the second
  1656. may have to act on. Since there is a limit on the number of Id statements
  1657. it is often necessary to use Al, and its use should be well understood.
  1658.  
  1659. There is an equivalent notation to Al, namely placing that substitution on the
  1660. same line preceeded by a semicolon (;):
  1661.  
  1662. Id,x^n~*dx = x2^(n+1)/(n+1) - x1^(n+1)/(n+1)        ;dx = x2 - x1
  1663.  
  1664. There may be several such 'also' statements on one line, but lines should
  1665. not exceed 150 characters.
  1666.  
  1667. This example shows really most that there is to it. Of course, more complicated
  1668. patterns than just an algebraic symbol to some power can be specified, but that
  1669. is really just an extension of the same principle. There are substitutions that
  1670. are performed if certain functions with certain arguments are present, and one
  1671. may specify if the order of these functions is important or not; one may
  1672. operate on function arguments, on vectors in a dotproduct etc. Basically,
  1673. through the years, things that may be needed have been implemented. As it
  1674. happens most of these are quite natural, barely needing a manual, such as the
  1675. one above. Let us give another example, to show a number of applications. In
  1676. the above integral more complicated things could have occurred, for instance
  1677. terms such as x^3*cos(x). To evaluate these one must first do partial
  1678. integrations:
  1679.  
  1680.    x^3*cos(x) = x^3 * d/dx{sin(x)} = d/dx{x^3*sin(x)} - 3*x^2*sin(x) 
  1681.  
  1682. Thus, before doing the x-integration one must first do these partial integra-
  1683. tions, and that as many times as needed given the highest power of x that
  1684. occurs. Assuming that at most x^10 occurs one would write:
  1685.  
  1686. Id,10,x^n~*cos(x) = x2^n*sin(x2) - x1^n*sin(x1) - n*x^(n-1)*sin(x)
  1687. Al,10,x^n~*sin(x) = - x2^n*cos(x2) + x1^n*cos(x1) + n*x^(n-1)*cos(x)
  1688.  
  1689. There are more elegant ways to do this, using X-expressions, but that
  1690. is not the point here. That general method is shown anyway, as last part
  1691. of Example 13.
  1692.  
  1693. The above implies doing these substitutions on ten subsequent Levels, and
  1694. substitution will be done as long as x to some power occurs. The final
  1695. step, to be taken if no more x present would be the integration of cos(x)
  1696. or sin(x):
  1697.  
  1698. Id,sin(x) = cos(x2) - cos(x1)        ;cos(x) = - sin(x2) + sin(x1)
  1699.  
  1700. If also x to negative powers would occur one would have to treat that
  1701. separately. This is where the conditional substitutions comes in handy.
  1702. One may test for the presence of negative exponents, and set a flag
  1703. depending on the outcome of such a test:
  1704.  
  1705. IF Multi,x^-1
  1706.  
  1707. This tests for exponents that are a multiple of the exponent shown, here
  1708. -1. If so a flag is set. Subsequent substitutions will be done if that
  1709. flag is set until an ELSE is encountered. The then following substitutions
  1710. will be done if the flag was not set. An ENDIF statement terminates the
  1711. conditional substitutions. The typical sequence would be here:
  1712.  
  1713. IF Multi,x^-1
  1714.  Substitutions to treat x^-n type terms.
  1715. ELSE
  1716.  Substitutions to treat x^+n type terms.
  1717. ENDIF
  1718.  
  1719. A NOT following the IF is recognized, and the following sequence gives
  1720. identical results:
  1721.  
  1722. IF NOT Multi,x^-1
  1723.  Substitutions to treat x^+n type terms.
  1724. ELSE
  1725.  Substitutions to treat x^-n type terms.
  1726. ENDIF
  1727.  
  1728. IF's may be nested, up to 8 deep.
  1729.  
  1730. A futher extension uses AND and OR statements, possibly combined with NOT.
  1731. For example, if there are also terms without sin or cos:
  1732.  
  1733. IF cos(x)
  1734. OR sin(x)
  1735. ..IF Multi,x^-1
  1736. ..Substitutions to treat x^-n type terms.
  1737. ..ELSE
  1738. ..Substitutions to treat x^+n type terms.
  1739. ..ENDIF
  1740. ELSE
  1741. Substitutions to deal with x^n without sin or cos.
  1742. ENDIF
  1743.  
  1744. A new notation, purely for readability, has been introduced. A . in column
  1745. one causes Schoonschip to skip all following periods. In this way one may
  1746. indent the nested IF's to show IF depth. See the section on conditional
  1747. substitutions for more details.
  1748.  
  1749. A few patterns as can appear in the left hand side of a substitution have been
  1750. introduced above. The need for those patterns are clear, once one starts on
  1751. this kind of problem. Along these same lines a set of patterns has been defined
  1752. that appears to be adequate to deal with things as they arise in practice. It
  1753. is somewhat difficult to give a complete description, but it has to be done.
  1754. Let us do this in two rounds, namely first somewhat sloppy, and then precise.
  1755.  
  1756. As long as one deals with a single quantity (including exponent or index or
  1757. arguments) one has various options specified by keywords. One such keyword
  1758. appeared already above, namely Multi. For algebraic symbols the following
  1759. substitution patterns are possible:
  1760.  
  1761. Id,a=...        Substitute n times if a^n encountered, n positive.
  1762. Id,a^n=...        Substitute once if precisely a^n encountered.
  1763. Id,a^n~=...        Substitute once for a, any non-zero exponent
  1764. Id,Multi,a^n=...    Substitute m/n times if a^m encountered, and m has
  1765.             the same sign as n; leave rest.            
  1766. Id,Once,a^n=...        Substitute once if a^m encountered, m/n ge 1;
  1767.             leave rest.
  1768. Id,Funct,a=....        Substitute for a if appearing as function argument.
  1769.             The action taken is to enclose the expression
  1770.             on the right hand side in brackets and place it
  1771.             instead of the argument a. Remarks concerning
  1772.             expressions in brackets as function arguments
  1773.             apply here. Such functions may not cross * lines
  1774.             and must be subject to some substitution before that.
  1775. Id,Funct,f1,f2,...,a=...
  1776.             Same, but only in the specific functions mentioned
  1777.  
  1778. Thus Id,Once,a^2=... when encountering a^7 leads to one substitution, and
  1779. a^5 is left.
  1780.  
  1781. Of course, Al (or ; and on the same line) may occur instead of Id.
  1782. In the above n is a number, except in the third case where it is a dummy.
  1783.  
  1784. Similar things may be written down for dotproducts or vector-components.
  1785. For single functions one may specify the function including the arguments,
  1786. but some or all may be dummies, and one may also have repetitive dummies.
  1787. For example:
  1788.  
  1789. Id,f1(a~,b,c,a~)=...
  1790.  
  1791. leads to a substitution if the function f1 is encountered with as second
  1792. and third argument b and c, while any argument on the first or fourth
  1793. place will do provided they are the same. Here a is a repetitive dummy.
  1794. One could have specified another dummy for the last place:
  1795.  
  1796. Id,f1(a~,b,c,d~)=...
  1797.  
  1798. and then the substitution is done for any argument on the first or fourth
  1799. place, including equal arguments.
  1800.  
  1801. The build-function D is special insofar that it is generally not allowed
  1802. as part of a substitution pattern. It may however appear all by itself
  1803. with or without dummies. Examples:
  1804.  
  1805. Id,D(al,be) = ....
  1806. Id,D(al~,be) = ...
  1807.  
  1808. For single functions one keyword may appear. If a function has nothing but
  1809. dummies as arguments, and if the keyword Always appears, then the substitution
  1810. will be done even if the argument count is not the same. Thus
  1811.  
  1812. Id,Always,f1(a~,b~)=...
  1813.  
  1814. is applied also when encountering f1(xx,yy,zz). The argument zz is then
  1815. simply dropped. Make sure that the case that there are more dummies than
  1816. arguments can not occur.
  1817.  
  1818. Finally one may even specify a dummy function:
  1819.  
  1820. Id,f1~(a,b,c~,...)=...
  1821.  
  1822. The substitution is done for any function whose arguments and argument count
  1823. agree.
  1824.  
  1825. For vectors a number of different possibilities exist:
  1826.  
  1827. Id,p(mu)=...        Substitute for p(mu).
  1828. Id,p(mu~)=...        Substitute for p with any index.
  1829. Id,Dotpr,p(mu~)=...    Substitute for p if appearing in dotproduct or as
  1830.             vector-component.
  1831. Id,Dotpr,f1,f2,..,p(mu~)=...
  1832.             Same, but only in the specific functions mentioned.
  1833.  
  1834. Id,Funct,p(mu~)=...    Substitute if p appears as function argument.
  1835. Id,Funct,f1,f2,..,p(mu~)=...
  1836.             Same, but only in the specific functions mentioned.
  1837.  
  1838. In the last cases things are done as expected for vectors. In all but the first
  1839. case it is assumed that the right hand side depends on the index mu. For
  1840. example, typically, one could have Id,Dotpr,p(mu~)=k(mu)+q(mu) . Suppose now
  1841. pDq is encountered. Schoonschip reads this as p(q), and substitutes q for the
  1842. index mu, which leads to kDq+qDq, as should be. If pDp is seen then Schoonschip
  1843. invents an index, say Naa, substitutes this index for mu and writes:
  1844.  
  1845.     { k(Naa) + q(Naa) } * { k(Naa) + q(Naa) }
  1846.  
  1847. A similar thing is done if p is encountered as function argument in case of
  1848. the Funct type substitutions:
  1849.  
  1850.  f1(...,p,...)    becomes    f1(...,Naa,...)*{ k(Naa) + q(Naa) }
  1851.  
  1852. which leads to f1(...,k,...) + f1(...,q,...). Thus linearity of f1 in p is
  1853. supposed here. This substitution should therefore not be applied if that is
  1854. not the case.
  1855.  
  1856. For any other pattern involving more than one quantity substitutions are
  1857. straightforward. The only extra options that one has here is that the
  1858. ordering of functions may be specified. The keyword Adiso (allow disorder)
  1859. indicates that substitution must be done no matter the ordering of the
  1860. functions. The keyword Ainbe (allow inbetween) implies that the substitution
  1861. must be done if the functions are in the same order, even if there are some
  1862. other functions inbetween. If none of these keywords is present then the
  1863. substitution is done only if exactly the same pattern is found. The pattern
  1864. may involve dummies for exponents, vectors, indices, functions and function
  1865. arguments, and one may have repetitive dummies.
  1866.  
  1867. As a special option one may also have factors xx^0 where xx is an algebraic
  1868. symbol, vector-component or dot-product. Schoonschip requires in that case that
  1869. specifically xx is not there.
  1870.  
  1871. ++++++++
  1872. We stress here that for dummies one must (repeat: must) use the same kind
  1873. of symbol as that what replaces it at execution time. See the discussion
  1874. on this subject in the section on X-expressions.
  1875. ++++++++
  1876.  
  1877. Forty substitution Levels are available. If more Levels are needed a line with
  1878. *yep must be inserted. The Level count is printed by Schoonschip next to
  1879. every substitution. More levels are needed for a given substitution as the
  1880. bracket depth is larger. It is often advantegeous not to use brackets if
  1881. not strictly necessary. For example, it is better to write
  1882.  
  1883. Id,x^n~ = x2^(n+1)/(n+1) - x1^(n+1)/(n+1)
  1884.  
  1885. which needs two levels rather then
  1886.  
  1887. Id,x^n~ = (x2^(n+1) - x1^(n+1)) /(n+1)
  1888.  
  1889. which needs three levels. Schoonschip generates a substitution for every
  1890. bracket pair. If you want to see what Schoonschip does use the option
  1891. P brackets.
  1892.  
  1893.  
  1894. 10. PATTERNS.
  1895.  
  1896. In this section a more precise discussion of the substitution patterns is
  1897. given. For a first reading this section may be skipped, it is really there only
  1898. for reference, in case something special is going on.
  1899.  
  1900. The way things are organized in Schoonschip there is a classification
  1901. in about 17 classes. In practice one will rarely realize what class a
  1902. given pattern belongs to, but for completeness we will discuss possible
  1903. patterns on the basis of this classification. We will also indicate what
  1904. action is taken once the pattern is found to be present, although that
  1905. may be influenced, postponed or even inhibited by means of conditional flags.
  1906.  
  1907. The classification is on the basis of what occurs on the left hand side
  1908. of the = sign on an Id or Al line. Only products of factors may occur (thus
  1909. no + or - sign except in exponents or function arguments), and no brackets
  1910. other than associated with a function and its arguments or a vector and its
  1911. index. Thus something like a+b or a*(c+d) is illegal. Furthermore, a keyword
  1912. may be given, and that influences the way Schoonschip reacts to a pattern.
  1913. Finally one will encounter the word repetitive dummy. That is when the same
  1914. dummy appears two or more times in the left hand side of a substitution. In
  1915. that case Schoonschip verifies that in the pattern the same thing appears in
  1916. both places, although the thing itself may be anything.
  1917.  
  1918. Here are the various classes, examples will be given later. Below a,b,..
  1919. stand for algebraic symbols, n,m,.. for short numbers, p,q,.. for vectors,
  1920. f1,f2,.. for functions etc.
  1921.  
  1922.  0.    f1(a~,b~,...)        Function, all arguments non-rep. dummies.
  1923.  
  1924.     Optional Keyword: Always
  1925.  
  1926.     Action: substitute for every such function found provided the
  1927.     number of arguments agrees.
  1928.     If the keyword  Always  is given then substitute irrespective of
  1929.     the number of arguments in the function found. It is up to the
  1930.     user to see to it that the number of arguments equals or exceeds
  1931.     the number of arguments actually appearing in the right hand side
  1932.     of the substitution.
  1933.  
  1934.  1.    a^n            Symbol with exponent, no dummy.
  1935.     Keyword: Multi
  1936.     Action: when encountering a^m divide m by n, and if the result,
  1937.     truncated to an integer, comes out to be 1 or more, substitute
  1938.         that many times. The remaining exponent is put back. Thus a^2 applied
  1939.     to a^7 leads to 3 substitutions and one factor a is left.
  1940.     The exponent may be negative: a^-2 applied to a^-7 leads to 3
  1941.     substitutions and a remainder a^-1. If n and m have opposite sign
  1942.     no substitution is done.
  1943.  
  1944.     If the exponent n is absent the keyword Multi is understood, and
  1945.     an exponent 1 used.
  1946.  
  1947.  2.    pDq^n            Dotproduct with exponent, no dummy.
  1948.     Keyword: Multi
  1949.     Action: same as in class 1.
  1950.  
  1951.  3.    a^n            Symbol with exponent, no dummy.
  1952.     Action: substitute once if exactly a^n found.
  1953.  
  1954.  4.    pDq^n            Dotproduct with exponent, no dummy.
  1955.     Action: see class 3.
  1956.  
  1957.  5.    p(mu)            Vector with index, no dummy.
  1958.     Action: substitute once if p(mu) found.
  1959.  
  1960.  6.    p(mu~)            Vector with dummy index.
  1961.     Action: substitute for every p(..) for any index. The substitution
  1962.     applies not if the vector p appears as factor in a dot-product
  1963.     or as function argument, and also not to vector components such
  1964.     as p(3) (i.e. if the index is a number).
  1965.  
  1966.  7.    a or mu or pDq or p(n)    Symbol (index, dotproduct, vector component)
  1967.     Keyword: Funct
  1968.     Action: replace a (or mu etc) when occurring as function argument.
  1969.     Note: such functions must be substituted for before the * line,
  1970.     because an expression as function argument can not survive a *.
  1971.     If functions are mentioned between the keyword and the argument
  1972.     then only those functions will be considered.
  1973.  
  1974.  8.    a^n or pDq^n        Symbol or dotproduct with exponent.
  1975.     Keyword: Once
  1976.     Action: substitute once if a^m encountered if m/n positive and
  1977.     equal or larger than one. Keep the remainder. Thus a^2 when
  1978.     encountering a^7 leads to one substitution and a^5 remains.
  1979.  
  1980.  9.    a^n*...f1(mu,b,..)    One function and anything else.
  1981.  
  1982. 10.    f1(mu,a,b~,..)        One function.
  1983.  
  1984. 11.    Anything
  1985.     Keyword: Adiso
  1986.     Action: substitute if all factors found even if the functions
  1987.     found are not in the same order as in the left hand side of the
  1988.     substitution. Note: Adiso stands for Allow disorder.
  1989.  
  1990.     Note: the expression is put at the location of the first function
  1991.     removed.
  1992.  
  1993. 12.    Anything
  1994.     Keyword: Ainbe
  1995.     Action: substitute if all factors found, with the functions in
  1996.     the same order, although there may be other functions inbetween.
  1997.     Note: Ainbe stands for Allow inbetween.
  1998.     Note: the expression is put at the location of the first function
  1999.     removed.
  2000.  
  2001. 13.    Anything
  2002.     Action: substitute if all factors found, with the functions in
  2003.     the same order and no other functions inbetween.
  2004.     Note: the expression is put at the location of the first function
  2005.     removed.
  2006.  
  2007. 14.    Not used.
  2008.  
  2009. 15.    p(mu~)            Vector with dummy index.
  2010.     Keyword: Dotpr
  2011.     Action: substitute for p if p part of a dotproduct appearing with
  2012.     a positive exponent.
  2013.  
  2014. 16.    p(mu~)            Vector with dummy index.
  2015.     Keyword: Funct
  2016.     Action: substitute if the vector p is found as function argument.
  2017.     If one or more function names are mentioned between the keyword and
  2018.     p(mu~) then the substitution will be done only in the specific
  2019.     function(s) mentioned.
  2020.  
  2021. All of this may sound a lot more complicated than it is, all these classes
  2022. are really such that they cover most cases that one can imagine. The user
  2023. needs not to know to which class a given substitution belongs, and most
  2024. substitutions are natural in the sense that it is obvious what action is
  2025. to be taken.
  2026.  
  2027. We will now give examples, essentially going through all possibilities.
  2028. The same starting expression will be used in all cases, and we will use
  2029. a *fix section to specify that expression. Then many cases follow, all
  2030. separated by a *begin implying a fresh start.
  2031.  
  2032. Example 14.
  2033.  
  2034. V p,q
  2035. A a,b,c,d,e,f,g,h
  2036. I mu,nu
  2037. F f1,f2,f3
  2038.  
  2039. X expr=f1(a,b,p)*f2(a,c,q)*f3(d,e)*f1(g,h)*
  2040.     { a^7 + a^-7 + a^2 + pDq^2 + pDp + p(mu) + p(nu) }
  2041.  
  2042. *fix
  2043.  
  2044. C Class 0, no keyword.
  2045.  
  2046. Z xxx=expr
  2047.  
  2048. Id,f1(a1~,a2~)=a1^10*a2^20
  2049.  
  2050. *begin
  2051.  
  2052. C Class 0, keyword Always.
  2053.  
  2054. Z xxx=expr
  2055.  
  2056. Id,Always,f1(a1~,a2~)=a1^10*a2^20
  2057.  
  2058. *begin
  2059.  
  2060. C Class 1, keyword Multi.
  2061.  
  2062. Z xxx=expr
  2063.  
  2064. Id,Multi,a^3 = xyz + hij
  2065.  
  2066. *begin
  2067.  
  2068. C Class 2, exponent 1, no keyword.
  2069.  
  2070. Z xxx=expr
  2071.  
  2072. Id,pDq = XYZ + HIJ
  2073.  
  2074. *begin
  2075.  
  2076. C Class 3, no keyword.
  2077.  
  2078. Z xxx=expr
  2079.  
  2080. Id,a^2 = a1^7/15
  2081.  
  2082. *begin
  2083.  
  2084. C Class 5.
  2085.  
  2086. Z xxx=expr
  2087.  
  2088. Id,p(mu) = - q(mu)
  2089.  
  2090. *begin
  2091.  
  2092. C Class 6.
  2093.  
  2094. Z xxx=expr
  2095.  
  2096. Id,p(mu~) = - q(mu)
  2097.  
  2098. *begin
  2099.  
  2100. C Class 7, keyword Funct.
  2101.  
  2102. Z xxx=expr
  2103.  
  2104. Id,Funct,a = a27
  2105.  
  2106. Id,f1(a1~,a2~,a3~) = 200*a1*a2*a3
  2107. Al,f2(a1~,a2~,a3~) = a1^10*a2^11*a3^12
  2108.  
  2109. *begin
  2110.  
  2111. C Class 8, keyword Once.
  2112.  
  2113. Z xxx=expr
  2114.  
  2115. Id,Once,a^2 = XXX
  2116.  
  2117. *begin
  2118.  
  2119. C Class 9.
  2120.  
  2121. Z xxx=expr
  2122.  
  2123. Id,a^2*f2(a1~,c,p~) = F2(a1,c,p)
  2124.  
  2125. *begin
  2126.  
  2127. C Class 10.
  2128.  
  2129. Z xxx=expr
  2130.  
  2131. Id,f1~(a,b~,p~) = F(a,b,p)
  2132.  
  2133. *begin
  2134.  
  2135. C Class 11, keyword Adiso.
  2136.  
  2137. Z xxx = expr
  2138.  
  2139. Id,Adiso,f1(g,h)*f1(a~,b~,c~) = F1(a,b,c,g,h)
  2140.  
  2141. *begin
  2142.  
  2143. C Class 12, keyword Ainbe.
  2144.  
  2145. Z xxx=expr
  2146.  
  2147. Id,Ainbe,f1(g,h)*f1(a~,b~,c~) = F1(a,b,c,g,h)
  2148. Id,Ainbe,f1(a~,b~,c~)*f1(g,h) = F2(a,b,c,g,h) 
  2149.  
  2150. *begin
  2151.  
  2152. C Class 13.
  2153.  
  2154. Z xxx=expr
  2155.  
  2156. Id,f1(x~,b,p)*f2(x~,c,q) = F(x,b,p,c,q)
  2157.  
  2158. *begin
  2159.  
  2160. C Class 15, keyword Dotpr.
  2161.  
  2162. Z xxx=expr
  2163.  
  2164. Id,Dotpr,p(mu~) = - q(mu)
  2165.  
  2166. *begin
  2167.  
  2168. C Class 16, keyword Funct.
  2169.  
  2170. Z xxx=expr
  2171.  
  2172. Id,Funct,p(mu~) = - F1(a,b,mu)
  2173.  
  2174. *end
  2175.  
  2176. 11. CONDITIONAL SUBSTITUTIONS.
  2177.  
  2178. In the foregoing IF, AND, OR and ELSE have been introduced already.
  2179. The general structure is:
  2180.  
  2181. IF pattern
  2182.  Substitutions
  2183. ELSE
  2184.  Substitutions
  2185. ENDIF
  2186.  
  2187. There may be no ELSE. The IF statement may be followed by AND and/or OR
  2188. statements. IF, AND or OR may be followed by NOT which inverts the action.
  2189. Finally, the pattern may optionally be followed by an = symbol and an
  2190. expression. In such a case the substitution is actually done if the
  2191. pattern fits. The pattern may be any of the classes discussed in the previous
  2192. section.
  2193.  
  2194. Inside Schoonschip IF's etc set or clear some bit. One bit is reserved
  2195. for any given IF depth. Nesting up to eight deep is allowed, there are eight
  2196. bits provided. Here are the rules for bit setting:
  2197.  
  2198. A succesful IF (or unsuccesful IF NOT) leads to setting of the bit. An AND (or
  2199. AND NOT) statement will be inspected only if the bit is set. If succesful (or
  2200. not succesful if AND NOT) the bit remains, else it is cleared. An OR (or OR
  2201. NOT) statement will be inspected if the bit is not set. If succesful (or not
  2202. succesful if OR NOT) it sets the bit. The substitutions or commands following
  2203. such a sequence will be inspected if the bit is set. After an ELSE the
  2204. substitutions or commands will be inspected if the bit is cleared.
  2205.  
  2206. Do not put any substitutions or commands inbetween the IF, AND or OR
  2207. statements if there is an ELSE. The reason is that substitutions and commands
  2208. following an ELSE are on the same level as those following the preceeding IF,
  2209. AND, OR group. The ELSE becomes ambiguous in such a case. Also, no AND or OR
  2210. after an ELSE, which is also ambiguous.
  2211.  
  2212. The fact that an expression may be given on the IF, AND, OR lines allows very
  2213. compact code. For example, to integrate any polynomium in x (see Example 15):
  2214.  
  2215. IF NOT x^-1 = [Log(x)]
  2216. AND NOT x^n~ = x^(n+1)/(n+1)
  2217. Al,Addfa,x
  2218. ENDIF
  2219.  
  2220. The command Addfa attaches the factor given, here x. That command will be 
  2221. executed only if none of the two previous substitutions applied. Note the
  2222. use of Al (rather than Id) for the Addfa statement. This may be done because
  2223. this statement is not using anything that might be produced by the previous
  2224. IF and AND statements.
  2225.  
  2226. Note the symbol (we stress, the symbol) [Log(x)].
  2227.  
  2228. Here some comments about level assignments. Schoonschip assigns all IF, AND and
  2229. OR statements to the same substitution level. IF is as Id, OR and AND as the Al
  2230. type assignement. A later ELSE is assigned to the same level as the associated
  2231. IF. The first substitution following an IF, AND, OR sequence may have Id or Al;
  2232. the level assigned is as usual. If none of the IF etc substitutions actually
  2233. perform substitutions then one should use Al. However, if that substitution
  2234. needs the completion of the previous IF etc substitutions then Id should be
  2235. used. The same holds after an ELSE, where Id must be used for the first
  2236. substitution following that ELSE if that substitution needs the completion of
  2237. the IF etc substitutions. Note that these latter substitutions may be way up.
  2238.  
  2239. If an AND or OR substitution depends on the result of previous IF etc
  2240. substitutions then it should not have an Al type assignment as Schoonschip
  2241. would use. To force level alignment for such a case simple put a line with Id
  2242. before the AND or OR statement, like
  2243.  
  2244. IF a1=2*(a1+a2)
  2245. Id
  2246. AND a1=(a4+a5)
  2247.  
  2248. Example:
  2249.  
  2250. L 1    IF a3=2*(a1+a2)
  2251. L 1    AND a7=5*a1*(a7+a8)
  2252. L 3    Id,a1=0
  2253. L 4    Id,Count,x,a1,1
  2254.     :
  2255. L 1    ELSE
  2256. L 3    Id,a1=3
  2257.     ENDIF
  2258. L 5    Id,...
  2259.  
  2260. The last level shown (L 5) is the maximum of (level when reaching ELSE, level
  2261. when reaching ENDIF). Compare with Al use:
  2262.  
  2263. L 1    IF a3=2*(a1+a2)
  2264. L 1    AND a7=5*a1*(a7+a8)
  2265. L 1    Al,a1=0
  2266. L 3    Id,Count,x,a1,1
  2267.     :
  2268. L 1    ELSE
  2269. L 1    Al,a1=3
  2270.     ENDIF
  2271. L 4    Id,...
  2272.  
  2273.  
  2274. 12. COMMANDS.
  2275.  
  2276. Sometimes certain operations are difficult or impossible to do with
  2277. substitutions, and a number of facilities have been build in that deal with
  2278. specific situations. They are generally called commands, and they perform
  2279. actions at the Level that they have been placed. They generally need at
  2280. least one level, and sometimes the number of levels to be used influences
  2281. the performance. The general syntax of a command is:
  2282.  
  2283. Id,Keyword,parameters separated by commas
  2284.  
  2285. in which case Schoonschip uses a number of levels depending on the command.
  2286. Alternatively, with # some number < 40:
  2287.  
  2288. Id,#,Keyword,parameters separated by commas
  2289.  
  2290. in which case Schoonschip sets aside # levels for this command. There is
  2291. one command for which this is quite relevant, namely Gammas.
  2292.  
  2293. Now to more specifics. Suppose that some function is symmetric in its
  2294. arguments, say f1(a,b,c)=f1(b,a,c)=... In such a case one would like the
  2295. arguments to be arranged always in the same order. The command
  2296.  
  2297. Id,Symme,f1
  2298.  
  2299. causes Schoonschip to inspect every function f1 that passes by at this Level,
  2300. and arguments are re-arrangered in a well defined way (first defined symbols
  2301. first). This is of course much easier than the perhaps very long set of
  2302. substitutions that would do the same thing. One would have to know beforehand
  2303. what arguments could appear, and then go through all combinations.
  2304.  
  2305. For commands the first four, if no confusion possible the first three
  2306. characters are relevant. The may be in upper or lower case. The following
  2307. commands are available:
  2308.  
  2309. Absol        Make the sign of the numerical coefficient plus
  2310. Addfa        Add factor
  2311. Anti        Inspects functions for characters with an _
  2312. Asymm        Function anti-symmetric under interchange of arguments
  2313. All        Rounds up all appearances of a vector, or appearances of
  2314.         all vectors in a specified function.
  2315. Beep        Sent Control-G to the terminal (which normally beeps at that)
  2316. Coef        Inspect numerical coefficient
  2317. Commu        Re-arrange commuting functions
  2318. Compo        Compose names from characters
  2319. Count        Count certain occurrences
  2320. Cyclic        Function invariant under cyclic permutation of arguments
  2321. Dostop        Clears, sets or tests the forced DO-loop exit flag.
  2322. Epfred        Reduce products of Epf functions
  2323. Even        Function even in sign of arguments
  2324. Expand        Expand frozen files
  2325. Extern        Call user defined subroutine
  2326. Gammas        Throw the book at Gamma matrices
  2327. Iall        Inverse of All
  2328. Numer        Insert numerical values
  2329. Ndotpr        Construct anomalous dot-products (for use with Gammas)
  2330. Odd        Function odd in sign of arguments
  2331. Order        Order functions as based on the first two arguments
  2332. Print        Prints message
  2333. Ratio        Rationalize
  2334. Spin        Sum over spins of spinor functions Ug, Ubg
  2335. Stats        Counts how often this command is called
  2336. Symme        Function symmetric under interchange of arguments
  2337.  
  2338. We will discuss them one by one. First the general format is shown, and
  2339. then some example is given. Commands may also occur in IF etc statements,
  2340. but often it is not well defined what means succes or failure. As a rule
  2341. succes is defined as 'some action has been taken'. For example, Addfa
  2342. will always give succes.
  2343.  
  2344. Ordering inside Schoonschip is always done on the basis of 'smallest first',
  2345. not only for the purposes of the commands of this section, but also for output
  2346. printing of the quantitities not mentioned in the B-list. This means the
  2347. following ordering for quantities of different kind:
  2348.  
  2349.  Index, Vector, Function, Algebraic symbol, Characters,
  2350.  Number (short numbers), Vector-component, Dot-product.
  2351.  
  2352. For quantities of the same kind the ordering is according to the moment at
  2353. which the quantity was encountered first. For dot-products the earliest
  2354. defined vector counts first. To guarantee a certain ordering the quantities
  2355. can be given in the appropriate list in the desired order.
  2356.  
  2357. With respect to numbers the counting is not entirely as one might expect:
  2358. 0 before positive numbers up to 127, then 128=-128, -127, -126,..., -1.
  2359. This is because of the two's complement notation for numbers.
  2360.  
  2361. ***    Id,Absol
  2362.  
  2363. The coefficient of the term inspected is forced positive. This command
  2364. needs no levels.
  2365.  
  2366. ***    Id,Addfa,expression
  2367.  
  2368. The expression specified is attached as a factor. This command is mainly
  2369. intended for use with conditional statements; the expression can be attached
  2370. depending on previous actions. There are no particular limitations
  2371. on the sort of expression that can occur here; anything allowed in a Z
  2372. expression or in the right hand side of a substitution is allowed here,
  2373. although here no dummies can be specified.
  2374.  
  2375. Example 15.
  2376.  
  2377. Integration of polynomium.
  2378.  
  2379. A a,b,c,d,e,x
  2380.  
  2381. Z xxx = a*x^2 + b*x + c + d/x + e/x^2
  2382.  
  2383. IF NOT x^-1=[Log(x)]
  2384. AND NOT x^n~=x^(n+1)/(n+1)
  2385. Id,Addfa,x
  2386. ENDIF
  2387.  
  2388. *end
  2389.  
  2390. The command All (and the associated Iall) has two different syntaxes. In the
  2391. first syntax the first argument is a vector (must have been defined before):
  2392.  
  2393. ***    Id,All,p,N,F
  2394.  
  2395. Optionally this list may be followed by the character arguments "F_, "D_
  2396. or "V_ (always separated by commas), and possibly an index list, see below.
  2397.  
  2398. For the second syntax the first argument is a function (must have been defined
  2399. before):
  2400.  
  2401. ***    Id,All,Fx,N,F
  2402.  
  2403. The parameters p,N and F must have been defined previously as vector,
  2404. algebraic symbol (it must be a one character symbol) and function.
  2405. The parameter N may be absent.
  2406.  
  2407. First syntax:
  2408. All occurrences of the vector p are considered. If any qualifying p
  2409. found the function F is appended. Next this function obtains arguments
  2410. reflecting the p found:
  2411.  
  2412. - If p(mu) with mu any index is seen this p is removed and the argument
  2413.   mu is added to the argument list of F.
  2414. - If pDq with any q and a positive exponent (say pDq^n) then the argument
  2415.   q is added n times.
  2416. - If pDp with a positive power (say n) is seen then a new index is created.
  2417.   This index is added 2*n times.
  2418. - If p is seen as argument of any function then an index is created. This
  2419.   created index replaces p as function argument, and furthermore the index
  2420.   is added to the arguments of F.
  2421.  
  2422. In the above work, whenever an index is created, it is given the symbolic
  2423. dimension N, or the default dimension (=4) if no N specified.
  2424. The main use of this command is to facilitate integration with the vector
  2425. p as integration variable.
  2426.  
  2427. Optionally character arguments may be specified after the list shown above.
  2428. The allowed characters are:
  2429.  "F_ "D_ "V_
  2430. If "F_ seen no function arguments will be inspected. "D_ inhibits dot-product
  2431. inspection, "V_ single vectors. Example:
  2432.  
  2433. Id,All,p,N,F,"F_,"V_
  2434.  
  2435. Only dot-products are considered.
  2436.  
  2437. Second syntax:
  2438. All arguments of the funtion Fx are considered. If a given argument is
  2439. a vector then that vector is replaced by a created index. The function
  2440. Fq obtains two new arguments, namely the vector and the created index.
  2441. In the final result the arguments of Fq are: first all vectors, then the
  2442. corresponding indices. For example, All,Fx,N,Fq applied to Fx(p,k,q)
  2443. gives Fx(Naa,Nab,Nac)*Fq(p,k,q,Naa,Nab,Nac).
  2444.  
  2445. It is clear that the All command will in general give rise to created
  2446. indices. Such indices are often renamed by Schoonschip, in order to
  2447. achive a well defined result in the output. This renaming may sometimes
  2448. be undesirable, in particular there may be undesirable consequences
  2449. when later a Freeze command is issued; the Freeze command may offer
  2450. trouble if a created index appears in a pair, one outside and one
  2451. inside the brackets. To handle such cases one may assign to the All
  2452. command a list of indices after the last function (and the possible
  2453. V_ etc). These indices must be defined in the I list, with the same
  2454. dimension as that specified in the All command, and they will be
  2455. used rather then newly created indices. Example:
  2456.  
  2457. I al1=N,al2=N,al3=N
  2458.  :
  2459.  :
  2460. Id,All,p,N,Fx,D_,al1,al2,al3
  2461.  
  2462. It may be that more indices are needed then provided in the list. There
  2463. are two options here. If the command is as above, and if the list is
  2464. exhausted then Schoonschip will issue an error message. If the list is
  2465. terminated with the character C:
  2466.  
  2467. Id,All,p,N,Fx,D_,al1,al2,al3,"C
  2468.  
  2469. then Schoonschip will, after using up al1-al3, create further indices
  2470. as needed.
  2471.  
  2472. C Example 16.
  2473.  
  2474. V p,q
  2475. F F
  2476. I mu=N,nu=N
  2477.  
  2478. Z xx= pDp^2 * pDq^3 * F1(p,p,q,p) * p(mu) * q(nu)
  2479.  
  2480. Id,All,p,N,F
  2481. P output
  2482. *yep
  2483. C Showing the dimensionality of the created indices:
  2484.  
  2485. Id,F(i1~,i2~,i3~,i4~,i5~,i6~,i7~,i8~,i9~,i10~,i11~)=
  2486.  F(i1,i2,i3,i6,i7,i8,i9,i10,i11)*D(i4,i5)
  2487.  
  2488. *begin
  2489. C A more realistic example.
  2490.  
  2491. I al,be,mu,nu
  2492. A N,N_
  2493. V p,k
  2494. F F,F20,F22
  2495.  
  2496. Z xx = G(1,1,al,be,p,al,be,p)
  2497.  
  2498. Id,All,p,N,F
  2499. P output
  2500. *yep
  2501. Id,F(i1~,i2~) = D(i1,i2)*F20(k) + k(i1)*k(i2)*F22(k)
  2502. *end
  2503.  
  2504. ***    Id,Anti,TA
  2505.  
  2506. All function arguments are inspected for character arguments ("X). If
  2507. a character with underscore is seen the character table TA is consulted.
  2508. If that character appears in that table the underscore is removed.
  2509. This command will be discussed further in the section on character
  2510. manipulations.
  2511.  
  2512. ***    Id,Asymm,F1,2,3,4,F2,F3,4,5
  2513.  
  2514. This command specifies that f1 is anti-symmetric in arguments 2,3 and 4,
  2515. f2 in all arguments and f3 in arguments 4 and 5. If the arguments are not
  2516. in the 'first defined first' order the arguments are permuted. If the
  2517. permutation is odd a minus sign is attached. If a number in the list is larger
  2518. then the number of function arguments that number is ignored.
  2519.  
  2520. There is a second syntax for this command that can be used if the arguments
  2521. occur in groups:
  2522.  
  2523. ***    Id,Asymm,F1:2,3,4:7,8,9:12,13,14:
  2524.  
  2525. The groups of numbers within colons denote argument groups. They need not to be
  2526. sequential. Only the first argument of a group is used in the comparison.
  2527. However, if an interchange is needed both groups are interchanged as a whole.
  2528. For example, if in the above case argument 7 is to placed before argument 2
  2529. than 2 is interchanged with 7, 3 with 8 and 4 with 9.
  2530. If the arguments are sequential an even shorter syntax is allowed:
  2531.  
  2532. ***    Id,Asymm,F1:1-3:7-9:12-14:
  2533.  
  2534. The number of arguments in each group must of course be the same.
  2535.  
  2536. Note: for symmetric functions see command Symme.
  2537.  
  2538. Example 17.
  2539.  
  2540. V p,q,k
  2541. I mu
  2542. A a,b,c,d,e,f,g,h
  2543. F F1,F2,F3
  2544.  
  2545. Z xx = F1(e,d,c,b,a) + F2(e,d,c,b,a) + F3(e,d,c,b,a)
  2546.     + F2(-125,-30,-1,0,30,125)
  2547.     + F2(pDq,pDk,kDq,p(3),q(2),F2,7,mu,p,a)
  2548.     + f1(e,f,g,d,a,b,c,h,k)
  2549.  
  2550. Id,Asymm,F1,2,3,4,F2,F3,4,5
  2551. Al,Asymm,f1:1-3:5-7:
  2552.  
  2553. *end
  2554.  
  2555. The command
  2556.  
  2557. ***    Id,Beep,#
  2558.  
  2559. sends a Control-G to the terminal. This normally results in a beep. It may be
  2560. used to signal audibly certain occurrences. Be careful though; one quickly gets
  2561. a lot of noise. The number # limits that: at most # beeps will be issued. The
  2562. number # must be positive and less than 128. Example:
  2563.  
  2564. IF a^10
  2565. Al,Beep,3
  2566. ENDIF
  2567.  
  2568. The Beep statement (not this command) may be used to generate some noise at
  2569. termination, or if an error occurs.
  2570.  
  2571. The command Coef essentially inspects the numerical coefficient of any term
  2572. passing by, and here specifically use with conditional substitutions is
  2573. intended. The syntax is:
  2574.  
  2575. ***    IF Coef,option
  2576.  
  2577. Of course, this command can also be used with AND or OR, with ot witthout
  2578. a NOT. The possible options are:
  2579.     pl    plus
  2580.     ng    negative
  2581.     eq,#    equal
  2582.     lt,#    less than
  2583.     gt,#    greater than
  2584.     ib,#,#    inbetween
  2585. Here # represents a number (any number, not just short numbers). When a
  2586. term passes by the coefficient is inspected or compared, and the IF bit
  2587. is set or cleared depending on the result. Concerning equal, two numbers
  2588. are considered equal if they agree within the number of decimal digits
  2589. specified by the Precision statement (25 default). The naming of the
  2590. options corresponds closely to the way the IF bit is set:
  2591.  
  2592.             y    set IF bit (or clear if IF NOT)
  2593.     If Coef,option
  2594.             n    clear IF bit (or set if IF NOT)
  2595.  
  2596.  
  2597. C Example 18.
  2598.  
  2599. A a1,a2,a3,a4,alt1,agt2,aeq15,ai12
  2600.  
  2601. Z xxx= 0.5*a1 + 1.5*a2 + 2.5*a3 + 1.E-20*a4
  2602.  
  2603. IF Coef,lt,1.        !Add factor alt1 if coefficient < 1.
  2604. Id,Addfa,alt1
  2605. ENDIF
  2606.  
  2607. IF Coef,gt,2.        !Add factor agt2 if coefficient > 1.
  2608. Id,Addfa,agt2
  2609. ENDIF
  2610.  
  2611. IF Coef,eq,1.5        !Add factor aeq15 if coefficient = 1.5
  2612. Id,Addfa,aeq15
  2613. ENDIF
  2614.  
  2615. IF Coef,ib,1,2        !Add factor ai12 if coefficient inbetween 1 and 2.
  2616. Id,Addfa,ai12
  2617. ENDIF
  2618.  
  2619. IF Coef,lt,1E-15    !Delete the term if coefficient < 1E-15.
  2620. Id,Addfa,0
  2621. ENDIF
  2622.  
  2623. *end
  2624.  
  2625. As shown, this command can be used effectively to eliminate 'dirt'.
  2626.  
  2627. The command Commu is used for ordering commuting functions. The ordering
  2628. is done (i) with respect to the name of the function (smallest first, see
  2629. the introduction of this section) (ii) number of arguments (iii) arguments.
  2630.  
  2631. ***    Id,Commu,F1,F2,F3,...
  2632.  
  2633. If the commuting functions occur nested between other functions then they are
  2634. taken out and placed behind these other functions. Thus the Commu command
  2635. may be of consequence even if there is only one function named, and if that
  2636. function occurs at most once in a given term.
  2637.  
  2638. Example 19.
  2639.  
  2640. A a1,a2,a3,a4,a5
  2641. F F1,F2,F3
  2642.  
  2643. Z xx = F3(a1,a2)*F1(a1,a2,a3)*F1(a4,a5)
  2644.  + F1(a1,a2,a4)*F2(a1,a2,a3)*F1(a1,a2,a3)
  2645.  + F3(a1,a4)*F2(a1,a2,a3)*F1(a1,a2,a4)*F2(a3,a4,a5)
  2646.  
  2647. Id,Commu,F1,F3
  2648.  
  2649. *end
  2650.  
  2651. The IF bit is set if any of the named functions is present.
  2652.  
  2653. The Compo command is quite complicated, and realistic application are not
  2654. well suited for description in this manual. We will nevertheless give a
  2655. complete description of this command. It involves character manipulation
  2656. and may lead to the generation of new symbols including functions. There
  2657. is a way to correlate the created name of a function with the arguments
  2658. specified. Combined with the use of Tables (Tables can also have characters
  2659. in the list) this is a very powerful tool to generate many symbols or also
  2660. functions reflecting a topology. For a very simple application see also
  2661. the example demonstrating the command Count, Example 21.
  2662.  
  2663. ***    Id,Compo,"X,TA,<options>,F1,F2,<options>,F3,F4,..
  2664.  
  2665. The character argument "X may be absent, or it may be "S or "S_.
  2666. The character table argument TA may be absent. If present it specifies
  2667. characters for which "X_="X (anti-particle = particle). If not given
  2668. the default is used, which may be none, or one defined by means of the
  2669. Anti statement.
  2670.  
  2671. Briefly, Compo takes the character arguments found in F1 etc, permutes them
  2672. into a well defined order (unless "S_ is specfied for "X) and at the same time
  2673. permutes argument groups in F1. The characters are then glued together and
  2674. either identified with an existing name, or if not existing the name is entered
  2675. in some name list, or the term is discarded depending on the options specified.
  2676.  
  2677. The functions F1,F2,... are inspected. The arguments are expected to have the
  2678. following structure:
  2679.  
  2680.     F1(c1,c2,c3,..,cn,/,d1,d2,..,dm,*,arg1a,arg1b,.,*,arg2a,arg2b,
  2681.     ..,*,argka,argkb,..)
  2682.  
  2683. In here c1..cn and d1...dm are characters, with the notation ". Legal are:
  2684. upper and lower case characters and number characters possibly followed by an
  2685. underscore. They may also be vectors, in which case the character(s) of the
  2686. vector name are used.  Either n or m may be zero, but not both. If m is zero
  2687. the / needs not to be given. The arguments arg1a,arg1b etc correspond to
  2688. character c1, arg2a,arg2b etc to character c2 and so on. The sum of n and m
  2689. must not exceed 6 (not counting the underscores), and not 2 if the name to be
  2690. constructed is to be a vector name.
  2691.  
  2692. The characters c1-cn are subject to the ordering process, the d1-dm not.
  2693.  
  2694. Concerning the argument groups (arg1a,arg1b,..),(arg2a,arg2b,...),...,
  2695. (argka,argkb,...) the following:
  2696.  
  2697. - an argument group may be empty. This corresponds to two successive *
  2698.   separated by a comma;
  2699. - the number of argument groups may be less then the number of characters
  2700.   c (i.e. k less than n). In that case argument groups k+1, k+2,.. are
  2701.   considered empty;
  2702. - the number of argument groups may be larger then the number of characters
  2703.   c (i.e. k larger than n). Access groups are not considered in the actions
  2704.   described below and are simply reproduced. 
  2705.  
  2706. When encountering such a function Schoonschip inspects the characters and
  2707. permutes them according to the standard character ordering (A-Z, a-z, 0-9;
  2708. characters followed by an underscore are ordered just before the corresponding
  2709. character without underscore: A,B,C_,C etc). The sets of arguments
  2710. arg1a,arg1b,.., arg2a,arg2b,.. are permuted in tune with this. Thus if for
  2711. example only c1 and c2 are exchanged then the argument list reads afterwards:
  2712.      *,arg2a,arg2b,..,*,arg1a,arg1b,..,*,arg3a,...
  2713. No permutation is done with respect to the characters d1,d2,...
  2714.  
  2715. No permutation is done if the character variable "S_ (no symmetrization)
  2716. was given in the argument list of Compo.
  2717.  
  2718. Next all characters are glued together, thus forming a name. This name is
  2719. searched for in the lists mentioned in 'options'; if found that name is
  2720. identified with that variable. If not found the action taken depends again on
  2721. the option specification. If a list is mentioned twice then the new name is
  2722. added to that list and new occurrences will be identified with that name. If no
  2723. list is specified twice in options then the whole term is discarded.
  2724.  
  2725. In the option list, enclosed between < >, the characters X A F V I may
  2726. appear once, the characters A F V and I also twice. Thus no new entries
  2727. can be made to X-expressions, but the X table (which includes also D
  2728. and T expressions and files) can be searched. At most one character can
  2729. occur twice. There is a default option: <AXIVFA> meaning search all lists,
  2730. and if not found insert in algebraic symbol list.
  2731.  
  2732. After identification of the name the corresponding symbol is made to be the
  2733. first argument of the function, replacing all c and d characters and the
  2734. optional /. Then all * are removed. The result is a function with as first
  2735. argument the constructed symbol, and the following arguments is what results
  2736. after the permutations among the argument groups. In subsequent substitutions
  2737. one may work this function out to whatever is required.
  2738.  
  2739. C Example 20.
  2740.  
  2741. F F1,F2
  2742. A a,b,c,d
  2743.  
  2744. Z xx =      F1("c,"b,"a,/,"e,*,a1,a2)
  2745.     + F1("c,"b,"a,/,"e,*,a1,a2,*,xy)
  2746.     + F1("c,"b,"a,/,"e,*,a1,a2,*,xy,*,a2)
  2747.     + F1("c,"b,"a,/,"e,*,a1,a2,*,xy,*,b2,*,xz)
  2748.  
  2749.     + F2("a,"b,/,"F,*,x,*,y,*,z1)
  2750.     + F2("b,"a,/,"F,*,x,*,y,*,z1)
  2751.     + F2("F,"c,"b,"a,*,*,z,*,y,*,x)
  2752.     + F2("F,"c,"b,"a,*,*,z,*,yp,*,x)
  2753.  
  2754.  
  2755. Id,Compo,<AVIFXA>,F1,<FF>,F2
  2756. Id,Always,F2(F1~,a~,b~,c~,d~,e~) = F1(a,b,c)
  2757. Id,F1~(a~,b~,z1) = F1(a,b)
  2758. *begin
  2759.  
  2760. Notes: concerning the first group, F1, various possibilities concerning
  2761. number of argument groups are demonstrated. The option specified for this
  2762. in the Compo command is actually the default option and could have been
  2763. omitted. In the second group it is shown how various functions with arguments
  2764. can be created, even with different number of arguments. To this purpose
  2765. the fake argument z1 was introduced in the first two cases. The function
  2766. substitution for F2 works no matter how many arguments, but one must take
  2767. care that in the right hand side no undefined quantities appear. This means
  2768. that the function F2 should not occur with less than 3 arguments.
  2769. Unfortunately it is not possible to handle empty arguments here. The fake
  2770. argument z1 is removed in the last substitution. 
  2771.  
  2772. Note also dummy use in the substitutions. For function dummies we used
  2773. a function symbol defined in the F-list (F1 in this case). Disaster may
  2774. result if this is not done. It is extremely difficult to analyze for all
  2775. possible cases that may occur if that type of error is made, and many
  2776. cases will lead to cryptic error messages seemingly unrelated to this.
  2777.  
  2778. A second example shows the use of Compo together with Tables. It is a
  2779. rather artificial example, but it shows the main ideas. Suppose an electric
  2780. circuit must be build up from 4 three-pole elements connected by diodes,
  2781. in the configuration shown:
  2782.  
  2783.            j1
  2784.     i1   ---0-------0---  i3
  2785.          j4    |    |j2
  2786.         |    |
  2787.     i2   ---0-------0---  i4
  2788.            j3
  2789.  
  2790.  
  2791. The currents i1 and i2 are flowing inwards, i3 and i4 outwards. j1-j4 are taken
  2792. to flow clockwise. The 3-pole elements have three external connections called
  2793. A, B and C. The connecting elements are diodes, the connections are called B
  2794. and C. B of a diode may be connected to a B from a 3-pole, C to the C of a
  2795. 3-pole. One might think here of emitter and collector of a transistor.  The
  2796. main object is now to generate all possible configurations, which is very
  2797. simple in this case, one may either have all the diodes oriented clock-wise, or
  2798. all oriented counter-clock-wise. Also one wants to exhibit the currents flowing
  2799. through the various objects. Once the expression involving all elements with
  2800. the currents is obtained explicitly one can go on and work out whatever is
  2801. wanted. If the connecting elements are for instance a diode, resistor and
  2802. battery in series one can compute all currents as function of the input/output
  2803. currents i1-i4, but we will leave this to the imagination of the reader.
  2804.  
  2805. In the example below the function v3 represents the 3-pole. The only
  2806. combination to be recognized is the combination ABC. Thus only the function
  2807. ABC is defined, and in the options of Compo the F-list is mentioned only
  2808. once. Things like AAB or ACC will then be thrown away. Below we simply
  2809. sum over all possibilities for the connecting lines (i.e. AA, BC and CB)
  2810. leaving it to Compo to keep only those combinations that contain exclusively
  2811. the functions ABC and BC.
  2812.  
  2813. A new feature in this example is the occurrence of characters in the
  2814. lists for the Tables Ch and Cg. While not exhibited here there is another
  2815. facility build in. Normally one refers to a table-element by means of the
  2816. table name followed by a number. One may also refer to table elements by
  2817. means of the table name followed by a character. Then the number associated
  2818. with that character (given above) is used to pick out the correct element.
  2819. This is useful if certain properties have to be associated with a character.
  2820.  
  2821. T Ch(n)="A,"B,"C
  2822. T Cg(n)="A,"C,"B
  2823.  
  2824. F BC,ABC
  2825. A i1,i2,i3,i4,j1,j2,j3,j4
  2826.  
  2827. Z solu = square("A,"A,"A,"A)
  2828.  
  2829. Id,square(c1~,c2~,c3~,c4~) = DS{L1,1,3,(DS{L2,1,3,
  2830.     (DS{L3,1,3,(DS{L4,1,3,(
  2831.         v3(c1,Ch(L1),Cg(L4),*,i1,*,-j1,*,j4)*
  2832.         con(Ch(L1),Cg(L1),*,j1,*,-j1)*
  2833.         v3(c3,Cg(L1),Ch(L2),*,-i3,*,j1,*,-j2)*
  2834.         con(Ch(L2),Cg(L2),*,j2,*,-j2)*
  2835.         v3(c4,Cg(L2),Ch(L3),*,-i4,*,j2,*,-j3)*
  2836.         con(Ch(L3),Cg(L3),*,j3,*,-j3)*
  2837.         v3(c2,Cg(L3),Ch(L4),*,i2,*,j3,*,-j4)*
  2838.         con(Ch(L4),Cg(L4),*,j4,*,-j4)
  2839.         ) } ) } ) } ) }
  2840.  
  2841. Id,Compo,<F>,v3,con
  2842. Id,v3(f1~,a1~,a2~,a3~) = f1(a1,a2,a3)
  2843. Al,con(f1~,a1~,a2~) = f1(a1)
  2844. *end
  2845.  
  2846. The command Count has grown out of the need to have a facility that selects
  2847. terms on the basis of certain asymptotic properties. One may know of various
  2848. functions and other quantities how they behave as function of some variable for
  2849. certain limiting values of that variable (like for example behaviour as
  2850. function of x for very large x). With Count one can for instance select terms
  2851. that behave for large x as x^n with n larger then some given number. This is
  2852. the most typical application. But the command allows many other things, here is
  2853. the description.
  2854.  
  2855. ***    Id,Count,xxx,arg1,#,arg2,#,....
  2856.  
  2857. In case that xxx is a function or X-expression the format is:
  2858.  
  2859. ***    Id,Count,Fx,arg1,#,arg2,#,...,# : arg3,#,...,# : arg4,#,...
  2860.  
  2861. The colon's separate groups of arguments.
  2862.  
  2863. Optionally, function names preceeded by "F may be specified directly after
  2864. the first argument of Count or after the semicolons, if any:
  2865.  
  2866. ***    Id,Count,Fx,"F,Fy,"F,Fz,arg1,#,arg2,#,...,# :"F,Fc,arg3,#,...,#
  2867.  
  2868. In here arg1, arg2 etc may be indices, vectors, algebraic symbols or functions.
  2869. As a first step, investigating a term, a number is constructed. This number is
  2870. the sum of numbers obtained for individual factors. The number for an
  2871. individual factor is the exponent of that factor (if applicable) multiplied by
  2872. the number following the corresponding argument in the Count list. Thus if in
  2873. the Count list x,7 occurs than a x^3 in a term leads to a contribution of 21 to
  2874. the number being constructed. If no exponent (as would be the case for a
  2875. function or vector) the number from the list is added once. The contribution of
  2876. vector-components or dot-products is computed on the basis of the value
  2877. assigned to the corresponding vectors in the list. Thus p,2,q,5 leads to 21 for
  2878. pDq^3 and 10 for q(3)^2. In constructing the number function arguments or
  2879. vector indices are not investigated. However, function argumnts of functions
  2880. specified with the "F option are counted as single occurences. Thus, the
  2881. statement
  2882.  
  2883. Id,Count,xxx,"F,Fa,a,35,b,1
  2884.  
  2885. leads to the count 38 for the term  b^2*Fa(a,b,c).
  2886.  
  2887. The action taken next depends on what occurs as first argument in the
  2888. Count list (i.e. xxx above):
  2889. - If xxx is a number then the constructed number is compared with xxx.
  2890.   If the constructed number is equal or larger than xxx the term is kept
  2891.   Else the term is deleted.
  2892. - If xxx is an algebraic symbol, vector component or dot-product the
  2893.   constructed number is made to be the exponent of that symbol and the
  2894.   combination is attached to the term.
  2895. - If xxx is a function or X-expression then the number is made to be the
  2896.   argument of that function or X-expression and the combination is attached
  2897.   to the term.
  2898.   A multiple count can be made. The occurrence of a colon (:) in the count
  2899.   list signals that subsequent counts must be put in subsequent function
  2900.   arguments. Thus if two colons occur a three argument function is created.
  2901.   The list up to the first colon is used to compute the value of the first
  2902.   argument, the argument list between first and second colon determines the
  2903.   value of the second argument, etc. Example: consider the term
  2904.  
  2905.     a^3*b^2*pDk
  2906.  
  2907.   with p and k vectors. The command
  2908.  
  2909.     Id,Count,Fc,a,1,b,2 : p,2,k,3
  2910.  
  2911.   (Fc defined before to be a function) generates a two argument function Fc:
  2912.  
  2913.     Fc(7,5)*a^3*b^2*pDk
  2914.  
  2915.   The fact that Fc may also be an X or D-expression allows for very compact
  2916.   but quite complicated counting. If Fc is a non-numeric X or D expression
  2917.   then possibly several substitution levels are needed to work out the
  2918.   result, and in this case Schoonschip does not automatically count that.
  2919.   For purely numeric X and D expressions only one level is needed. To insure
  2920.   proper level spacing in case of non-numeric Fc write a dummy substitution
  2921.   involving Fc directly before the Count command and use Al for the Count
  2922.   command:
  2923.  
  2924.     Id,XxxX=Fc
  2925.     Al,Count,Fc,a,1,b,2 : p,2,k,3
  2926.  
  2927.   where XxxX is not occurring anywhere else.
  2928.  
  2929. In the following example we do not only demonstrate Count, but show also
  2930. some other application of Compo. The coefficients a1-a5 are constructed and
  2931. entered in the A-list (remember default options Compo is <AFVIXA>). Also
  2932. the use of Keep and *next is shown.
  2933.  
  2934. Example 21.
  2935.  
  2936. A x,y
  2937. T tt(n) = "1,"2,"3,"4,"5
  2938.  
  2939. C Here a complicated way to make
  2940. C    pow(x) = a1*x + a2*x^2 + a3*x^3 + a4*x^4 + a5*x^5.
  2941.  
  2942. Z pow(x) = DS(J,1,5,{f1(/,"a,tt(J))*x^J})
  2943.  
  2944. Id,Compo,f1
  2945. Id,f1(y~) = y
  2946.  
  2947. Keep pow
  2948. *next
  2949.  
  2950. Z xx = pow(x)
  2951.  
  2952. Id,Count,3,x,1
  2953.  
  2954. Keep pow
  2955. *next
  2956.  
  2957. Z xx = pow(y)
  2958.  
  2959. Id,Count,f1,y,2,a3,10
  2960.  
  2961. Keep pow
  2962. *next
  2963. V p,q
  2964. A AA
  2965.  
  2966. Z xx = pow(y)*f1(a2,a3)*pDq^2
  2967.  
  2968. Id,Count,AA,y,2,f1,-4,p,1,q,3
  2969.  
  2970. *end
  2971.  
  2972. The commands Cyclic and Symme are analogous to Asymm, except that invariance
  2973. under cyclic permutation or simply exchange of arguments is implied.
  2974.  
  2975. ***    Id,Cyclic,F1,2,3,4,F2,F3,4,5
  2976.  
  2977. ***    Id,Symme,F1,2,3,4,F2,F3,4,5
  2978.  
  2979. For the command Symme the alternative syntaxes used to denote groups of
  2980. arguments can be used:
  2981.  
  2982. ***    Id,Symme,F1:2,3,4:7,8,9:12,13,14:
  2983. ***    Id,Symme,F1:1-3:7-9:12-14:
  2984.  
  2985. As to Cyclic, the arguments are permuted following the pattern specified in
  2986. the Cyclic list, which may make things pretty obscure as the following
  2987. example shows. The arguments specified are permuted till 'smallest first'.
  2988.  
  2989. Example 22.
  2990.  
  2991. A a,b,c,d,e
  2992.  
  2993. Z xxx = f1(e,d,c,b,a) + f2(e,d,c,b,a) + f3(e,d,c,b,a)
  2994.  
  2995. Id,Cyclic,f1,2,5,4
  2996. Id,Symme,f2,f3,2,3,4
  2997.  
  2998. *end
  2999.  
  3000. ***    Id,Dostop,on
  3001. ***    Id,Dostop,off
  3002. ***    Id,Dostop
  3003.  
  3004. The command Dostop may be used to set, clear or test the forced DO-loop exit
  3005. flag. If this flag is set then the next ENDDO encountered is taken to be
  3006. satisfied. This command may be used to execute a set of substitutions
  3007. and commands followed by a *yep repeatedly till some condition is satified.
  3008. Here a typical example:
  3009.  
  3010. Z xx = a^10
  3011.  
  3012. DO J=1,100
  3013. Dostop off
  3014. Id,a1^n~=a1^(n-1)*b
  3015. IF NOT a1
  3016. ..Id,Dostop,on
  3017. ENDIF
  3018. *yep
  3019. ENDDO
  3020.  
  3021. *end
  3022.  
  3023. The DO-loop sequence will be re-executed 100 times or till no more a1 present.
  3024. In the case shown the cycle is run 10 times and the result is b^10. Note
  3025. that:
  3026. - The Dostop statement and command are within the same program segment (i.e.
  3027.   there is no line with an * inbetween);
  3028. - The last line of the DO-sequence contains an * in column 1.
  3029. Refer to the remarks on the Dostop statement for more details.
  3030.  
  3031. The Dostop command may have other or no parameters:
  3032.  
  3033. Id,Dostop,off
  3034. Id,Dostop
  3035.  
  3036. In the last case the Dostop flag is tested, but not modified. The command
  3037. may be used in conjunction with an IF:
  3038.  
  3039. IF Dostop
  3040. ...
  3041. ENDIF
  3042.  
  3043. A set flag implies 'yes'.
  3044.  
  3045. The command Epfred leads to reduction of products of Epf with equal number of
  3046. arguments to one Epf.
  3047.  
  3048. ***    Id,Epfred
  3049.  
  3050. The simplest case is for two arguments:
  3051.    Epf(i1,i2)*Epf(i3,i4) = D(i1,i3)*D(i2,i4) - D(i1,i4)*D(i2,i3)
  3052. In three dimensions this is the equation that rewrites the product of two
  3053. cross products in terms of dot-products. If p, q and k are vectors, than the
  3054. pseudo-scalar (k.pxq) is given by  Epf(k,p,q). If pp, qp and kp are also
  3055. vectors then the product (k.pxq)*(kp.ppxqp) can be rewritten in terms of dot-
  3056. products. Similar relations hold in higher dimensions. Note: the product of
  3057. two Epf of different dimension is not reduced.
  3058.  
  3059. Example 23.
  3060.  
  3061. V p,q,k,pp,qp,kp
  3062.  
  3063. Z xxx = Epf(k,p,q)*Epf(kp,pp,qp) + Epf(i1,i2,i3,i4)*Epf(i1,i2,j3,j4)
  3064.  
  3065. Id,Epfred
  3066.  
  3067. *end
  3068.  
  3069. The commands Even and Odd specify that some function is even or odd with
  3070. respect to change of sign of certain arguments. Minus signs of such arguments
  3071. are removed.
  3072.  
  3073. ***    Id,Even,f1,2,3,4,f2,f3,4,5
  3074.  
  3075. ***    Id,Odd,f1,2,3,4,f2,f3,4,5
  3076.  
  3077. Example 24.
  3078.  
  3079. F f1,f2,f3,f4
  3080.  
  3081. Z xxx = f1(-a1,-a2,a3,-a4) + f2(-a1,-a2,a3,-a4) + f3(-a1,-a2,a3,-a4)
  3082.     + f4(-a1,-a2,a3,-a4)
  3083.  
  3084. Id,Even,f1,2,3,f2
  3085. Id,Odd,f3,2,3,f4
  3086.  
  3087. *end
  3088.  
  3089. The command Expand occurs in combination with frozen files. See the section
  3090. on freezing a file. Syntax:
  3091.  
  3092. ***    Id,Expand,fname
  3093.  
  3094. In here fname is the name of a frozen file. All frozen subfiles referred
  3095. to through the function DF or expanded.
  3096.  
  3097. ***    Id,Extern,arg1,arg2,...
  3098.  
  3099. The command Extern allows entering an of external routine as integral
  3100. part of Schoonschip. First one needs the statement External:
  3101.  
  3102. External filename
  3103.  
  3104. The statement External, specifying an external file, leads to loading of that
  3105. file in working space. The command Extern leads, at execution time, to a jump
  3106. to the first location of that file. If that file contains position independent
  3107. executable code then manipulations on expressions can be performed. This
  3108. requires an understanding of the formats used inside Schoonschip, and supposes
  3109. the ability to generate such a file.
  3110.  
  3111. The interface provides acces to all arrays, and also utilities such as
  3112. print routines etc inside Schoonschip can be used. The information will
  3113. not be given here, but is available. Roughly speaking, a whole series
  3114. of addresses is passed on as a structure on the stack. The arguments are
  3115. passed on in the form of an array.
  3116.  
  3117. In principle this facility allows the creation of special packages
  3118. designated for specific problems.
  3119.  
  3120. ***    Id,Iall,p,F
  3121. ***    Id,Iall,F
  3122.  
  3123. Inverse of All for the two possible syntaxes. Do not use Iall if the indices
  3124. that occur as argument may have dimensional restrictions (Dim_N or Dim_4)
  3125. as created when doing gamma algebra, command Gammas. The command Ndotpr is
  3126. to be used in such cases.
  3127.  
  3128. ***    Id,Gammas, loop indices + options, Trace, loop indices + options
  3129.  
  3130. This command will be discussed in a separate section: Gamma algebra.
  3131.  
  3132. The command Numer can be used if numerical values must be inserted for
  3133. certain quantities. The format is:
  3134.  
  3135. ***    Id,Numer,arg1,#,arg2,#,...
  3136.  
  3137. The numbers need not to be short numbers, they can be anything. Function
  3138. arguments are not considered. The arguments may be algebraic symbols,
  3139. vector components or dot-products.
  3140.  
  3141. Example 25.
  3142.  
  3143. V p,q
  3144.  
  3145. Z xxx = a1^2*pDq^3/p(4)
  3146.  
  3147. Id,Numer,a1,2,pDq,1.E10,p(4),1.E5
  3148.  
  3149. *end
  3150.  
  3151. The command
  3152.  
  3153. ***    Id,Ndotpr,F1
  3154.  
  3155. is closely related to the Gammas command and will be discussed in the section
  3156. on Gamma algebra.
  3157.  
  3158.  
  3159. ***    Id,Order,F1,F2,...
  3160.  
  3161. This command searches for the functions F1, F2.... and builds a chain on
  3162. the basis of the first two arguments. First the function F1 is searched.
  3163. The second argument is taken, and looked for in other functions. If found,
  3164. the new function is chained to the previous. Etc.
  3165.  
  3166. One index is kept in the collected Faa, namely the first seen.
  3167.  
  3168. There are two additional options for this command. Specifying the character "C
  3169. (for collect) as first arguments leads to collection of all arguments except
  3170. the first two into one function. Specifying a number as first argument gives
  3171. that number as first argument to the collected functions of the first chain
  3172. collected, that number+1 to the second, etc. The option "C may be combined with
  3173. this. If the number given is zero no first argument is kept. Examples
  3174. (the output is reproduced here):
  3175.  
  3176. Z x1 = Faa(4,5,ddd)*Faa(2,3,bbb)*Faa(1,2,aaa)*Faa(3,4,ccc)
  3177. Id,Order,Faa
  3178.  
  3179. x1 = + Faa(1,aaa)*Faa(1,bbb)*Faa(1,ccc)*Faa(1,ddd) + 0.
  3180.  
  3181.  
  3182.  
  3183. Z x1 = Faa(4,5,ddd)*Faa(2,3,bbb)*Faa(1,2,aaa)*Faa(3,4,ccc)
  3184. Id,Order,"C,Faa
  3185.  
  3186. x1 = + Faa(1,aaa,bbb,ccc,ddd) + 0.
  3187.  
  3188.  
  3189.  
  3190. Z x1 = Faa(4,5,ddd)*Faa(2,3,bbb)*Faa(1,2,aaa)*Faa(3,4,ccc)
  3191. Id,Order,90,Faa
  3192.  
  3193. x1 = + Faa(90,aaa)*Faa(90,bbb)*Faa(90,ccc)*Faa(90,ddd) + 0.
  3194.  
  3195.  
  3196.  
  3197. Z x1 = Faa(4,5,ddd)*Faa(2,3,bbb)*Faa(1,2,aaa)*Faa(3,4,ccc)
  3198. Id,Order,90,"C,Faa
  3199.  
  3200. x1 = + Faa(90,aaa,bbb,ccc,ddd) + 0.
  3201.  
  3202.  
  3203.  
  3204. Z x1 = Faa(4,5,ddd)*Faa(2,3,bbb)*Faa(1,2,aaa)*Faa(3,4,ccc)
  3205. Id,Order,0,Faa
  3206.  
  3207. x1 = + Faa(aaa)*Faa(bbb)*Faa(ccc)*Faa(ddd) + 0.
  3208.  
  3209.  
  3210.  
  3211. Z x1 = Faa(4,5,ddd)*Faa(2,3,bbb)*Faa(1,2,aaa)*Faa(3,4,ccc)
  3212. Id,Order,0,"C,Faa
  3213.  
  3214. x1 = + Faa(aaa,bbb,ccc,ddd) + 0.
  3215.  
  3216. ***    Id,Print,#,Message
  3217.  
  3218. This command can be used to print a message at execution time. The number
  3219. # limits the number of times the message is printed. Everything after the
  3220. third comma, including blanks, up till the end of the line is printed when
  3221. this command is encountered at execution time. Example:
  3222.  
  3223. Id,2,Print,  Hello world.
  3224.  
  3225. The message "  Hello world." is printed at most twice.
  3226.  
  3227. The command Ratio is specifically there to facilitate integrations. It
  3228. is used to rationalize a product of factors that are linear in the integration
  3229. variable. The simplest case is:
  3230.     1/(x+a) * 1/(x+b) = {1/(x+a) - 1/(x+b)}/(b-a)
  3231. Since in Schoonschip expressions cannot have a negative exponent (except when
  3232. they are purely numerical) one cannot directly write such things. The way to
  3233. do that is to introduce a symbol to represent an expression appearing with
  3234. negative exponent, for example xpa = x+a. Then the equation becomes:
  3235.     xpa^-1*xpb^-1 = {xpa^-1 - xpb^-1}*bma^-1
  3236. Here the [] notation for symbols comes in very conveniently. One may write:
  3237.     [x+a]^-1 * [x+b]^-1 = {[x+a]^-1 - [x+b]^-1}/[b-a]
  3238. If the exponents are large this becomes quite complicated, and that is where
  3239. Ratio comes in. In the command one must specify the two factors and their
  3240. difference, in the case mentioned one would write:
  3241.  
  3242. ***    Id,Ratio,[x+a],[x+b],[b-a]
  3243.  
  3244. Ratio works for all cases of exponents that may occur, positive or negative.
  3245.  
  3246. C Example 26.
  3247.  
  3248. A a1,a2,a2ma1
  3249. F f1
  3250. B b2,b3,b4,b5
  3251.  
  3252. Z xx=f1(8,4)
  3253.  
  3254. Id,f1(n~,m~)=
  3255.     { b2*a1^n*a2^m 
  3256.     + b3*a1^-n*a2^m 
  3257.     + b4*a1^n*a2^-m
  3258.     + b5*a1^-n*a2^-m
  3259.     }
  3260.  
  3261. Id,Ratio,a1,a2,a2ma1
  3262. *begin
  3263.  
  3264. C Here the use of Ratio with [] names.
  3265.  
  3266. B [b-a]
  3267.  
  3268. Z xxx = 1/[x+a]^3 * 1/[x+b]^2
  3269.  
  3270. Id,Ratio,[x+a],[x+b],[b-a]
  3271. P output
  3272. *yep
  3273. C Just checking...
  3274.  
  3275. Id,[x+a]^n~ = (x+a)^(3+n)*(x+b)^2/[x+a]^3/[x+b]^2
  3276. Al,[x+b]^n~ = (x+a)^3*(x+b)^(2+n)/[x+a]^3/[x+b]^2
  3277. Id,b = [b-a] + a
  3278. *end
  3279.  
  3280.  
  3281. ***    Id,Spin,loop indices or momenta
  3282.  
  3283. This command is discussed in the section on particle physics.
  3284.  
  3285. ***    Id,Stats,#
  3286.  
  3287. This commands provides for some statistics. The counts are printed at
  3288. conclusion of a section (delimited by a * type line). Four counts may
  3289. be kept, specified by the number # which may be absent implying 0, or
  3290. one of numbers 1, 2 or 3. No error message is given if the number exceeds
  3291. 3 or is negative; Schoonschip takes the number modulo 4. Every time
  3292. this command executes one is added to the appropiate count. Example:
  3293.  
  3294. IF a^3
  3295. Id,Stats,2
  3296. ENDIF
  3297.  
  3298. This construction counts the number of terms with a^3. The result is
  3299. printed at termination.
  3300.  
  3301.  
  3302. 13. PARTICLE PHYSICS.
  3303.  
  3304. There are a few build-in facilities that are particularly useful to particle
  3305. physics. We refer here to gamma-matrices and traces of products of gamma
  3306. matrices.
  3307.  
  3308. The special functions G,Gi,G5,G6,G7,Ug and Ubg are reserved to denote gamma
  3309. matrices and spinors. Since in a given calculation more than one loop of
  3310. gamma-matrices can occur all functions have a loop index. Gamma's with
  3311. different loop indices are supposed to commute. The relation to the standard
  3312. notation for these quantities is (old notation):
  3313.  
  3314.     G(L,mu)        gamma-matrix with index mu of loop L.
  3315.     Gi(L)        the identity matrix of loop L.
  3316.     G5(L)        = G(L,1)*G(L,2)*G(L,3)*G(L,4).
  3317.     G6(L)        = Gi(L) + G5(L).
  3318.     G7(L)        = Gi(L) - G5(L).
  3319.     Ug(L,m,p)    spinor loop L, particle mass m, momentum p, spin 1/2.
  3320.     Ubg(L,m,p)    Conjg{Ug(L,m,p)}*G(L,4).
  3321.     Ug(L,mu,m,p)    spin 3/2 spinor.
  3322.     Ubg(L,mu,m,p)    Conjg{Ug(L,mu,m,p)}*G(L,4)
  3323.  
  3324. With the Schoonschip version of Jan 1, 1989 new notations have been introduced
  3325. for the gamma matrices. The above notation is still accepted, but the new
  3326. is more flexible and we will use that.
  3327.  
  3328. In this new notation gammas have two loop indices. They may also have more than
  3329. one index. The order of these two-index gammas is immaterial; at some point,
  3330. when traces or spin summation or whatever is to be done (usually with the
  3331. command Gammas) the gammas are chained on the basis of these two loop indices.
  3332. Example:
  3333.  
  3334.     Ug(i3,M,q)*G(i1,i2,mu)*G6(i0,i1)*Ubg(i0,m,p)*G(i2,i3,nu,al)
  3335.  
  3336. This will be chained into one gamma string (called G-string in the following):
  3337.  
  3338.     Ubg(i0,m,p)*G(i0,"s,"6,mu,nu,al)*Ug(i0,M,q)
  3339.  
  3340. equivalent to the old sequence
  3341.  
  3342.     Ubg(i0,m,p)*G6(i0)*G(i0,mu)*G(i0,nu)*G(i0,al)*Ug(i0,M,q)
  3343.  
  3344. This takes the pain out of the process of ordering the gammas.
  3345. Inside G-strings "4, "5, "6 and "7 may occur next to Gi, G5, G6 and G7 but
  3346. they mean the same.
  3347.  
  3348. An anti-particle spinor may be represented as a particle spinor with -m
  3349. instead of m. The G's satisfy the rule:
  3350.  
  3351.   G(L,"s,"4,...,mu,nu,..) =
  3352.    - G(L,"s,"4,...,nu,mu,..) + 2*D(mu,nu)*G(L,"s,"4,.....)
  3353.  
  3354. which is the usual anti-commutation rule. All G are treated by Schoonschip as
  3355. imaginary, which corresponds to a hermitean set. In complex conjugation
  3356. the order of the G is to be reversed (i.e. the order inside a G-string is
  3357. reversed). G5 is imaginary, G6 and G7 are each others complex conjugate.
  3358.  
  3359. The commands Gammas and Spin allow for reduction of a product of G's to
  3360. at most 2 G's, Trace taking and Spin-summation. The build-in equations
  3361. can handle 4-dimensional and N-dimensional situations, with ot without G5's.
  3362.  
  3363. The command
  3364.  
  3365. ***    Id,Spin,L1,p,...
  3366.  
  3367. leads to spin summation. Schoonschip looks for pairs of spinors Ug and Ubg
  3368. with the same arguments except the loop index (one of the loop indices must
  3369. be mentioned in the list), and replaces such pairs by the appropriate
  3370. combination. Instead of a loop index also vectors may serve as identification.
  3371. With the command
  3372.  
  3373. Id,Spin,p
  3374.  
  3375. or
  3376.  
  3377. Id,Spin,L1
  3378.  
  3379. the expression
  3380.  
  3381.     Ug(L1,m,p)*Ubg(K1,m,p)
  3382.  
  3383. is replaced by
  3384.  
  3385.     - i*G(L1,K1,p) + m*Gi(L1,K1)
  3386.  
  3387. Similarly for spin 3/2 spinors:
  3388.  
  3389.     Ug(L1,mu,m,p)*Ubg(K1,nu,m,p)
  3390.  
  3391. is replaced by:
  3392.  
  3393.    { D(mu,nu) - 1/3*i*G(L1,K1,mu)*p(nu)/m + 1/3*i*G(L1,K1,nu)*p(mu)/m
  3394.  
  3395.     - 1/3*G(L1,K1,mu,nu) + 2/3*Gi(L1,K1)*p(mu)*p(nu)/m^2 }
  3396.  
  3397.     * { - i*G(L1,K1,p) + m*Gi(L1,K1) }
  3398.  
  3399. The command Gammas can be used to do work on G-strings. See the section on
  3400. gamma algebra.
  3401.  
  3402. Example 27 gives the complete calculation for muon decay in the V-A theory.
  3403. It is not repreduced here.
  3404.  
  3405. The Compo command is very useful if one wants to calculate diagrams.
  3406. The possible vertices can be given in terms of X-expressions. For a
  3407. given topology one sums over all possible propagators. Separate examples
  3408. exist for such cases.
  3409.  
  3410.  
  3411. 14. INTERNAL PROCEDURES.
  3412.  
  3413. Some insight in how all this actually works inside Schoonschip is really
  3414. indispensible, and this section provides for some details. An example (Example
  3415. 28 followed by Example 29) shows how to do a problem that could easily explode
  3416. if not worked out carefully.
  3417.  
  3418. Consider the expression:
  3419.  
  3420. Z XX = (a*x^2 + b*x)*dx
  3421.  
  3422. The process starts with reading the input. The input is encoded, and placed
  3423. into memory. Names are placed in arrays. This encoding stops when the line with
  3424. the * is encountered. Then Schoonschip starts working out the Z expressions,
  3425. one after the other. This happens at Level 0. At Level 1 one term after the
  3426. other passes by. In this case the first term passing by is the the term
  3427. a*x^2*dx. No new term is emitted then till this term has passed 40 Levels, and
  3428. at each Level the user has the opportunity to work on that term. Then this term
  3429. is collected in the output store, a large area of more than 40 kbytes. There
  3430. are provisions for handling overflow of that area, but more about that later.
  3431. Only when that term is stored is the next term issued, here b*x*dx.
  3432.  
  3433. The advantage of this procedure is that virtually no storage is needed for the
  3434. intermediate results. Often symbolic programs work out the whole expression
  3435. before going to the next level. Then one finds inside the initial expression,
  3436. the expression as it becomes after the first Level, and so on. The same
  3437. expression, in various stages of processing may then be found many times in
  3438. memory. This leads very quickly to memory overflow, which is not easily
  3439. manageable.
  3440.  
  3441. On the other hand, when collecting terms in the output store a substantial
  3442. reduction in the number of terms may take place. For instance, to take a very
  3443. trivial example, the initial expression (a+b)^2 leads to 4 terms, and all of
  3444. these 4 terms go through all 40 Levels (actually Schoonschip notes how many
  3445. Levels are active, and skips the empty Levels). If one were to collect these
  3446. terms immediately after the first Level there will then only be three terms:
  3447. a^2 + 2*a*b + b^2. That is what happens at the output store: identical terms
  3448. are recognized, and the coefficients are added rather then keeping the terms
  3449. separately (here that applies to a*b). Thus term collecting will in general
  3450. lead to a reduction in number of terms, and in fact this is usually very
  3451. substantial.
  3452.  
  3453. This fact was of course quickly realized, and an option is available to do this
  3454. term collecting at any time inbetween the substitutions and commands. This is
  3455. done through the *yep line. When encountering this line Schoonschip processes
  3456. all substitutions up to that point and then collects all terms in the output
  3457. store. Next this output store is emptied on the disk, and then read in again,
  3458. term by term. Again each term then passes through all Levels, possibly to
  3459. another *yep, till all substitutions have been exhausted. It is up to the user
  3460. to put these *yep lines judiciously in case of a large problem.
  3461.  
  3462. As may be clear from the above this procedure has the added advantage that
  3463. after a *yep the full 40 Levels can be used again. Thus there is basically no
  3464. limit on the amount of substitution and commands that can be done.
  3465.  
  3466. The assignment of substitutions and commands is essentially automatic. The user
  3467. has a number of options here. Putting Id in columns 1-2 of a substitution
  3468. assigns that substitution to the next Level. The characters Al put the
  3469. corresponding substitution on the same Level. Thus substitutions that do not
  3470. interfere with each other can so be put on the same Level: the first has Id,
  3471. the second Al in columns 1-2. Also, one may want some substitution to be done
  3472. at a number of consecutive Levels. In such cases one simply places a number
  3473. after the Id or Al. Thus Id,7,... implies that the corresponding substitution
  3474. is inspected for at 7 consecutive Levels.
  3475.  
  3476. When reading the input Schoonschip prints the associated Level in front of the
  3477. line. To understand this numbering it must be realized that working out
  3478. brackets requires Levels, namely one Level per nesting. Thus in the last
  3479. example the first substitution is put at Level 2, because Level one is used to
  3480. work out the brackets. In fact, working out the brackets is very much like a
  3481. substitution; the initial expression is translated to something like $AAA^2,
  3482. where $AAA is a symbol invented for this purpose, and at Level 1 the
  3483. substitution
  3484.  
  3485. Id,$AAA = a+b
  3486.  
  3487. is placed. For this reason the $ symbol must not be used in names. This process
  3488. may be seen in detail by requesting printing of these $ expressions by means of
  3489. a  P brackets  directive. Also X-expressions may require Levels, they are like
  3490. build-in substitutions. As soon as an X-expression materializes at some Level
  3491. Schoonschip substitutes its definition.
  3492.  
  3493. To make the whole process transparant we will here reproduce the contents of
  3494. memory for a simple case somewhere in the middle of a calculation. Consider:
  3495.  
  3496. Z xxx = (a*x + b)*dx
  3497.  
  3498. Id,x*dx = (x2^2 - x1^2)/2
  3499.  
  3500. *end
  3501.  
  3502. Typically at some point the following may be found in memory:
  3503.  
  3504. Level 0: $AAA*dx
  3505.  
  3506. Level 1: dx    and    a*x + b
  3507.  
  3508. Level 2: dx*a*x
  3509.  
  3510. Level 3: a    and    $AAB/2
  3511.  
  3512. Level 4: 0.5*a    and    x2^2 - x1^2
  3513.  
  3514. Level 5: - 0.5*a*x1^2
  3515.  
  3516. Levels 6-40: skipped
  3517.  
  3518. In output store:    0.5*a*x2^2
  3519.  
  3520. At this point the action is at Level 5. A little time later the term
  3521. -0.5*a*x1^2 will arrive at the output store, and that exhausts the work at
  3522. Level 4. Then Schoonschip goes back to Level 1 and produces the next term,
  3523. b*dx. After that has passed to the output store (for simplicity we have not
  3524. included the substitution for this one) Schoonschip goes all the way back to
  3525. Level 0, finds that the problem is all done, and passes to the next stage,
  3526. namely printing of the contents of the output store.
  3527.  
  3528. This rather complicated procedure has the great advantage that only very little
  3529. memory is used at any one time. One finds bits and pieces all the way down from
  3530. Level 0 to the output store, and Schoonschip keeps on climbing up and down all
  3531. Levels till all work at all Levels is exhausted. In dealing with large problems
  3532. one must have some idea of this procedure in order to organize the calculation
  3533. in the most efficient way. Any substitution with more than one term in the
  3534. right hand side leads to multiplication of the number of terms generated with
  3535. some factor, depending on how many terms occur in that right hand side, and
  3536. also on how often the sustitution is actually done.
  3537.  
  3538. To see how much work is done by Schoonschip use the directive  P stats. Then
  3539. some statistics are printed, of which in this context the most interes- ting
  3540. ones are the number of multiplications and the number of terms. One
  3541. multiplication is counted for every time two terms (not factors) are multiplied
  3542. together. Thus  (a*x + b)*(c*x + d)  implies four multiplications. Often the
  3543. count comes out higher than expected at first sight due to for instance the way
  3544. brackets are worked out. The number of terms is simply a count of the terms
  3545. that arrive at the output store. That would be 4 in this case. Another example:
  3546. (a + b)^4 leads to 2^4=16 multiplications, and then to 16 terms, and after
  3547. sorting in the output store one will have 5 terms. In actual fact, the count
  3548. for multiplications comes in this case to 81, but we will not bore the reader
  3549. to explain this in detail. Mainly this is because Schoonschip begins by setting
  3550. a 1 before getting to the actual expression. In practice the number of terms
  3551. and also the number of multiplications are a good indication of the complexity
  3552. of a problem, and the time needed is roughly proportional to these numbers. For
  3553. large expressions with many terms most time is spent sorting the terms in the
  3554. output store. Try to avoid more than 100,000 terms. If one gets in this kind of
  3555. situation it is necessary to examine in detail the organization of the problem,
  3556. and the separation in various parts using *yep. See also the sections on large
  3557. problem handling and file handling commands. The largest calculation done so
  3558. far involved as many as 1,000,000 terms, but it is not known how much diskspace
  3559. was used. The present version needs about 20 seconds for 10,000 terms or
  3560. 100,000 multiplications, but this must be seen as a very rough low estimate. If
  3561. diskwriting is involved times may increase drastically. The calculation
  3562. mentioned used 20 minutes on a CDC 7600, but that was counting only cpu time,
  3563. not actual time. It would probably take many hours on a 68000, assuming enough
  3564. diskspace. The important point is of course that at least there is no
  3565. limitation due to Schoonschip itself, and given time and diskspace it will work
  3566. its way through. If P stats is specified it will print statistics every time
  3567. 8192 (= 2^13) terms have passed through, so that one can see some action.
  3568.  
  3569. In particular series expansions where the argument expanded in is again a
  3570. series can very easily lead to an enormous number of terms. Suppose some
  3571. function, f(y), is given in terms of a series expansion, and suppose also y is
  3572. a series expansion in terms of a variable x. Now suppose that the series
  3573. expansion of f in terms of x up to x^10 must be found. If y is a polynomium
  3574. involving up to x^9, thus 10 terms, then substitution of this in y^10 leads to
  3575. 10^10 terms, which would take roughly 20*10^6 seconds if nothing else would
  3576. grow out of bounds. Such problems must be worked out really carefully, and in
  3577. Examples 28, 29 we have reproduced a substantial part of such a problem, enough
  3578. to understand the principle.
  3579.  
  3580. 15. CHARACTER SUMMATION.
  3581.  
  3582. Characters have become quite useful in generating diagrams. Typically
  3583. a character is associated with every particle in the theory. Anti-particles
  3584. have the same character as the particles but appended with an underscore
  3585. (_). Certain particles are their own anti-particle. There is a way to let
  3586. Schoonschip know which particles are their own anti-particle.
  3587.  
  3588. In generating diagrams one must first have a list of vertices. The name
  3589. for a vertex is composed of the characters that correspond to the particles
  3590. entering that vertex. In that name the characters must be ordered in a
  3591. well defined way: alphabetically, upper case before lower case before numbers,
  3592. characters with an underscore before those without an underscore. Thus:
  3593. A_AB_BC_C......Z_Za_ab_b...1_12_2... Here some examples:
  3594.  
  3595. AWW    Aww    U_U    AG_G    Ue_e    Ubt_    U_b_t    U
  3596.  
  3597. Vertices have indices and momenta as parameters. Four particle vertices
  3598. have no momentum dependence.
  3599.  
  3600. The list of vertices must be given in terms of X-expressions. Each vertex
  3601. must have sufficient parameters to cover all cases. For a given particle
  3602. one may have momentum, vector index and spinor index. Even if the vector
  3603. and spinor index will normally not occur simultaneously they need to be
  3604. carried along. A 3-vertex will thus have 9 parameters. Examples:
  3605.  
  3606. X U_UW(AL,al,P,BE,be,Q,GA,ga,K) =
  3607.     C*D(AL,BE)*(Q(GA)-P(GA)) + C*D(AL,GA)*(P(BE)-K(BE)) +
  3608.     C*D(BE,GA)*(K(AL)-Q(AL))
  3609.  
  3610. This is a vertex for three vector particles. The spinor indices al, be, ga
  3611. are not used. Here two spinor vertices:
  3612.  
  3613. X Ubt_(AL,al,P,BE,be,Q,GA,ga,k) = i*G(ga,be,AL) + avc*i*G(ga,be,AL,G5)
  3614.  
  3615. X Ue1_(AL,al,P,BE,be,Q,GA,ga,k) = i*G(ga,be,AL,G6)
  3616.  
  3617. Note that spinor indices usually appear in reverse order. This is the
  3618. vertex for a vector particle (charged W) coupling to a fermion and an
  3619. anti-fermion (bottom and top or electron-neutrino 1). Here a fermion
  3620. propagator:
  3621.  
  3622. X t_t(L1,l1,L2,l2,K)=NOM(K,Mt)*G(l2,l1,K) + NOM(K,Mt)*Gi(l2,l1)*Mt
  3623.  
  3624. NOM is the usual propagator factor, 1/[KDK + Mt^2].
  3625.  
  3626. In this way all vertices and propagators must be defined. Now suppose
  3627. some diagram must be calculated, say W selfenergy (the charged W's are
  3628. represented by U and U_). After the type declarations all vertices and
  3629. propagators must be given in terms of X-functions:
  3630.  
  3631. C Calculation of charged vector boson (U, U_) self-energy.
  3632.  
  3633. F Fx,F2,B22,B21,B1,B0,VE3,PROP
  3634.  
  3635. I AL=N,al,BE=N,be,GA=N,ga,MU=N,mu,NU=N,nu,MUP=N,mup,NUP=N,nup,
  3636.   L1=N,l1,L2=N,l2,L3=N,l3,L4=N,l4,L5=N,l5,L6=N,l6,L7=N,l7,L8=N,l8,
  3637.   L9=N,l9,L0=N,l0
  3638.  
  3639. I Mu4,Nu4
  3640.  
  3641. V P,Q,K
  3642.  
  3643. C The use of these character tables, the Anti statement and the G line will be
  3644. C explained below.
  3645.  
  3646. T TAP: W,Z
  3647. T TFE: t,b
  3648.  
  3649. Anti,TAP
  3650.  
  3651. G 1
  3652.  
  3653. X t_t(L1,l1,L2,l2,K)= i*NOM(K,Mt)*G(l2,l1,K) + NOM(K,Mt)*Gi(l2,l1)*Mt
  3654. X b_b(L1,l1,L2,l2,K)= i*NOM(K,Mb)*G(l2,l1,K) + NOM(K,Mb)*Gi(l2,l1)*Mb
  3655.  
  3656.  
  3657. G 3
  3658.  
  3659. X Ubt_(AL,al,P,BE,be,Q,GA,ga,K)= i*G(ga,be,AL,G6)
  3660. X U_b_t(AL,al,P,BE,be,Q,GA,ga,K)= i*G(be,ga,AL,G6)
  3661. X Wt_t(AL,al,P,BE,be,Q,GA,ga,K)= i*[1-8/3s^2]*G(be,ga,AL) + i*G(be,ga,AL,G5)
  3662. X Wb_b(AL,al,P,BE,be,Q,GA,ga,K)= i*[4/3s^2-1]*G(be,ga,AL) - i*G(be,ga,AL,G5)
  3663.  
  3664. G
  3665.  
  3666. C First establish the topology, for example the simple two 3-vertex, two
  3667. C propagator diagram. Note that no _ may be used in file names.
  3668.  
  3669. Z IUUB=SELF("U,"U_)
  3670.  
  3671. C Now a character summation. I1 is the given input character,
  3672. C in this case the "U representing the positively charged W.
  3673. C The sum in DS goes over all characters J1 and J2 such that the name
  3674. C U J1 J2 properly symmetrized corresponds to some X-expression.
  3675. C In this case that will only be some b, b_, t, t_ combinations for J1, J2.
  3676. C The symbol 'Sym' implies symmtrization factor based on the characters
  3677. C following. If they are identical (will not happen here) a factor
  3678. C 1/2! will be added.
  3679. C The subsequent numbers, 2,3,5,6, imply that only X-expressions in
  3680. C groups 2,3,5 and 6 will be inspected. That is then the meaning of
  3681. C the G lines above: they specify a group number for the X-expressions
  3682. C following. Default is 0, and if no groups have been specified all
  3683. C will be considered.
  3684. C Whenever a match is found a term in the summation arises: the
  3685. C function DIB with the characters I1, J1, J2 and I2 as arguments.
  3686. C The function DC is used for various purposes; here it provides
  3687. C a factor -1^1 if both characters J1 and J2 appear in table TFE.
  3688. C If one uses "F_ rather then "F the factor is provided none of the
  3689. C characters appear in the table TFE.
  3690. C The second number 1, the exponent, may be omitted and is then 1.
  3691. C This is the factor -1 for a fermion loop. The "F in the DC function
  3692. C stands for factor.
  3693. C Other uses for DC are summarized later.
  3694.  
  3695. Id,SELF(I1~,I2~)=
  3696.    DS(I1;J1;J2;Sym;J1;J2,2,3,5,6,(DIB(I1,J1,J2,I2)
  3697.   *DC("F,TFE,-1,1,J1,J2) ))
  3698.  
  3699. C This is essentially the diagram. Mu4 and Nu4 are the external U and U_
  3700. C indices, P is the loop momentum, Q is the U momentum and K = P + Q.
  3701. C The * are used by the command Compo. In for example VE3 that command
  3702. C re-arranges the characters I1, K1 and K2 in the character order defined
  3703. C before. Every interchange also gives rise to an interchange of the
  3704. C argument groups delimited by the *.
  3705.  
  3706. Id,DIB(I1~,K1~,K2~,I2~)=
  3707.    VE3(I1,K1,K2,*,Mu4,mu,Q,*,L1,l1,-K,*,L3,l3,P)*
  3708.    VE3(-K1,I2,-K2,*,L2,l2,K,*,Nu4,nu,-Q,*,L4,l4,-P)*
  3709.    PROP(K1,-K1,*,L1,l1,K,*,L2,l2,K)*
  3710.    PROP(K2,-K2,*,L3,l3,P,*,L4,l4,P)
  3711.  
  3712. C Compo searches the X-expression list for the names composed of the first
  3713. C few characters that appear as arguments of the functions VE3 etc. and if
  3714. C found keeps the term, else makes it zero.
  3715.  
  3716. Id,Compo,<X>,VE3,PROP
  3717.  
  3718. C Compo has now composed the name and performed the necessary symmetrization.
  3719. C Now the functions themselves can be substituted. AA is a dummy name here.
  3720.  
  3721. Id,VE3(AA~,MU~,mu~,P0~,L2~,l2~,Q~,L1~,l1~,P~)=
  3722.        AA(MU,mu,P0,L2,l2,Q,L1,l1,P)
  3723. Al,PROP(AA~,L4~,l4~,Q~,L3~,l3~,P~)=AA(L4,l4,L3,l3,Q)
  3724.  
  3725. C At this point the full expression for the diagram has been obtained.
  3726. C The next step is to do the loop integral. The loop momentum appears
  3727. C in the propagators through the functions NOM, and as arguments in the
  3728. C Gamma matrices.
  3729.  
  3730. Id,Commu,NOM
  3731. Id,NOM(P,M~)*NOM(K,M0~)=F2(M,M0)
  3732. Id,Gammas,"C
  3733.  
  3734. C Remove K as G argument, replacing it by the four dimensional Q
  3735. C and the loop momentum P. No index is created by this work, and the
  3736. C dimensionality of MU is irrelevant.
  3737.  
  3738. Id,Funct,K(MU~)=P(MU)+Q(MU)
  3739.  
  3740. C Now collect all P in the function Fx.
  3741.  
  3742. Id,All,P,N,Fx
  3743. *yep
  3744.  
  3745. C The P-integration can be done:
  3746.  
  3747. Id,F2(M~,M0~)*Fx(MU~,NU~) = D(MU,NU)*B22(M,M0) + Q(MU)*Q(NU)*B21(M,M0)
  3748. Al,F2(M~,M0~)*Fx(MU~) = Q(MU)*B1(M,M0)
  3749. Al,F2(M~,M0~)=B0(M,M0)
  3750.  
  3751. C Do Anomalous traces.
  3752.  
  3753. Id,Gammas,"A
  3754. *end
  3755.  
  3756.  
  3757. In this case only one diagram is evaluated simply because there are no
  3758. more vertices listed. If a complete set of vertices is given the complete
  3759. result obtains.
  3760.  
  3761.  
  3762.  
  3763. Character tables.
  3764.  
  3765. Character tables are distinguished from other tables (that can be used as
  3766. function arguments) by means of the colon (:) following the name.
  3767. To every character possible there corresponds a location in the table,
  3768. zero by default. Any character mentioned gives a 1 and a -1 in the
  3769. location for its antiparticle (denoted by a appended underscore).
  3770. Specific numbers may be assigned, for example
  3771.  
  3772. T TAB: A=3:5,B=7,a,z=3
  3773.  
  3774. This assigns 3 to A, 5 to A_, 7 to B, -7 to B_, 1 to a, -1 to a_,
  3775.  3 to z and -3 to z_.
  3776.  
  3777. Important: all numbers appearing in character tables must be short integers
  3778.  (-129 < # <128).
  3779.  
  3780. The function DC uses such tables. Other character manipulations often
  3781. need a table to specify which particles are their own anti-particles.
  3782. Except for DC calculations such an anti-particle table may be given
  3783. before a *fix, and is then the default for the character function DS
  3784. and the command Compo for example. In all cases one may specify a
  3785. particular anti-particle table for the specific case: for DS as an
  3786. argument before the group numbers, for Compo anywhere in the list.
  3787.  
  3788. Anti statement and command. The Anti statement
  3789.  
  3790. Anti,TAA
  3791.  
  3792. establishes character table TAA as the default anti-particle table. This
  3793. is used by default by DS and Compo work. The statement may be given in the
  3794. fix section and is then valid by default for all other sections.
  3795. The command:
  3796.  
  3797. Id,Anti,TXX
  3798.  
  3799. leads to inspection of all function arguments. The table TXX is used to
  3800. determine which particles are their own anti particles, and correspondingly
  3801. a possible appended undescore is removed.
  3802.  
  3803.  
  3804.  
  3805. Character summation function DS.
  3806.  
  3807. General format:
  3808.     DS(C1;C2;C3;..;Sym;C4;C5,..,TX,#1,#2,...,(Expression) )
  3809.                     ^--^---^--^  ^  ^  ^
  3810. The ^ indicate optional arguments. The characters C1, C2 etc must be followed
  3811. by a semicolom; they may be characters, or else they are taken as dummies. A
  3812. preceeding - sign adds or removes an underscore. The summation goes over all
  3813. names that fit the name of an X-expression. For example, if C1="A and there are
  3814. two additional dummies mentioned then DS searches for all X-expressions with a
  3815. name of three characters of which one is an A. C2 and C3 become then the other
  3816. two characters and may as such be used in the Expression.
  3817.  
  3818. If the symbol Sym is mentioned then a symmetrization factor is provided
  3819. based on the characters following this symbol.
  3820.  
  3821. If a table TX is mentioned it is taken to be the antiparticle table, listing
  3822. all characters X for which X=X_.
  3823.  
  3824. If group numbers are specified only X-expressions in the groups mentioned
  3825. are considered.
  3826.  
  3827. Example:
  3828.     DS("A;J3;-J3;"B;Sym;J3,-J3,2,(Dic("A,J3,"B) )
  3829.  
  3830. Every X-expression name containing characters of the form AXX_B (or AX_XB)
  3831. leads to a term in the sum. For example the following names fit the pattern
  3832. twice:
  3833.  AEBE_  (with J3="E and J3="E_)
  3834.  Z_ZAB  (with J3="Z and J3="Z_)
  3835. The order of the characters in the name is not of importance here. This
  3836. order is however important when using the command Compo. That command
  3837. orders the characters before searching the namelists.
  3838.  
  3839.  
  3840. The character function DC.
  3841.  
  3842. DC always equals some numerical factor depending on the character arguments.
  3843.  
  3844. DC("F,TFE,#1,#2,C1,C2,...)
  3845. DC("F_,TFE,#1,#2,C1,C2,...)
  3846.  The value of the DC is #1^#2 (if #2 absent is taken to be 1) provided all
  3847.  characters C1,C2 etc appear in the table TX. Else it is 0. For "F_ the
  3848.  other way around. Here an example of a character table TX:
  3849.  
  3850. T TFE: t,b
  3851.  
  3852. DC("P,TX,#,C1,C2,...)
  3853.  Compute and multiply with a permutational factor determined by the occurence
  3854.  of identical characters in C1, C2 etc. The number # is used as exponent.
  3855.  For example, with the value 2 for # and the characters "A "A "A "B "B the
  3856.  value (3!*2!)^2 obtains. The table TX lists particles that are their own
  3857.  anti-particles (X_ = X). Here an example of such a character table:
  3858.  
  3859. T TAP: W,Z
  3860.  
  3861. DC("C,TX,C1,C2,...)
  3862. DC("C_,TX,C1,C2,...)
  3863. DC("T,TX,C1,C2,...)
  3864. DC("T_,TX,C1,C2,...)
  3865.  Compute the sum of the 'charges' of C1,C2,.. as listed in table TX. If zero DC
  3866.  is 1, else 0. If the character "C_ is used the opposite. If the character "T
  3867.  is used keep the term if the sum is positive including zero. If "T_ is used
  3868.  keep if < 0. Here an example of such a character table: 1 is assigned to
  3869.  particle Z, and also 1 to its antiparticle Z_. If the second 1 is not
  3870.  given it is taken to be the opposite of the first one (thus here -1) for the
  3871.  antiparticle.
  3872.  
  3873. T TX: Z=1:1
  3874.  
  3875.  
  3876. 16. GAMMA ALGEBRA.
  3877.  
  3878. The equations and algoritms used in this section will not be derived here.
  3879. The derivations can be found in a publication (M. Veltman, Gammatrica, 1989,
  3880. to be submitted to either Nuclear Physics or Computer Physics Communications).
  3881.  
  3882. The treatment of gammas has become quite complicated, but things have been
  3883. organized in such a way that for most cases the default options will do
  3884. the necessary. Essentially, other then four dimensional gamma algebra can
  3885. be done. It is nonetheless essential that a number of things are well
  3886. understood.
  3887.  
  3888. The only quantities for which other than four dimensionality can be specified
  3889. are indices. There is no way to specify the dimensionality of a vector, or
  3890. of a dotproduct. In doing gamma matrix manipulations Schoonschip takes
  3891. vectors to be four dimensional, i.e. G(L,p) contains only G(L,1) to G(L,4).
  3892. That might be seen as a restriction, but it is not. Refer to the "C option
  3893. discussed below.
  3894.  
  3895. The type of non-four dimensional vectors in the sense just mentioned occurring
  3896. in practice are loop momenta. There are several ways to deal with that.
  3897. The easiest way seems to be to first do the loop integrations before
  3898. doing the gamma algebra. First all gamma's are collected using the "C
  3899. option (see below), and then occurring loop momenta are replaced by four-
  3900. dimensional momenta or index pairs with N dimensional range. These can be
  3901. handled properly. For the moment it will be assumed then that all momenta
  3902. occurring as arguments of the gammas matrices are four dimensional, but
  3903. that indices may either be four or N-dimensional. No provisions have been
  3904. made to consider indices with ranges other then these two, although one
  3905. may use any algebraic symbol instead of N.
  3906.  
  3907. New notations have been implemented. Instead of one loop index the gamma's may
  3908. now have two loop indices. This very much eases the task of ordering the
  3909. gamma's properly when generating them by means of some automatic procedure.
  3910. Gamma's can be rounded up and put in the proper sequence on the basis of
  3911. the indices. The notation is:
  3912.     G(i1,i2,mu),  Gi(i1,i2), G5(i1,i2),  G6(i1,i2),  G7(i1,i2)
  3913. Gi is the unit matrix. The meaning of G6 and G7 is as before:
  3914.     G6 = Gi + G5,  G7 = Gi - G5.
  3915. The ordering is based on the indices:
  3916.     G(i1,i2,mu) * G(i3,i4,nu) * G(i2,i3,al) = G(i1,i4,mu,al,nu)
  3917. which is about the same as the old notation
  3918.     G(L,mu)*G(L,al)*G(L,nu)
  3919. One may in fact directly use the multi-index notation G(i1,i3,mu,al,nu).
  3920. It actually was used internally (but with only one loop index) since a long
  3921. time. Also Gi, G5, G6 and G7 may appear in that list:
  3922.     G(i1,i2,mu,G5,al,be,G6,ga,Gi,la,G7)
  3923. A string is called a trace if the first and second index are the same.
  3924. Otherwise the expression is called a gamma string, or shortly string.
  3925. A string may be odd or even depending on the number of arguments not counting
  3926. Gi, G5, G6 and G7. Thus the last shown is an odd string. Traces of odd strings
  3927. are always zero.
  3928.  
  3929. To avoid prolifiration of indices one may preferably use integer numbers
  3930. instead. For example:
  3931.     G(1,2,mu) * G(3,4,nu) * G(2,3,al) = G(1,4,mu,al,nu)
  3932. When dealing with more then one string number ranges may be reserved for
  3933. the different strings, thus avoiding confusion. Example:
  3934.  
  3935. X Vert(n,mu) = G(n,n+1,mu,G6)
  3936.  
  3937. Z xx =  Ubg(1,mm,p)*Vert(1,mu)*G(2,3,nu)*Ug(3,mn,q)
  3938.       * Ubg(10,mn,k)*Vert(10,mu)*Ug(11,me,qq)
  3939.  
  3940. When starting work on gamma matrices Schoonschip begins by rounding up the
  3941. gammas. For two index gammas the ordering is determined by the indices.
  3942. For gammas with one index (the old notation) the ordering is based on the
  3943. order in which they appear in the expression considered. By default the
  3944. strings are normalized, i.e. direct neigbour equal arguments are eliminated
  3945. ( G(....,X,X,...) = D(X,X)*G(........) ) and traces of an odd number of
  3946. gammas (not counting G5 etc) are set to zero. Optionally that normalization
  3947. may be suppressed.
  3948.  
  3949. After rounding up the strings and traces appear with only one loop index.
  3950. The index is chosen from the indices seen: the smallest number (or earliest
  3951. mentioned index) is taken. Indices are 'smaller' then numbers.
  3952.  
  3953.    G(1,2,mu,al) * G(3,4,nu,G5) * G(2,3,la)  =>
  3954.  
  3955.                                 G(1,"s,"4,mu,al,nu,G5,la)
  3956.  
  3957. The character argument "s indicates a string rather then a trace. The "4
  3958. is the unit G matrix, the need for this argument will become clear below.
  3959. The 1 is now the loop index. Another example:
  3960.  
  3961.    G(i1,2,mu,al) * G(3,i1,p,G5) * G(2,3,la)  =>
  3962.  
  3963.                                 G(i1,"t,"4,mu,al,p,G5,la)
  3964.  
  3965. For brevity these objects will be called G-strings in the following.
  3966. The arguments may be indices, vectors or Gi-G7.
  3967.  
  3968. At this point there are now two types of G strings, namely "s or "t strings.
  3969. This very first phase of the work is called collecting. Normalization is
  3970. optional. Optionally one may stop the work at this point.
  3971.  
  3972. The next step is to apply all the known algorithms to these objects.
  3973. Optionally one may specify which strings should be worked on, either by
  3974. a specific loop index or by number range. More about that below.
  3975. Schoonschip starts by considering all arguments in the G-string. If
  3976. all indices have the (default) range 1-4 then the string becomes a four-
  3977. dimensional G-string. Occurring vectors are considered four dimensional.
  3978. If a string becomes four dimensional the character argument "s or "t is
  3979. changed in "S or "T. Some work is done on the strings:
  3980.  
  3981. - adjacent identical arguments are eliminated. This includes for traces
  3982.   first and last argument.
  3983. - for "S and "T strings the G5, G6 and G7 are anti-commuted to the
  3984.   left and the result is placed instead of the "4 argument.
  3985. - simple cases such as the trace of the identity are completely worked out.
  3986.  
  3987. Examples:
  3988.  
  3989. I mu,nu,al=N,be=N
  3990.  
  3991.     G(1,"s,"4,mu,nu,al)    => unchanged.
  3992.     G(1,"t,"4,mu,nu,al)    => 0       (odd trace).
  3993.     G(1,"s,"4,mu,al,al,nu)    => N * G(1,"S,"4,mu,nu)
  3994.     G(1,"t,"4,mu,al,be,mu)    => 4 * G(1,"t,"4,al,be)
  3995.     G(1,"t,"4,G5,mu,G6,nu)    => G(1,"T,"6,mu,nu)
  3996.                 => 4 * D(mu,nu)
  3997.     G(1,"s,"4,G5,mu,G6,nu)    => G(1,"S,"6,mu,nu)
  3998.                 => G(1,"S,"4,mu,nu) + G(1,"S,"5,mu,nu)
  3999.  
  4000. The last step belongs also to the class of doing simple cases. The expansion
  4001. of G6 would not have been done if there had been more index arguments.
  4002. Optionally one may stop the work here.
  4003.  
  4004. The next step is sum-splitting. N-indices in "s or "t strings are split
  4005. in a four dimensional and an N-4 dimensional part. As a convention the
  4006. quantity N_ is understood and used as N-4. Here are the equations for
  4007. the case of two index pairs:
  4008.  
  4009. I mu,nu,al=N,be=N
  4010.  
  4011.    G(1,"s,mu,nu,al,be,..,al,be) =>
  4012.             G(1,"S,mu,nu,al,be,..,al,be)
  4013.         +/- G(1,"s,"_,be) * G(1,"S,mu,nu,al,..,al)
  4014.         +/- G(1,"s,"_,al) * G(1,"S,mu,nu,be,..,be)
  4015.         +/- G(1,"s,"_,al,be,al,be) * G(1,"S,mu,nu,..)
  4016.  
  4017. The sign is determined by the convention that the indices to be split are first
  4018. moved to the very left. They are taken to anticommute with all four-dimensional
  4019. indices and vectors, and to commute with G5, G6 and G7. Optionally, for traces
  4020. containing an even number of G5 or for strings independent of the number of G5
  4021. one may specify anticommutation with G5. In that case G6 and G7 are expanded
  4022. before the sum-splitting is done. For traces with an odd number of G5
  4023. commutation is used even if the anticommutation option is specified, simply
  4024. because the trace is otherwise not well defined. The outcome would not be
  4025. invariant for a cyclic rotation of the arguments.
  4026.  
  4027. Note the "_ character argument. The range of the indices in an "_ string
  4028. is from 4 to N. Both the string and trace of the unit "_ are one:
  4029.  
  4030.     G(1,"s,"_) = 1
  4031.     G(1,"t,"_) = 1
  4032.  
  4033. Other then that "_ strings are treated as the other non-four dimensional
  4034. strings. For example elimination of a direct pair:
  4035.  
  4036.     G(1,"s,"_,...,al,al,...) = N_ * G(1,"s,"_,.....)
  4037.  
  4038. Sum-splitting requires that all N-indices occur in pairs. This no real
  4039. restriction as the pairs need not to occur in one and the same string,
  4040. but for example one index may occur in a string and the other in another
  4041. string or even some other function.
  4042.  
  4043. If a string contains only N-range indices then it is called pure, and
  4044. no sum-splitting is done. Index pair eleimination and trace evaluation are
  4045. done directly on such a string.
  4046.  
  4047. Sum-splitting is done by default. Optionally work may be stopped here.
  4048.  
  4049. The next step is the unification of G-strings. By default this is not done,
  4050. because it is not always advantegeous, and because it may be necessary to
  4051. indicate explicitly which strings are to be unified. The unification is
  4052. based on the Chisholm's equation:
  4053.  
  4054.   G(1,"X,a1,a2,...,mu,b1,b2,...) * G(2,"T,mu,c1,c2,...,cn)
  4055.     =   2 * G(1,"X,a1,a2,...,c1,c2,...,cn,b1,b2,...)
  4056.       + 2 * G(1,"X,a1,a2,...,cn,...,c2,c1,b1,b2,...)
  4057.  
  4058. where "X may be "S or "T. The application requires
  4059.  
  4060. - the G-strings involved must be four-dimensional.
  4061. - they must have one index in common (mu in the above).
  4062. - at least one of them must be a trace.
  4063.  
  4064. The general rule is that it is advantageous if the G-strings have other
  4065. arguments then the explicitly shown index in common. That may be either
  4066. vectors or indices. Thus there is an advantage if for example c1 and b1
  4067. are the same, because in the second term that can be worked out.
  4068. This work is called unification, and optionally one may stop the work here.
  4069.  
  4070. The next step is to eliminate index pairs in the G-strings. For four-
  4071. dimensional strings there is the Kahane algorithm which eliminates all
  4072. pairs in a given string in one sweep, for "s and "t strings there is a
  4073. single pair algorithm that can be applied repeatedly. This is done by
  4074. default. One may specifically allow or inhibit index pair elimination
  4075. in _ type strings seperately. Optionally one may stop the work here.
  4076.  
  4077. The next step is the elimitation of vector pairs in four dimensional strings.
  4078. This is also a single pair algorithm that can be applied repeatedly.
  4079. It is called the P-algorithm. Optionally one may stop the work here.
  4080.  
  4081. The final step is to actually evaluate the traces, and to reduce the
  4082. four dimensional strings to a standard form. This is called the W-operation
  4083. (for final work).
  4084.  
  4085. In summary, the following is done:
  4086.  
  4087. - Rounding up of all strings. This step cannot be avoided. All occurring
  4088.   G are rounded up, even those that are not to be worked on. By default
  4089.   the strings are normalized.
  4090. - Sum-splitting. By default. With optionally Anticommuting G5 if an even
  4091.   number of G5 present.
  4092. - Unification. Not done by default.
  4093. - Index pair elimination, also for pairs in _ type strings (the latter
  4094.   may be inhibited with the i-option) Done by default.
  4095. - P-algorithm for four dimensional strings. By default.
  4096. - Work: final traces and reduction for four dimensional strings.
  4097.  
  4098. The options are characterized by a character, namely N, A, S, U, I, P and W.
  4099. The command for all this is
  4100.  
  4101. Id,Gammas
  4102.  
  4103. By default work is done on all occurring strings. For most cases, using
  4104. the two-index G notation this will do. If there are single index G's
  4105. (the old notation) then it must be possible to specify which are strings
  4106. and which traces. By default they are taken to be strings. If a trace is
  4107. intended loop indices must be mentioned:
  4108.  
  4109. Id,Gammas,Trace,i3,i4
  4110.  
  4111. In strings i3 and i4 the "s is replaced by "t.
  4112.  
  4113. As soon as one or more specific index is mentioned in the Gammas command only
  4114. loops with the loop indices as occurring in the list will be worked upon.
  4115. For any individual loop index options may be specified. Options may be on
  4116. or off. The are turned on by the appropriate character argument, and turned
  4117. off if the argument is followed by an undersore (_). Furthermore one may,
  4118. in case numbers are used as loop indices, indicate a range of loop numbers.
  4119. Here is the syntax:
  4120.  
  4121. Id,Gammas,C1,C2,i1,1-4:C3,C4,Trace,i2:C4,C5,i3,9-10
  4122.  
  4123. C1, C2 etc are character arguments, either one of these:
  4124.  
  4125. "N  "N_ "A "A_ "S  "S_  "U  "U_  "I  "I_  "P  "P_  "W  "W_ "i  "i_
  4126.  
  4127. In addition there is the option "C. It is synonym for turning all
  4128. options except "N off, i.e. only collecting and normalization is done,
  4129. with the further difference that no specialization to four dimensions
  4130. is ever done. This is very essential if there is some integration vector
  4131. where this vector is not four dimensional. Typically, if n-dim integration
  4132. is to be done one first collects all G with the "C option, then the
  4133. integrations are done, and after that the remaining work can be
  4134. done through another Gammas command.
  4135.  
  4136. To avoid normalization specify "N_ in addition to "C.
  4137.  
  4138. The first mentioned character arguments define the default. If none is
  4139. mentioned the default is "N,"A_,"S,"U_,"I,"P,"W,"i. The "i refers to index
  4140. pairs in N_ (i.e. "_) type strings.
  4141.  
  4142. G strings with loop indices mentioned after the Trace argument are forced
  4143. to be traces ("t).
  4144.  
  4145. A loop index may also be specified by a number range. Any G-string with a
  4146. loop index within the range (inclusive the values mentioned) are considered.
  4147. If the loop index or the range is followed by a colon then the following
  4148. character arguments define the options for specific loop. Those options
  4149. override the default options.
  4150.  
  4151. Example:
  4152.  
  4153. Id,Gammas,"A,"U,1-9:"A_,10-20:"U_,"I_
  4154.  
  4155. Strings with loop indices 1-9 and 10-20 are considered. Unification is
  4156. attempted on loops 1-9. Loops 1-9 have commuting G5 with respect to
  4157. sum-splitting, 10-20 anticommuting for traces with an even number of G5  or
  4158. strings for any number of G5. No index pair elimination is attempted on 10-20
  4159. loops, but index pairs in N_ type strings are still worked on. To inhibit that
  4160. a "i must be mentioned in addition.
  4161.  
  4162. Please note the use of the colon (:). This is because at least in principle it
  4163. is not excluded to also use character arguments as loop indices for two-index G
  4164. (they are inbetween numbers and indices with respect to ordering). Several
  4165. characters are illegal in this respect: "S,"T,"s and "t, at least if they occur
  4166. as the second argument in a two-index G.
  4167.  
  4168.  
  4169. As noted before, in all gamma operations all vectors are considered four-
  4170. dimensional. There are at least two ways to handle things. Commands to
  4171. simplify the work have been introduced.
  4172.  
  4173. Consider a case in which there occurs some momentum p is to be integrated
  4174. over N-space, and suppose this p occurs as G argument:
  4175.  
  4176.     G(1,2,al,be,p,al,be,p)
  4177.  
  4178. (the two index notation is and will be used from now on). The first step is
  4179. to get the p out. A new command, essentially a combination of existing
  4180. commands can be used here:
  4181.  
  4182. Id,All,p,N,F
  4183.  
  4184. In this command p is a vector, N is an optional argument specifying the
  4185. range of the indices to be created, and F is a function defined in an
  4186. F-list. This command rounds up all p, also those occurring in functions and
  4187. dot-products, and collects them in the function F. Example:
  4188.  
  4189. V p
  4190. F F
  4191. S N
  4192.  
  4193. Z xx =  pDq*pDp*F1(aa,bb,p)*p(mu)
  4194. Id,All,p,N,F
  4195. *end
  4196.  
  4197. This is the output:
  4198.  
  4199.     xx = + F1(aa,bb,Naa)*F(Naa,mu,q,Nab,Nab) + 0.
  4200.  
  4201. In here the quantities Naa and Nab are created indices with range N.
  4202. If one substitutes
  4203.     F(i1~,i2~,i3~,i4~,i5~) = p(i1)*p(i2)*p(i3)*p(i4)*p(i5)
  4204. then the original expression re-emerges. This may actually be done
  4205. more easily with the command Iall, the inverse of All:
  4206.  
  4207. Id,Iall,p,F
  4208.  
  4209. searches for F and restores to the original expression.
  4210.  
  4211. Both All and Iall have also another syntax, see the description elsewhere
  4212. as well as the example further down.
  4213.  
  4214. The All command may now be used to eliminate the p from the G-string. Next
  4215. integration may be done, for example:
  4216.  
  4217. Id,F(i1~,i2~) = D(i1,i2)*F20(k) + k(i1)*k(i2)*F22(k)
  4218.  
  4219. where k is a four-dimensional vector. After this gamma work may be done.
  4220. Here is the full example with output:
  4221.  
  4222. I al,be,mu,nu
  4223. S N,N_
  4224. V p,k
  4225. F F,F20,F22
  4226.  
  4227. Z xx = G(1,1,al,be,p,al,be,p)
  4228.  
  4229. Id,All,p,N,F
  4230. Id,F(i1~,i2~) = D(i1,i2)*F20(k) + k(i1)*k(i2)*F22(k)
  4231.  
  4232. Id,Gammas
  4233. *end
  4234.  
  4235.  xx = + F20(k) * ( 64 - 32*N_ )  +  F22(k) * ( 16*kDk )
  4236.  
  4237. It should be emphasized that the symbol N, occurring in the All command
  4238. must be defined in the symbol list, together with the symbol N_. If
  4239. such a symbol occurs already as range in an index list this is done
  4240. automatically, but in this case that did not happen. The command All
  4241. will not work otherwise. Also p and F must have been defined before,
  4242. either implicit or explicit. N cannot be defined implicit, because
  4243. it would be taken as an index rather then an algebraic symbol.
  4244. Again, N_ is supposed to be N-4.
  4245.  
  4246. The command All is really a combination of three existing substitutions,
  4247. namely
  4248.  
  4249. Id,p(mu~) = ...
  4250. Id,Dotpr,p(mu~) = ...
  4251. Id,Funct,p(mu~) = ...
  4252.  
  4253. In addition All handles the creation of the function F with its undetermined
  4254. number of arguments smoothly.
  4255.  
  4256. The substitutions shown have been modified slightly. Now the range of the
  4257. index mu is taken into account. If an index is created in the course of the
  4258. work for these substitutions it is given the range of mu.
  4259.  
  4260. The second method for dealing with vectors in G-strings is as follows. Let
  4261. there be a string containing several vectors as aguments:
  4262.  
  4263.     G(1,1,mu,G5,p,q,nu,G5,q,p)
  4264.  
  4265. Now use command All specifying the function G rather then the vector p:
  4266.  
  4267. Id,All,G,N,F
  4268.  
  4269. Again, N, N_ and F must have been defined before. This command takes
  4270. out all vectors from the specific function mentioned (here G) and collects
  4271. them, together with the indices created, into the function F1:
  4272.  
  4273. F F1
  4274. I mu,nu
  4275. V p,q
  4276.  
  4277. Z ft = G(1,1,mu,G5,p,q,nu,G5,q,p)
  4278.  
  4279. Id,All,G,N,F1
  4280. *end
  4281.  
  4282. The result is:
  4283.  
  4284.  ft = + G(1,1,mu,G5,Naa,Nab,nu,G5,Nac,Nad)*F1(p,q,q,p,Naa,Nab,Nac,Nad)
  4285.  
  4286. Now the gamma work can be done. The result is rather messy, and it is displayed
  4287. here (slightly edited) for a simpler case:
  4288.  
  4289. F F1
  4290. I mu,nu
  4291. V p,q
  4292. A N,N_
  4293.  
  4294. Z ft = G(1,1,mu,G5,p,nu,G5,q)
  4295.  
  4296. Id,All,G,N,F1
  4297. P output
  4298. *yep
  4299.  
  4300. ft = + G(1,1,mu,G5,Naa,nu,G5,Nab)*F1(p,q,Naa,Nab)
  4301.  
  4302. Id,Gammas
  4303. P output
  4304. *yep
  4305.  
  4306. ft =      + 4*F1(p,q,Dim_N_,Naa,Dim_N_,Naa)*D(mu,nu)
  4307.      + 4*F1(p,q,Dim_4,mu,Dim_4,nu)
  4308.     + 4*F1(p,q,Dim_4,nu,Dim_4,mu)
  4309.     - 4*F1(p,q,Dim_4,Naa,Dim_4,Naa)*D(mu,nu) + 0.
  4310.  
  4311. As is clear Schoonschip has added on prefixes to the indices inside
  4312. the function F1 to show the range. The function F1 with those prefixes
  4313. cannot be handled by any substitution or command except the command
  4314. Ndotpr, specially created for this situation. It works out the F1
  4315. arguments and creates various symbols analogous to dotproducts (but
  4316. they are not, they are symbols) showing the summation range:
  4317.  
  4318. Id,Ndotpr,F1
  4319. P output
  4320. *end
  4321.  
  4322. ft = 4*p(mu)*q(nu) + 4*q(mu)*p(nu) + D(mu,nu) * ( 4*pq_ - 4*pq4 ) + 0.
  4323.  
  4324. In here pq_ means the dotproduct of p and q but only components 4 to N
  4325. enter in the dotproduct. Similarly pq4 denotes a dotproduct with only
  4326. the first four components entering. Obviously pq4 + pq_ = pDq, where
  4327. pDq is the normal dotproduct.
  4328.  
  4329. The symbols pq_ and pq4 are algebraic symbols. They are created during
  4330. execution, and if a symbol list is asked for in a subsequent section
  4331. (after another *yep for example) the A-list would be:
  4332.  
  4333. A i=i, N, N_, pq_, pq4
  4334.  
  4335. Just for curiosity: if the A option had been specified in the Gammas
  4336. command the term pq_ would have come out with the opposite sign. That
  4337. is because there is one G5 inbetween p and q.
  4338.  
  4339. Here is once more the example, but without the intermediate printing:
  4340.  
  4341. F F1
  4342. I mu,nu
  4343. V p,q
  4344. A N,N_
  4345.  
  4346. Z ft = G(1,1,mu,G5,p,nu,G5,q)
  4347.  
  4348. Id,All,G,N,F1
  4349. Id,Gammas,"A
  4350. Id,Ndotpr,F1
  4351. *end
  4352.  
  4353. ft = 4*p(mu)*q(nu) + 4*q(mu)*p(nu) + D(mu,nu) * ( - 4*pq_ - 4*pq4 )
  4354.  
  4355.  
  4356. This concludes the discussion. For the rest of this section some more
  4357. examples.
  4358.  
  4359. C G collection including spinors.
  4360.  
  4361. I mu=N,nu=N
  4362. V p,q
  4363.  
  4364. Z xx = G(i1,i2,mu)*G(i2,i3,nu)*Ubg(i1,M,p)*Ug(i3,M,q)
  4365.  
  4366. Id,Gammas,"C
  4367. *end
  4368.  
  4369.     xx = + Ubg(i1,M,p)*G(i1,"s,"4,mu,nu)*Ug(i1,M,q) + 0.
  4370.  
  4371. C No problems with complex conjugation:
  4372.  
  4373. I mu=N,nu=N
  4374. V p,q
  4375.  
  4376. Z xx = Conjg( G6(i0,i1)*G(i1,i2,mu)*G(i2,i3,nu)*Ubg(i0,M,p)*Ug(i3,M,q))
  4377.  
  4378. Id,Gammas,"C
  4379. *end
  4380.  
  4381.     xx = + Ubg(i3,M,q)*G(i3,"s,"4,nu,mu,G7)*Ug(i3,M,p) + 0.
  4382.  
  4383. where a G6 was included.
  4384.  
  4385. A string containing only N-indices is called pure. All index pairs can be
  4386. eliminated, and traces can be evaluted completely. Here an example
  4387. involving a string and a trace:
  4388.  
  4389. I mu=N, nu=N, al=N, be=N, ga=N
  4390.  
  4391. Z xx = G(i1,i2,mu,ga,nu,al,be,ga)
  4392.      + G(i1,i1,mu,ga,nu,al,be,ga)
  4393. Id,Gammas,"C
  4394. P output
  4395. *yep
  4396.  
  4397. xx = + G(i1,"s,"4,mu,ga,nu,al,be,ga) + G(i1,"t,"4,mu,ga,nu,al,be,ga)
  4398.  
  4399. Id,Gammas
  4400. *end 
  4401.  
  4402. xx = + D(mu,nu)*D(al,be) * ( 8 - 4*N )
  4403.      + D(mu,al)*D(nu,be) * ( - 8 + 4*N )
  4404.      + D(mu,be)*D(nu,al) * ( 8 - 4*N )
  4405.  
  4406.      +   G(i1,"s,"4,mu,nu,al,be) * ( - N_ )
  4407.      - 2*G(i1,"s,"4,mu,be,al,nu) + 0.
  4408.  
  4409. Except the pair elimination nothing has been done about the string. One could
  4410. actually bring the strings into some normal form, but the advantages of that
  4411. are unclear, and it is also dubious as to what is the best normal form. The
  4412. work involved and the number of terms generated is considerable. For this
  4413. reason nothing has been implemented. But a possible way will be discussed now.
  4414.  
  4415. Define the function AG to be totally antisymmetric in all its arguments
  4416. except the first which is the loop index. If the number of arguments beyond
  4417. the first is m it is equal to the totally antisymmetric combinations of m
  4418. gammas divided by m!. Examples:
  4419.  
  4420.      AG(L)          = Gi(L)
  4421.     AG(L,mu)       = G(L,mu)
  4422.     AG(L,mu,nu)    = 1/2 * { G(L,mu)*G(L,nu) - G(L,nu)*G(L,mu) }
  4423.     AG(L,mu,nu,al) = 1/6 * { G(L,mu)*G(L,nu)*G(L,al) - .... }
  4424.     :
  4425.     :
  4426.  
  4427. Any string can be written as a linear combination of such functions AG:
  4428.  
  4429.     G(L,"s,m1,m2,m3,...) = a0*AG(L) + a1*AG(L,n1) + a2*AG(L,n1,n2) + ...
  4430.  
  4431. For example:
  4432.  
  4433.     G(L,"s,"4,mu,nu) = D(mu,nu)*AG(L) + AG(L,mu,nu)
  4434.  
  4435. For the case of three indices:
  4436.  
  4437.     G(L,"s,"4,mu,nu,al) =
  4438.         D(nu,al)*AG(L,mu) - AG(L,nu)*D(mu,al) + AG(L,al)*D(mu,nu)
  4439.          + AG(L,mu,nu,al)
  4440.  
  4441. The number of terms increases faster then the number of terms for a trace.
  4442. For four indices the number of terms is 10 (3 for a trace), for five it is 11
  4443. and for six it is 76 (15). Here a program that computes this expansion for the
  4444. case of four indices (where only a0, a2 and a4 are non-zero):
  4445.  
  4446. I mu=N, nu=N, al=N, be=N, b1=N, b2=N, b3=N, b4=N
  4447.  
  4448. Z xx = { 1/(4*DB(4)) * G(L,"t,"4,mu,nu,al,be,b1,b2,b3,b4)} * AG(L,b4,b3,b2,b1)
  4449.        + 1/(4*DB(2)) * G(L,"t,"4,mu,nu,al,be,b1,b2) * AG(L,b2,b1)
  4450.        + 1/4 * G(L,"t,"4,mu,nu,al,be) * AG(L)
  4451.  
  4452. Id,Gammas
  4453. Id,Asymm,AG,2,3,4,5,6
  4454. *end
  4455.  
  4456. Note that AG was specified to be anti symmetric in more arguments then actually
  4457. occur. The excess is simply ignored by Schoonschip.
  4458.  
  4459. The time involved is considerable because of the large traces to be computed.
  4460. For six indices the time to evaluate AG is about 150 seconds (M68000).
  4461. The method shown is however not the most efficient.
  4462.  
  4463. 17. R-INPUT.
  4464.  
  4465. Sometimes it is desirable to work on a very large input expression, larger
  4466. than Schoonschip can accomodate in its input space. The R-input facility
  4467. is designed specifically for this purpose. More precisely, it is geared
  4468. towards input that is exactly of the form as normal Schoonschip output.
  4469. Put an R in column 1 of the line with the file name; Schoonschip
  4470. will read the subsequent input and transform it into the same format
  4471. that is used in *yep situations. After a subsequent *yep the expression
  4472. can be worked on. As an example consider a case given before producing the
  4473. output
  4474.  
  4475. xxx = + [b-a]^-1
  4476.   * ( [x+a]^-1 - [x+b]^-1 ) + 0.
  4477.  
  4478. To be sure that all symbols have the same meaning specify the P lists
  4479. option in the problem that produces that output, and include these
  4480. lists in the new input. Then put an R in column 1 and a blank in column 2
  4481. of the line with xxx:
  4482.  
  4483. A i=i, [b-a], [x+a], [x+b]
  4484.  
  4485. F D, Epf=i, G=i, Gi, G5=i, G6=c, G7, Ug=c, Ubg, DD, DB, DT, DS, DX, 
  4486.   DK, DP, DF=u, DC
  4487.  
  4488. R xxx = + [b-a]^-1
  4489.   * ( [x+a]^-1 - [x+b]^-1 ) + 0.
  4490.  
  4491. *yep
  4492.  
  4493. Id,[b-a]^-1=bma
  4494. *end
  4495.  
  4496. There is no limit on the length of the expression other than available
  4497. disk space.
  4498.  
  4499. R-input can be very useful if one wants to edit expressions or process
  4500. parts of large expressions. It may also be used effictively to compare
  4501. outputs. To this purpose put the secons expression behind the first
  4502. but put an M (for minus) in column 1 rather then an R:
  4503.  
  4504. A i=i, [b-a], [x+a], [x+b]
  4505.  
  4506. F D, Epf=i, G=i, Gi, G5=i, G6=c, G7, Ug=c, Ubg, DD, DB, DT, DS, DX, 
  4507.   DK, DP, DF=u, DC
  4508.  
  4509. R xxx = + [b-a]^-1
  4510.   * ( [x+a]^-1 - [x+b]^-1 ) + 0.
  4511.  
  4512. M xxx = + [b-a]^-1
  4513.   * ( [x+a]^-1 - [x+b]^-1 ) + 0.
  4514.  
  4515. *yep
  4516.  
  4517. B [b-a]
  4518.  
  4519. *end
  4520.  
  4521. 18. STATEMENTS. CONDITIONAL INPUT READING.
  4522.  
  4523. Several statements have already been mentioned before. Here is the complete
  4524. list.
  4525.  
  4526. Showl        Show some statistics of large disk files being written.
  4527. Nshow        Switches Showl off.
  4528. Write fname    Write all common files to disk file fname.
  4529. Enter fname    Enter common files from disk file fname.
  4530. Bdelete b1,..    Delete blocks
  4531. Read fname    Start reading external file fname.
  4532. End        End of an external file.
  4533. Screen        Print in output lines up to 80 characters (default).
  4534. Lprinter    Print in output lines up to 130 characters.
  4535. Anti TX        Defines character table TX to contain the default anti-
  4536.         particle list. May appear in *fix section.
  4537. Beep options
  4538.         If no options all beep requests are cleared.
  4539.         If #,t issue # beeps at termination.
  4540.         If #,* issue # beeps when concluding a section (* delimited).
  4541.         If #,e issue # beeps in case of an error.
  4542. Common ...    Common declaration.
  4543. Delete ...    Delete files.
  4544. Directory    Defines directories to be used for large files. See section
  4545.         on file handling.
  4546. Digits        Defines number of digits to be printed for floating point
  4547.         numbers.
  4548. Dryrun #    Do a 'dry run'. Print at most # terms at completion.
  4549. External fnam    Read fnam into memory. Command Extern executes that file.
  4550.  
  4551. Fortran type output has been shown to need often considerable editing.
  4552. The section of Schoonschip producing this has been rewritten. By default
  4553. the fortran output has only complete terms on any given line (if possible)
  4554. rather then the compressed form desirable in the old days when cards were
  4555. used. The compressed form is still available though. In addition, one may
  4556. specify how many continuation lines any given statement may have. Also
  4557. one may direct Schoonschip to place brackets around negative exponents.
  4558. Finally one may optionally direct Schoonschip to supplement every integer
  4559. with a decimal point, as some Fortran compilers require this.
  4560. All this may be achieved with the Fortran command. Every item is optional,
  4561. the defaults being: no compression, 9 continuation lines/statement, no
  4562. brackets, no . in integers, fortan type output.
  4563.  
  4564. Fortran #,Brackets,Compression,.,A
  4565.  
  4566. Only the first character of Brackets and Compression is significant and may
  4567. be lower or upper case. A minus sign in front of Brackets, Compression or .
  4568. switches back to the default, for example Fortran -Brackets instructs
  4569. Schoonschip not to put brackets around negative exponents.
  4570.  
  4571. The exponent of a number is normally shown using the character E (e.g.
  4572. 1.23E+10). If a number of digits (Digit statement) larger than 5 has been
  4573. specified then D will be used instead (1.23D+10).
  4574.  
  4575. Finally, to specify output for the A-compiler mention the character A
  4576. on the Fortran statement.
  4577.  
  4578. Freeze xfile    Freezes file xfile. See section on large problem
  4579.             handling.
  4580. Keep fil1,...    Keep files over a *next
  4581. Large #        # is a number in the range 1 to 5 inclusive. Default is 2. It
  4582.         specifies the number of intermediate output files to be used
  4583.         for large file sorting. See section on file handling commands.
  4584. Maximum #    Specifies the maximum size of intermediate output subfiles.
  4585.         Default is 110 000. See section on file handling commands.
  4586. Names fname    Enter names of a common file.
  4587. Nprint fil1,..    Do not print file1,..
  4588. Oldnew xx=yy    Renames a quantity.
  4589. Outlimit #    Sets a limit of # bytes on disk usage. In case of large file
  4590.         usage this sets the limit on total disk space used for the
  4591.         intermediate output files. Default: 500 000 = 0.5 Mb.
  4592. Overflow off    Suppresses short number (exponents, function arguments)
  4593.         overflow error trapping. May appear in *fix section.
  4594. Overflow on    Reactivates overflow error trapping.
  4595. Print ...    Specifies files to be printed.
  4596. Precision #
  4597.  
  4598. This specifies the precision required for dealing with numbers. This number #
  4599. applies internally at various instances. In the output two terms are taken to
  4600. cancel if the addition gives a cancellation up to # digits. Comparing numbers
  4601. with the Coef command uses the precision criterium. Also, when writing terms to
  4602. disk every number is truncated to 10 digits if # above is 9 or less. This saves
  4603. considerably on disk space. The default is 22 digits.
  4604.  
  4605. Progress    In case of no output to the terminal print a . to the
  4606.         terminal every 128 terms to show progress.
  4607. Punch ...    Specifies files for which fortran output must be made.
  4608.  
  4609. Rationalize #
  4610.  
  4611. Schoonschip by default tries to rationalize numbers. The number # specifies
  4612. to how many digits the numbers must agree. For example, Schoonschip will
  4613. rationalize Pi = 3.141592654.. to 22/7 = 3.142857143... if 3 is specified.
  4614. Specifying 5 gives 355/113 = 3.14159292... which actually agrees 7 digits.
  4615. It should perhaps be noted that after every rationalization Schoonschip
  4616. actually performs the division and compares the result with the input number,
  4617. just to be sure. If 0 is put for # no rationalization is done. The default
  4618. is 22 digits, with check up to 26 digits.
  4619.  
  4620. Round on    Numerical expressions as function arguments to be converted
  4621.         to short integers are normally obtained by truncation. If
  4622.         Round on the number is rounded to nearest integer. Round
  4623.         off resets to the default, truncation.
  4624. Silence        Instructs Schoonschip not to print "Ready" to the screen and
  4625.         wait for an answer for certain PC's that normally clear the
  4626.         screen immediately at termination.
  4627. Sum ...        Specifies indicies to be summation indices.
  4628.  
  4629.  
  4630. Synonym name1=name2
  4631.  
  4632.         Every occurrence of name1 between single quotes is replaced
  4633.         by name2. This is very much like replacements of BLOCK
  4634.         arguments, except that it is not limited to a block.
  4635.         The end of the range of validity of some set of synonyms is
  4636.         defined by the synonym statement without any arguments.
  4637.         At most 16 synonyms allowed.
  4638.  
  4639. Traditional    Do traditional sorting. See section on file handling commands.
  4640.  
  4641. The conditionional input reading statements may be used to formulate small
  4642. variations on a given problem. The idea is to define some parameters in the
  4643. beginning of a problem, and then to read input as a function of those
  4644. parameters. Many variations upon a given problem can then be run simply
  4645. by changing a few parameters in the beginning.
  4646.  
  4647. The parameters are called _Sw0 to _Sw9 and their default values are 0.
  4648. The initial value of the parameter _Sw0 may actually be set on the command line
  4649. when invoking Schoonschip. To this purpose use the notation S=#, where # must
  4650. be a number in byte range (-128, 127). Example:
  4651.  
  4652. Schip S=7 Ifile
  4653.  
  4654. The initial value of _Sw0 will be 7.
  4655.  
  4656. The _Swx may be changed by means of a Set statement. The syntax is:
  4657.  
  4658. Set _Sw? = expr
  4659.  
  4660. with ? a number in the range 0 - 9, and expr a simple numerical expression
  4661. (see below) in byte range, i.e. -128, 127. Example:
  4662.  
  4663. Set _Sw3 = 7
  4664.  
  4665. Every occurrence of _Sw3 is replaced by the number 7. This includes actual
  4666. occurences within any given expression, for example
  4667.  
  4668.     ... a^_Sw3 ...
  4669.  
  4670. is read as  a^7. Other example:
  4671.  
  4672. Set _Sw5 = _Sw5 + 1
  4673.  
  4674. In addition the variables _Sw0 - _Sw9 may occur in a Gotoif (or Gotoifn)
  4675. statement. Here is the syntax:
  4676.  
  4677. Gotoif expr1, expr2 ? expr3
  4678.  
  4679. Expressions expr1, expr2 and expr3 must be simple numerical expressions,
  4680. defined below. They evaluate to a number. Expr1 must evaluate to a number
  4681. in the range 0 - 99. The other two expressions are evaluted on a 16 bit
  4682. basis (range -32000, 32000). The question mark ? may be >, < or =. The
  4683. expressions are compared and if the condition is true all following lines
  4684. are skipped until a line with an @ symbol in column 1 is seen. This @
  4685. symbol may be followed by a number, and if this number is equal to the
  4686. value of expr1 the skipping stops, else continues. If there is no number
  4687. after the @ symbol the skipping stops always.
  4688.  
  4689. The statement
  4690.  
  4691. Gotoifn expr1, expr2 ? expr3
  4692.  
  4693. is analagous to the above except that the skipping starts if the condition
  4694. is not true. Finally
  4695.  
  4696. Goto expr1
  4697.  
  4698. leads to an unconditional start of skipping.
  4699.  
  4700. The expressions may contain numbers separated by the operators + - | & * and /.
  4701. The operator | stands for logical OR and & is the logical AND. Precedence: +
  4702. etc as usual, | as +, & as *. The division is integer division, for example 3/2
  4703. equals 1. Furthermore the variables _Sw0 to _Sw9 are considered to be numbers
  4704. with whatever value that they have been set to (zero initially).
  4705.  
  4706. Here is a simple example, showing also the use of the Synonym statement:
  4707.  
  4708. Synonym Xxx = _Sw0
  4709.  
  4710. Set _Sw9 = 3
  4711. Set _Sw1 = 2-3*(22/2-4)
  4712. Set _Sw2 = 2-(22&2-4)*_Sw9
  4713. Set _Sw3 = 6
  4714. Set _Sw4 = 1 | 0x20
  4715.  
  4716. Z xx = (a + b) ^ 3 + a0^'Xxx' + a1^_Sw1 + a2^_Sw2 + a3^_Sw3 + a4*_Sw4
  4717.  
  4718. Gotoif 20, _Sw3 > 5
  4719.  
  4720. Id, b = 20*c
  4721. Goto 21
  4722.  
  4723. @20
  4724. Id,b = a + c
  4725.  
  4726. @21
  4727. *begin
  4728.  
  4729. Here is the output in case the value 62 was specified as initial value for
  4730. _Sw0, by means of a command line specification: Schip S=62 ... If no S=#
  4731. parameter present on the command line the value of _Sw0 would have been 0
  4732. giving 1 instead of a0^62.
  4733.  
  4734. xx = a0^62 + a1^-19 + a2^8 + a3^6 + 3*a4 + 6*a*c^2 + 12*a^2*c + 8*a^3 + c^3
  4735.  
  4736. Note the notation for a hexadecimal number, 0x20 (= 32 decimal). An OR with 1
  4737. produces 0x21, i.e. 33 decimal. The AND of 2 with 22 is 2 (in hexadecimal 22 =
  4738. 0x16, which gives 0x02 when AND'ed with 0x02).
  4739.  
  4740. In the above case, since the condition is true, skipping starts immediately
  4741. after the Gotoif statement, and continues till the line with @20 is met. Thus
  4742. the problem reads:
  4743.  
  4744. Z xx = (a + b) ^ 3 + ...
  4745.  
  4746. Id,b = a + c
  4747. *begin
  4748.  
  4749. If _Sw3 is not set, or set to some value equal or less than 5 the problem
  4750. will be read as
  4751.  
  4752. Z xx = (a + b) ^ 3 + ...
  4753.  
  4754. Id, b = 20*c
  4755. *begin
  4756.  
  4757. Use of
  4758.  
  4759. Gotoifn 20, _Sw3 < 6
  4760.  
  4761. instead of the earlier Gotoif statement would give the same results.
  4762.  
  4763. If no skipping is going on lines with an @ in column 1 are ignored.
  4764.  
  4765.  
  4766. 19. LARGE PROBLEM HANDLING.
  4767.  
  4768. Considerable attention has been focussed on the question of large output.
  4769. The traditional output sorting method of Schoonschip is inadequate for
  4770. truly large problems, with more then 50 0000 terms in the output.
  4771. Moreover, as small computer systems do not have infinite large disk
  4772. space (typically 20 Mb) a method economizing on that is important.
  4773.  
  4774. The traditional system works as follows. Generated terms arrive at the
  4775. sorting routine and are compared with the terms already present in the
  4776. output store. If found, coefficients are added. If not found, and there
  4777. is space left the term is entered in the output store. Else the term
  4778. is simply written to disk, and further adding of terms to the output
  4779. store is inhibited. This method is quite wasteful as far as disk space
  4780. is concerned. The timing depends crucially on the disk system, and
  4781. is generally slow.
  4782.  
  4783. The new method uses up to five output files. If the output store is full
  4784. the content of the output store is dumped on, say, file1, and sorting
  4785. resumes. If again the output is full the store is dumped on, say, file2,
  4786. etc. If the maximum number of files is reached then merging is done
  4787. rather then straight dumping. Assume for example that a maximum of three
  4788. output files has been specified. Assume now that already three files,
  4789. file1, file2 and file3 have been created. At this point, when the output
  4790. store is again full, a merge takes place. The smallest file (say file2)
  4791. is selected, and merged with the contents of the output store to a
  4792. new file, called file2a (for example, naming conventions are given below).
  4793. And so on. When the whole problem is finished there are then three
  4794. possibly very large files. As a final step these three files are
  4795. piecewise merged into the output store and printed etc.
  4796.  
  4797. With this method the disk usage is already considerably less than with
  4798. the traditional method, because only sorted expressions are written
  4799. to disk. Still, the disk use may be quite more than the final size of
  4800. the result; each of the above three files may well be of the order of
  4801. magnitude of the final size.
  4802.  
  4803. If disk space is really crucial then the above method may be used
  4804. specifying usage of only one file. The first overflow produces the
  4805. file. The second produces a merging of the file and storage, giving
  4806. rise to a new file. Disk usage is maximum at the moment that the last
  4807. part of the original file is read, and the new file is almost written
  4808. out. That disk usage is then about twice the size of the final result.
  4809.  
  4810. To deal with this final factor of two a fractured file system has been
  4811. implemented. A fractured file is a file split up in smaller files.
  4812. Each of these smaller files is a normal file to the operating system;
  4813. only one at the time is opened for reading or writing. Moreover, after
  4814. reading they are immediately deleted. In the case described one would
  4815. for example produce file1, fractured up into five files called file1_0
  4816. to file_5. When merging this with the output store file2, fractured
  4817. into file1a_0 to file1a_7 (for example) is created. At the moment that
  4818. the last subfiles are being created most of the subfiles of file1
  4819. will have been deleted. The maximum disk space used with this method
  4820. is usually about equal to the size of the final file plus an overshoot.
  4821. This overshoot may be one extra subfile size. In addition of course
  4822. the overshoot is problem dependent; computing the difference of two
  4823. large but equal expressions leads to a final size of zero, but the
  4824. intermediate result may at one point be as large as that of one expression
  4825. alone. Schoonschip assumes that an overshoot at least as large as the
  4826. size of the output memory is allowed. This is used to skip the last merging,
  4827. thus dumping the last output store onto file2 and then merging (possibly
  4828. very large) file1 with this much smaller file2 while printing.
  4829.  
  4830. This method appears to be the best one can do concerning disk usage.
  4831. The timing is reasonable, but goes up quadratically with the size
  4832. of the final file. To give an idea, a 6 Megabyte final result takes
  4833. about 6000 seconds merging time, depending on the system (M68000
  4834. assumed).
  4835.  
  4836. If space is no issue then more then one dump file may be specified.
  4837. The sorting time decreases roughly linearly with the number of files.
  4838. This is of course very problem dependent.
  4839.  
  4840. A very important factor is also output memory size. Sorting time
  4841. decreases roughly linearly with increasing memory size. To allow for
  4842. adaption to particular systems the size of the output memory may
  4843. now be specified on the command line when calling Schoonschip.
  4844. However, be careful with systems having dynamic memory management
  4845. such as the Sun. If to much memory is specified then the system will
  4846. accept that and swap memory onto disk as needed. This is of course
  4847. very counterproductive. It would bring Schoonschip virtually to a halt.
  4848.  
  4849. Also the format of numbers plays a role. Integers (limit 2 000 000 000)
  4850. take less space on the disk then most other numbers (6 versus 14 bytes
  4851. for anyone term). Thus if all numbers can be made integer by means
  4852. of some overall factor then that will improve both speed and output size.
  4853. The factor can be divided out later, or whatever. If a precision of
  4854. less then 9 digits is specified (N 9 or Precision 9) then all
  4855. numbers written to disk will be rounded such as to fit in 6 bytes.
  4856.  
  4857. Of importance is the way an expression is factored. This factorization
  4858. is under control of the user through the use of the B-list. In the
  4859. output store the terms are stored precisely as they are printed:
  4860.   head1 * ( tail11 + tail12 + ...) + head2 * (tail21 + ...) + ...
  4861. Without factoring much more space would be used:
  4862.   head1*tail11 + head1*tail12 + ...
  4863. Too much factoring is also wasteful:
  4864.   head1 * (tail1) + head2 * (tail2) + ....
  4865.  
  4866. To adequately allow tailoring of a problem a number of facilities have
  4867. been provided. Notably, for a large problem, a "dry run" may be executed.
  4868. If that is specified then Schoonschip will not write any file, but simply
  4869. discard any full output store. An estimate of the time and disk space
  4870. needed will be made and printed. The estimate is for minimum disk space
  4871. (i.e. only one output file to be used). Optionally a limited number of
  4872. terms in the output will be printed, to inspect for optimal factorization.
  4873.  
  4874. If more then one device is available for storage then it might be desirable
  4875. to split up the output files over different devices or directories.
  4876. Also this may be done.
  4877.  
  4878. Finally the maximum size of the subfiles may be specified.
  4879.  
  4880. The naming of the files is as follows. All names are of the form
  4881.   TAPxyyyL
  4882. where x and yyy are hexadecimal numbers. The equivalent of file1_0,
  4883. file1_1...file1_10,... etc. above is TAP6000L, TAP6001L ... TAP600AL,....
  4884. The equivalent of file1a_0 etc is TAPB000L etc. File2_0 is TAP7000L,
  4885. file2a_0 is TAPC000L, etc. Thus the two groups of output files are
  4886. TAP6 through TAPA and TAPB through TAPF. File TAP6 when merged with
  4887. storage produces file TAPB and conversely.
  4888.  
  4889. Also the "Yep" file has been made into a fractured file. The name used
  4890. is TAP4yyyL, with yyy starting at 000. In this way the disk usage is
  4891. minimized in the case of a *Yep.
  4892.  
  4893. A useful tool in handling large problems is the Freeze command. Suppose
  4894. there exits a large common file that must be worked on further. In
  4895. particular, suppose that work must be done on certain factors. If
  4896. the file has, say, 10000 terms then that work must be done 10000 times.
  4897. To cut down on the work as well on the size of the problem the
  4898. following may be done.
  4899.  
  4900. First, when producing the file specify on the B-list those factors on
  4901. which the work must be done. For example, if an expression must be
  4902. integrated over some variable x, with X1, X2 and X3 denoting x dependent
  4903. factors:
  4904.  
  4905. Common xfile
  4906. B x,X1,X2,X3
  4907. Z xfile = ....
  4908.  Substitutions, commands
  4909. *begin
  4910.  
  4911. The result will be of the form:
  4912.  
  4913.  xfile = x * (terms1...) + x^2 * (terms2...) + X1 * (terms3...) etc.
  4914.  
  4915. There may be many terms inside the brackets. As the file must be a common
  4916. file it now resides on disk. The subsequent command (after the *begin)
  4917.  
  4918. Freeze xfile
  4919.  
  4920. produces the following result. The file xfile is read and split up in one
  4921. main file and possibly many 'frozen' subfiles. The main file will still
  4922. be called xfile, and is as follows:
  4923.  
  4924.  xfile = x * DF(xfile,1) + x^2 * DF(xfile,2) + X1 * DF(xfile,3) etc.
  4925.  
  4926. The subfiles are denoted as x_file:
  4927.  
  4928.  x_file(1) = terms1
  4929.  x_file(2) = terms2
  4930.  x_file(3) = terms3
  4931.  :
  4932.  :
  4933.  
  4934. The frozen subfiles are not directly accesible like other files. They
  4935. may be referred to only by means of the DF function. There is a command,
  4936. Expand, that allows substution of the subfile for the DF function. For
  4937. example,
  4938.  
  4939. Z xx = DF(xfile,3)
  4940. Id,Expand,xfile
  4941. *end
  4942.  
  4943. will produce for xx the contents of x_file(3). This may also be used
  4944. to restore the file to its original shape:
  4945.  
  4946. Common xfilp
  4947. B x,X1,X2
  4948. Z xfilp = xfile
  4949. Id,Expand,xfile
  4950. Delete xfile
  4951. *begin
  4952.  
  4953. The new file xfilp will be precisely as the original xfile. Deleting
  4954. (but not replacing) a frozen main file leads to deletion of all frozen
  4955. subfiles.
  4956.  
  4957. It is clear that the work on the frozen main file xfile will be much
  4958. less voluminous since it will have many less terms. After the work has
  4959. been done one may re-establish the complete file using the Expand command.
  4960.  
  4961. Freeze is a very powerful tool. It must however be used with some care.
  4962. Most importantly: file arguments are not, repeat not, transferred to
  4963. the subfiles. For example, defining
  4964.  
  4965. Z xfile(a1,a2) = ...
  4966.  
  4967. and subsequently freezing xfile leads to a number of subfiles. Using
  4968. now xfile with some other arguments,
  4969.  
  4970. Z ha = xfile(mu,nu)
  4971.  
  4972. and subsequently expanding the subfiles will not lead to the replacement
  4973. of a1 and a2 in the subfiles by mu and nu. Thus as a general rule a
  4974. file to be frozen should not have arguments.
  4975.  
  4976. Particularly tricky are created indices here. If such indices are
  4977. summation indices then it may happen that of such a pair of indices
  4978. one appears outside parenthesis, and one inside, and thus may become
  4979. part of a frozen subfile. Since Schoonschip often renames summation
  4980. indices there may then result a situation where the index outside
  4981. is renamed, while that inside remains the same. See the discussion
  4982. at the All command.
  4983.  
  4984.  
  4985. 20. FILE HANDLING COMMANDS.
  4986.  
  4987. This section assumes that the reader is familiar with the section on large
  4988. file handling. The commands may be in upper or lower case, and only the
  4989. first two (three if confusion possible) characters are significant.
  4990.  
  4991. To specify Traditional sorting:
  4992.  
  4993. Traditional
  4994.  
  4995. Whatever the default is and will be is a matter of time and experience.
  4996.  
  4997. The specify the new method:
  4998.  
  4999. Large #
  5000.  
  5001. where # is a number in the range 1 to 5 inclusive. Default is 2. It specifies
  5002. the number of output files to be used.
  5003.  
  5004. To specify the maximum size of the subfiles:
  5005.  
  5006. Maximum #
  5007.  
  5008. where # is the maximum size of the subfiles in bytes. Default is 110 000.
  5009.  
  5010. For each of the subfiles a prefix (directory) may be specified. One may
  5011. either specify a collective prefix for all subfiles regardless of the
  5012. first number (6-F), and/or specify individual prefixes. Here is the
  5013. syntax:
  5014.  
  5015. Directory #,prefix1,#,prefix2,#,prefix3,...
  5016.  
  5017. For any subfile the number designating the subfile is compared with
  5018. the chain. The prefix inbetween two numbers (including the first
  5019. but not the second) that have a range including the file number
  5020. will be used. If the number is less than 1000 hex (=4096) then only
  5021. the last three hexadecimal digits of the file number are used, else
  5022. all. The prefix is simply glued in front of the name TAP... as described
  5023. before. The special notation . (just one period) designates no prefix.
  5024.  
  5025. It should be noted that Schoonschip accepts hexadecimal numbers with
  5026. the notation 0x... where ... are hexadecimal digits. For example
  5027. 0x100 is the same as 256.
  5028.  
  5029. Here some examples.
  5030.  
  5031. Directory 0,/usr/tmp/,10,/user1/tmp/,100,.
  5032.  
  5033. The numbers must be in ascending order. This statement must be the
  5034. very first in any Schoonschip program, and it must be in a *Fix section.
  5035.  
  5036. Files TAPx000L through TAPx009L are prefixed with /usr/tmp/:
  5037.  /usr/tmp/TAP6000L
  5038. for example. Files TAPx00AL through TAPx063L are prefixed with
  5039. /usr1/tmp/. Files TAPx0064L and up get no prefix. There is collective
  5040. sharing of directories, for example TAP6001L and TAPB001L get the same
  5041. prefix.
  5042.  
  5043. Directory 0x4000,/usr/tmp/,0x6000,.,0xB000,/usr/tmp1/
  5044.  
  5045. The prefix /usr/tmp/ is assigned to files TAP4yyyL and TAP5yyyL.
  5046. Files TAP6yyyL through TAPAyyyL get no prefix, and files TAPB000L up
  5047. get /usr/tmp1/. Files TAP0yyyL through TAP3yyyL (not yet used) get
  5048. no prefix.
  5049.  
  5050. Default: no prefix.
  5051.  
  5052. The old statement
  5053.  
  5054. Outlimit #
  5055.  
  5056. specifies in all cases the maximum number of bytes that can be written.
  5057. Default: 500 000.
  5058.  
  5059. To obtain information on the size of the various files being written
  5060. use the statement
  5061.  
  5062. Showlength
  5063.  
  5064. It causes Schoonschip to print the total size and the name of the last
  5065. subfile after completion of that file. The statement
  5066.  
  5067. Nshow
  5068.  
  5069. Switches it off. The statement
  5070.  
  5071. Dryrun #
  5072.  
  5073. causes Schoonschip to do a dry run as described before. The number #
  5074. specifies the maximum number of terms that will be printed. This
  5075. statement may appear also after a yep for example. If # is 0 or absent
  5076. no dry run is made.
  5077.  
  5078.  
  5079.  
  5080. 21. SUMMARY.
  5081.  
  5082. Lines with a C in column one (excluding Common) are comment lines.
  5083. Lines with a blank in column one are taken to be continuation lines (also
  5084. for C-line continuations).
  5085.  
  5086. Lines with a ~ in column one are ignored.
  5087.  
  5088. A ! signals the start of comments on a line, but otherwise is seen as
  5089. end-of-line.
  5090.  
  5091.   Print options:
  5092.  
  5093. P brackets         First 2 characters significant.
  5094. P heads            First 2 characters significant.
  5095. P input            First 2 characters significant.
  5096. P lists            First 2 characters significant.
  5097. P ninput        First 2 characters significant.
  5098. P nlists        First 2 characters significant.
  5099. P noutput        First 2 characters significant.
  5100. P nstatistics        First 2 characters significant.
  5101. P output        First 2 characters significant.
  5102. P statistics        First 2 characters significant.
  5103. Lprinter        Print output lines till 130 characters.
  5104. Screen            Print output lines till 80 characters.
  5105.  
  5106. External file reading:
  5107.  
  5108. Read fname        Start reading from external file fname.
  5109.             In fname no Read statements allowed.
  5110. End            Switch back to normal input and close the file.
  5111.             A subsequent reading of that same file starts
  5112.             again at the begin.
  5113.  
  5114. Common file manipulations:
  5115.  
  5116. Enter Cfile        Enter common files contained in file Cfile.
  5117.             Must be in first section, terminated by *fix
  5118.             There may be several Enter statements in that section.
  5119. Write Cfile        Write common files to file Cfile.
  5120.  
  5121. Blocks and DO-loops:
  5122.  
  5123. BLOCK Name{arg1,...}    Defines Block Name. In text arguments between ''.
  5124.             Call: Name{brg1,...}   Name must start in col 1.
  5125.             If an argument contains comma's this argument must
  5126.             be enclosed in {}. Concerning nesting: Schoonschip
  5127.             strips away one layer of {} at a time.
  5128. ENDBLOCK
  5129.  
  5130. DELETE Name1,Name2,...    Delete blocks Name1,...
  5131.  
  5132. DO L1=n1,n2,n3        Optional n3. If absent is taken to be 1. In text
  5133. ENDDO            argument L1 between ''.
  5134.  
  5135.   File related statements:
  5136.  
  5137. Common Name1,Name2(0),Name3,..        Defines common files.
  5138. Delete Name1,Name2(5),Name3,..        Delete files.
  5139. Keep Name1,Name2(5),Name3,....        Keep local files over a *next.
  5140. Names Name1,Name2(5),Name3,...        Enter namelists of these files.
  5141. Nprint Name1,Name2(5),Name3,..        Do not print these Z-expressions.
  5142. Print Name1,Name2(5),Name3,...        Print these Z-expressions.
  5143. Punch Name1,Name2(5),Name3,...        Write to tape8 in Fortran compatible
  5144.                     form.
  5145.  
  5146. In certain lists the name of an indexed file may appear without index. In
  5147. that case the command applies to all files with that name. This holds for
  5148. Delete, Keep, Nprint, Print and Punch.
  5149.  
  5150. Various 'first-column' types:
  5151.  
  5152. *            Start execution or go on to next section. Options:
  5153.              fix  yep  next  begin  end
  5154.              The *fix section must be the first section.
  5155.              All names, but not expressions in brackets are
  5156.              kept over a *yep.
  5157.              *next as *yep, except that local files not mentioned
  5158.              in a Keep list are deleted.
  5159.              All except fixed quantities and common files are
  5160.              deleted over a *begin.
  5161.              *end signals end of input file.
  5162. A a1,a2=x,..        Algebraic symbol list. If x is a number then powers
  5163.              of a2 equal or higher than x are set to zero.
  5164.              Alternatively x may be c, r or i, denoting reality
  5165.              properties. Default is r. Constructions such as
  5166.              a2=3=c are allowed.
  5167. Al            Substitution or command on same Level. On a line
  5168.              starting with Id subsequent ; are read as Al,
  5169. B b1,b2,..        List of symbols to be factored out in output.
  5170.             Legal: symbols, vectors, dotproducts, vector comp.
  5171.             If a vector name is mentioned all dotproducts and
  5172.             vector components referring to that vector are
  5173.             factored out.
  5174. D Name(n,..)=xpr,xpr,..    Data expression. Expressions must be single terms.
  5175. F f1,f2=x,..        Function list. Reality properties may be specified
  5176.              through x, legal are i,c,r and u. Default is r.
  5177. I i1,i2=x,..        Index list. The dimension x may be a number or a
  5178.              single character algebraic variable, defined before
  5179.              in an A-list.
  5180. Id            Substitution or command on next free Level. See Al.
  5181. Oldnew a1=b1,a2=...    Change name a1 into b1 etc.
  5182. Outlimit #        Change output byte limit. Default: 500 000.
  5183. Sum i1,i2,..        Declares i1,i2,.. to be summation indices. This is
  5184.              not related to the summation indices of the DS
  5185.              function, but indices appearing twice according
  5186.              to the Einstein summation convention.
  5187.              Indices in this list must have been defined before.
  5188. T Name(n,,,)=sy1,sy2,..    Table.
  5189. T Name: "X=1:1,..    Character table.
  5190. V p1,p2=z,..        Vector list. Names of 1 or 2 characters. The optional
  5191.              z implies that p2 is to be set to zero as soon as
  5192.              it occurs, also in vector-component or dot-product.
  5193. X Name(arg,..)=xpr    X-expression.
  5194. Z Name(arg1,...)=xpr    Z-expression. If arg1 is a number or simple numerical
  5195.              expression Name is a subscripted file. The number
  5196.              must be in the range 0-32767.
  5197.              Here a simple numerical expression may contain
  5198.              numbers, or block or DO-loop arguments that become
  5199.              numbers, separated by +-* or /.
  5200.  
  5201. The general structure of a substitution or command involves several elements
  5202. that can be separated in groups. All groups and elements must be separated by
  5203. comma's.
  5204.  
  5205. The first group is the Id or Al itself (with possibly ; instead of Al,)
  5206. optionally followed by a number:
  5207.     Id,    Al,    ;    Id,#,    Al,#,    ;#,
  5208. The number specifies on how many Levels the substitution or command is to
  5209. be applied.
  5210.  
  5211. The next group may contain one item, namely a keyword. This only for
  5212. substitutions, not commands. Valid keywords are:
  5213.     Multi    Funct    Dotpr    Ainbe    Adiso    Always    Once
  5214. This group may be empty.
  5215.  
  5216. The next group either defines a pattern followed by a = sign or is a command
  5217. followed by arguments separated by comma's (if any). Patterns are products of
  5218. factors, with dummies designated by a ~ following the symbol. Not all factors
  5219. can be dummies. See section 10.
  5220.  
  5221. The available commands and their formats are:
  5222.  
  5223. Absol    Force coefficien positive.
  5224. Addfa    Add factor.
  5225.      Id,Addfa,expression
  5226. All    Collect vectors p into function F. Created indices may be assigned
  5227.     a dimension. First syntax:
  5228.      Id,All,p,N,F
  5229.     possibly followed by the character arguments "F_, "D_, and/or "V_
  5230.     which inhibit function argument, dot-product or single vector
  5231.     inspection (example: Id,All,p,N,F,"F_).
  5232.     Second syntax:
  5233.      Id,All,F1,N,F
  5234.     Collect all vectors of function F1 into F. Substitute a created
  5235.     index in F1, and also as additional argument of F.
  5236. Anti    Check function arguments for characters, and if _ present remove
  5237.     that if character mentioned in anit-particle chcracter table.
  5238.      Id,Anti,TA
  5239. Asymm    Re-arrange arguments of anti-symmetric function.
  5240.      Id,Asymm,f1,2,3,4,f2,f3,4,5
  5241.      Id,Asymm,F1:2,3,4:7,8,9:12,13,14:
  5242.      Id,Asymm,F1:1-3:7-9:12-14:
  5243. Beep    Generate a beep on the terminal.
  5244.      Id,Beep
  5245. Coef    Inspect numerical coefficient.
  5246.      IF Coef,option
  5247.      options:    pl    plus
  5248.             ng    negative
  5249.             eq,#    equal
  5250.             lt,#    less than
  5251.             gt,#    greater than
  5252.             ib,#,#    inbetween
  5253. Commu    Re-arrange commuting functions.
  5254.      Id,Commu,f1,f2,f3,...
  5255. Compo    Compose names.
  5256.      Id,Compo,<options>,f1,f2,<options>,f3,f4,..
  5257.      options: AFIVX with AFV possibly twice. Optionally "S_ suppresses
  5258.      symmetrization of the name. Optionally a character table may be
  5259.      specified, to be used if characters with an underscore appear.
  5260. Count    Count certain occurrences with certain weigths.
  5261.      Id,Count,xxx,arg1,#,arg2,#,....
  5262.     If xxx number then term kept if count equal or larger than xxx.
  5263.     If xxx symbol or vector-component or dot-product xxx^# is made.
  5264.     If xxx function or X,D expression then xxx(#) is made. In that case
  5265.     a multiple count can be made:
  5266.      Id,Count,Fx,arg1,#,..,# : arg2,#,..,# : arg3,#,...
  5267.     Now Fx(#1,#2,#3,...) is made with #1 determined by the arguments up
  5268.     till the first colon, #2 by the arguments between first and second
  5269.     colon etc.
  5270. Cyclic    Function invariant under cyclic permutation of the arguments.
  5271.      Id,Cyclic,f1,2,3,4,f2,f3,4,5
  5272. Dostop    Set, clear or test Dostop flag.
  5273.      Id,Dostop,X
  5274.     where X = On, off or test. Default test.
  5275. Epfred    Reduce products of Epf functions.
  5276. Even    Function even in sign of arguments.
  5277.      Id,Even,f1,2,3,4,f2,f3,4,5
  5278. Expand    Expand frozen subfiles (appearing as DF(fname,#) ).
  5279.      Id,Expand,fname
  5280. Extern  Jump to user defined routine.
  5281.      Id,Extern,arg1,arg2,...
  5282. Iall    Inverse of All.
  5283.      Id,Iall,p,F
  5284.      Id,Iall,F
  5285. Numer    Insert numerical values.
  5286.      Id,Numer,arg1,#,arg2,#,...
  5287. Odd    Function odd in sign of arguments.
  5288.      Id,Odd,f1,2,3,4,f2,f3,4,5
  5289. Order    Order functions on the basis of their first two arguments.
  5290.      Id,Order,F1,F2,...
  5291. Print    Print a message, maximally # times.
  5292.      Id,Print,#,Message
  5293. Ratio    Rationalize.
  5294.      Id,Ratio,xpa,xpb,bma
  5295. Stats    Count passage in one of four counters (0-3). Result printed at end.
  5296.      Id,Stats,#
  5297. Symme    Re-arrange arguments of symmetric function.
  5298.      Id,Symme,f1,2,3,4,f2,f3,4,5
  5299.      Id,Symme,F1:2,3,4:7,8,9:12,13,14:
  5300.      Id,Symme,F1:1-3:7-9:12-14:
  5301.  
  5302.   Three commands are special to problems of relativistic quantum mechanics:
  5303.  
  5304. Gammas    Collect, Reduce and/or take trace of products of G's.
  5305.      Id,Gammas,options,L1,L2-L3:options,Trace,L3,L4-L5:options,...
  5306.      options are designated by characters: "C collect only, "A anomalous
  5307.      trace, "S do spinsum, "U unify strings, "I do index pair reduction,
  5308.      "i do index pairs in _-type strings, "P do P-tricks, "W do final work.
  5309.      All options except "C may be followed by an underscore, implying
  5310.      switching off. The "C option when not combined with anything else
  5311.      gives normalization, however without ever specialization to
  5312.          four dimensions (essential if there are non-four-dimensional vectors)
  5313.          Default: "A_,"S,"U_,"I,"i,"P,"W
  5314. Spin    Replace pairs of Ug,Ubg by spin-summation expression. The spinors may
  5315.      be defined by loop indices or vectors.
  5316.      Id,Spin,L1,p,...
  5317. Ndotpr    Create special dot-products. Closely related to Gammas command.
  5318.      Id,Ndotpr,F1
  5319.  
  5320. A number of special functions is build in. They are:
  5321.  
  5322. D        Delta function.
  5323.  
  5324. Epf        Anti-symmetric Weyl tensor. May have any number of arguments.
  5325.  
  5326. DD        Internal purposes (used to represent X and D expressions and
  5327.         files).
  5328.  
  5329. DS        Summation function. Format:
  5330.         DS(J1,#,#,(xpr1),(xpr2))    xpr2 numeric, optional.
  5331.         The sum over the given range is constructed. The numerical
  5332.         coefficient is by recursion, using xpr2. The first coefficient
  5333.         is 1. Example: e^x = DS(J,0,20,(x^J),(1/J)) + O(x^21).
  5334.         Caution: summation symbols such as J may be used only once
  5335.         in a given expression.
  5336.         Character summation:
  5337.         DS(C1;C2;..;Sym;C3;C4;TX,..,2:4,7,(xpr))
  5338.  
  5339. Numerical functions (may be part of expressions that must be numerical
  5340. such as for instance expressions occurring as exponents, or with a negative
  5341. exponent, but not of simple numerical expressions such as Z-expression index):
  5342.  
  5343. DB        DB(n) = n!    DB(n,m) = n!/{m! (n-m)!}
  5344.         DB with two arguments is word-bound, fails if n=19, m=8,9,..
  5345.  
  5346. DT        DT(n1,n2,..)    1 if all arguments positive or zero, else 0.
  5347.  
  5348. DK        DK(n1,n2)    1 if n1=n2, else 0.
  5349.  
  5350. DP        DP(n1,n2,..)    1 if permutation to smallest first is even,
  5351.                 else 0. Order normal: -127,..,0,...,+127.
  5352.                 0 if two arguments equal.
  5353. DF        DF(xfile,#) or DF(xfile,#1,#2)
  5354.                 The last case is equivalent to the first
  5355.                 with # = 100*#1 + #2.
  5356. DC        DC(n1,n2,..)    1 if sum of all arguments is 0, else 0.
  5357.         DC("X,.....)    "X is option character. May be "C, "F, "T
  5358.                 with or without underscore following.
  5359.   Special functions relevant to particle physics are:
  5360.  
  5361.      G(L,mu)    Gi(L)    G5(L)    G6(L)=Gi(L)+G5(L)    G7(L)=Gi(L)-G5(L)
  5362.      Ug(L,m,p)    Ug(L,mu,m,p)    Ubg(L,m,p)    Ubg(L,mu,m,p)
  5363. Use -m for anti-particle spinors.
  5364.  
  5365. New notation:
  5366.      G(i1,i2,mu,nu,..,G6,..)  Gi(i1,i2)  G5(i1,i2)  G6(i1,i2)  G7(i1,i2)
  5367. Internally generated G-strings:
  5368.      G(L1,"s,"4,mu,nu,..,G5,..)        General 4 and N dim mixture.
  5369.      G(L1,"t,"4,mu,nu,..,G5,..)        General 4 and N dim mixture.
  5370.      G(L1,"S,"X,mu,nu,........)        4-dim. "X may be "4, "5, "6 or "7.
  5371.      G(L1,"T,"X,mu,nu,........)        4-dim. "X may be "4, "5, "6 or "7.
  5372.      G(L1,"s,"_,mu,nu,........)        N-4 dim.
  5373.      G(L1,"t,"_,mu,nu,........)        N-4 dim.
  5374.  
  5375.  
  5376. APPENDIX A. COMMAND LINE OPTIONS.
  5377.  
  5378. The standard usage is:
  5379.  
  5380. Schip file1 file2 options
  5381.  
  5382. Schoonschip input is supposedly contained in file1, the output is written
  5383. to file2. Fortran compatible output (directive Punch) is written to tape8.
  5384. If file2 absent then the output is written to standard output, i.e. the
  5385. screen. If in addition file1 absent then the standard input (the keyboard)
  5386. is used as input. When doing that remember that *end terminates the run.
  5387. Also errors lead to termination. Normally Schoonschip echo's the input lines
  5388. back to the screen.
  5389.  
  5390. Alternatively input, output and punch file (tape8 by default) can be
  5391. designated by means of the notations i=, o= or f= (the f stands for Fortran
  5392. compatible; upper case accepted as well):
  5393.  
  5394. Schip i=file1 o=file2 f=file3
  5395.  
  5396. This cannot be combined with the first method.
  5397.  
  5398. All options are optional. First one may specify certain options by
  5399. preceeding them with a - sign. These options are:
  5400.  s    For Schoonschip versions running on a PC with bitmap screen.
  5401.     The "Ready" line and the requested keyboard input are suppressed
  5402.     if s (for silence) specified.
  5403.  b    Certain Fortran compilers do not accept negative exponents without
  5404.     brackets (for example A**-3). If b specified brackets are written.
  5405.     The default is no brackets.
  5406.  p    Show progress by printing a point (.) to standard output every
  5407.     128 terms.
  5408.  .    Place a . after every integer in the output. Some Fortran compilers
  5409.     insist on this.
  5410. Also upper case characters may be used. Example:
  5411.  
  5412. Schip file1 file2 -b.p
  5413.  
  5414. Options b, . and p apply.
  5415.  
  5416. These options may also be selected inside a Schoonschip program by means of
  5417. the statements
  5418.  
  5419. Silence
  5420. Fortran options
  5421. Progress on
  5422. Progress off
  5423.  
  5424. These statements are discussed elsewhere (section Miscellaneous).
  5425.  
  5426. Another option leads to noise (Control-G is sent to the terminal) upon
  5427. completion. This may be specified as b=# where # is the number of beep's
  5428. the terminal is to receive. The option S=# where # is a number in the range
  5429. -128, 127 inclusive implies setting of the initial value of the parameter
  5430. _Sw0 to the value #. Example:
  5431.  
  5432. Schip file1 file2 b=10 s=19
  5433.  
  5434. Upon completion 10 beeps will be sent to the terminal (with some interval).
  5435. The initial value of _Sw0 is 19.
  5436.  
  5437. Most important, one may now specify memory usage to Schoonschip. There
  5438. are two large storage areas used during execution, called the input space
  5439. and the output space. The input space contains the expressions, substitutions,
  5440. etc. The output space is where the final result is collected. Performance
  5441. in case of large expressions is very sensitive to the size of the output
  5442. store. The larger the better. As an heritage of the old CDC days Schoonschip
  5443. has always been very frugal in memory usage. The build-in size of in- and
  5444. output space used to be 20 Kb and 50 Kb respectively. Given that nowadays
  5445. few machines have less than 1 Mb of memory that seems to frugal.
  5446.  
  5447. The version of Jan 1, 1989 is more expansive. To begin with an amount of
  5448. about 80 Kb is used separately for buffers etc. This used to be much less.
  5449. Default sizes for in- and out space are machine dependent, but typically
  5450. 100 Kb and 250 Kb are taken. The total memory usage (excluding Schoonschip
  5451. itself, which is about 100 Kb) comes then to about 450 Kb.
  5452.  
  5453. The in- and out sizes may now be specified on the command line. To this
  5454. purpose one uses the notation IS=# and OS=# (lower case accepted also)
  5455. where the # stand for number specifying magnitude in Kb. Thus the old
  5456. situation is obtained with this command line:
  5457.  
  5458. Schip file1 file2 IS=20 OS=50
  5459.  
  5460.  
  5461. Finally a number # preceeded by a + sign can be specified on the command
  5462. line. Then Schoonschip skips the first # problems on the input file. Every
  5463. occurrence of a *end line counts as one problem. Example:
  5464.  
  5465. Schip +5 Varia Out
  5466.  
  5467. Problem five in file Varia is executed.
  5468. Some other examples:
  5469.  
  5470. Schip Infil Outfil -bp
  5471.  
  5472. The file Infil is taken to contain the input, output is written to Outfil.
  5473. Dots are printed when starting a problem, and further every 128 terms.
  5474. Brackets are placed around negative exponents.
  5475.  
  5476. Schip +1 i=Varia o=Vario -p
  5477.  
  5478. Problem 1 of Varia is executed, the output is written to Vario and meanwhile
  5479. dots on the screen show progress.
  5480.  
  5481.  
  5482. APPENDIX B. COMPATIBILITY.
  5483.  
  5484. Programs working with older 68000 versions will work provided the square
  5485. brackets [] are taken out and replaced by for example curly brackets.
  5486. In addition there is a slight change in Integ (evalution of numerical
  5487. expressions as function arguments). It now truncates, rather then rounding
  5488. to nearest integer. The statement 'Round on' may be used to re-instate
  5489. rounding (CDC versions of Schoonschip truncated).
  5490.  
  5491. The command Trick is now called Gammas, but will still be accepted. The block
  5492. delete command, DELETE (all upper case) has been replaced by BDELETE (case
  5493. insensitive, only the first four characters significant). The rarely used
  5494. statement 'Printer' has been replaced by Lprint.
  5495.  
  5496. Programs that executed on previous (CDC) versions of Schoonschip will
  5497. also run with this version with minor, mainly cosmetic modifications. The
  5498. main differences are in the use of lower case characters in this version,
  5499. and furthermore different notations for BLOCK and DO-loop arguments.
  5500.  
  5501. - Block arguments in the text of the block must be embedded in quotes.
  5502.   The same holds for DO arguments. These latter can now take negative
  5503.   values in all cases. Use of {} obligatory. Block arguments, in a call,
  5504.   may now have comma's provided they are enclosed in {}.
  5505.   The word COPY is no more needed when calling a block.
  5506.   Block names may at most be 6 characters in length.
  5507. - The complex variable I is now written as i. If needed the statement
  5508.   Oldnew i=I takes care of this.
  5509. - The S-list is now the A-list. However, S is still accepted.
  5510. - ID and AL are now Id and Al. However, both are accepted.
  5511. - GI is now Gi.
  5512. - CONJG and INTEG are now Conjg and Integ.
  5513. - Various keywords and commands have sometimes slightly different spelling,
  5514.   ODDXX is now Odd.
  5515. - The Print options have different format. For example, PRINT INPUT
  5516.   is now P input.
  5517. - Dummies are now characterized by a following ~ instead of a +.
  5518. - An exponent may now also be denoted by ^ instead of **.
  5519. - The special function DX is no more implemented. It is used internally
  5520.   for purposes relating to the Gammas command.
  5521. - Characters as function argument are denoted by "X instead of =X.
  5522.