<<

THIRD INTERNATIONAL COLLOQUIUM ON ADVANCED COMPUTING MEHTODS IN THEORETICAL PHYSICS MARSEILLE, OUNE 25-29, 1973

EDITOR A. VISCONTI

VOLUME I

UNIVERSITÉ Dt PROVENCE I \ UNIVERSITÉ DAIXMARSEILLE DÉPARTEMENT Dt PHYSIQUE MATHÉMATIQUE 1 DÉPARTEMENT DÉ PHYSIQUE SECTION THÉORIQUE

CENTRE DE PHYSIQUE THÉORIQUE C. N. R. S. - TABU Of S :'.AI ItRCS -

AVANT-PROPOS 1 PARTICIPANTS 3 QUESTIONNAIRE S 5

A - METHODS OF COMPUTATION F: JAMES Numerical Calculation Techniques in Spaces of High Dimensionality A-I-l Y. SUNDBLAD A User's Review of Algebraic Systems A-II-0 M.J. LEVINt ASHMEDAI : A Symbol Manipulation Program A-III-1 H. STRUBBE Calculations with Schoonschip A-IV-1 A.C. HEARN The Reduce Program for Computer Algebra A-V-l R.G.K. LOOS New Exact Algebraic Algorithms A-VI-1 M. BERGMAN ) Application of Mechanical Theorem-Proving to h. KANOUI ) Symbolic Calculus A-VII-1 E.H. ROFFMAN Scientific Computing in Real Time - A-VIII-1

B - APPLICATIONS TO PHYSICS

K. V. ROBERTS Computers in Plasma Physics B-I-l J. NEUUUSER Some Computational Methods in Group Theory B-II-1 D. BARTON General Relativity and Symbol!: Algebra B-III-0 J.P. HANSEN General Review of Statistical Mechanics B-IV-1 D. PUTTER ) A Waterbag Method for Fluid Simulations B-V-l G.H. TUTTLE ) R.A. RUSSELL-CLARK ALAM/CLAM and Some Applications of Computer Algebra Systems to Problems in General Relativity B-VI-0 E.H. ROFFMAN The Interaction of Solitons B-VII-1 E. STOLL ) Computer Simulation of a First-Order or a Disconti- T. SCHNEIDER ) nuous Phase Transition in the Two-Dimensional One- Spin-Flip Ising Model U-VIII-1

H. MULLER-KRUMBHAAR) Monte Carlo Calculation with Selfconsistent Field K. BINDER ) Boundary Condition : a Method for the Determination of Critical Exponents B-IX-1

73/P.550 - 1 -

- AVANT-PROPOS -

Le "Troisième Colloque international sur ies Méthodes Avancées de Calcul par Ordinateur en Physique Théorique" qui s'est tenu au Centre de Physique Théorique de Marseille en Juin 1973, se traduit par des Comptes-Rendus dont le volume -et l'intérêt aussi j'espère - est en nette augmentation par rapport à celui des précédents Comptes-Rendus publiés en 1971.

En effet, le nombre de communications, qui était de 18 lors du dernier colloque, est monté a 33. Comme précédemment, ces communications sont rangées sous trois rubriques :

- Méthodes de calcul - Applications à la physique - Physique des particules élémentaires

La première rubrique contient des exposés généraux sur différentes techniques de calcul, et aussi l'étude de trois langages qui sont parti­ culièrement utiles pour le physicien théoricien

La deuxième rubrique étudie les applications â la physique, en particulier à la physique des plasmas, à la relativité générale, à la mécanique statistique et à l'hydrodynamique. Enfin, pour la première fois dans nos colloques, est apparue une étude des méthodes de calcul dans la Théorie des Groupes.

La troisième rubrique, la plus importante, est consacrée a la physique des particules élémentaires. Elle débute par un exposé de mise au point sur les méthodes de calcul en électrodynamique, puis étudie certaines méthodes appliquées à la théorie du moment magnétique anomal, à la structure hyperfine du positronium et plus généralement aux états liés, aux phénomènes critiques de Wilson, et â certaines applications de la méthode de Padë.

Il m'apparaît que ce colloque a évolué selon une loi maintes fois vérifiée : débutant comme une réunion groupant un nombre réduit de scienti­ fiques sMntêressant à un même problême, et dans notre cas le centre d'intérêt était 1 utilisation des méthodes de calcul pour 1 évaluation de diverses corrections radiatiues en Electrodynamique quantique, ce colloque a perdu a mesure que les réunions se succédaient, son caractère "bon enfant" par suite de 1 augmentât ion du nombre des participants et de la variété des communications présentées Les nécessités d'une organisation plus poussée risquent d'entraîner une certaine sclérose des formes, les discussions ont moins de spontanéité, sont plus apprêtées et finalement ce qui n'était a l'origine qu'une occasion de rencontre tend vers la forme d'une confé­ rence internationale

Je ne crois pas que dans le cas présent, une telle évolution soit tout à fait bienfaisante, je pense, pour ma part, qu'il est nécessaire de chercher des formes nouvelles, de nouveaux centres d'intérêt, en un mot qu'il faut laisser "l'esprit" souffler sur ces réunions. Pour ce faire, je propose que pour les deux ou trois prochaines réunions, le colloque se tienne hors de Marseille : l'Université de Canterbury, avec le Profes­ seur J.5.R. Chisholm, celle d'Utrecht, avec le Professeur M. Veltman, en Europe ; l'Université de Salt Lake City avec le Professeur A.C. Hearn aux U S.A. , sont des lieux où il y a un intérêt certain pour les applications de l'Informatique à la Physique Théorique. Je suggère donc que l'un de ces éminents spécialistes dans ce domaine prenne la responsabilité d'organiser le prochain colloque

Ces quelques remarques sans apprêt, ne devraient pas faire oublier la dette de gratitude que le Comité d'Organisation et moi-même avons contrac­ tée envers tous les participants : ils ont fait leur possible - et ils ont réussi - pour rendre cette réunion vivante et intéresser les scientifiques présents à des applications qui souvent étaient assez étrangères au domaine où ils étaient spécialisés. Un tel résultat, en ce temps de spécialisation à outrance que nous vivons, est suffisamment important pour que le principe de ces rencontres soit maintenu, même si on devait modifier plus ou moins profondément leur forme et leur contenu.

A. visconti - 3 -

- PARTICIPANTS

CM. ANDERSEN College of William and Mary, Williamsburg (Virginia) A. ARNEODO Université de Nice R.H. BARBIERI Scuola Normale Superiore, Pisa R.C. BARRETT University of Surrey, Guildford D. BARTON Computer Laboratory, Cambridge M. BERGMAN UER Marseilla-Luminy A. BERGSTROH Research Institute of National Defence, Stockholm A. BOURGEAT Institut National des Sciences Appliquées, Villeurbanne C. BREZINSKI Université de Lille I S.J. BRODSKY S.'l.'fl.C, Stanford P. BUTERA Université de Milan B.L. BUZBEE University of California, Los Alamos M. CADILHAC Université de Provence, Marseille M. CAFFO Université de Bologne J. CALMET Centre de Physique Théorique, CNRS Marseille D.C. CAREY National Accelerator Laboratory, Batavia O.S.R. CHISHOLH University of Kent, Canterbury P. CVITANOVIC Cornell University, Ithaca E. DE RAFAEL IHES, Bures-sur-Yvette V. ERMATCHENKO E.N.S., Université de Paris VI K.J. EVANS Université de Cambridge I. FRICK Université de Stockholm J. GILEWICZ Université de Provence, Marseille J.P. HANSEN Université de Paris XI, Orsay A.C. HEARN University of Utah, Salt Lake City F. JAMES : " •' : CERN, Genève T. KINQSHITA:,.-v,.:. v Cornell University, Ithaca M/KLEIN"-'..'1/ " r C.N.R. Ottawa C.P. KORTHALS-ÀLTES Centre de Physique Théorique, CNRS Marseille J. KRAUS- Université de MUnich F. J."LAMBERT Université Catholique de Rio de Janeiro B.E. LAUTRUP IHES, Bures-sur-Yvette M.J. LEVINE Carnegie Mellon University, Pittsburgh R. LQQS Stanford University - 4 -

B, MITHP.A Université de Lyon I R C MJÛISNESS Université de Californie, Los Alamos H. MULLER-KRUMBHAAR IBM Research Laboratory, Zurich 0 NEUBUSER Rhein West. Technische Hochschule Aachen M. NGUYEN-VANKE université de Paris VI D.A - OWEN Centre de Physique Théorique, CNRS Marseille J. PALDUS Université de Waterloo, Ontario W. PEETERMANS Institut de Mécanique Spatiale de Belgique M. PERROTTET Centre de Physique Théorique, CNRS Marseille C. PLAUT Université de Nice D. POTTER Imperial College, Londrss E. REMIDDI Université de Bologne K.V . ROBERTS Cul ham Laboratory, Abingdon (Berkshire) E.H . ROFFMAN City College of the City University, New York R. ROSKIES University of Pittsburgh R.A. RUSSELL-CLARK Computer Laboratory. Cambridge J. SCHLESINGER Université de l'Etat, Mons Ch . SCHÛMBLOND Université Libre de Bruxelles Y. SHIMA Soreq Nuclear Research Centre, Yavne M. SOOP European Space Operations Centre, Darmstadt S. STEENSTRUP Université de Copenhague H. STRUBBE CERN, Genève Y. SUNDBLAD Royal Institute of Technology, Stockholm E. TOURNIER Université Scientifique et Médicale de Grenoble J. TRULSEN The Auroral Observatory, University of Tromsji G TUTTLE Imperial College, Londres M. VELTMAN CERN, Genève A VISCONTI Centre de Physique Théorique, CNRS Marseille J J. WE IS Université de Paris XI I WJI.LERS CERN, Genève J Z1NN JUSTIN CEN Sac lay - 5 -

- QUESTIONNAIRE -

We shall try to give a resume of the different answers and suggestions which were made to the questionnaire sent to all participants in September 1973.

1. Do you feel -that there should be a fourth colloquium ? All the answers but one, are yes. Stan Brodsky suggests thct a 4th colloquium should be held if it is needed.

2. Should the next colloquium be held in two years, three or ? ytars ? The majority thinks that a two-year interval is O.K. Seven answers suggest three years, and one answer a single year.

3. Should the colloquium last three days, five days, or more days ? The majority finds that the colloquium should last five days

4. Should the colloquium" be held in Winter, 5pring, Summer or Autumn ? The answers are equally divided between Spring time (16) and Summer (18). Five people suggest Autumn and one suggests Winter.

5. Should the next colloquium be held in Marseille, or where ? Here also, the majority suggests Marseille. But as you will see in my Avant-Propos, I support strongly that the next colloquium should be held somewhere else, Canterbury, Utrecht or Salt Lake City. The change of atmosphere may imply a change of the forms ap.d the spirit which in my opinion should be welcome.

6. Should the colloquium keep its present form ? The answers are equally divided between Yes (16) and No (16). For my part, I do think that we should not be attached blindly to the present form, and try very hard to renew the presentation and the canter of interest.

7. Should contributions be limited to Q.E.D. or mention other field', which should be represented ? There are eight Yes in favour of Q.E.D. and twelve No Q.E.D. It appears to me that every participant wants the emphasis put in its own field. I do think that something has to be changed but I don't know whs" to suggest.

8. If the meeting is limited in subject matter, should speakers from other fields be invited to give survey papers ? 13 participants want to havt survey papers. 8 answers are just No.

9. If your answer to 8 is Yes, mention the fields you would like to sve surveyed. The answer to that question is included in the remarks to the question 7. - 6 -

Il S he-1.; Id the r:i\r, subjects be covered by invited single talks by several people o" should a small number of people give a series of lectures in the form of a Summer School ? 14 participants want to have the main subjects to be covered by invited single-talks. 9 answers want, like in a Summer School, to have people giving series of lectures.

A. Visconti A - METHODS OF COMPUTATION - -A -1-1-

NUMERICAL CALCULATION TECHNIQUES IN SPACES OF HICH DIMENSIONALITY

F. James (Data Handling Division, CERN, Geneva, Switzerland)

1. INTRODUCTION

Although the field of numerical analysis is many centuries old, with techniques developed by Gauss, Newton, and Legendre still being used today, the development of workable methods for many-dimensional spaces has been rather recent, extremely difficult, and in some branches is not yet satisfactory by any means. It is generally true that "optimal" one-dimensional methods lose many of their nice properties when extended to two or three dimensions and often cannot be applied at all in spaces of very high dimensionality. Before turning to speci­ fic problem areas, let me give three reasons why many-dimensional spaces generally lead to exceptional difficulty:

i) You cannot see what you are doing. A function of more than two variables cannot be represented on paper in any straightforward way, and an experimental distribution of points in more than two or three dimensions cannot be inspected to determine even its gross features. I do not feel personally that this is a fundamental limitation although it certainly hinders progress in numerical analysis and it is a major stumbling block in multi­ variate data analysis, which has caused quite a bit of work to go into computer-aided visualization techniques. At best these techniques may enable us to extend our visualization powers by one or two dimensions, but I doubt that anything earthshaking will emerge from this line of thinking.

ii) Multidimensional space is very big. The exact meaning of this will become clearer in the later discussion, but for now we may get an idea of the "volume" of the space by considering the extension to n dimensions of a method requiring p points in one dimension. A straight forward (Cartesian product) extension requires; pn points, which for large n is enormous. This does seem to be a fundamental:: limitation, although there are indica­ tions that we may at least be able to avoid this exponential blow-up by tailoring meJiods especially to the large-n problem.

iii) Multidimensional regions have different shapes. In one dimension, all finite continuous intervals are equivalent in the sense that they can be mapped onto the unit interval by a linear (affine) transformation, and even if semi-infinite and infinite intervals -A - 1 - 2 -

are allowed, only three "different" regions need be considered. In two dimensions however, even the circle and the square are not affinely equivalent, so the number of regions to be considered is already infinite. This may seem at. first like a trivial problem, but for many applications it definitely is not. For example, an integration formula over a circle does not generally work over a square, and vice versa.

In this paper I will discuss in particular two kinds of numerical calculation which exemplify espacially well the various problems inherent in many dimensions, namely numerical integration and goodness-of-fit testing. This does not mean that other fields such as differential equations are not equally important and interesting, but iï only a reflection ofray persona l background and interests. I think also that it is good to consider one field classified as statistics and therefore often ignored by numerical analysts.

2. NUMERICAL INTEGRATION All numerical integration algorithms approximate the desired integral by some linear combination of function values of the general form: v N N i=l

where n is the volume of the integration region n, and N is the number of points Xj at which the function raust be evaluated. The weights Wi depend of course on the method and are often equal to unity.

Behind the simplicity of the above formula hide a multitude of different approaches to the problem which I will classify into two groups called philosophies 1 and 2.

2.1. Philosophy 1 - Formulae of degree d

This philosophy, is based on the hypothesis that we have a given limited number of points N at our disposal, and aims at finding the best formula for that N, usually without taking into account any special properties of the function f, and in -particular -without using any information from early points in choosing later points. Since the function_must be smooth enough to be integrated with N points; it is reasonable to adopt a Taylor-series-expansion approach and assume that it~can.be represented approximately by a polynomial of fairly'low order. Formulae can be found which will integrate exactly any polynomial of less than, or equal to some degree d. The best known of these is the Gauss formula which, in one dimension, using N points is exact for all polynomials of - A- I . 3 -

- degree d - 2N-1 or less, and is in this sense the most efficient formula possible in one dimension. In addition, it satisfies the two important additional criteria: i) All the weights Wj are positive. This is important in order to avoid round-off error arising from cancellation of large and opposite terms, and seems also to make the formula less sensitive to the validity of the "polynomial" assumption. ii) All the points Xi lie within the region of integration fl. This seems such"an elementary requirement, that one is surprized to discover that many formulae in N dimensions do not possess it. For the one-dimensional case, the theory of formulae of degree d is well understood. Since it is based on the theory of orthogonal polynomials which is not. so well developed in more than one dimen­ sion, it is nofc surprizing that a general method of getting effi­ cient n-dimensibnai formulae does not exist. Of course the one- dimensional Gauss formula can be extended to n dimensions £for the hypercube at-least) but it then requires N= fi + lV points . \ Ï ) . - and is far from being the most efficient formula of degree d in general. The situation is discussed ih detail in Stroud's excel­ lent book1! and in Hàber" s more general review article,2' and I can only:.summarize -here very}briefly the main results. If we accept •only} formulae whereall weights;Wi: are positive and all points • Xjjlie in;the region h," then very few, generally applicable formulae

have been fouhdiv For exariçle,; if the;region n is not convex, it •~ is unlikely "that one vrtll! fi^ any. reasonable formula since many interesting poiiits may lie outside the region. And even if we restrict ourselves to ,the; simplesjt region, the hypercube, very few acceptable formulae are known to be valid for all n and still reasonably close to; the theoretical efficiency limit. An indica­ tion of tie state of the art is given in table 1.

Table i - N-point formulae of degree d in n-dimensional hypercube. Degree d Best knawn N N(Gauss) 2 . 2n + 1 ' 3 - 2n 2n ._ S. - ~ 0(ns) ,not found 3n >S ? . (J(d + I))", d.odd

As Table 1 indicates, low-degree formulae considerably better than Gauss can be found, and in fact many higher-order formulae of -A- 1 - 4 -

comparable efficiency are know, but they do not have the property of alJ positive weights for all n. Stroud has shown that a formula of d=5 exists, with N of the order of n5 and positive weights, but no one has as yet found the formula.

Concerning the practical choice of a "philosophy 1" formula, it would seem that a product rule (Gauss, for example) is the only- general solution for high degree, say d>5. However, the exponen­ tial growth of the number of points with increasing dimensionality makes these rules unworkable for very large n. As computers get faster, this limit on n is pushed ever upward, so that it is now thinkable to apply a 10-point rule in as many as seven or eight dimensions.

Another approach is to use a more efficient low-order rule and gain accuracy by dividing the hypercube into smaller sub-hypercubes. But this does not eliminate the exponential growth problem since the number of sub-hypercubes now depends exponentially on n.

2 Philosophy 2 - Convergence to required precision

This philosophy is based on the idea that we should be able to inspect the partial results of the integration calculation as it proceeds and use these results to decide whether or not to continue and perhaps even haw to continue. A method' is /'now characterized not by its degree but by its rate of convergence toward the true answer. This means that in general we will have to require that the method be "extendable" in the sense that in. proceeding from an N-point result to an (N+M)-point result, the original N points can be used. A new concept that now becomes important is that of the growth j'aLe, namely the smallest number of .additional points that must be added to the current result in order to get an improved answer in the framework of the method under consideration.

unfortunately, the requirement o£ extendability eliminates the Gauss formulae since no two Gauss formulae have more than one point in common, and the best way of combining an N-point Gauss result with an (N+l)-point result is probably just to throw away the N-point result. In many dimensions the growth rate is there­ fore enormous since intermediate results are useless. This has led to the increasing popularity in recent years of the Clenshaw- Curtis and Romberg methods.

The Clenshaw-Curtis ' formula is based on the zeros of Chebyshev polynomials rather than Legendre polynomials, and this means that the 2N-point formula uses all the N points of the N-point formula. This method is therefore extendable,- but has a large gVowth Tate because the number of points must be multiplied by 2n (for n dimensions) at each step. " " -A- I - S -

The Romberg fomula is not only extendable, but is based on the extension technique known as Richardson extrapolation. The general idea is the following. Suppose that we have some N-point foiroula for which the leading term in the error (expanded in powers of N) is of order N-2 (e.g. the trapezoid rule}. Then if fy is the N-point result and R2N the 2N-point result from the same formula, we have

RJJ - I + E0f2) + E (higher orders)

R^- I + 1E(N~2) + kE (higher orders)

where I is the true value of the integral and E stands for error terms of different order in N~*. Now the linear combination

^—£ » I + k'E (higher orders)

eliminates the leading term in the error and therefore causes much faster convergence as a function of N. Continued application of the same technique is then used to eliminate higher and higher orders up to the maximum that can be achieved with a given number of points. In this sense the Romberg method gives the fastest possible convergence (best linear combination of,previous results) biit it also has a high growth rate for a large number of dimensions and.worst of all, it has large negative weights. The growth rate problem has been alleviated to a large extent by the work of Lyness and McHugh*) whose Romberg-type method is based on a variation of the Richardson es£raj::>l-tior. r?-i£dr£rig st each stsp only one extra point (in cne dimension) instead of doubling the number of points.

Since both the Clenshsw-Curtis and Romberg methods are one-dimi- sional formulas being extended to n dimensions, it is not surprizing that their nice properties break down for large n. In fact it is true in general that a formula of degree d converges like N"d in one dimension, but when extended to n-dimensions converges only like jj-d/n. For large n, the convergence becomes slow and the growth rate large, and the Monte Carlo method, which converges like N~l for all n, becomes competitive.

The Mante Carlo method, because of its slow 0T*) convergence is usually not even considered, for integration over a small muter of dimensions. However, foT large n, it has the following distinct -• and probably unique,advantages :

i) Its convergence is independent of n. ii) It has the smallest possible growth rate, since each new point gives a new result. -A - I - 6 -

iii) The error estimate is easily formed at each step with a small additional cost and is valid under rather general finiteness conditions on the function.

iv) The convergence of the integral does not depend on any strong smoothness conditions on the function.

v) As a corollary to iv), the problem of the odd-shaped region n can be solved by imbedding it in a larger hypercube and considering the function to be zero out­ side B, with the convergence being slowed down only by the constant factor of the ratio of the volumes of fl and the hypercube, even though a discontinuity may be introduced in the function.

In view of the above properties, it is clear that the Monte Carlo method is well suited to integration over a large number of dimensions and may in fact be the only such method. This has caused a great deal of work to be done in recent years developing methods based on the Monte Carlo technique2»5,6,7) uith an aim to speeding the convergence and reducing the error. The error on a Monte Carlo estimate can in general be expressed as

flRMS yj N where the RMS indicates that this is the standard deviation of a Tandom variable (asymptotically normally distributed, in fact), V(f) denotes the variance of the function, and N is as usual the number of Monte Carlo trials.

The traditional approach toward improving A is to transform f or. the integration region n so as to effectively reduce the factor V(f). These important techniques go by the general name of variance-reduction and are described in standard textsSi"). The more recent complementary approach is to attack directly the N-dependence by modifying the way in which the "random" points Xi are chosen. Techniques! based on this approach may be called quasi-Monte Carlo or number-theoretic depending on the extent to which the method resembles classical Monte Carlo2,6,7).

Part of the incentive for abandoning the usual pseudorandom generation of points Xi comes from the discovery by Marsaglia8) that the generators most commonly used (multiplicative congruential generators) produce points which all lie on a rather small number of (n-l)-dimensional hyperplanes in n-dimensions, and are therefore in some sense unsuitable for Monte Carlo integration for large n and large N, since vast regions of the n-dimensional space will never be sampled no matter how large N is. This suggests that the convergence of standard Monte Carlo methods using these conventional pseudorandom generators must eventually -A- 1-7 - become even slower than N"1 for large N. Dieter and Ahrens have shown9) how these generators can be improved (i.e. the number of hyperplanes can be increased arbitrarily) by using several multi­ plicative constants instead of just one, for example the ith random number r. would be given by

ri " K-I + ?ri-2+ Wi-S ]mod 1c instead of

ri"[ori-l]modk This apparently allows us to extend the usual Monte Carlo method to an arbitrary number of dimensions n and an arbitrary number of points N while preserving«the. desirable properties listed above. It has however been pointed out°J that certain "regularities" in the spacing of Monte Carlo points, although clearly making them "non- randoof '. are not necessarily undesirable for multidimensional inte- grationl°). On thefcontrary, it appears that the regularities of certain quasi-random sequences lead to convergence like N"1 rather than N"i making than vastly preferable for large N. However, of the five good properties listed above for the Monte Carlo method, number iii (easy error estimate) is certainly lost in the quasi-Monte Carlo method, and the. validity-o^ the-others is not at all clear. But in spite of our relative lack of lodsrstanding of the properties of the quasi-Monte Carlo iiethod, it must be considered generally superior to the method based on pseudorandom sequences and it may be our only hope of per­ form]^ mmerical-integration in a^^ large number of dimensions with convergence; faster than N~l.

Two rather recent ideas for extending Monte Carlo techniques seem very prcSsiising, : One is by Tsudall) who-starts by applying a high-order Clenshaw-Oirtisproductrule (which-yields far too many; points actually to evaluate) and then chooses randomly from among these points those to be evaluated. He gives no strong theoretical reason why his method should be si^eripr to ordinary Monte Carlo, but he gives a. mmerical example in which it performs remarkably well. The other recent method is due to Sheppey and has not to my knowledge been published although it has been translated into a generally avail­ able, computer programI2)-,-~5he idea is to start with a standard Monte Carlo-sampling but to introduce gradually an empirical variance reduc­ tion- (by stratified sampling) where the intervals are determined from information about the-function gathered in the "earlier Monte Carlo sampling. The method is therefore able to decrease the effective -A- I - g -

variance V(f) as it proceeds so that convergence becomes faster than N-J. However, the points are no longer independent and some users suspect that the result is biased or at least that the usual error analysis is no longer applicable. Certainly there is room for more theoretical work to be done on this potentially very powerful technique.

The idea of adaptive sampling is carried much further in a program being developed f.t SLAC by J. Friedman. His approach is to assume that the function is rather badly behaved and that its large variance is principally due to a finite number of spikes or broadar peaks, lie takes advantage of the fact that n-dimensional minimization techniques are now well developed, to first find these peaks and then deteraine roughly their shapes, which allows him to obtain a control function approximating the real function well enough to be used in importance sampling. Overhead for this method is rather high, but variance-reduction by as much as 1010 has been reported, without any a priori knowledge about the function.

Goodness-of-fit Testing

Another field which has been studied extensively for one- dimensional problems, but almost not at all for higher dimension­ alities, is that of goodness-of-fit testing. The problem is to test whether a set of points (events) x could be a random sample drawn from B population with a given probability density function f(x), or whether the points x. are incompatible with thé density f(x). In fact the situation Aere is even much worse than for multidimensional integration, since to my knowledge, thé first test efficient in two dimensions (efficient in a sense to be explained below) was published only in 1970, and no such test has been published for more than two dimensions.

Part of the difficulty stems from a belief among many academic statisticians that the most common one-dimensional test, Pearson's chi-square test, is perfectly adequate when applied in many dimen­ sions, the one-dimensional bins simply becoming n-dimensional hyper- boxejj. It is of course true that the test is still valid, in the sense that the distribution of the test statistic is known asymp­ totically and is independent of the dimensionality of the data set. In fact the statistical term "data classes" (where physicists use "bins" or "boxes") emphasizes the fact that the distribution of chi- square is independent of the dimensionality and shape of the bins. Of course the power of the test depends very much on the binning, but it elso depends on the hypothetical density f which changes from case to case and it depends'even'more on the alternative hypothesis which is usually unspecified.

Since we need an objective criterion for deciding which test -A - I . 9 .

to use, it is unfortunate that the usual criterion, power, is not well-defined for goodntjs-of-fit tests. Statisticians usually overcome this difficulty by using loccl po^er (power with respect to infinitesimal deviation.; from the null hypothesis f) or by considering the power with respect to certain classes of alternative hypothesis. I shall .try to overcome this difficulty by abandoning temporarily the criterion or power in favour of a more intuitive concept which we could call efficiency. Let me define a goodness- of-fit test as inefficient if it throws away ••-learly valuable information (this is in analogy with' its usage in the theory of estimates but is different from the usual meaning of efficiency in testing).

Now any testing method which involves grouping the data into bins will be inefficient if the events so grouped together are in fact physically different in the framework of the model being tested. In one-dimensional testing it is usually possible to make the bin.'i smaller than the measurement inaccuracy, so that events groups/together are anywày nearly indistinguishable and little or r*J int'orraation is lost by binning. ffewever, the requirement that there be at least, five to. ten events per bin for the usual chi- square test sets a,lower limit on bin size (for a given sample size] which becomes very large when/the'extension is made to many dimensions. Or, turning the argument around, if we make bins small enough so .is not to lose informatics), the required sample size (assuming on average ten events per bin) becomes enormous.

For example, let us consider a typical experiment in elementary particle physics to study a reaction with m outgoing particles. Neglecting all internal (spin) degrees of freedom, each event can be represented as % point in a space of 3m-4 dimensions. (The interesting geometry of this space, and techniques for totally or partially, integrating over it., are.clearly described in a recent book by! Byckling and l&jantie13).) We are typically interested in values of m up to six or seven arid- sometimes as high as fifteen or twenty. This means that it is cramon to work in spaces of, say, eler/en dimensions (m-S). The typical met mrement accuracy in each of these dimensions is of the order of one percent of the allowed

range of: the variable. In order not to lose efficiency jn. testing a theory, we would then require 10M bins and 1023 events, whereas typical experiments produce 103 such events, and giant experiments yield perhaps 10s. As m increases, the number of events that can be detected and measured decreases, so the situation becomss even worse .".,

. The above considerations essentially rule out any method involving binning in spaces of high dimensionality (unless such a method can be found for which it is acceptable tnat almost all bins are empty). It is therefore natural to turn to non-binning methods known to be good in one dimension. The most popular and probably ' "A - i - 10 -

the best such methods are the Kolmogorov test and the Cramer-,., Von Mises test, which are described in the bc*k of Eadie et al . They are based on the cumulative (integracedj distribution function

F(x) = J= ffx'Ddx' and the equivalent experimental distribution S 00 = number of events with x'

Now it turns out that this test can be extended in a straightforward way to any number of dimensions, il though tht. implementation of such an extension is not immediately obvious. But the difficulty arises in that the distribution of W2 (assuming the null hypothesis) is dependent on F in nerf thaii one dimension so that the test loses the distribution-free property it has in one dimension. For the two dimensional case this was gotten around by ;'«rbinl5) by transforming F to the uniform discvibution using Rosenblatt's transformation. This yields a distribution-free (and efficient) test at the cost of introducing a certain arbitrariness since there are in fact many ways of transforming a many dimensional distribution into the uniform distribution.

More recently, this same test is being studied in spaces of higher dimensionality by E. Schorr of ŒRN who hàs'càiculated:(not yet published) the distribution of the W2 statistic; in 3^4,1 and S dimensions. From the theoretical point of view; then; the situation seems quite satisfactory, since we have a distribution-free and efficient test and the distribution of the test statistic is known. However, we so far have almost no practical experience with the rethod, so the actual degree of computational complexity involved in implementing it on a computer is not yet clear; This complexity will be high since the Rosenblatt transformation requires a series of multidimensional integrations of which at least one must be in the full-dimensional space.

A quite different line of research is being followed by the SLAC computation group in collaboration with John Tukey. They have developed several techniques (unpublished) of which I will describe the one with which thty have the most practical experience and which seems to work well, although the theoretical side is-unsatisfactory (the distribution of the test 'statistic is unknown and must be determined by a Monte Carlo ' calculation'separately for each case). This method actually compares two sets,of points in n dimensions for statistical compatibility, but it can be reduced to the usual goodness- -A - I - 11 -

of-fit test by identifying one set of points with the experimental data and obtaining the second set by Monte Carlo generation according to the theoretical density f. The method involves finding, for each point in set 1, its k closest neighbours considering both sets together (the idea of closest neighbour implies the existence of a metric for the space, which usually introduces an element of arbitrariness). Now among these k. points around point i, a number kij will belong to set -1 and k,* will be from set 2. The test consists in looking at ti« frequency distribution of the different possible values of the k,. (or k,.), and comparing this with the binomial distribution which it would be if the two sets were compatible and the kj. were independent. The "chi-square" measuring the deviation between the two frequency distributions is the test statistic, but it is not distributed as a Pearson chi-square and the confidence level must be determined empirically.

It looks as "though we can finally look forward to a great deal of progress in the next few years in this important but long overlooked field. - A-I-12-

References

I] STROUD, A.H. - Approximate Calculation of Multiple Integrals, Prenctice-Hall, N.J. (1971). 2) HABER, S. - Numer:-.al evaluation of mult pie integrals. SIAM Review 1_2, 4 (1970). . 3) CLENSHAW, C.W., and CURTIS, A.R., - A method for numerical inte­ gration on an automatic computer, Numer. Math. £, 197 (1960).

4) LYNESS, J.N., and MCHUGH, B.J.J. - Integration over multidimensional hypercubes I, a progressive procedure. Computer J. (>, 264 (1963).

5) HAMMERSLEY, J.M., and HANRSCOMB, D.C., - Monte Carlo Methods, John Wiley, New York (1964). 6) ZAREMBA, S.K. - The mathematical basis of Monte Carlo and quasi- Monte Carlo methods, SIAM Review, i£. 303 (1968). 7) HALTON, J.H. - A retrospective and prospective survey of the Monte Carlo method, SIAM Review, 12, 1 (1970). 8) MARSAGLIA, G. - Random numbers fall mainly in the planes, Proc. Nat. Acad. Sci. (USA) 61, 25 (1968). 9) DIETER, U., and AHRENS, J.H. - private communication, to be published in their book on random number generation. 10) HASELGROVE, C.B. - A method for numerical integration, Math. Coup. 15, 323 (1951). II) TSUDA, TAKAO - Numerical integration of functions of very many variables, Numer. Math. 20, 377 (1973).,

12) LAUTRUP, B. - Program RIWIAD, CERN Program Library No. D114. 13) BYCKLING, E., and KAJANTIE, K. - Particle Kinematics, John Wiley, LoiKon (1973). 14) EADIE, W.T., DRIJARD, D., JANES, F., ROOS, M., and SADOULET, B. - Statistical Methods in Experimental Physics, North Holland, Amsterdam (1S71). 15) DURBIN, J. - As)mptotic distributions of some statistics based on the bivariate sample distribution function, published in Non-Parametric Techniques in Statistical Inference. Proceedings of a Symposium at Indiana University, Bloonungton, Indiana, 1969, Cambridge University , Press, London (l')70). -* - '- ' -A-IJ.-0-

A USER'S REVIEVJ Or ALGEBRAIC SYiv 15

by

YNGVI 5Mf.3LAD Deparvn nt for Comput.r Science kc>al Institute cî iochi'Oiogy Stocj-.uu.lir.

ABSTRACT

Several of the .r.ost widely spread systems for algebraic manipulation on computers are presented and examined from such aspects as Availability.(Smallness, Portability, Maintenance) User-friendliness (Syntax, Debugging) Euilt-in routines (Arithmetic, Functions, Algorithms, Greatest Common Divisors, Pattern Matching) Run-time efficiency for three testproblems

(Campbells Y2n-fuiictions, Computation of the Einstein tensor for given metric, Computation of the order of Runge-Kutta formulae)

w.,^ij^yîtetf ^pér^prêsented .at-.the'-'a'hird^ Colloquium-- >'•'-. ^t *-^::^/.oji::Advaricëd "CompU-ter. Methods> in" Tfeoreticai; Physics "Ï

ïM^ÔS^fêsttPP^S^fcy'-'-ths; Swedish Board:^forf Ter>hni"al- '•''' -A-II-1-

A USER'S REVIEW OF ALGEBRAIC SYSTEMS

About 20 years ago the first known computer programs for doing non-numerical calculations (differentiation) on formulas were written independently for Whirlwind and Univac I. About 15 years ago the first general programming systems for non-numerical computation, e.g. LISP, began to be developed. About 10 years ago the first general purpose formula manipulation systems, e.g. ALPAK (grandfather of ALTRAN) appeared. Since then the development of systems and algorithms for computer processing of mathematical formulae has been very fast. One would expect this field of computer application to have ripened by now and to have got a good and increasing number of regular users, but there are surpi^isingly few users. T sometimes get the impression that there are more system designers than users of the systems. It seems to be quite common to think of the computer as having only two faces, one for numerical computation, one for business data processing. Many computer users, even in universities, don't know that there are ready to use, mostly easily attainable, computer languages and programs for manipulation of non-numerical algebraic data.

May I here direct myself specially to those of you (if any) who have never or very little used algebraic systems and hope chat you will at least try and see what they can do for- your problems. Please feel free to discuss your problems and experiences with me here afterwards" or by correspondence. As 1 said before, very many algebraic systems have been developed and we have imported and used several of the most widely spread systems in'Stockholm, i.e. ALTRAN, rORMAC, LAM. REDUCE and SAC-1 for IBM 360/7 5, SCHOONSCHIP and SYMBAL for CDC 6600. There are about 10 regular users, working in theoretical physics or computer science, and they often come and ask me which one of all these nice systems to use for their specific problem. This was one reason for making a comparison and evaluation of our systems, another reason was the feeling that such a comparison was needed to get more guidelines for future development of the systems. •A-II-Z'

I will not discuss applications very much, several very impressive applications in theoretical physics will be presented in other talks at the colloquium.

I will not give special attention to the specific tools for theoretical physics that are included in some systems, which are given special presentations at this meeting anyway, but rather look at the systems as general tools for algebraic computation, just as ALGOL and FORTRAN are general tools for numerical computation.

It is of course impossible to make a fair comparison of systems and I know that several of yeu, especially the system designers, will disagree when I. talk about their- system. In Stockholm we have not designed any system of our own so we are unbiased at least in that respect.

In some other respects I am certainly not unbiased. I was "brought up" with ALGOL-like languages and have strong opinions on what a language should look like to be easy to use. I should also mention that I work in computer science, not in theoretical physics, and came into the algebraic manipulation field from numerical analysis.

Let us now look at what kind of users algebraic systems have or might have

- Casual users, want "algebraic desk calculators", when they now and then come to a point in their work where an algebraic manipulator might help. User-friendliness and fast turnaround are crucial to these users, which form the most numerous group, potentially. The break-through might take S years though, very much depending on when algebraic systems are designed in such a way that nobody refrains more from using these systems when algebraic calculations become too tedious or error-prone than they do from using the computer when numerical calculations become tedious or error-prone.

- Regular users, have the same demands as casual users; hut perhaps need more resources, especially computer memory.

- Routine users, who perhaps want to check a tedious algebraic derivation in a scientific paper. This will probably be a very important field of application of these systems, at least by volume. One does not show every step in ; a numeric ,,y -A-II-3-

calculation in a paper, one describes the algorithm so that anyone with a computer can check the results if he wants to. Algebraic systems might do the same for algebraic calculations, which in a possible future can and have to be described, but not given step by step, so that they can be checked by computer. - Formula "crunchers", who make very large calculations with IQOO's or 10000's of terms. Their programs need large resources and often special design for the special structure of the problem and general purpose systems often tend to be to very inefficient compared to special programs in lower-level languages. - Algorithm developers, need systems where they can influence the datastructure, "assembler-like" systems. They also need flexible syntax- This is sometimes hard to combine. - System designers and implementers. In the following table I have put in some of the more important existing systems under the most typical group of users. At least one reference for each of the systems is given at the end of this paper.

User group Systems Casual 1 = {SYMBAS, FORDECAI. , KACSYMA, SCRATCHPAD, REDUCE} Regular 1 •> 'ALTRAN, FORMAC, SYMBAL, CAHAL} Formula cruncher SCHOONSCHIP, ASHMEDAI Algorithm developer SAC-1 , REDUCE (LISP) System designer. LISP, SHOBOL, FORTRAN, Machine language

Let us how take a short look at each of the systems available in Stockholm and then try to compare them from some important aspects. -A-II-4-

ALTRAN

ALTRAN is developed and maintained at Bell Telephone Laboratories. The current version is from 1972 and "fulfills W.S. Brown's ten year dream of an algebraic system" (his ALPAK came in 1963), The system is almost entirely written in ASA FORTRAN, a few machine coded primitive routines for packing and unpacking of data are computer dependent.

The syntax of the language is somewhat FORTRAN-like, i.e. main program and subroutines, no block structure, recursivity though. The semantics are PL/I-iike, every dependent variable must be declared with type and attributes. The most important attribute is the layout, which contains names and maximum exponents of independent variables. The system contains about 100 library routines for matrix operations, truncated power series, etc.

The following program, which checks the order of Runge-Kutta formulae, see the run-time comparison below, gives an idea of how ALTRAN looks. -A-II-5-

ALTRAN VERSlOli 1 LEVEL 8

PROCEDURE HAW INTEGER R.1.NR=S!R£ADI) DO 1=1,NR! READ R; RUKUCHIRM DOfflD END

PROCEDURE RUKUCRIR1 INTEGER R.1.J.M,F«.B1H.0RDER REAL TB.TA.RKTIHE RATIONAL A.B ARRAY (2:RIAi ARRAYl2:R.liR-l)B LONC V.GEBRAICIK( l!R)iR.FlO:R.O:R):R.H:R!FI,FlPS.KPS.TAYLOR,ERRPS.YC ARRAY ( 0 : RI Fl PS=0. KPS. TAYLOR. ERRPS INTEGER ALTRAN ÎPSORD LONG ALGEBRAIC ARRAY ALTRAN .TPSSBS 1 TB=T1HEI) READ Pi; WRITE "R-K-FORMULA:-.Fl DO 1=2. R READ All I! WHITE All I DO J=l.I-li READ BlltJIi WRITE Sllt..1); DOE8D DO EN» t FlPS(0)=FKK(ll=F(ff.0ll DO 1=R,2.-1 ÏC=Bll.l)*FlO.OI DO J=2.1-i;YC=YC+BlltJ)*KU);D0END KPSI0)=F(0.0H FAC=1 DO J=1»R KPStJI=YC**J*FtO.Jli FAC=FAC»Ji E1N=1 DO H=l.Ji BIN=B1N«(J-H+1I/H KPS( J )=KP5I J l+Al I )«*M*YC»«IJ-M )«FIH.J-H l»BIU DO EH!) KPS(J1=KPSU)/FAC DOEND FlPS=TPSSBSiFlPS.KPS.KU).Ri DO DID [ TAYLOR'.0)=F(0.0)i DO 1=1.R TAYLORU)=0; DO J=0.l-li DO H=0.1-W "TAYLOR! 1)=TÀYLORl 11+DÏFFITAYLORll-l I. Fi J.H ) )* "'( FI J+1.H 1+FI JiM+1 l*Ft 0.0) ) DO END; DOEIE TAYLOR! 1 l=TAYL0RI 1 l/l 1+1 ) SO END I EMPS=Î1ÏS-T»ÏL0R TPSORDI ERRPS.ORDER); WRITE ORDFR.-ERROR-TERH ICOEff. I :" ,WR?,TE ERRPSIORDERI TA=Tl«Etr- n»TlUF=T>-TB-- WR1TF RKT1«E.- " END -A-n-6-

FORMAC

FORMAC is IBM's effort in Algebraic Manipulation. It was developed 196M-69 but is since then a "dead" language, which is regarded as a completed program product and is not maintained any more. FORMAC is not a language in itself, it is based on a host language, both a FORTRAN- and a PL/I-version exist. The PL/I-version may soon be out of date, as IBM will not maintain the PL/I-compiler on which it is based longer than until 1S7t. All program logic is written in the host language, the only FORMAC-statements that exist are (almost) assignment, LET (...), and output, PRINT OUT (...), statements.

The first step in the computer processing of a FORMAC program is a conversion to pure host language, preprocessing, with FORMAC statements translated into subroutine calls. The pure FORTRAN- or PL/1-program is then compiled, linked to the FORMAC machine coded subroutine library (identical for both languages), and executed. FORMAC contains mathematical information like differentiation rules for elementary functions, identities for i,n,e, etc. As sample FORMAC program we use the FORTRAN-FORMAC version of the Runge-Kutta program. •A-II-7.

FORM AC OPTIONS STRING ÎF1201 0PTSET(EXPND!L1NELINCTH=721 SEADI5.99) KR 99 ÎORMATU1I DO 1 1=1.NR CALL SEIIIUtl.lt READI5.99Ï 1R READ15.981 FF 98 FORHATI20A4I ; PRINT OUT(Fl='FF'1 DO 2 ,1=2.1R READI&.98I FF LEIIJ-'J'l PRIST OUTIAUI^FF1 I Jl=J-i DO 2 KK=1.J1 READ15,981 FÏ PRIST OUKBIJ.'KK'1='FF'I 2 CONTINUE LEÏ(FlPS=EÏALt?l.KUl.Fl0.0111 DO 3 JJ=2.1R J=lR-JJ+2 LET(J=,J,iïC=B(J.ll»F(û,01l IF (J .EO. 21 GO TO 4 J1=J-1 DO 4 KK=2.J1 LETIKl=,KK,;YC=Y.C+BU.Kll<>mill 4 CONTINUE LET(KPS=F( O.Oll DO 5 KK=1,1R LEïlKl=,KK,iKPSl=ÏC«»Kl*F(O.Klll DO 6 K=1.KK LET(M='H'!KPS1=KPS1+AU1"H*ÏC»»IK1-H1»FIH.K1-H1» X C0HBU1.M1I 6 CONTINUE LET(KPS=KPS+KPS1*H**K1/FACU11I 5 CONTINUE LETCF1?S=E¥ALIF1PS.K

A REDUCE program is translated by a preprocessor command by command (block) from ALGOL-like form into pure LISP and the LISP-version, which contains callu of precompiled LISP-functions, is then interpreted. As sample program we give the REDUCE solution of the Y. -problem. . BEG 111 MIL ARRAY EP(20l,Y120l,JYl20),n2YI2C); INTCLhR PROCEDURE WàHTUi&.CiDl; IF A=8 THEN UH rt=C THEN (IF C=0 THEN 1 ELSE 4) ELSE IF C=D THEtf 6 ELSE 12) ELSE IF B=L THEN UF C=U THEN 4 ELSE 12) ELSE IF C = Q THEN 12 ELSE 2•£( 1 + 1 ) i U2Y(lv):-F0R I==0:2*N-2 SUU Of lOYt.'Il ,1.111 )*E( 1+11 ; CALL: N): = iN-l;UU:=-UJ; YY0:=YY1; YYl:=2*(F0R A:=l:(U/2) SUH Y{At*YU-A>) KIF DU=1 THcN Y(N/2)*Y(fi/2) ELSE 0); Y(N) :=4*EP(0)*IY(Nl)tYY0)-D2Yi;41) -5*YY1 -2*(F0R n: = l!(K/3)SU»l FOR C: = B: [ lN-B)/2) SUM Y(3)*Y(i.)*Y > * r < C > *Y ( U-A-H-C ) *WliH f( A , B, C , N-A-3-C > ) +2*IFUR A: = l:t(ft-2i/21SUM 3*0Y(A)*0Y1 11-A)-YlA)-fL)2Y(i>Jl-A)-YINl-A)*D2Y(A)) 4 I IF M=-l THtN 3*dY(.Jl/2)**2-2*Y( U/2) *i)2Y» Nl/2 1ELSE 0) Y2U:=Yl.N): E;;D NE>IN; P.lOI ; OYlll:=EP(ll; J2YI1 ) :=£iM2l ; YYl;=u;-".\i = ls. Oj:=-l; . F: = 2; ':•

PHD; ••;•••-.•'•.'•- ïpfûï* WIÏ >LXrN(ll; EMJ; ,Ai;8eÎGÏ«^(ilL-.J5K*lV'-(.! ) ; "-..' t'j'J ; vvNftMélr»F:'ïù'ïg;tà:*^^ -A-II-10- SAC-1

SAC-1 is different from the other systems in that it is not a language, just a collection of FORTRAN subroutines for algebraic calculations. It is developed by G.E. Collins and his Ph.D. students of University of Wisconsin since 1967, and is mainly used to test ideas on new and more efficient algorithms. As example of how a SAC-1 program looks we take a part of the SAC-1 solution of the Y^-problem. Y1=0 R=N/2 RH1=R-1 IF(RM1 .LT. 1) GOTO!i98 DO 'i99 A=1,RIU 1A=A+1 T=H-A H90 Sl=Pir(OY(IA),TRE) S2 = PP::0n(nv{T),Sl> CALL KLPERCSl) 31=PPROD(Y(IA),U2Y(T)) S3=PDIF(S2,S1) CALL FELPERCS1) CALL FELPERC52) IF(T .ME. 1) GOTO U92 S1=PQ(D2Y(1A),TVA) GOTO is 9 3 <;92 S1=PPR0D(02YCIA),Y(T)) U9 3 CONTINUE S2=PDIF(S3,51) CALL FELPERC51) CALL FELPERCS5) S1=Y1 Yl=PSUtl(Yl,S2) CALL FELPERC51) CALL FELPER(Si) U99 CONTINUE Il98 CONTINUE S1=PIP(Y1,TVA) S2=Y2 Y?»PSUtHY2,Sl) CALL FELPEP,(51) CALL FELPER(52) 500 IF(I!0D(N-1,2) .i!E. 0) GOTO 510 S1=PPR0D(DY(H+1),DY(R+1)) S2=PIP(S1,TRE> <"ALL FELPEP.(Si) !>1=PPR0D(Y'.R+1).D2Y(R+1)) S3=PIP(S1,7VA) CALL FELPERCS1) S1=PDIF(S2,S3) CALL FELPEP.(S2) CALL FELPFP.CS3) S2=Y2 Y2 = PSU!UY2,S1) CALL FELPERCS2) CALL.FELPERtSl) 510 IF(Yl_.;iE. 0) GALL FELPER(U) -A-lI-11-

SAC-1 is highly modularly built. The hierarchy of the modules, each being described in a report verbally and in FORTRAN subroutines, is shown below. The lower right hand part corresponds to the latest development.

LIST PRIMITIVES (Machine Language)

POLYNOMIAL FACTORIZATION

-i:*^ •A-II-12

SCHOONSCKUP

This system is developed at CERN by M. Veltman and is mainly intended for formula crunching in quantum electro dynamics. It has a syntax which is quite different from what the other languages have. The most important and almost only possible operation is substitution. As sample program we take computation of the Ricci-tensur for = given metric, the "7 out of 10" - metric, see below. The program was written by M. Veltman, The problem is, incidentally very well' suited for SCHOONSCHIP, putting in explicit elementary functions, as in the Bondi metric, makes programming in SCHOONSCHIP more difficult, but certainly not impossible, ab the differentiations can be done by clever "substitution tricks". The system contains no standard differentiation routines though.

S DET.A.B.C.E.K.L.M V AP.BP.CP,EP.KP.LP.MP X ZEROCN.J>=1-0K(N.J) 0 GG. KPCN), I.PCN). 0. KPCN). 9PO,0.ClC«M-L*B).4 + J*1 ,J1 ) X TGD0CN.J.J1,J2) = DTCJ2-J1 >*GGD0CN*4+J+1 .J1.J2) + DTCJ1-J2-1)*GGDDCN*4+J+1.J2.J1 ) X CMRCN1.N2.N3) = 0.5*(TGD(N3.N1.N2) + TGDCN3.N2.N1) - TGD CN , ,N2 ,N3.) ) X CH0CN1.N2.N3.N4) =0.5*(TGDDCN3.N1.N2.N4)+TGDD{N3.N2,N1.N4>- TG00CN1.N2.N3.N4)) X GACN1.N2.N3) = DSCv4,0.3,CTG!CN3.N4)*CHRCN1.N2.N4))) X RT4CN1.N2.N3.N4) = 0ET-CHDCN2.N4.N1.N3) - DET-» CHD CN2 . N3 .N1 ,N4 ) • 0SCN5.0.3.CCHRCN2.N3.N5)*GACN1,N4.N5> - CHRCN2.N4.N5)*GACN1.N3.N5) ) ) X RT2CN1.N2) = OSCN3.0.3.(ZEROCN3,N1)« 0SCN4.0.3,UER0* RT4CN3.N1.N4.N2) ) ) > ) B E.DET.A N

SYMBAL

SYMBAL is developed for CDC 6000 by H.E. Eiigeli in ZUrich. It is based syntactically on ALGOL with several extensions. The sample program checks Runge-Kutta forniulae.

SYMBAL VERSION l.DK 13/3/70)

STftflT FSOGHAM 0t 0, 2 «•»•••••••••••••••»•••••••••••••••••• =1tBIN= =NEWs CHECi=FO«MAL=FIt4,B,Kl =NEW=KPS.TAYLOR.ERROR,FI DUMP I=01 RtsUPaCUNI) K) 1 . F|=X0J=FO^iII = ' tH=DO'=X-lB: ' ' » Mf>DEt4]l=R| =F0H = IlsWi2i-l=D0==BF.SIN= KPSI=F t 0 « 0 J•(=FO"rJ !=ï!R=SUM==FOR=MI=0|JsSUMs M F At!)* »(= -J'' = .4| = l|I-l = SU>1=BiI»N)»KtN)lt(J-M) •FIMtJ-^ietlINOMIALtJïHl^H+d/FACTlJ) ) t FIIà=S=KtI]tKPSAFl| =EMO=l FH==SïKt' ]:Ft!,i"l*Fl' TAYl.0Rl3(TS=Ftn,!ll>* t =FOK=I ! = 1 iR-SUHz « T1 a=FOP=J 1=0:1-1 5SUM= SFORSM : =611 - ) '-JSSUHr (=D=FtJ,M]AT)«(FC.J*l.Mj*FtJ.H*lI»FC0.03>l/FACTtI*ll« HtlM ER^OR;=SPLlTPnwER5(Fl-TAYLORtH)1 DUMPI=5t =FOR=I«»0IR=DO= =IF=ER«OS[nO0=TH(rN= FRRORt I J l=ERROR[ I ] »0 I <>1 CHECKRK(Kêis?:i/?i,xa:*i /Pil*2^t/2^1', • X21X1/2' «X-lt2.' ' »XK1 iK2»K3 I ) I CHECKRM(Kl*-J«Ki>/*tX2U/3t?/3' .*?'• XI/3> 1*0.2/3' ' iXKl .K2»K3 • ) I CHECKRKt (Kl + ?«h-2*2»K3»K*!,'6i*2ll/?tl/2il«.<2IXl/2'fX0«l/2'tXOiO.l' l< XKltK2'K3»K4')l =ENr»= -A-II-14-

Let us now concentrate on our available systems and compare them from the following important aspects. 1. Availability 2. User-friendliness 3. Special features 4. Run-time efficiency It is a general tendency to stress 4. too much, perhaps bec&use it is so easy to measure, and 2. too little. One must renember that computers are built to serve human beings and the computers should be adapted (by development of software) to the human preference of higher level languages with powerful concepts, rather than the much too common state of humans adapting to the computer's Q's and 1'f.

1 . AVAILABILITY

a- §Môl^NFS5_anrf_M0DULART.TY All systems, except SAC-1 in its "naked version" can only be run on a large computer, on IBM/3 60 ALTRAB needs 260 k (8-bit-) bytes, FORMAC 160 kbytes, REDUCE 400 kbytes (a subsystem without matrix handling and high-energy physics 300 kbytes), which means that they need at least an IBM 360/65 or 370/155. Work is in progress to make REDUCE smaller by use of overlays. SAC-1 is very modular and subpackages up to several different levels can be installed. Exact integer arithmetic needs 80kbytes, polynomial arithmetic 100 kbytes, rational function arithmetic 130 kbytes, etc, which means that it can be run on smaller computers if the right level of ambition is chosen. In Dublin the polynomial package is run on an IBM 360/44.

SCHOONSCHIP and SYMBAL for CDC 6000 both need at least 24 k 60-bit words, equivalent to 180 k 8-bit bytes.

b. PORTABILITY To be really portable, i.e. possible to implement on almost any computer with moderate effort, a system must be wi'itten in a generally accepted higher level language, for which most computers have compilers or interpreters. ALTRAN -A-II-15-

and SAC-1 are mainly written :.n FORTRAN and are therefore highly portable. REDUCE is written in LISP and can therefore in principle be imported to any computer that has a LISP interpreter, but should not, for efficiency reasons, be used-more extensively unless there is a LISP compiler so that the basic REDUCE routines can be run efficiently. FORMAC for IBM 360/370, SCHOONSCHIP and SYMBAL for CDC 6000 are all written in machine language and are not portable to other types of computers. c. 5ISTRIBUTigN_and_INSTALLATI0N ALTRAN is freely distributed to educational institutions from Bell Laboratories. The source tape, from which the system can be implemented in eleven steps, is accompanied by a detailed installation and maintenance manual. It took us about two man-weeks to install the system in Stockholm. FORKAC is an IBM type III program that is distributed without any responsibilities from the manufacturer. REDUCE is fretly available from A.C. Hearn at the University of Utah and is distributed for IBM 360 with a suitable LISP system and a detailed installation guide. With luck it can be installed in two days, SAC-1 is distributed in the form of printer listings in reports fron the University of Wisconsin, which makes the installation tedious and error-j>rone. SCHOONSCHIP is freely available from CERN and is accompaniec by an implementation guide that makes it possible to install the system in one day. SYMBAL is not freely distributed. d- MAINTENANCE ALTRAN ils very well maintained from Bell, fixup's of the systëm' are distributed about 1 times a year and are usually easy to install without regeneration of the whole system. REDUCE is maintained from University of Utah in the form of updates. To update tne system one must regenerate the whole REDUCE module. SCHOOMSCHIP is maintained from CERN in the form of updates. For SAC-1 occasional corrections to the listings are sent out-from University of Wisconsin. FORMAC and SYMBAL are not maintained at all at present. -A-II-16-

e• INTERACTIVITY REDUCE exists in a dialog version for PDP-10, thd symbolic desk calculators SYMBAS and FORDECAL are based on FORMAC.

2. USER - FRIENDLINESS

a. SYNTAX As pointed out before I think that the syntax of the languages used to communicate with the computer is very important. In the field of algebraic manipulation it can be considered as especially important, many programs in this field are written to get the solution to a problem with one or a few sets of data, rather few programs are used for "production runs". One often wants to play around with problem formulation and the algorithm used and wants good tools to make such changes. It is quite common that one learns more from the programming of a problem than from the results. The differences in syntax between the systems are illustrated in the sample programs in the short presentations above. There is an ALGOL- tradition, of which I personally am in favour, to which REDUCE and SYMBAL belong, and a FORTRAN (PL/I)-tradition containing FORHAC and ALTRAN• SAC-1 is more of a "formula assembler", and the syntax of SCHOONSCHIP is very different from all the other systems. An ordinary user is very much hampered by unneccessary restrictions in what is syntactically allowed and by incomplete definitions of the syntax in available documentation. These difficulties have been especially evident in SCHOOHSuHIP, where for instance, Y**2 is illegal if Y is the name of an expression but Y*Y is not, a number may not be exponentiated but an independent variable may, a name of numeric expression may not be an index, indexed variables are considered as non-commutative vector elements etc. A problem with the REDUCE syntax is.that it is not completely defined so that one can.find out if a construction is legal or not. One must often use "trial- and-error" which is a nuisance whet. turn-around time at th«* data centre is long, Probably soi^e remaining bugs -A-II-17-

contribute to this situation. We have also liad some problems of this kind, but not at all to the same exten", with SYHEAL and a earlier version of ALTRAM mainly because of bugs i the interpreters.

b. SECURITY This is a property of system that might be good for some users, bad for others. By imposing an extra burden or. a user, such as type declarations, a system can give more security about the correctness of the program (no misspellings or unintended uses of a variable) and of the results. In ALTRAN everyth-ng must be declared, in 5YMBAL every name with more than one character must be listed as "new" , only a guard igainst misspellings, in REDUCE and SCHOONSCHIP every identifier can and some must be declared.

c. EXTENDABILITY By this I mean th possibility to define new datastructures, operators and com: ands within tht language itself. The only one of our s stems that is rea'ly extendable in that respect is REDUCE. as it is also a surface language to LISP.

d. DEEUGGING_AIDS For the same reasons that were stated above under syntax, debugging aids ar • very important in general purpose algebraic systems because the testing phase is usually much longer than ~he successful execution phase. Good debugging aids can keep the number of expensive erroneous runs down considerably. •ALTRAN gives very_vgood diagnostic messages both at compile-

time and at run-feme always with line numbers i-oferi ir.e to the source preiram and with a numeric error cdde that can be found in T e penual. One should be able to turn the line number cnecking off when the program runs successfully though, because the checking slows down the.execution somewhat. .,,. -Debugging in FORMAC is. faiyly complicated , some errors, A-.«%_.:i'«ifr^f^ parenthesises, .are discovered by/the; .-•• -A-II-18'

preprocessor, errors in the use of the host language by the FORTRAN- or PL/I-compiler, most errorc at run-time, sometimes with cryptic messages. In REDUCE the program is formally analysed and interpreted statement by statement and is interrupted when the first error occurs. This is easy to live Kith in an interactive environment bux can be very frustrating in batch with long turnaround time, where one would like a ccmplate syntax analysis that finds most of the formal errors in one run. SAC-1 has no debugging aids at all. My experience with SCHOOHSCHTP is toe short to judge the error handling, but I have noticed that the system after finding the first error often cannot analyse the rest of thi. program. SYMBAL n-'kes a ccipjete syntactic analysis of the program a; d then interp-e-s it up to the first run-time or first syntactic error. The error messages are not always easy to understand. e. -jUTPUT

1 The Turin of -.jtput from a 6Pbraic systems should be such that the ..or easily can find the relevant parts or patterns in long formulae. 0: ?ur six sys.teTS RTOUCE has the best tools for affecting the form of output. The order between factors in terms can be prescribed, the terms can be ordered after decreasing order of powers of specific variables that are factored out, expressions can be put on common denominator, variables can be given with negative powers or in the denominator, etc. Ordering of factors and terras with factored out variables is al— r -ssible in ALTRAN and SCHOONSCHIP. ALTRAN' and SYMB. .so have some other possibilities. We illustrate the printed form with examples. -A-II-19-

ALTRAN :

RiTMd.i.l.îI

( 2*P**?!*5INITlt«*?*Dt!i_)*DG( 1) • D**2*ÏINTH**2»rif;( 11**2 - P.**?*1", IUT14**?*

020(1,1) - 2ac.*S!'-ITII**J*,jail) - 2*P.*SIMTH**2*r)G(l,l ) / ( CJG )

FORMAC:

- 2 f,.( T, R, TH I ( 2 ) 2 RIEI1,3.1,3) = - 2 ;'.£ G .1 T, R, TH ) SIN ( TH

- 2 r,. I T, c, TH ) (21 ? I R - ÎSE B .( T, R, TH ) SIN ( TH > R + AE 2 G.i T, R, TH > (2) 2 2 2 - 2 G.( T G . ( T, ', TH ) SIN ( TH ! R t 2 «E , F, Til | 121 (21 2 2 B .1 T, R, TH I G .( T, R, TH ) SIN I TH I S - AE 2 2 G.( T, R, TH I (Z ) 2 2 G .( T, fi. TH ) SIM ( TH I P

Notice the way FORMAC makes a line feed without considering at all where it breaks. All other systems try firstly to break on an additive operator, secondly on a multiplicative operator.

•LAM::

2 2 2 -2G 2 2 -2G 2 -2G 2 -26 R =R SIN

Notice here how the output follows the. standard mathematical notation in tensor algebra,, which gives a compact output which is easy to read. -A-I1-20-

REDUCE: 2 2 ? KIXI (-2) 2 Ultl-ll 3 ) 3)=<» »()F|KIX),R> «'SlNtS) "IE ) + ?*K *OHKlX),R)s

; KU) 1-2) 2 DM»tXI,R)*SlNtSI -If: ) " f> *DFtK(X),^,2)«SIN(

i .^ (XI l-i) 2 «IXI (-2) SI <=(E I " 2*B*OF(HlX),B)-SrHSI *(£ I 2 KUi 1-2) .. •<*«*0riBI *.) ,ft)*SlU(S> *lr. I

SCHOOMSCHI?: fi s

• 1 . z-2. *R.>C'»K<»<»?<»L0o2,*'>c:> i'J) °i"P ;3i » 1 ./2.»H»C*K»»2»L,*SJ*EP (0 ) ofc? -P.*...

* 1 ,/it.''^«<'2>lt,'»4*ftP(3),,cP (3) * 1 ./'»,3l3»o2oL*,">w,tP<0)6,,2 » C»K»»3OL* •..

* 1 ./i.»C*»?*K*,,4aA0(3l''f>3(3) • 1 ./*.»C*0?,1K»»4"F.P (ô)**2 • K*»H,,U',*2* ...

SYMBAL•

RTEt 1 «.3t ].3J 1= -?»P/7?G"SrMrnt2oDGt 1 3 - 2«i)/'E2G«SlNTHt2«Dt>U 1

- H*?/çî>G«slNTHt2»0?Gti;i] • E*Pi'2/F.2G«>SIUTH*?<>nGt]]<»0B[] j

As an example of two-di--:.-ional output, which may become a cheaper way to include formulae in scientific papers and textbooks I give a sample of output prjduced by a plotter program of ours that accepts formula input in 5YM8AL, form with some additional conventions for representation of elementary functions and derivatives, INPUT:

VAHtOJ |E Tl VAHtU I- XI VARC21 1= ¥1 VAHC31 •.= 7-,

FCMlJ i= l/w*I*U«PClI * Y»Pf?J + Z»PC3])| ÏF£I ,? "^LaTlVlSTIC WA»F PoijATIOuS FOR BETA OEC-YI

ZERO la I»"»c«DFt4,l) • T*M»c»ûF[3,3J * H«C»0FC4»2) • Ftn«(E - M«OZ) I

TEXT la PLANF WAVE S0LUT!0MS| Ftl) Is ÇXPtlJ«Utm

TEXT := POSSIBLE EIGENVALUES! E I» (C*2«(PC1)*2 • vi2J,j » Pt3)tg) • Ct4«H«2)t(l/2)| y; RELATIVISTIC WAVE EQUATIONS FOR BETA DECAY

IHC^+IHC^+HC^+F! E-MC'-O

PLANE NAVE SOLUTIONS

I[XP1+YP^-ZP3) . F;-a .--<.. H Uj

POSSIBLE EIGENVALUES

E-VC2 P? + Pf + Pf| + C4tf -A-II-2Z

Readable introductions exists to all the systems. Precise definition? exist to ALTRAN, FORMAC and SYMBAL in the form of manuals. The REDUCE manual does not give complete definition of the language. For SCHOONSCHIP a systematic user's guide is badly needed.

SϧTEM_DOÇ'JMENTATION The source code for all the systems except FORMAC and SYMBAL is freely available. For REDUCE it has especially pleasant fcrm as it to a large extent is written in the ALGOL-like surface language to LISP that constitutes a subset of REDUCE. The SAC-1 source code is included in reports, that also contain precise descriptions of the algorithms and results on their asymptotic behaviour.

SPECIAL FEATURES

All the systems (except SCHOONSCHIP) can handle rational functions in several variables and do arithmetic, differentiations, substitutions, etc. Beside that some of the systems have special features which can be useful for •nany problems.

SAC-1, SYMBAL and the latest version of REDUCE all have listbased infinite precision integer and rational arithmetic. In FORMAC there is a bound of 2295 decimal digits, i.e. in practise infinite precision. ALTRAN has one word short integers and up to ten words long integers. The length must be the same for all long integers which leads to inefficient memory handling and somewhat inefficient arithmetic. SCH00N3CKIP uses doublf. worj floating point arithmetic, 90 bits mantissa, which can be converted to the nearest rational number (looking-at the first 70 bixc) on output. This precision is usually sufficient in the kind r>£ applications that SCHOONSCHIP was designed; for., -A-I1-23-

There are situations though where infinite precision is very useful: - cases where numerical cancellations and instabilities are such that very small perturbations in data cause enormous changes in the results, e.g. in solving algebraic equations of high degree. - a parameter whose exact value is crucial, e.n. an eigenvalue. - obtaining "theorems" on how a result behaves analytically as function of some parameter. Such suggested theorems on for instance the behaviour of some coefficients might then be possible to prove analytically.

b- Et2ôïï!?ëlP2ÏNT.ARITHMETIÇ In all systems except SYMBAL the resulting expressions can be evaluated in floating point arithmetic. ALTRAN then demands that all variables are replaced by numbers, "formulae are exact". It should be remembered though that more extensive numerical calculations should not be made in these systems for efficiency reasons. It is ofter much better to output the expressions in a form that can be included in an ALGOL or FORTRAN source program and compiled together with the rest of that program. REDUCE and SYHBAL have special commands for this kind o.' output.

c. yNEVALUATED_FUNCTigNS In FORMAC, REDUCE and SCHOONSCHIP formulas may contain unevaluated functions. Differentiation and some substitu­ tion rules for the functions can be specified in all these three languages. More sophisticated properties, such as oddness, evenness, symmetry, antisymmetry can easily be • specified in SCHOONSCHIP and REDUCE. In the other "languages tricks can be used, see below under d.

d. ELEMENTARYFUNÇTigNS In fORMAC properties of the elementary transcendental functions (and of the error function) such as differentia­ tion rules and evaluation rules for* some specific arguments are built in. In REDUCE some properties of SIM, COS, EXP and LN arc; built in and properties of other \^ -A-II-24-

functions are easy to define. In the other languages tricks must be used for elementary functions. One can for instance use a single variable instead of function * argument and give rules on how to differentiate with respect to this single variable. As example I give a differentiation procedure, taken from a SYMBAL program for computation of the Einstein tensors for the Bondi metric. The metric contains the unevaluated functions 28 2Y U, V, g, Y, and the elementary functions e , 2 ' and • sine, and we need the ability to differentiate twice.

The variables are Xj - t, xj = r, x2 = 8, X3 =$, U, V, 8 and y are functions of t, r, 6. B[I] is the representation of 8B/8x., D2V[I,J] is the representation

2 28 of S V/3xi3x., E2B represents e . neRV!=<»=Fo"WAL=E»i»NS =MEW=J;II«JJI . I»=IF=I«(I«1)*0=THEKI= .

ïD5ESBnE»E?B»2»0bt IJ • =D3E?G4E»E2G»g«»DGC I] * , =D=UE«nutn * =n=VMMOvtI J • . (=lF=I»n=THEN=0sELSF==lF=I=1=THEN==D£R*E3ELSE==D5SINTHAE*COSTH)=

• (=lF=Ms3=THEN=(=FnR=J|=n|2=SUM= . (sn=0StJUE)«D2Rt!l:==IF=IUlJHE)«D2Utli»JdJ * • (!:0=0VUU*E)»D2«llI,J.,} Î . «'( = IF = l=2=THEN==()=cOç;TH*F*SIrtTH=EUSE=0) 5ELSE5Ô) =ELSES0 «>l r

e. PATTERN_MATÇHIN§ Advanced tools for substitution of patterns in formulae are found in SCHOONSCHIP and REDUCE.

There has been a tremendous development in the knowledge about how to perform basic algebraic operations such as taking greatest common divisors, solving linear systems with symbolic coefficients, polynomial factorization, during the past S years. Most of this development as done in connection with SAC-1 , which therefore always contains the best known algorithms. The. algorrthmsi'iare UGually also included (after some delay) in REDUCE-and to some extent in ALTRAN. The other systems (FORHAC and SYMBAL) are "dead". -A-II-25- g. TRUNCATED, POWER,SERIES The use of truncated power series (TPS) has proven to be very useful in algebraic manipulation programs. ALT~AN has built in routines for TPS-arithmetic, which are very efficient in that only terms which can contribute to the result are computed. In REDUCE and SCHOOHSCHIP one can give weights to the variables and specify a weight level above which (REDUCE) or below which (SCHOONSCHIP) all terms are ignored. In SYMBAL an exponent level can be specified and all terms containing any variable with an exponent higher than that level are ignored. In REDUCE, SCHOONSCHIP i.nd SYMBAL the terms are computed before they ere thrown away though. h- 56ïïQNAL_FyNÇTïgNS In ALTRAN, REDUCE and SAC-1 there are built in routines for reduction of rational functions to canonical forir by computation of greatest common divisors. For efficiency reasons these routines can be switched off. In the other languages polynomial division and gcd routines must be written by the user.

i. VEÇTORS_and_HATRIÇES In all the systems array structures can be used, ALTRAN, REDUCE and SCHOONSCHIP have built in routines for vector and matrix algebra, SCHOONSCHIP only for inner products though.

3. GAMMA_HATRIX_ALGEBRA REDUCE and SCHOONSCHIP contain special facilities for tensor :and gamma matrix algebra, which is of interest in high-energy physics.

k- v- :NQfc£2yMy|ATIVE_ALGEBRA Most .algebraic.systems have an internal canonical form for the formulae which presupposes commutativity. Of our si< systems only SCHOONSCHTP has a direct capability of norij^ommutative algebra in that functions do not commute dn geijèri ^-Facilities for doing non-commutative algebra in REJ^eE are present in a test version- -A-I1-26-

1. SEÇOKDARy_ST0RAGE In SCHOONSCHIP terms are automatically directed to secondary storage (disk) when main core becomes full. The collecting of like terms is then made by a neat way' of swapping parts of the expression between core and di=y. In the other systems overflow must be foreseen and taken into account in the program and the job control statements. REDUCE and FORMAC have simple commands for directing output to secondary storage.

M. RUN-TIME EFFICIENCY lost of the timings on performance of algebraic systems on the same problem that have been published so far have been incompatible for the following reasons. - Different algorithms have been used. - Different computers have ^een used. - The test programs have been written by experts, system designers and implementors, who know the properties and idiosyncrasies of the systems thoroughly, and can use that knowledge to get best possible performance. In the tests we have made we have tried to avoid thtse pitfalls by developing the algorithm in one language (usually SYMBAL) and then translating it as close as possible to the other languages so that the same Science of operations is performed. We also consider ourselves as ordinary users and write the programs in a straight­ forward manner without using '."ricks that would not speed up the program in all the systems. We can not stick completely to this strategy because of the differences in syntax and in some cases it does not lead to the most natura? program in some languages. Finally we have only used two computers, an IBM 360/75 an 1 a CDC 6600. As a crude measure of speed we> take the CDC to be twice as fast as t'ie IBM.

a. THE Y, PROBLEM

In a short paper in the ACM !"• '..SAM Bulletin, no 22,

J Campbell suggests computation of Che Y-,n functions as -A-I1-27- a good test problem for formula manipulation systems. The Y„ functions appear in approximations of wave functions when potential scattering is treated quantum mechanically with phase integral approximation, see the. paper for references to papers on the physical background.

Y2n is a polynomial in eQ, t.t,..., c. . obtained from Y„. 's of lower order by differentiations and summations.

Yt, contains 2 terms, Ys 4 terms, Y8 7 terms,..., Y2o 137 terms. The computation is suitable as test problem as it mainly consists of abundant use of the basic formula operations. The problem has aroused wide attention and the October 197 2 issue of the ACM SIGSAM Bulletin, no 24, contained several reports on performance by different systems. This comparison was or the incompatible kind mentioned above though. We therefore considered it worthwhile to test the systems available in Stockholm more from the ordinary user's point of view. In its original formulation the computation is described with the following recurrence relations

Y0 = 1

Y2 = t0/2 If1 1 r' Y?n = 2 Y2 Y2B 2 Y 2 + ~ a+Ln ° " \ +B lr+S-J * ^ S™

+ + Y Y + Y Y \ o+u—n—I iWlJlt t 2a 2S " l{Wh 2a 26))' where £ means that the summation should only include terms where at least 2 indices are different from zero and e' = for all n. n t n+,,1 This algorithm taking into account the symmetries in the sums was first written and tested out in SYMBAL, which in my personal opinion has the nicest and most flexible syntax of the languages at least for ALGOL experienced programmers. Several modifications could be made t- the first SYMBÂL program to increase the efficiency. Thus by use of'pure integer arithmetic instead of- rational arithmetic in the coefficients about 30% was gained, by the observation that derivatives should onlv be computed once for each n 60% was gained. -A-II-28-

Our final, most effective, way to write the recursion formula is the following

2n 1 Let Z2n = 2 " Y2n

z2 =Ï(J , zz2 = o

Then

2r. 0\ 2n-I LT\-i)

, (n-1)/2 v -5(2 y Z„ Z„ . + (if n even then Z2 else 0)1 - \ ** /n-,n — n / x a = 1 ip.

ZZ2n

,n/3 (n-8)/2 \

^ Z Z u(C1 B Y n B 1f, ( I Ï 2B 2r 2n-2B-2r ' ' ' - - ) p- i Y-P

n/t (n-o)/3 (n-a-B)/2

Z Z 2 Z M(ll B n (I B ) " •• Z I I 2c 2B 2-r 2n-2[I-2p-2Y ' ^' - - ^

(n-2)/2, + 2 £ (3Z2aZ2n-2-2

+ (i— f n odd then 3-Zn-' 1. - 2Zn- l,Z n-" 1, else 0)/ J

All summations are made up to the integer parts of the upper bounds. u(a,B,Y,i5) is a weight function giving the number of permutations of S,S,Y,{, The final SYMBAL program was then tranlated as isomorphically as possible into the other four languages. The most time-consuming and errorprone was the translation into SAC-1, which in its present state is a collection of FORTRAN subroutines for the most primitive operations like for instance polynomial multiplication. A?1 collection of garbage like intermediate results must be handled by the programmer. The translation was made by Orjan leringe, whose patience and ingeniousness is gratefully acknowledged. -A-II-29-

The timings for computation of Y11-Y2o (in some cases Y16) are presented in the. following table.

I Maximum Time Core System Program 8-bit-bytes! (sec) 60-bit words Y2n

Original 200 SYMBAL YlG (200000)B

SYMBAL Integer Arithmetic *16 135 (100000)B

Y 20 390 (1i*Q000)B

SYMBAL Final, Different. Y,6 33 (100000)8 2i*0k

once *20 99 C|t4ÛOOO)8 360k

ALTRAN in Final Y 261 320k FORTRANG 20 ALTRAN in Final Y 1Ui| 290k FORTRANH 20 ALTRAN in Expert Y H7 290k FORTRANH 20

FORMAC Final Ï16 96 300k 400k REDUCE Final Y2o 152 SAC-1 Final Y20 139 130k

SCHOONSCHIP 26 (7G000)8 210k « Final Y2o

Here we can clearly see how several factors have effect on the performance.

- The algorithm, note the times for computation up to

Yi6 for the different SYMBAL versions. - The system implementation, a mere optimized ALTRAN system produced with the FORTRANH compiler was almost twice as fast as the original system made with FORTRANG. - The expert knowledge of the system. A small change of the ALTRAN program to make it simplify an expression only once (by putting in an extra pair of brackets) and to make it use a simpler differentiation routine made it 3 times faster.

Taking computer speed into account we see that ALTRAN and SCHOONSCi.TP had roughly the same performance on this problem. To get more information on how the systems behave for different sizes of the problem we can plot the time to compute Y„ , T ,-'versus, n. This is done in fig. 1 for ':the JBM?3:6Q-systems,.in fig. 2 for the CDC 6600-systems. -A-ÎI-30.

Note the logarithmic scale on the T-axis. The fact th-c the points form a relatively straight line for most of the systems lead is to the following model

Tn " V13""4 The smaller Ti, is for a system the better it behaves for small problems, the smaller b is the better it behaves for big problems. The following table gives the observed values for T^ and b. Taking computer speed intc account, which of course only affects Tt,, the values for SCHOONSCHIP and SYMBAL should be doubled.

System T* b ALTRAN 8 1.H ALTRAN, expert 2.U 1 .1» FORMAC 0.6 3.? REDUCE 1.U 1.9 SAC-1 1.7 1.85 SCHOONSCHIP 0.7 1.75 S."MBAL 0.3 2.3

For SCHOONSCHIP, where the fit is rather bad, the growth

n is more like T„ • (b+nc ) -". As b~value Ti„/T9 is given.

ÏSS§25_£èt£y^ïï2NS_in_GENERAL_RELATIVITY From a given its'» matrix, the metric tensor, a hierarchy of tensors are calculated by differentiations and summations of products. The performance on two metricB was tested:

I. The Bondi metric

"v/r-e2s - uWT 26 rU2e2* 0 0 0 0

Symm. -r2e2* 0 -r2ê2*sin2

x0=t, xi=r, x;=8, Xa=$ V,U,B,Y are functions of t,r,e -A-I1-31-

II. The "7 out of 10" metric A K L •1 B M 0 Symm. C 0 D A,B,C,D,K,L,M are functions of all four coordinates. With I the calculations K:"e maJa up to the covariant and the mixed Einstein tensor. With II the calculations were made up to the (0,0)-component of the covariant Riccitensor.

Results: (All times are in seconds): I II Time Core Time Core ALTRAN 257 35Cx FORMAC 173 300k LAM 104 800k too 400k REDUCE 856 800k SCHCCNSCHIP 16.5 (7O0O0>8 3S SYMBAL (100000)8 108 (200000)8 For the ALTRAN program vie used "expert knowledge" and rewrote the differentiation routine, which we know is rather inefficient in its general form (with the original routine the computation needed 478 seconds). Still the ALTRAN program spends proportionally more time for differentiations (about 75%) than the othe- s (F0RMAC 20%, SYMBAL 45%). Notice the difference between the two LISP-systems, LAM was designed for this special kind of computation, EEDUCE is more general purpose.

SSE9raH6_of_the_QRDER_of_RyNGE-CTnA_rORMULAE We have written programs in some of the systems to check the order of accuracy and obtain the leading error term for some formulae of Runge-Kutta type, for solving ordinary differential equations numerically.

The formulas- tested are

Improved Euler (order 2): k] = I(x0,y0)

k2 = f(x0+h,y[!<-kl)

yi = y0+h(k1+kz)/2 -A-II-32-

Heun (order 3): k, = fUo.yo)

ko = f(x0+h/3,y0+kiIs)

k3 = f(x0+2h/3,y0+2k2/3)

yi = y0+h(ki+3k3)/i*

Classical Runge-Kutta kj = f(xo>yo)

(order ): " k2 = f(x0+h/2,y0tki/2)

k3 = f(x0+h/2,y0+k2/2)

+ + ki, = f (xo htyo k3)

yi = yo+hCki+2k2 + 2k3+ki, )/6 The checking was made by formal Taylorexpansion of the solution and of the obtained expression by the Runge- Kutta formula up to the highest possible order. In ALTRAN the truncated power series package was used. In SYKBAL a maximum exponent was set to make uninteresting intermediate terms disappear Cafter having been computed). In rORMAC only the final result was truncated. The following table gives the timings, notice the difference in exponential behaviour.

Ck,+k;),'2 (kj+3k3)/"» (k, + 2k2 + 2k3+ki, )/G ALTRAN 6.5 22.5 56.5 FORMAC 0.6 14? SYMBAL O.ti 2.2 8.8 -A-II-33-

CONCLUSIONS The results of the comparison of the systems from different aspect is collected in the following iable, where the systems are given a subjective rating from 5 (best) to 1 . A " mears that the system does not offer the corresponding possibility.

Property ALTRAN FORMftC REDUCE RAC-1 SCHCONSCHIP SYMHAL Smallness 3 4 2 5 U 4 Portability 5 1 3 4 2 1 Distribution 5 1 5 3 5 0 Maintenance 5 0 i» 2 4 0 Interactivity 0 3 5 0 0 0

Syntax 3 2 4 1 1 5 Security 5 1 3 1 3 3 Debugging 5 4 2 1 2 3 Extendability 2 2 5 2 1 2 Output 1» 3 5 1 2 l

User's documentation • 5 4 3 4 2 4 System documentation 5 0 5 5 3 a

Exact arithmetic 2 4 5 5 1 6 Floating point arithmetic 3 U 2 4 S 0 Unevaluated function- 2 5 4 2 4 T Elementary functions 2 5 4 2 2 2 Pattern matching 3 3 5 1 S 2 Kodern algorithms 3 0 4 5 a 0 Truncated power serifs 5 1 3 1 3 •l

Rational functions 5 2 4 5 0 2

Vectors and matrices 3 2 5 1 5 3 Gamma matrix algebra 0 0 5 0 5 0 Non-commutative algebra 0 0 2 0 5 0 Secondary storage 2 3 3 2 5 1 Run-time-effic iency : Small problems 1 I» 3 2 3 S Moderate problems 2 1 3 4 5 5 Large problems 1» 1 3 3 5 2

It seems that the most efficient systems and the ones that offer most possibilities are also the ones that are most difficult to write-programs in. Systems with linear datastructure, i.e. ALTRAN and; SCHOONSCHIP, seem to be more effective for big problems, list-based systems are more flexible. It also seems that here as in other computer applications it is not necessarily new languages and systems that are needed but good user-oriented tools, like debugging aids, to use the ones that already exist. Construction of smaller, "desk calculator" systems, might spread the use of algebraic manipulation considerably though, -A-II-34-

REFERENCES TO THE SYSTEMS:

ALTRAN : A.D. Hall: The ALTRAN System for Rational Function Manipulation - A Survey, Comm, ,ACM, JU (1971), pp. 517-521 ASHMEDAI: See paper by M.S. Levine, these Proceedings. CAMAL: See paper by D. Barton, these Proceedings. FORDECAL: A. Laplace: FORDECAL, FORMAC Dest Calculator, I.R.M.A., Université de Grenoble (1971)

FORMAC: R.G. Tobey 8 al: PL/I-FORMAC Symbolic Mathematics Interpreter. IBM Contributed Project,., "ibrary, no 360D-Q3.3 .QOH (1967) LAM: See p.iper by A Russel-Clark, these Proceedings : W.A. Martin-R.J. Fateman: The MACSYMA System. Proceedings of the 2nd '.'ymposium on Symbolic Algebraic Manipulation, ACM (1971;, pp 59-75 REDUCE: See paper by A.C. Hearn, these Proceedings SAC-1 G.E. Collins: Tha SAC-1 System, An Introduction and Overview. Proceedings of the 2nd Symposium on Symbolic and Algebraic Manipulation, ACM (1971), pp 1U4-152 SCHOONiJCHIP: See paper by H. Strubbe, these Proceedings SCRATCHPAD: J.H. Griesmer-R.D. Jenks: SCRATCHPAD - A capsule view, IBM Research Report (Yorktown Heights) (1972) SYMBAL: M.E. Engeli: Formula Manipulation - The User's Point of View, Advances in Information System Science 1_ (1969)', PP 117-171 SYMBAS: Contact H. Meuer, KFA, JUlich, West-Germany -A-II-35- Tn

FOBMAC

ALTHAH H (expert program)

"* 5 6 T 8 9 10

Fig.1 Performance for the Y_ - p'ro^lem o- IBM SBO/^

\ -A-II-36-

50

SCHOOHSCHIP

A

0.5 -i 1 1 1 1 1 ^- n

5 6 T 89. .10;.-. -::-i Firç.2 Ferforràanoé for the;,ïn^Pr6blënfïô^CDCé660t);; -A-III-i-

ASHME.DA1: a Symbol Manipulation Program

M. J. Levine Carnegie-Mellon University Pittsburgh, Pennsylvania 1521Ï

Talk presented at the Third Colloquium on Advanced Computing

Techniques in Theoretical Physics, CNRS, Marseille, France, 1973

Supported by the U. S. Atomic Energy Commission. •A-III-2-

I. INTRODUCTION

ASHMEDA1 is a symbol Manipulation program incorporating Dirac matrix and polynomial algebra operations. It is written entirely in Fortran V but is a descendent of a sequence of machine language programs 'taring back over 10 years. All these programs have been use-*, primarily but not exclusively for Feynman graph calculations. While the user-program inter­ face is now more elaborate than previously, only those operations which seemed roost useful have so far been taken over. At present it is being used heavily in the analytical 6th order electron (g-2) work which Roskies will discuss later. Although it uses some nonstandard features of the Uni- vac 1108 Fortran V, these machine dependencies are readily overcome. This version is running on IBM-360's and DEC PDP-10's as well as here at CNRS on the Univac 1108.

First, I will give a description of the input format and operational capabilities of the program. Next, I will briefly compare it with what

I imagine SCHOONSCHIP and REDUCE to be. (I apologize now for any mis­ representations I may make concerning them.) Finally, I will describe in some detail one particular important operational feature of this entire sequence of programs.

II. Pr~CRIPTION

Commands and data consisting of expressions (to be processed and in

some cases to control processing) and identities (to be us-id in substitutions) are input on data cards in essentially free field format. Because we use -A-ni-3-

ASHMEDAI in a fast batch Bode, the output is copious and there is no

ability to recover from detected errors other than to describe the trouble.

Essentially, there is a "current expression", input initially from

cards, upon which various operations are performed. After you are done, it

is deleted and you can start off again. Consider the example:

INPUT A-12*(B-(A"2+B/3)) $ SUBST A=B+2 $$ COLCT PRINT '

After performing the indicated substitution on the input expression and

collecting terms when directed, it will produce

+12*B*B*1/1 + 41*B*1/1 + 50*1/1

You notice that arbitrary parentheses are allowed in data. Numerical de­

nominators are allowed as are exponents on symbolic factors on input.

Notice also the idiocies D^B and 50*1/1 whose continued existence is due

to lack of motivation to remve them since they do not change the range

of applicability of the program. There are no inverses for scalavs (you

can enforce A*IA=1) and no explicit rational function operations (i.e. you

cannot divide an expression by a polynomial.).

Another example is:

INPUT VI * SPUR(G(Mu)*(Q/+M))*SPUR(R/*GCNu))*G(MU,NU)

SUBST R(K) = 3.Q(K) + P(K)

DOT GAMMU TRACE COLCT SUBST Q.R = SCALAR $$C0LC^ PRINT

J-.JN > - *, -A-III-4

which will produce +48*SCALAR + 16*P.R + 1»P/

You see here tho Dirac matrix and 4-vector operations. Non-reserved sym­ bols are typed automatically from context. The "G" with 1 index is a gamma matrix; with 2 it is the metric. "E" is the permutation symbol. There is vector substitution with a dummy index which will find its target in slashes L„ dot products. Basically, one can: 1) Define expressions. 2) Perform substitutions (sets of identities can be saved). 3) Collect terms. 4) Take traces of products of Dirac matrices. 5) Do the Chisholm \ y ... y identities.

6) Do covariant index contractions (tc form dot products, etc.). 7) Write onto and retrieve from drum (tape). 8) Remove common symbolic or numerical factors from expressions or multiply through by them. 9) Call certain space saving packing schemes into operation. 10) Extract frovn an expression all those different ways in which certain factors occur. 11) Extract the ex­ ponents of given scalars in each term and use these in finite sums, theta functions, delta functions, products and various numerical operations. Further, user written subroutines implementing nonstandard operations can be called by various dummy commands. Examples of this are the Chebyschev polynomial addition theorem and orthonormality properties used in the angular integrals in our 6th order work. As we use the program, it is a 46k word core load: 16k program, 30k dynamically assignable storage. Without using the drums, explicit inter­ mediate expressions of many thousands of terms can be tolerated. Much Il Jj l i ;

-A-III-5-

laiger virtual intermediate expressions (see below) can be processed.

Hundreds of thousands of terms can be processed i~ runs of many minutes on the UNIVAC 1108.

The 2-colour 6th order election (g-2) graphs are done, trace and all, in under 2 minutes each using about 30% of the store without drums and without packing many factors per word.

III. COMPARISONS

The only other programs with which I can make any comparisons are the

LISP based REDUCE and the "'machine language SCHQONSCHIP both of which will be discussed here tomorrow.

First consider SCHOONSCHIP because it is quite similar to ASHMEDAI in outlook. Both attain high packing density through use of partial words for storage and high speed by suiting the plan of attack tc the structure of the machine. Veltman likes machine language. So do I, but

I'm tired of having to rewrite. While I imagine that some speed improve­ ment may be available that way, many compilers write very good code. For­ tran is capable of surprising subtlety and complexity.

In the single timing comparison that I have run (a 6th order trace

and some substitutions) the latest SCHOONSCHIP on the CDC-6600 took half

the time of ASHMEDAI on the UNIVAC 1108 C3 seconds) . An oluer SCHOONSCHIP

with different;algorithms was slower than ASHMEDAI by a factor of 2. I

would have expected more from a hand coded 6600 program, but the comparison

is a limited one. For both, the memory space used was orders of magnitude

from being & problem. -A-111-6-

While SC.OONSCHIP has some additional fûatures, it also lacks some. It is likely '".at problems which can be done on it can be done on ASHMEDM. Certainly, the portability of ASHMEDAI is not a disadvantage nor is its enhanced modifiability. Comparisons with REDUCE are more difficult. REDUCE is written in LISP, a language designed to allow easy specification of list structures. The price you pay for elegant writing is reduced execution efficiency. Maintaining all data structures in LISP format is logically desirable but can lead to reduced storage efficiency. The features of variable format list structures, dynamic storage allocation, dynamically generated co­ routine linkages and recursiveness are certainly useful in this sort of work. While it may be surprising, all these features can be attained by judicious use of Fortran. One price paid for using a less widely avail­ able source language is reduced portability.

REDUCE has many olegant and powerful polynomial manipulation capabili­ ties unavailable in ASHMEDAI. The method of specifying operations is quite different and perhaps easier to use for the uninitiated. In the limit of very great memory size and machine speed, it is very powerful and useful for these problems. But, for moderate machines the greater efficiency of ASHMEDAI in memory usage and speed of execution is important. There are calculations that I would like to perform this year and not wait for the next generation of machines.

While it is just a single example, the test problem I mentioned above with respect to SCHOWSCHIP immediately exceeded core in REDUCE/ My feel­ ing is that LISP may slow execution but need not cieate storage problems. -A-m-7-

Without knowing the guts of REDUCE, I imagine it would benefit greatly

from use of external storage devices for temporary data storage and for

overlaying of program segments.

IV. VIRTUAL EXPRESSIONS, COROUTINES AND CYCLING

(OR "HOW TO USE ALMOST NO CORE STORAGE AND HARDLY FEEL IT".)

Finally, we come to that important operational feature mentioned in

the introduction. It was alluded to in my mentioning virtual inter­

mediate expressions and coroutings. It is a feature also implemented in

SCHOONSCHIP but probably not in REDUCE. To see what this feature is and

why it has been incorporated, suppose that you have ?n expression which

can be considered as a sum of terms. You want to perform two operations

on it. These particular operations can be performed term by term.

You could perform the fiTSt operation on each term of the input to .

form an intermediate expression, collect terms and them similarly, per­

form the second operation. Such an intermediate expression is "explicit"

since it exists as a whole at a single '-i-us, Alternatively, each tije

you get a term of the intermediate expression, you could immediately per­

form the second operation on it and only collect terms at the end. This

time the intermediate expression could be'called "virtual" since it never

exists altogether at any one time. The second scheme has the disadvantage

of not capitalizing on cancellations which may occur at the interiisùiaLe

stage but it Saves the time needed to collect terms at that po'.nt and it

avoids having that expression all there at once. There are cases where

memsmm -A-II1-8- each approach 1: preferred and in ASHMEDAI you have a choice. Inter­ mediate expressions become explicit and terms are collected only when the

COLCT conw.and occurs.

The implementation of this "one term at a time" processing and going back for the next little piece is the most exotic part of ASHMEDAI. Many commands (e.g. SUBST, TRACE, DOT, etc.) are not executed when read.

Rather, they cause requests to be queued in a "control stack". This stack building continues until a :;OLCT command is encountered. Then, a collec­ tion request is queued in the stack and the stack is closed. Next, with­ out reading additional commands from cards, the stack is "executed". The routine designated by the first stack request has as its input the ex­ plicit expression from data on cards or from a previous COLCT. Its output is a single term and a "table" containing the information it needs to pro­ duce the next term from that expression when it is called again. Successive

"worker" routines in the stack have as input the single term output by the previous operation and again possibly 2 outputs. The first output is another

(or the same) single term. If that routine wishes to be called again to pro­ duce other terms as o-.tput from that single input term, it has as its second output pir^uct another "table" containing the information needed to produce the next c: t,i,v. and containing pointers to 1) the previous table, 2) the input term, 3) the request in the control stack that caused this routine to be called.

Prior tr reurning command to the "master calling routine" (MCR), each worker routii); . ,ist decide whether 1) it can produce no further terns from -A-m-9- the given input terra (CF=-1), 2) it should be called again using its own output as inpjt (CP=0), or 3) it has output and can do no more to it (CF=+1). In case 2), the MCR again calls that worker routine. This constitutes recursion. In case 3), it calls the routine specified by the next request queued in the control stack. In case 1), the MCR steps back one notch on the pushdown list of tables (returning any defunct tables and terras to available storage! and reenters the control stack at the point specified by the table now on top. It is clear that upon being called, each worker routine must ascertain whether 1) this is the first call on this input term (if CF=+1,0) or 2) this is a subsequent call and the next output term can be readied (if CF=-1).

Thus, to implement this avoidance of explicit intermediate expressions, a sort of cycling occurs with control flowing down the control stack of opera­ tion requests and back up a list of tables. These tables provide temporary storage external to the routines themselves and effectively say ''call me again later when you want the next term resulting from this operation on this input". Such routines, which hand control back and forth between themselves as equals, are called coroutines by computer scientists.

Since in this scheme intermediate expressions exist only 1 term at a time, very little working storage is needed. If necessary, this idea can be carried out also in the collecting of terms. This collection scheme^ which can become expensive of time, is a standard sorting procedure. It is implemented in AS1MEDA1 and in SCHOONSCHIP. Suppose we allot a cer­ tain fixed space for collecting terms and as terms come to be collected -A-:n-io-

they are placed in that space. If we already have a like term, its co­ efficient is added to that of the term already in the collection. If you get a new kind of terrc and no more space exists, you write it on a tape or other external device or file. When all the terms to be collected have been processed in this way, the tiiiss in the collection area fre un-

\i\e any in the overflow file and can be set aside in a second temporary file. After they have been removed from the core collection area, those terra? in the overflow file are again sieved and another batch of fully collected terms is ready for addition to the second temporary file. The

leftovers were again placed in the overflow file (or into another one).

This sieving back and forth continues until all terms of this explicit

intermediate expression have been collected. Then the fully collected

tenus on the second filo can be recalled for further processing, and

commands again read from cards to form a new control stack. The larger

your collection area, the fewer will be the cases of multiple passes for a

single term. Although time can get to be a problem, with this scheme very

little core storage is needed while still allowing explicit intermediate

expressions of tens of thousands of terms.

Finally, whatever the comparisons between programs, we should bear

in nind that as physicists we should use any available tool if we need it.

If you need to do a problem in which these programs can be of help and if

you don't have a very large machine (REDUCE) or a CDC 6000/7000 machine

(SCHOONSQIIP) I suggest you try ASHMEDAI. -A-IV-1-

CALCUXATIONS WITH SCHOONSCHIP*'

H. Strubbe

ABSTRACT

An algebraic maiupul.tion system is a program char allows ose to do cr'xcu'.a- tions with formulae, in the sane vay that the,FORTRAN, compiler allows c<* to do calculations with numbers.

SCHOO'JSCHIP can handle cay algebraic problem, at les** if che progresser succeeds to present the taethod of solution in tern» of elementary operations like: multiplying polynomials, substituting function, comparing terms

It will be explained how SCHOONSCHIP works internally. In particular the use of memory, the representation of formulae and the overflow to disk will b sketched.

Part of thi» t»xt will be presented at the "Third Colloquium on Advanced Computing Methods in Theoretical Physics." Marseille 25-2? June 1973.

•) SCHOOSSCHIP: A CDC 6600 program for symbolic evaluation of algebraic expres­ sions. CESS preprint by M. Valeman, 1967. CERN program library R 201.

CERN-DATA HANDLING DIVISION DD/73/16 June 1973 -A-IV-?-

-'IFFERESCE BETWEEN NUMERICAL AND ALGEBRAIC CALCULATIONS

A comparison with a FORTRAN program. FORTRAN program:

Ai = A » V A2 = (Al » C) * (Al - C)

T!:e inter-i^diate results, line after line, are

Bemcu'ks:

* All -Mriables at the right-hand side of a particular formula he-.'e a numeri­ cal value before that formula is evaluated.

* Eacli formula, whatever complicated it ie, will reduce to one number in the end.

* Interchanging the order of the statements of the program leads to an error- message of the type: undefined quantity encountered.

The same calculation in SCHOONSCHTP goes exactly in the reversed order. SCHOOiJSCHIP progran:

/. A2 =• (Al <• C) * (Al - C)

IB, Ai » A * B

ID, C - 1

ID, b » 3

ID, A = 2

The intermediate results, line after line, are:

A2 - Al**2 - C**2 A2 » A**2 + 2 * A * B + B**2 - Ofc2 A2 = A**2 * 2 * A * B • B**2 - 1 ::.•-,- A2 » A**Z + 6 * A + 8 -.i--.. ;:V-i, ; A2 » 24 :•,:.., V,;..v!rv.i:-'r ; .'.• -A-IV-3-

Renarke:

* The lengT of an evaluated expression is very hard tc predict; this leads to special storage probleras.

* The final result of the calculation ie not necessarily one number.

* The mechanism of the calculation goes via a scanning and substitution proce­ dure:

Z ?n the first column indicates that the expression which follows has to be examined for substitutions ID in the first two columns defines the following expression as a substitu­ tion.

* Each term cf the intermediate result is inspected for the next substitution. If its left-hand side matches* the replacement is made.

BASIC STATEMENTS IN SCH00H5CHIP

The elemeutary operations, out of which every SCHOONSCHIP calculation has to be.built- up, are:

* Multiplication and Addition of Polyp^mials.

Input Output Z Z - (A + B)**2 Z - A**2 + 2 * A * B + B**2

The quantities involved can be algebraic symbols, indices, functions or vectore.

* Substitutions>

Input Output Z Z - F(A,B) - A**2 + F(X,?) ID, F(A,B) - A**2 + B**2 Z » B**2 + F(X.Y)

The replacement is mode when the arguments match.

In contrast to this» arguments can be dummies. They are denoted with a "•* sign behind their names. D + means: for all values of U.

Input ' Output .

TZ,: Z - F((Â;+^>, (A-*)} + F(X,Y) ID, F(U+, V*} - U * V Z - A**2 - B**2 + X * Y -A-IV-4-

* Pattern Hatching .

Input Output Z Z - A**4 * C * B**2 ID, A**2 * C**2 * B - A2C2B ID, A**4 * C * B - A4CB ID, C * B**2 - CB2

A more complicated example;

Input Output Z 1 = A**4 * F(2,4) * C**3 Z - A*** * F(2,4) * C**3 + «. * F (1,3) * C + AFC(1,3) + A**3 * F(3,3) * C**A + A**3 * F(3,3) * C**4 ID, A**N+ * F(K+. M+) * C - AFC(N.M)

* Special Commands in order to: Calculate traces; Compare coefficients of terms; Give a weight to termsi Rearrange function arguments, etc. .

* Finally, there exists a set of built in functions:

C-anma mac.rices ; Spin li and spin 2h spinors; SummatioT; function (= Z. , f.); J«k j Kroneckei delta, binomial function» etc. ,

HOW CAN A COHPUTER DO SUCH CALCULATIONS?

3.1 The representation of formulae

Assume we want to represent the polynomial:

2.1 * A**3 * B * C**4 + 7.3 * A**4 * B**4 * C**A * Y**2 * U * V

A possible convention could be ta write in memory the following string

2.1, A, 3, B, 1, C, 4, 0, 7.3, A, 4, B, 4, C, 4, Y, 2, U, 1, V, 1, 0

Remarks: •

* The coefficients are double precision floating point numbers.

* Rather than using the actual name of each variable, it is sufficient to make a name list and refer to a variable by its number in the list.

* In order to save space, several quantities can be packed together in one memory word.. -A-IV-5-

* As the number of terms and their length are not known in advance, it is impossible to Bet up from the beginning an array with fixed locations for each term. * The zero was put in as separator between terms. This is not very efficient. In order to find the next term, the entire previous term has to be Fetched from storage and inspecte'' for a possible zero.

A much more apprcpriate v is the use of 'POINTER" (symbolized by an arrow). A pointe: is nothing but the address r the next term. In other words, we can go from one i:erm to the next, simply by following pointers.

last term

By convention, s oointer with value zero indicates 'he last term of the expres­ sion.

In order to avoid drawing those arrows all the time we will aisu use another notation: P(i,j).

P(l|j) is the first terms P(i,j) p ints to P(j,k) Hj,0) is the end.

So the same structure as above is denoted by

P(l,3) Term I, P(2,0) Last term, P(3,2) Terra 2.

Another advantage of the uBe of pointers is that it makes the ordering of terms very easy* This is e.g. necessary for the terms in the output space. Assume we have the string:

Now. the-term A2 comes in. Rather than moving all tert 5 in order to allow AJ to •;l3it-'ihbecweeii-f'AV^and--aV it^iS:.,sufficient to -change onepo.inter: -A-IV-6-

Finally, we need a way to represent expressions in brackets. This is done by defining sab-expressions. The name of such sub-expression starts with a $.

Consider again the example:

Z A2 - (Al + C) * (Al - C) ID, Al - A • B ID, C " 3

This will be translated in the internal SCHOONSCHIP notation as follows:

INPUT ARRAY

A2 - PU,0H1.) * $1**1 * $2**1 $1 - P(2,3)(l.) * Al**l. F(3,0)(l.) * C**l $2 - P(i,5)U.) * Al**l, ?(5,0)(-l.) * C«.l fl - R">.n(l.) » A**l , P(7,0)(l.) * B«*l $4 - P<3,0)O.)

SliBSTITJTION ARRAY

Al - $3 C - $4

When the translation of the input is finished, the calculation itaelf c*n start. This is the moment to replace the overlay IN, which did the work, up till now, by the overlay EXEC.

The allocation of memory for the different arrays and overlays is given in appendix 1.

3.2 The calculât io n_ me c h ai» i sm

The calculation mechanism can be formulated vety easily:

a) the Z-expression is looked at.

b) $ expressions are immediately substituted.

c) for each term a scan through the substitution array is made. If one of the

left-hand sides matches, that part of the term ia replaced by the correspond­

ing $ expression.

d) go back to b) till all substitutions are performed.

A major problem with algebra calculations is the fact that résulta tend:to get extremely long and can no more fit into memory. Then they have to go on disk. This slows down Che calculation considerably. Consequently» it is of crucial importance that an algebra system avoids intermediate expressions as much as possible. -A-IV-7-

Consider the following example:

Z EXP - (A + B + +Y+ Z)**4 ID, A - Z ID, B - Z

ID, Y - Z

It would he very inefficient to calculate (A + B + ... + Y + Z)**4, then to do the first substitution on this result, then the second substitution or :he new result, ...

The reason is that each of those intermediate results is so Ion that they will reside on disk.

The way SCHOt/NSCHIP performs, such t: calculation is the fallow ng:

EXP - P(lsO){l.) * $1**4

$1 - P(2,3)(l.) * A**l, F(3.4)(l.) * B**l, P(4,5)(l.) * C* i, ...

EXP is generated term by term (by specifying pointers to the ap ropriate factors).

The first term is:

P(53,2) P(54,2) P(55,2) P(56,2)

what will lead to A1*, ïhia tens is then looked at for substitutions. All substitutions are applied and worked but before the next term is generated:

P(..,2) PC.,2) ,P(..,2) P(...3) or A3B.

Now this term is inspected for substitutions, etc..

The order in which the terms are generated is:

3 P(..f2) P(..,2) P(,.,2) PC.,4) or A C

etc.

P(..,2) P(..,2) P(..,2) PC..,27) or A3Z PC'..,2) P(.,,2) p'c.,3) PC.,2) or AZBA

till

1 Pf..t27) P(..,27) PC.,27) PC..,27) or Z*

This generating ttechanism ia very easy becau* it simply has to follow the pointers of $1.

The important point is that we have only one term at the time in memory, rather than long intermediate expressions The same philosophy applies to new expressions, arising from substitutions* They are alBo dealt with term by term. This leads roughly to a tree structure: -A-iv-a-

Z 2 - Al + Bl + Cl ID, Al - AU + A12 + AU ID, A13 - A131 + A132 ID, Bl - BU + B12 + B13 + BU will produce terms for the outpuc in the following order:

output space

All these terras overwrite each other as soon as they are no more needed.

3.3 Filiing the output Bpace

Ac the wotnent * ;rms arrive in the output, it is checked whether they add up with a previous term. Three cages are possible.

Assume A**4 + 3 * A**2 + A is already in the output srace:

PU,2X1.) •- «**4, PU,J)(3.J * A**2, P(3,0)(l.) * A**l

a) A**3 comes in:

PU,M(l.) * A**4, P(2t3)(3.) * A**2, P(3,0)U.) * A**lt P(4,2)(l.) * A**3

b) -3 * A**2 comes in: P(1,3)<1.) * A**4, P(2,3)(3.) * A**2, P(3,0)(l.) * A**l N.B. the Aa term is no raore connected,

c) A**l comes in: PU,2)(1.) * A**4, P(2,3)(3.) * A**2, P(3,0)(2.) * A**l

When the output is full, "Garbage Collection" takes place (non co'nnected terms are removed). If this does not help, the disk is used aa overflow array.

It is very unlikely that overflow occurs in the input array (i.e. the initial expression — read in on cards — is too long). One can easily get around this by reading in that expression in several pieces.

It is also very unlikely to have overflow in the execution-space, BE only > one term is dealt with at the time. , ~r~ -\"-" •'... .'.-, -..'.-

Overflow in the output array happens very often ; "The. follbwitig mechanism ;

: v !: :::: m comes then into action. •'"'~-'•":~"-'"--~ '",-••K~'"-i••;'"/ --yr -~.-'•:•:•:- -A-IV-9-

Asaume the output is nearly full and contains A**2 as only term depending on A. As the calculation proceeds, the following terms are produced:

A**4 : can still fit in memory, but occupied the last free words A**2 : cannot be kept in memory. Goes to the overflow tape (tape h, usually a disk file) A**3 : adds up with the A**3 in core A**5 : goes to tape 4 A**2 - goes to tape 4

Each tr-rra is cotnpo--^. with all terms in the output space. If it does not add up, it is sent to the overflow tape. However, no test is made whether chat term adds up with a term, already stored on that tape.

In other words, tape 4 will contain in th*.s example:

A**2, A**5, A**2.

All terms on the overflow tape are different from those in the output space.

When all terms are generated, the overlay EXEC is replaced by the overlay OUT.

This overlay then emptier the output space (e.g. by prir.ting).

Next terms are read in from tape 4 and put in the output space, while addition and cancellation can occur. New cverflow is written on tape 5.

The output space ÎB again emptied and by repeatedly interchanging the function of tape 4 and tape 5 this mechanism can go on till all terms are printed.

3.4 Linking of S CHOP NSC H IP programs

Rather than printing the content of the output space, it is also possible to save it for the next part of the calculation or for a later run.

At the end of a;calculation st "-- one can transfer results from the output bacif to t^e i™put-* t*e" a ne« 8*? oi substitutions can be applied an it. Example:

Z EXP(U.V) - U * V * NEXT Z PR - (EXP((A + B), (A - B)))**2 * END

If the result to be transferred is too big for the input space, that result will he written on disk, and only one buffer of., it will be in memory. -A-IV-1Q-

This explains how it is anyway possible to multiply three expressions — each one too big to fit in memory — with each other; each eKp .'ion has only one buffer in memory.

Obviously this requires an additional amount of admilustration, specifying which expressions are in core or on tape, which part of them is in the buffer, etc..

Results to be usad in a next run can also be written on disk (and then catalogued as permanent file) . This allows one to split up any long calculation into little pieces what — at least in the CERS computer center — pays off in turn-around time. (N.B.: CERN X JOB - express job: 30 K memory and 64 sec 6600 CP time, turn-around "15 min) .

An important point in this disk, manipulation is that results are written in L..e internal SCHOONSCHIP notation, rather than in character code, what eliminates repeated conversion. -A-IV-11-

APPENDIX 1: The memory lay-out of SCKOONSCHIP

Namelists, variables 1500 Input and execution apace

Output space

Resident program

Overlay Overlay Overlay Overlay WRONG IN EXEC OUT

The resident, program contains mainly - the system routines - the I/O buffers - a routine to read and write on disk - a dumping routine. The overlay IN translates the input into the ir.ternal notation (with pointersi etc) The overlay EXHC does the actual calcuZacicn and sends terms to the output. EXEC can start the overflow mechanism. s -A-iV-12-

The overlay OUT empties the output space by printing, by writing the results on disk or by transferring them from the output space to the input apace. OUT continues with the overflow work.

The overlay WRONG does the error handling.

The input and execution space contains; - the t-uilt in formulae

- the input formulae

- the substitutions

- the rest of it is used as working space during execution.

N.B. : Thfc aine of the different areas is given in --ords (60 bits). -A-V-l-

TBE REDUCE PROGRAM FOE COMPUTER ALGEBRA*

by

.Anthony C. HEARN

(University of Utah, Salt Take City)

•Work supported in part by the National Science Foundation under Grant No. GJ-32181 and by the Advanced Renearch Projects Agen-.y of the Office of the Departnent of Defense under Contract No. DAHC 15-73-C-0363 ac the University of Utah. -A-IV-12-

The ove'lay OUT empties the output space by printing, by writing the results on disk or by transferring them from the output space to the input space* OUT continues with the overflow work.

The overlay WRONG does the error handling.

The input and execution space contains: - the built in formulae - the input formulae - the substitutions - the rest of it is used aa working space during execution.

N.B. : The size of the different areas is given in words (60 bits). -A-V-l-

THE REDUCE PROGRAM FOR COMPUTER ALGEBRA*

by

Anthony C. REARM

(university of Utah, Salt Lake City)

*Work supported in part by the National Science Foundation -under Grant No. GJ-32181-and by the Advanced Research Projects Agency of the Office of the Departnent of Defense under Contract No. DARV 15-73-C-G363 ac the University of Utah.

\ -A-V-2-

1. INTRODUCTION

The REDUCE program for computer algebra haa now been In existence in one form or another for over nine years, and there is an extensive bibliography describing its design [1] and applications [2], including a User's Manual [3]. Therefore, rather than repeat what has been said already in these publications, I intend in this particular talk to say more about the design philosophy inherent in REDUCE and in doing so indicate what changes are necessary and improvements are planned for

the future.

There are several design criteria used in REDUCE which have

influenced Its utility and to a certain extent its efficiency. For

one thing REDUCfc. is designed to be an interactive rather than a batch

program. Of course such a program can also be used in a batch er

ment as REDUCE often is, but the design philosophy of an interact.

system is so different that it does influence to a large extent tt, way

Chat programs are constructed. Thus the REDUCE program consists of a

sequence of commands which are evaluated by the computer, rather than

a whole program which is first parsed before any evaluation occurs.

The REDUCE command loop is shown in Figure 1. We see that REDUCE

input such as the assignment statement

X : = Y + 2; (1)

is first converted by a translator into LISP 1.5 which is used as an

intermediate language during the computation. This LISiP expression -A-V-3' is than compiled if required, evaluated by a LISP «valuator to produce

LISP output which ie than translated back Into REDUCE. Such a sequence is followed fcr each command given to the computer. In most applications the command is not compiled but simply Interpreted by the system. However the specific routines which carry through the algebraic evaluation are of course themselves compiled programs so chat there is little loss of efficiency in carrying through the top level step

interpretively.

We have found that the interactive ne.cure of the language is a

great advantage when one has a computing system which can support it.

Error correction and the design of programs become much easier in such

an environment. Although such interactive systems are in the minority

at the moment, we expect that more will became available in the near

future. We shall say more about the REDUCE language itself later in

this paper.

Another major design feature of REDUCE is that it recognizes poly­

nomials as the ba&ic class of expressions handled and therefore has

within it a very efficient and powerful polynomial manipulation system.

Rational function operations and special purpose calculations such as

gamma matrix algebra are built up out of these basic polynomial concepts.

However over the years it has become clear that there are really four

types of. problems encountered in calculations in physics and related

areas .namely:

1. polynomials

2. polynomials with side relations -A-V-4-

j. fntlonâi functions

'i, rational funetintis with tide relations.

Let mû begin by explaining what I mean by uide relations, This

U s Le» lntfodueeti by H. g. Brown several years age te dtietibe « rtUfip of roiflftniio Between algebraic eapreantanB. In REDUCE, lueh relation» are Introduced by a l.liT .ttotoment as In the following

(tanicploe :

LET X - V + :'.; ' '

FOX ALL X,Y LET COS(X)*COS(Y) = 1/2*C0S(X+Y) + l/2*COS(X-Y); (3)

FOR ALL X,Y LET COS(X+Y) - COS(X)*COS(Y) - SIN(X)*SINCY) S (4)

FOR ALL X LET COS(X)**2 + SIN(X)**2 »1; (5)

FOR ALL U,V LET P(U)*D(U,V) = F(V); (6)

In the most general sense, such relations establish the mathematical equivalence between their left and right hand sides, and there is no particular significance to the side of the equation on which a particular expression occurs, unlike an assignment statement in which the sense of a replacement of the left hand side by the right hand si^e is implicit.

However, in order to make the implementation of such relations more

efficient, REDUCE does place some restrictions at present on the form

and interpretation of such relations. A discussion of some of the

problams involved in the implementation of such relations was given at

the last Colloquium [4] and I shall not repeat that here. For our

present purposes, the following observations are sufficient. To begin

with, REDUCE does currently consider such relations in the sense of a

replacement. In other words, if it finds an expression or part of •A-V-5-

an expression which matches against the left hand side of such a relation it replaces It by the right hand side. However, this restriction -aust be relaxed under certain conditions as we shall see later. Secondly, because their implementation is straightforward, we shall exclude simple variable replacements as In Eq. (2) from our present discussion. These

are currently Interpreted as asaijuients by the system, except that

the value of the right hand side is taken at the tine of substitution

rather than the value at definition as in an assignment statement.

We also notice that Eqa (3) and (4) define different parts of the

same set of relationships between certain trigonometrical expressions.

However, because of our replacement interpretation on such relations,

vi have a problem if both equations are present at the same time. For

example, consider the evaluation of the expression COS(U+V). Equation (4)

will cause this to be replaced by an expression involving COS(U)*COS(V).

The system will now evaluate this expression, because the evaluation

mechanism also computes the value of the substituted expression. So the

term COS(U)*COS(V) by Eq. (3) will be replaced by an expression involv­

ing COS(U+V) and so on. T.n other words an infinite loop will result

which the system will recognize and terminate with an error condition.

As a consequence, Eqs. (3) and (4) cannot both be active in a calculation

at the same time.

Finally, a rule such as that given in Eq. (5) for replacing a sum

of terms involves ambiguities in implementation which 1 discussed at the

previous Colloquium [4]. The problem of ambiguity can easily be seen -A-V-6-

lf one considers applying such a relation to the expression 2 coa(x) 2 + sin(x) . It is clear that this can be represented in several 2 2 vays; for example as cos(x) + 1,2 - ain(x) or left as it is. All such forms are of course compatible with each other via Eq. ^5). We shall say more about this particular probieti later on.

If one studies zhe literature of successful applications of symbol manipulation techniques to physical problems one finds that the majority of problems are either straight polynomial problems without any side relations at all or polynomial problems with aide relations. It la hard to find published examples (although they do exist) of problems in which explicit rational function or rational function with side relation techniques were really necessary, although a tremendous amount of important and necessary work Is going into solving such problems.

Even more important, many problems which look at first sight like

rational function problems can often be considered more efficiently as

polynomial problems with side relations. I learned this the hard way!

The current REDUCE implementation provides the user with the rational

mode as a default. In retrospect, this is probably a mistake, because

many users present problems to the system which rapidly get out of hand

wt- n considered as rational function problems, but if rephrased as

polynomial problems remain tractable. Let me illustrate this by an

example which arose in studying a problem in finite element analysis

Ï5]. Consider the calculation of derivatives of thrt. expression

* = (x-2)2(2x-l) - 3y2(x-y-l)(x-2)((x-y-l)/(y-l> + l/(x-l)>.

If this is considered as a rational function problem then the result -A-V-7-

•f computing 3 $/3 x3 ; using the usual default modea in REDUCE is

4 33 3Z 3 3 23 2 (12.* ( - 3>vX + 2<

2 2 2 3 2 *Y - 18.*X j,Y - 21v

432 333233 + 7*Y - 3>vY - 3*Y -

23 222 2 3 2 ivX ivY r 3*X AY - 9j»X .vY + 3ivX -i- 3f,X*Y - 9,vX,>Y + 9,vX,vY - 3«X -

3 2 Y + 3>Y - 3*Y + 1) . 3 3 It is clear that the denominator in this case is simply (X-l) (Y-\) ,

buc even if this replacement wete made, the expression still contains

tightt^n terms in the numerator. On the other hand, suppose we allowed

negative powers in our polynomials. Although this goes against the

••isual text book definition of a polynomial, ic was recently shown by

Dr. RUdiger Loos and myself [6] that such extended polynomials could in

fact be handled by standard polynomial algorithms provided one was a

little careful when one does division. Full details of this modification

are found in the cited reference. Using this representation, the result

after (polynomial) differentia'cion is:

2 t-3) 2 (-3) 1-2) 12ft( - X «(X - 1) - 3ftXftY «CY - 1) + G*X*Y*(Y - 1) +3*

1-31 (-1) (-2) X*Y*IX - 1) - 3ftXrt(Y - 1) + 2v.X*

(-3) 3 (-3) 2 (-2) 2 (-3) 1)'"':'* 2ftY *(Y - 1) - BftY f.JY - II + 4*Y A(Y - 1)

(-1) (-2Î 1-2) -•-+ 6*Y*r.lY - 1) - 8«Yf,(Y - 1) - 3*Y**(X - 1) - GftYftfX

(-3) (-1) (-1) (-2) i .• ^-i_--'f-Hi-J,i4'iiëSi%!ji:^^i.:..ii-j ^{x-^t) - 3*(X - li - 2*(X (-3) - 1) ). -A-V-8-

This expression still contains eighteen terns. However we have not yet taken into account the fact that we are dealing with negative powers and therefore have an implicit side relation of the form

FOR ALL Z LET Z*(Z-1)**(-1) - 1 + (Z-l)**(-l)i (7)

If we now apply this to the above expression it reduces to: (-3) 1-3) 1-3) 12*< - 3ftX*r(Y - 1) - 3*Y*(X - 1) + 6 CY - 1) + 2) .

So by considering this calculation as a pelyno- ial problem with side rela* tions rather than a rational function problem we obtained significantly more compact results, and in addition the calculation took less time.

Of course you cannot expect this simplification to happen in every case, but as I said earlier, a surprisingly large number of problems which were originally tackled by rational function methods were found on reexamination to be better treated by polynomial methods with side relations.

Another aspect of the design philosophy of REDUCE concerns the question of how side relations are actually implemented. Some of the alternative routes by which such problems can be solved are given in

Fig. 2. As illustrated there, a problem with side relations can either

be handled by a general purpose pattern matching program or by the use

of special packages. The choice of which particular route to follow

depends on the environment in which the calculation is done. There is

of course a trade off between the two methods. A problem solved by a

general purpose pattern matcher can usually be specified in terms of

a few commands such as those given in Eqs. (2-7), but because of

the generality of the techniques employed this implementation of side -A-V-9-

relationa tends to be less efficient than the use of a spe<. .ally written package of functions for the purpose. However, it usually

takes a considerable amount of programmer time to write such special

purpose packages, and so if the calculation Is only done a fe\ tines it

is probably more efficient overall to use a general purpose pa. ~ern

matcher. On the other hand, If calculations are to be performs many

times with the same set of side relations, as for example in quantum

electrodynamics calculations, then it is clearly more efficient to

write specific routines to implement the rules.

In point of fact, many of the more successful algebraic calculations

by computer have been done with Bystems specifically designed to do a

certain class of calculations such as those in quantum electrodynamics,

celestial mechanics or general relativity. In many of these cases, a

package of routines which; Implemented some set of side relations were

developed within a polynomial manipulation framework. The question

for the future then is where should one invest one's effort in designing

algebra systems? In other words should one spend a lot of time developing

more efficient general purpose pattern matching procedures or should

one work on designing tools for the easier Implementation of packages

of special purpose functions? Clearly the answer is that both must be

considered. On one hand, designers should be thinking about more

efficient ways for substitution and Implementing aide relations generally.

On the other hand, there la a clear need for developing better techniques

for implementing special purpose packages. The problem up to now in my -A-V-10- opinlon has been that In order to implement such special purpose packages, one must be the corapleat system expert. This might mean that in order to make extensions to a given system you have to find the system designer and employ him (or implore himl) to do the programming for you. Better of course would be the development of tech~ niques which make it relatively straightforward for the expert user to do the same thing. To understand what efforts we are making in REDUCE along these lines let me say something 'now about current developments in the REDUCE language itself.

The REDUCE language in which both user programs and the system itself are written has continued to evolve as time has gone on. In its present form it shows marked similarities to ALGOL 60 although the variable binding strategies are those of the intermediate language LISP.

We are also adding some of the more structured programming forms present in languages such as PASCAL. The result has been a language which users on the whole tend to find reasonably palatable. However more work

is needed in the future to resolve a problem which arises in algebraic

calculations and which is apparent to a much lesser extent in numerical

calculations. Let me illustrate this by an example. Consider the

assignment statement in Eq. (1). In most modern numerical programming

languages, a statement of this sort can be evaluated regardless of the

numerical type of the variables X, Y and Z. POT example, if Y and Z

are both integers then integer addition is performed and an integer

results. If Y is a floating point number, and Z an integer, then Z is -A-V-ll-

converted Into a floating point number and a floating addition is performed, and so on. In an algebraic context, the range of possibilities for the types of the variables Y and Z is much larger, and so the semantic resolution of what the addition operation actually means in eich case is much more difficult. Most algebra systems presently in existence avoid this problem by interpreting the meani^ç of the addition operation at execution time. Thus at execution time the system checks to see the explicit type of Y and Z and performs the appro­ priate addition operation on them. Ideally, if sufficient information

about Y and Z is available when the expressions are being parsed then

this particular resolution could be done then and the appropriate

function such as that for integer addition, polynomial addition or

rational function*addition, and so on, could be chosen. At present,

the programmer, in order to gain efficiency, must do all this himself.

Tn other words,' he must currently write procedures which make explicit

calls - to the appropriate addition function, for example, and explicitly

convert arguments to the right form, as one had to do in FORTRAN 2 with

functions like FLOATF for floating a fixed point number. Thus in the

current version of REDUCE, if the above assignment statement occurred

in a procedure in which Y and Z happen to contain polynomials in the

REDUCE Internal representation, then the following statement would be

used'irt'the program:

-•&:• - ADDF(Y,Z); (8)

where A1TOF is a REDUCE function for adding such forms. -A-V-12-

This gain of efficiency of course Imposes a burden on the programmer, namely that he must learn the explicit names of all such functions and use them In the right context. Clearly, this Is a job which should be done by the program itself and not the user! In fact, this is essentially the problem of mode resolution which is considered in great detail in the design of ALGOL 68. Our future plans for REDUCE include such a mode analysis scheme in our translation step. The net effect of this will be that a user can write much more natural programs for symbolic manipulation which are as efficient aa these coded in terms of the explicit functions required far each operation.

I think there are a few important observations which can be made at this point. Although I appreciate that my philosophy here is in conflict with some of the other workers In this field (especially

some at this meeting) 1 feel that it is important that users be aware

of some of the developments in computing which influence these questlonb.

During the last twenty years we have experienced a computer revolution,

and, in particular, the digital computer has completely changed the way

we think about scientific problem solving. I believe however that

another revolution is in progress at the moment which again within ten

to fifteen years will have completely changea the way we currently think

about computing. The problem up to now has been that the calculations

which we are talking about at a meeting such as this have required1very

expensive computing equipment and in many cases have only been possible

ac really large commuting centers. However as I am sure many of you are -A-V-13- aware there has been a dramatic decrease forecast in the costs of computer central processing units and memory during the next decade or so. In fact, in addition to suggestions that computer memory may coat as little as one thousandth of a cent per bit by 1985, some reputable hardware experts have even projected that a computer equivalent to the

IBM 7090 (excluding peripherals) with which many of us are familiar will be available as a chip for approximately $1! [7] At that point concepts which are of great concern to us at the moment such as size

of programs and execution speeds will become secondary to what will be

ths much larger costs involved in this field, namely system development

and programming. It is clear to me that in this environment the systems

which survive must possess a very flexible 'easily understandable high

level language architecture. Automatic programming systems of the sort

discussed by Dr. Keith Roberts [8] and now being considered by several

research groups including our own must form the basis for programming

efforts at that time. Therefore our philosophy with REDUCE at the

moment: is aimed towards automating a lot of the procedural steps which

currently the programmer has to perform.

There are several avenues which must be followed in order to

provide the tools necessary for utilizing the architectures and

machines which ate around the corner. For one thing (and to a certain

extent this may go against what I said earlier about large memories)

programs must become more modular and the interfaces between each

module designed better than has been true up to now. There is a Teal -A-V-14- practical reason for this approach to programing; recent work, on verifying the correctness of programs emphasizes the difficulty of trying to resolve ambiguities if the program is not structured properly. Thus if we are to provide a programmer with some sort of verification tools to help him write programs which are correct and to provide him with useful error diagnostics when things go wrong, the basis for this programming development must be modular in structure.

Another development which we are also looking at concerns the use of specific descriptors and constructors for building up parts of algebraic expressions. Consider for example the classical definition of a polynomial: n p(x) = Z a xV (9) v=0

n-1 n V =aQx + l a x (10) v=0

Farts of this polynomial are given standard names in the literature, n-1 Thus a x is the leading term, Sax is the reductum. x the main

n — v=o v —

variable, an the leading coefficient and so on. Algorithms for operations

on polynomials are usually given In terms of these descriptors. However

the implementation of these algorithms in most current systems is in

terms of system functions which apply to the explicit data structures used

internally to represent polynomials, and bear little relationship to the

mathematical descriptors. It was pointed out by lobs [9]i'.'however.'» that

one could use a set of standard names for such descriptors and wribe the -A-V-15- computer implementation of the algorithms in terms of these. The result is a program which makes no reference to the explicit data

âtructures in the computer. Information about these is Included during

the parsing of the program in such a way that no efficiency is lost in

the execution nf the resulting code. We are currently working on

incorporating tliese ideas into the basic REDUCE system and other systems

which are evolving out of REDUCE.

After that 1OAJ> digression, let us return to Fig, 2. A second

option open in designing a, system with side relations concerns the

structuring of the result. In REDUCE, for example, a lot of effort is

spent on producing palatable output of expressions. Some people

consider this a waste of tine but ray usual response to such comments

is that the improvement in comprehensibility which results from spending

some time on structuring the output is worth the effort. In fact, the

production of the output in REDUCE sometimes takes as much time as the

evaluation itself, because of the calculational complexity of the output

formatting! Moreover, whenever side relations are involved the problem

becomes even more complicated. From a mathematical point of view, it

is usually better if one keeps results internally in a canonical form;

that is in a form in which two identical expressions h,ive the same

internal structure when converted to this form. This enables tests

for equality arid'"addition of terms for example to be performed most

efficiently.. However if one simply outputs the canonical form in

standard mathematical notation it is often not what the user wants. -A-V-16-

The user may be looking for symmetries or compactness in the result which are there if the side relations are employed in a certain way but which are lost when the expression is kept in the system's canonical form. A good example of this may be found in Ref [10] in which an expression which arose in a calculation in quantum electrodynamics was reduced in size by an order of magnitude when the appropriate set of side relations were judiciously employed. In such a case we are truly regarding the side relations as equivalences with each aide of the equation having equal weight rather tnan in the sense of assignments

in which the left hand side is replaced bv Lue right. The implementation

of such an interpretation of the side relations to bring about expression

size reduction is currently possible in REDUCE only by hand intervention,

using the computer as a mathematical scratchpad to verify that the hand

operations are correct. The result is an expression equivalent to the

original expression, which ia inherently more satisfying tc the user

hut which is no longer canonical from the program's point of view. The

question then is whether we can develop a reduction procedure which will

lead to an aesthetically pleasing result in terms of size, symmetries,

and so on, but which is still canonical. This is an unanswered question

at present but one to which a certain amount of thought should be gin n.

In conclusion» I hope that you can see from this account that

REDUCE remains a dynamic and viable system for computer algebra. The

developments which I have discussed have in many cases.resulted from

suggestions . from the many users of the system. , I woulîl I.owever like

to thank in particular Dr. RUdiger Loos whr-se ideas and suggestions -A-V-17- durlng the last few years have had a considerable influence or the development of the system.

REFERENCES

[1] See, for example: HEARH, A.C., REDUCE, a User-Oriented Interactive System for Algebraic Simplification. In KLERER, M., and REINFELDS, J., Interactive Systems for Experimental Applied Mathematics, Academic Press, New York and London (1968) 79-90 HEARN, A.C., REDUCE 2; A System and Language for Algebraic Manipulation, Proceedings of the Second Symposium on Symbolic and Algebraic Manipulation. ACM, New York (1971) 128-133

[2] See, for example: BARTON, D. and FT.TCH;, J.P., Applications of Algebraic Manipu­ lation Programs in Physics, Reports on Progress in Physics 35 (1972) 235-214

[3] HEARN, A.C., REDUCE Î User's Manual, Second Editior, University of Utah Computational Physics Group Report No. UCP-19, March 1973

[4] HEARN, A.C., The Computer Solution of Algebraic Problems by Pattern Matching, Proceedings of the Second Colloquium on Advanced Computing Methods in Theoretical Physics, CNRS, Marseilles (1971)

[5] BARNHILL, R.E., BIRKHOFF, G. and GORDON, W.J., Smooth Inter­ polation in Triangles, General Motors Research Laboratories Publication GMR-1064 (1971)

[6] HEARN, A.C. and LOOS, R.G.K., Extended Polynomial Algorithms, Proceedings of ACM 73, ACM (Nev York), (1973) 147-152

[7] FOSTER, C.C., A View of Computer Architecture, CACM 15 (1972) 557-565

18] ROBERTS," K.V., Computing Methods in Plasma Physics, Proceedings of the Third Colloquium on Advanced Computing Methods in Theoretical Physics, CNRS, Marseilles (1973)

[9] LOOS, R.G.K.,, Algebraic Algorithm,. .Descriptions as Programs, SiGSAM'BÛÏletinV^ACM, 'New Ypick, No. 23 (1972)'16-24

[10] HEARN; A.C., The Problem :)f Substitution, Proceedings of the 1968 Summer Institute on Symbolic Mathematical Computation, IBM Programming Laboratory Report FSC 69-0312 (1969) 3-19. -A-V-18-

REDUCE INPUT

(TRANSLATOR}

LISP INPUT

-(COMPILER}

(JVALUATOTP)

LISP OUTPUT

(TRANSLATOR])

REDUCE OUTPUT

REDUCE COMMAND LOOP

Figure 1 -ft-V-19-

PROBLEM WITH SIDE RELATIONS

GENERAL SPECIAL PATTERN PACKAGES MATCHER

V

CANONICAL READABLE -<—>- RESULT RESULT

Figure 2 - A-VI-1- Novetnber 1973

NEU EXACT ALGEBRAIC ALGORITHHS

Rudiger G. K. L009

Computer Science, Univaraity of Utah (Salt Lake City, 84112, USA)

ft WorK Bupportad by NSF grants GJ-30125x and GJ-32181. Computer time supported under ARPA Contract F3a6B2~7B-C-B3BB. -A-VI-2-

1. INTRODUCTION During the lait few years the distinction between numerical an- BO called symbolic algorithms has turned out to bs qui ta fuzzy* The mathematleal content la the same and vary often the amount of ar ith-iet ical operations performed In a symbollc computation is greater than in the corresponding numerical computation. Prom a theoretical point of view today the only viable distinction between both areaa saemB to be exaci.-ises. Since physiciete are one of the biggest UBBT groupa for numerical algorithme one doee not have to tell them that from a practical point of vieu both areas look very different , mainly dL* to the hardware and software especially designed for numerical programming systems. Us restrict ourselves in section 2 to recent work on greatest common divisor (g. c. d. ) and in section 3 to factorization algoriîhms for polynomials over the rational integers. In Bection 4 we discuss how the idea of exactness can be be extended to other domains and focus our attention on algebraic numbers.

2. GREATEST JOrtTON DIVISOR

2.1 INTEGER ARITHMETIC

The integer arithmetic which can be performed on current computers is restricted by the computer uord size to integers no larger than typically IB decimal digits. Under this restriction exact aigebraic operations can only be performed modulo p where p 1B a pr imir chosen such that no overflow occurs- There are not many direct applications of interest for arithmetic in such a finite fieid. called a Galois field GF(p), but ue wi I I see later that one can make efficient use cf this arithmetic in aubalgor Î thms, in particular if one can chose the prime p near the computer uord size. In 19G1 G. E. Colltnstl3] designed a method to make the integer arithmetic independent of the computer word size and to allow for infinite precision. Since the size of integers varies considerably during a calculation in an unpredictable manner ha uses chained link etructures of dynamically varying size. The arithmetic is performed in a base J3 which ie close to the computer word size such that the dig! ta In this representation, the /3-dig'its, can be held in a single uord. On a PDP-1B computer the trade-off for integers in ^-representation and floating point representation is given by four (3-digits. Fo^- larger integers floating point overflow occurs. U. S. Brown [63 points out that uithaut exact integer arithmetic even the degree of an integral polynomial depends on the round-off error propagation of the coefficients. Collins states that arbitrarily large coefficients are "natural since computers are now fast enough that any restriction imposed by the word length of the computer are artificial and unnecessary. It is also important since only the most

trivial algabraic opérations on polynomials can be performed :'--ulthout generating Integer coefficients which are 120 or more dectabts digits in length. Frequently the final result will have coefficients of modest size, but obtaining this result requires the generation of polynomials with very much larger coefficients."[15] -A-VI-3- 2.2 AN ABSRACT MODULAR ALGORITHM

Never thai ass oparationB on \on- integers ara coat Iu and ona attempts to minimi:» their usa aa much as possible. A very successful I way to do this ia provided bu the class of ths so called modular algorithms. Us give an abstract skeleton of such an algorithm, say to perform the binary operation "op" on tuo integers A and B for obtaining the result C over the integers I.

C - A op B

docl A,B,C t 1.

(1) [Bound] Compute r primes pi pr such that ICI

!2) [flap] For i-l..r set A! •• A mod pi,Si •- B mod pi.

(3) [Modular op] For i-l..r set Ci «- Ai op-.v Bi mod pi.

(A) [Reconstruct] Using the Chinese Remainder Algorithm [28,p253]

compute C 'from the images Cl....,Cr. II

The important point here is that only in step 12) and step (4), 1. e. on the eurfaca of the algorithm, long integer arithmetic is used. In practice [4,17] the steps .are performed sequentially for each prime. Also step (1) may be drooped and a test may be added if sufficiently many primes were processed to obtain the result. Of course in order to make the abstract algorithm effective some theoretical assumptions have to be made on the operation "up". The algorithm applies a homomorphism, the mod p operation, ano performs the image operation "op>v* on the input images over GFlp). One could be tempted to replace all long integer operations by calculations over GF(p) for several primes. However, since the integers form an integral domain uhereas GF(p) is a field there are algebraic differences. For example one cannot calculate the remainder or the g.c'.d. ' of tuo integers by this method since both are trivial over a field. For mora information the interested physicist is referred to "Modular Arithmetic and Finite Field Theory: A Tutorial" by E. Horoultz in [ZBJ. Also Chapter ft of Knuth's [Z81 "impressive one man encyclopedia" (Straaaen) provides a selfcontained treatment; hciuevsr, long integers of fixed size, not of varying size are dealt uith.

2.3 SYMBOLIC ADJUNCTION AND SUBSTITUTION HQtlOTIORPHISM

NBXt ue consider polynomials oyer the . integers I. For applications the restriction to integers seems tb.be intolerable. But let us consider a polynomial over the rational numbers Q. Clearly it can be transformed into an integral polynomial with a rational integral denominator. It turns out that this can be an efficient nay to handle such polynomials. Finally ue observe that the so called "real" numbers In FORTRAN, ALGOL GB, or ALGOL G8 are mathematically rational numbers in floating point representation. -A-VI-4- Tt-io pr?cGsa of adjoining an indeterminate « to a domain D Is called symbolic adjunction and the new domain is denoted by DIHO, The procaes may be iterated, resulting in the domain 0[M1HX23 ... [xn] nf\era xn is called the main variable. The nam a "variable" may be misleading In this context. A variable la defined with respect to a set of possible values which it may possess. The concept of an indeterminate Is not defined with respect to such a set» although an indeterminate may bs restricted to be or to become a variable* Since in turn functions are defined in terms of variables one hae to distinguish between polynomial functions and polynomials and between rational functions and polynomial quotients evan if one folIOWB the common use of these words. Ue conclude that exact algorithms on integral polynomials require not only infinite precision integer arithmetic but a!so a consistent implementation of symbolic extensione by means of indeterminates. The inverse process of going back from an extension 0 Cx] to the domain D by substituting an element a*D for x defines a second homomorphic mapping which is called a substitution homomorphtsm. Nou by the Remainder Theorem for polynomials to substitute a for x in the polynomial AU) is equivalent with taking the Euclidean remainder of A(x) uith respect to *-3, A(K1 - OU) U-al + flU). Since the degree of fl must be less than the degree of x-a R is indeed an element of D A (x) a R mod(x-a).

2.5 MODULAR POLYNOMIAL g.c.d. ALGORITHM

It is important to observe that in a given domain algebraic "e ! at ;c-3, a~.o ..i-.b digontnms oased on them, depend exclusively on the algubraic structure imposed by the connectives, but that they do not depend on the properties of the individual domain éléments. Therefore the abstract modular algorithm fi.- integers can be extended, except for step (U, to polynomials in n-1 indeterminates, replacing the primes pi,..., pr by the irreducible polynomials xn - al.xn - a2,...,xn - ar, and replacing the mod pi operations by mod(xn ai) operations. The Chinese Remainder Algorithm extends to polynomial interpolation. From here it becomes also clear that the number of interpolation points ai, the bound in step (1), depends on the degrees of the polynomials in xn. Combining the algorithm for I with the algorithm for several indeterminates we arrive at the abstract modular algori thm for I [MU 1X21.. , txn] which is diagrammatical Iy given by

Hxll... ïxn]

mod pi/ \ Chinese Remainder

GFlpi] [xll -A-VI-S- Ueing this approach Collins 19) preoanted, in 1938, an outline of a modular g.c.d. algorithm for several variables. In [28] Knuth glvao a version In uhich first the substitution homomorphlsm is applied and then the I -> GF(pi) mapping. This approach doee not minimize long integer calculations [IB]. In 1971 Broun [4] published a version in uhich the termination condition relieB on the cofactorB, i. e. the Input polynomials divided by the corresponding g.c.d. . The cofactore are also constructed by the algorithm. In Broun [4 ) the reader find9 tne exciting story of polynomial g.c.d. research. An in depth -reatment of "Chinese Remainder and Interpolation Algorithms" is given by J. 0. Lipeon[291.

2.S PERFORMANCE In [141 Collins 6houe by measurements on randomly generated polynomlale that the modular g.c.d. algorithm i& orders of magnitudes faster than the improved versions (primitive, reduced ar.d subreeul tant) of Euclid's algorithm, uhich are a i so due to the former [7,8J. Theoretically this observât ion ia bacKad by the computing time ana I usie in [4] and [9]• For a fixed number of variables the maximum computing time IB a polynomial function of the degrees and the length of the Integers involved. In the number of variables the algorithm ie exponential as all ring operations on polynomials. It ie important to note that the algorithm applies, finally on the bottom of the recursion over the variables, the Euclidean algorithm on univariate polynomials over a field. Hence the problem of defining a pseudo remainder algorithm [28,p3B8 ) over I M does not arrise. It is the pseudo remainder algorithm which introduces integral factors at an exponential rate in the generation of the polynomial remainder sequence ir. order to Keep the operations over I and to avoid costly operations over Q. A 6im.lar advantage result*: if o.nr- .^i/.r ; ieô the ::.ùcï~' - algorithm to other operations, e.g. to matrix inversion [18,33 ]; finally, the algorithm applies classical Gaussian elimination over the field GFtpï; therefore all divisions are exact. Before we turn back to a more recent g.c.d. algorithm by J. Moses [34] ue deecibe modular factorization algorithme becauBe Moses* algorithm ie based on subalgori thms used in the factorizt ion process.

3. FACTORIZATION

Let A denote a polynomial over' I [xl]... [xnl. A simple a I gor I thm bas«3d on a g.c.d. calculation of A and dA/dxn may be ueed to detect repeated factors Al,...,At of A such that A - aiVAl>vA2iW(2ivA3>Wt3...At,'.-.vt. Here a denotes the g.c.d. of the coefficients of A considered aB polynomial in xn; this g.c.d. is cal led the content of A and A ie called primitive if this g.c.d. is 1. The factors : Al,...,At are called squarefres, because by construction they do;not contain repeated factors any more. To split a.j/flçlunowiarv^lntoijj'tsyçpiitënt- and its primitive part; or., to calculate ;ith'B;VsquarjB'frêe"ffct^rs^!a''khbùri:;às an' incomplete ^factorization. In :cohtraèi:3a^-completë^fàctérizatlôn splits a polynomial in irreducible factors which'are unique up to' the sign.and the order. -A-VÎ-6-

3.1 BERLEKAMP'S AJ30RIThTI

The claaBical factorization algori thm by Kror.ecker la described and analyzed in [151. The algorithm for DM assumes that » complete factorization algorithm le available for the domain D. The algorithm ie not practicality useful except for polynomiale with very email moduli of the coeffIcienta and rnodeet degrees. Also Kronecker's method dees not uork for GF(p) tx] , ao the usual modular algorithm is not appi'caaie. In 1967 Berleksmp El,2] discovered a very faet factorization algorithm for polynomials over GF(pï [x] which has a polynomial maximal computing time function and is described in detail in £28 J . The a igor .thin is espec i a I ly efficient for smal I pr imes p, but in 13G9 Berlekamp [3] designed another algorithm the average computing time of uhich goes with 1 nIp) af though the I computing time depends on p ln(p). However, the abstract modular algorithm is still not efficiently applicable. The reason 'is that tne Ctiinese Remainder Algorithm can not distinguish the images of two irreducible factors of the same degree out has to try, for k images, all 2v<>vlk-l) possible combinationa.

3.2 HENSEL'S LEnriA

In 1968 Zassenhaus [431 proposed the use of Hansel's constructive p-aaic !emma [25] for passing from a factorization over GF(p)[x] to a factor'zat,on over I [*] . Let

A » A( (xWrA-t tx}*,. .ivAr (x) mod p

be an irredocitue factorization modulo p. Then Hanoel'a lemma allows one to construct a sequence A,*1.. . A^'such that

A a A(j'(x) -fAjUhv. . .* A^'(x) mod pL

The algorithm proceeds until pvnvi > m, where m ie a precomputed bound depending on the coefficient size of the factors. Here the arithmetic is performed in the range -lpftfti/21 Ipttfti/2I. Then after at most 2iTnvtr-l) rrial divisions the irreducible factors of A over I can be computed. These trial divisions are still required because the number of factors nodulo ptavi may differ from the number of factors over Î. For exampl s the polynomial KA*4+1 [28,exercise 4.6.2.12] spl i ts modulo every prime in factors but is irreducible over I. However, in the average this is quite unlikely and Collins US ] conjectures a polynomial bounded average computing time. An implementation of the algorithm was first given by D. tlusser [19,351 who also proveo that no Barlekamp-Hensel-type factorization algorithm has a polynomial bounded maximum computing time. In much the same way as in the case of the modular g.c.d. algorithm the Hensel construction can be extended to the case of several variables. Algorithms are given by.RothschUd andWang .&21; and Nusser [3G]. tlusser has also-obtained empirical^ computing, ./times ;! on randomly generated univariate polynomial s with.degree going from

18 to 20 and coefficient size9 from 2vnv7 to 2ftft21( ; where also sometimes factors were introduced. The times range from .38 to 27.3E s in a SAC-1 U21 implementation on a UNIVAC 1108 computer. It is quite unthinkable that a human being' could' have obtained these results working by hand. -A-VI-7- 3,3 MODULAR ALGORITHMS REVISITED

A polynomial having same zero coefficients is called a sparse polynomial, otherwise a dense polynomial. The computing time analysis of the nodular g.c.d, algorithm has shoun that asymptotically the algorithm Is as fast as a single multplication. Houever the time of the algorithm ts quite Insensitive to a possible sparsenese of the input polynomial a since the interpolation depends exclusively on the degreee and not on the number of actual present terms. Since the classical multiplication algorithm does not depend explicitely on the degrees but only on the number of terms, one can expect the favorable behavior of the modular algorithm comparée as to multiplication only for nearly dense polynomials. The question arises uhethar or not for Bparse multivariate polynomials there is a better algorithm depending on the terms Instead of the degrees. Clearly all algorithme using a psoudo remainder algorithm designed for gparae polynomials should have the desirid property. lf> 1972 in 121) an improved version of Colling' subresultant g.c.d. algorithm uas announced based on the observation that the pseudo remainder algorithm introduces sometimes extraneous factors in the remainder sequence. However, this observation is only true far a pseudo remainder algorithm designed for dense polynomials [28,p3G8], because if the algorithm is designed for sparse polynomials as in [21] fhe factors are left out automatically. Hence the g.c.d. algorithm which uas released in REDUCE [201 attempts to divide out factors uhich are in general not there and fails. In 1973 Moses and Yun [34] developed a new g.c.d. algorithm based on the Hensel construction and called it EZ-algorithm (Extended Zassenhaus algorithm!. First the polynomials are made primitive and reduced by substitution homomorphisms to polynomials over I tx] . Then the univariate modular g.c.d. algorithm is applied and one polynomial is split in its g.c.d. and its cofactor. Assuming that both these factors are relatively prime a Hensel construction for polynomials in several variables '8 appliod and followed by a division teet. The same Hensel construction is used by Rothschild and Uang [42] for multivariate factorization; it differs from Musser's version. If the factors arB not relatively prime a variant of the EZ-algorithm handles this special case. The important point here is that the Hensel construction seems to preserve the sparseness of the polynomials, a fact which is not yet finally established by a computing time analysis but which is backed by empirical obeervatione uncertain classes of sparse polynomials. For example, for both the polynomials

:F - Ul-x2i.x3+l) Ixl-x2+3*x3>* and G- (xl-x2,-.x3+l)*'lxl-x2+3+x3),

presented-aa IriputB'in expanded form, the HZ-aIgorithm needs 4.2 a, the modular" algorithm 18.5 s and the reduced g.c.d. algorithm more than IB minutes (the same order of magnitude has to be expected for the subresultant g.c.d. algorithm! in ths MACSYHA-systsm [32] ana POP-10 computer. For more measurement!! the reads-- is referred to [341. -A-VI-8- In spite of these rooulto It lo nearly impossible to glva practical acJvicj as to uh'-ch algorithm to use. Obviously, the be»t Miy uouici be to have a collection of algorithme optimally tuned to certain classes of polynomials and automatical Iy selected. Unfortunately not much le'know about the average computing time of the algorithms and it is often extremely hard to gain this knouledge.as may be seen from the complete analyeia of the Euclidean algorithm for integers in 1273 and till. Certainly it Mould be prematura to select an algorithm by considering tha properties of the inputs in a aiven problem area. Very seldom a user has to apply the g.c.u. algoritr-ii directly to the input : instead tha algorithm is called over and over aga ' n on intermediate steps where the properties of the polynomials can differ drastically from the input or output characteristics. Tne oest u3y to a successfully computed solution is a c!e3r understanding of the mathematical methods involved and full access to the implemented algorithms. Qnce mi re the interested reaaer 15 -eferred to Knuth Chapter 4 [28] and to Collins' survey paper tlbl.

4. EXACT A_uORITH!1S FOR ALGEBRAIC NUMBERS

In this section ue shou how on the basis of the previously discussed exact algorithms new algorithms can be constructed e«tenaing the idea of exactness to algebraic numbers. Us restrict ourselvw to the underlying ring of the integers and also to real algebraic numbers. A self contained development of the theory ie given in [30] and a deta'-led description ai the algorithms in [311. The basic idea for operations on algebraic numbers is the fol I oui ng. Let p t x) c Î tx] be a po I ynomi a I ni th pos i t i ve I eading coe f f i c i ent uhich is pr imi t i ve and square free. The 1 at ter property implies that the x-a*is cannot be a tangent to the polynomial graph. lie say p(x) is a defining polynomial for the algebraic number a if p has the described properties and p(a)«0. But since p(x) in general defines not only a but also other algebraic numbers different from a ue need aome tools for indexing different algebraic numbers. We chose intervals ulth rational endpoints isolating a from othsr roots of p(x). An algerraic number is nou defined by tne pair of it's solating interval and the defining polynomial. In order to perform arithmetical operations on algebraic numbers one needs arithmetic on intervals, arithmetic on defining polynomials and some means to insure that the resulting interval ie an isolating interval of the resulting polynomial.

4.1 ARITHHETIC ON ISOLATING INTERVALS

Uith exact integer arithmetic at hand one can implement exact rational number arithmetic using the efficient algorithms of Henrlct and Broun- C24J. A left open ar.^ right closed interval is represented by a pair of integers. Given two: .; intervals ^Ntx.y] -and J-tv,û3 ja binary arithmetical operation ... • on' intervals-; is defined": by

K-I*J-ïmintx«v,x»u,y»v,yBuï,max{x»v,xew,y»vly*u)]f where r in the case of division, J must not contain the origin.- We may cons i dor the process o f genera t i ng an i so i a 11 ng interval'. Starting uith a defining polynomial p(x) one computes an integral bound c such that all roots of p are in Izl < b. the starting interval t-b/l.b/ll ta then bisected and Sturm*9 Theorem applied to the endpoints giving the number of real roots in each -A-VI-9- eubInterval. The process is repeated until Bublntervals containing only a «Ingle real root ara generated. If b is chosen to be a pouer of 2 all Integral roots are detected exactly. Exact roots are represented by a pair of identical rational numbers. Isolating intervale and hence real algebraic numbers may be refined to any given precision by bisection and by considering the sign of p(x) on the endpolnts. A package of algorithms for real root isolation and refinement was designed and analyzed by L. HaiMel [IE.22,23). The application of Sturm's Theorem requires the gene -=tion of a negative polynomial remainder sequence of p(«) and p' (x) and is therefore closely connected to Euclid's algorithm and its improved variants.

4.2 ARITHMETIC ON DEFINING POLYNûTlIALS

Given tuo defining polynomials Alxl» H^a.x'- a^TT,, (x-o;)and

B(x)-2ir,bi x' »bRTE1*(x - (J;), how can ue generate a polynomial C(x)-c T7^x-f;) euch thatjj»" a » 0, where » denotes a binary arithmetical operation ? The Prithmetic of defining polynomials is based on the concept of the resi-1 tar.i. The Sylvester matrix of A and B is the m+n *"»y m+n matrix

| a a a "| J m m-1 a i I a a a I I » m-1 0 | I I I a a ... a | I m m-1 8| » j D b • b b | [ n -1 1 8 | I b- b | I n a I I I I I I I I d •-• b | I n 8| l_ _l

The upper part of. M conai3t9 of n rows of elements of A, the Ic'-ier'part of m roue of elements of B, where all entries not shown are zéro.:.The. resultant of A and B is defined by

res(A.B) - det(tl).

Based on the fact that the resultant is a symmetrical function of the roots a and 0 IW one can prove Bfl the following Theorem which «olvea the problem of the arithmetic on defining polynomials botn for real and complex algebraic numbers s -A-VI-10-

Thaorem

m n Let Ai*).a || (x-u ) and Bl»).b || (x-0 ) be ra i.l i n ).l J polynomials of positive degree over an Integral ijomain R ulth roots a ,....0 and (J 0 respectively,Then thi polynomial 1 m 1 n

(nn n m m n r(x) . (-1) ga b II || (x-Y ) m n i»l jol i j

has the m>n roots.not necessarily distinct, euch that

(a) r(x|.res(A(x-yl ,B (yl I , t -o +(> , g-1, 'i ' i

(bl r WL. es(Aix+y) ,Biy)), ï -a -0 , g«l, ij ' j

m (c) rtx)

g-l-l! BIB) /b .

For practical applications it ie sufficient to consider only addition and Multiplication, bacauaa tha polynomial A(-x) has the negative roota and tha potynomiai xtavnnvAtl/x) the Inverse roots of the polyfomial A(x), Hence ue arrive at ths

Aigpr i thm (Algebraic number arithmetic)

Input; Let R be an Archimedian ordered integral domain. a,0 are algebraic numbers represented by tuo isolating intervals I,J having endpoints in 0 and by two defining polynomials A and B of positive aegree over R.

Output: An isolating interval K and a defining primitive squarefree polynomial Cïxï representing t»d+0 lor YMOA0 for • fliultiplication),

11)[Résultant! - rlx)»res(A(x-y),B(y)) m (r (x)-res(y A(x/y),B(y!) for multiplication)

2 f (2) [Squarefree factorization] rlxLD (x)0 (x) •••0 (xl , 12 f -A-VI-11- (3) [Root Isolation] Generate isolating in'.rrval» or netzngles 1 ..... 1 ,...,1 such that every root of D !l contained 11 lg fg I .1 f in exactly one I and I nl «0, lsi.ksf, lsjsg , Is I Sg , i) ii Kl 1 k (l,j)»(k.li.

W) [Interval arithmetic] Set K-UJ ll*J for nul t Ipl ication) using exact inteval arithmetic over Q.

15) [Refinement] If there is more than one I such that Knl «8 '-i ii bisect 1 and J and gc back to 9tep (A). Otheruise return K and Clxl-O (x).|| i Algebraically speaking the algorithm perforas arithmetic in the field of all algebraic numbers. The important point compared to the ueual Interval arithmetic on floating point numbers liée in the fact that no Information is fast during the calculation. There fora ue can prescribe the precision even after having performed the operatione on the algebraic' numbers. The algorithm uses minimal precision to irdure that the Intervals isolate the resulting numbers. However, in every calculation occur only a finite number of real algebraic numbers.Then by the classical Theorem on the primitive element [411 one can replace calculations over the algebraic extension Q(al,o2,...,an) by calculations over a simple extension Q(ct). Again a resultant relation is the constructive base for calculating a from al,...,an. One uill certainly prefer this approach if many operations have to be performed on the same set of algebraic numbers. A package for arithmetic over Q(a) and Qtai Cx] Mas designed and analyzed by C. Rubald [391. In [31] an algorithm based on the Theorem of the primitive e.ement is described. The a I go. ^m has many possible applications. Ue mention the exact solutioi. of non-linear eystems and exact 6?cisionB in Tarski's Elementary Algebra and Geometry [401. Also the algebraic case of Rioch's algorithm for integration in finite terme requires arithmetic on algebraic numbers [381.

4.3 CONCLUSION

Ue have illy covered a small amount of the recent uot-k on exact algebraic algorithms. Although many of the algorithms deserve extensive practical testing and improvement there is no doubt that they util become the base for further progress in this arsa. Ue believe that the computer uill in future not only aBeist in solving problems'of extreme (physical) size but also of extreme logical complexity. ^,Ue , are, on I y at the beginning . Ue do not yet understand hou to deei-jn an optimal algorithm for multiplication of sparse polynomials." but ,ue do know that the questions of representation, language, design philosophy and evsn hardware are of second order uhen compared to the question of how good the algorithm is. -A-VI-12-

5. REFERENCES

[1J E . R. Berlekamp Factoring Polynomials over Finite Fields, Bel. system Tec:>. Jour., Vol. 46 (!'" ', pp. 1853-1853.

C?] E. R. Berlekamp, Algebraic Coding Theory, McGrau-HIII, Nsu -orK, 19S8.

[31 E. R. Berlekairp, Factoring Polynomials over Large Fin;te Fields, Hath. Comp.. Vol. 24, No. Ill (July 197B). pp. 713-735.

[45 V S. Broun, On Euclid'o Algorithm and the Computation of Polynomial greatest Common Divisors, Jour, A. C, M., Vol. Its, No. 4 (Oct. 19711, pp.478-584.

151 U. S. Broun, ALTRAN User's Manual (2nd ed.), Bell Laboratories. Murray Hill, N.J., 1372.

IE) U. S. Broun and J. F. Traub, On Euclid's Algorithm and the Theory of Subresul tants, Jour. A. C. M., Vol 18, No. 4 (Oct. 1371), pp. S15-S32.

[7] G. E. Collins, Polynomials Remainder Sequences a.id Determinants, Am. Math, rionthly. Vol. 73, No. 7 (Aug.-Sept. 19BB), op. 788-712.

(8) G. E. Collins, Subresultants and Reduced Polynomial Remainder Sequances, Jour. A. C. M., Vol. 14, No. 1 (Jan. 19B7!, pp. 128-142.

(9J G. E. Collins, Computing Time Analyses for Seine Arithmetic and Algebraic Algorithms, Proc. 13B8 Summer Institute on Symbolii Mathematical Computation, pp. 195-231, IBM Federal Systems Center, 1968.

[IB] G. E. Collins, The Calculation of the Mul ti vari ate Polynomial Resultants, Jour. A. C. M., Vol. 18, No. 4, (Oct. 1971), l-o. 515-532.

Ell] G. E. Collins, The Computing Time of the Euclidean Algorithm, Stanford Univ. Camp. Sci. Oept. Repart Ni. CS-331, January 1973, 17 pages.

1121 G. E. Collins. The SAC-1 System: An Introduction and Survey, Pi-oc. Second Symposium on Symbolic and Algebi'aic Manipulation, pp. 144-152, Assoc. Comp, Mach., Neu York, 1971.

[131 C, E. Collins, ThB SAC-1 Integer Arithmetic System-Version III, Univ. of Wisconsin Comp. Sci. Dept. Tech. Report No. 15S, Jul, 1972, B3 pages. -A-VI-13-

!14J G. E. Collin», Tht SAC-1 Polynomial GCD and Résultant Syitem, Univ. of Ul«eon*In Comp, 5;.. Dgpt. Tech, Rsport No. 14S, F-b. 1972, 93 pagui.

[151 G. E. Colline, Compute" Algebra of Polynomials and Rational Funct'ors, Am. Hath, '."intnly, Vol. 80, No. 7 (Aug.-Sept. 1373), pp. -"r-7-v,

US] G. E. Collins and L. E. Ksindel, The SAC-1 Polynomial Real Zero System, Univ. of 'ri'.sronsi.! Comp. Sci. Dept. Tech. Report No. 9", Aug. 1370. 72 Paget.

[17] G. E. Collinss. L. E, Heindel, E. Horowitz, M. T. McClellan and D. R. Mueser, The SAC-1 Modula. Arithmetic Syetem, Univ. of Uieconeln Computing Center Tech. Report No. 10, Juna 1969, 53 pages.

US] G. E. Collins and 11. T. ricClellan, The SAC-1 Polynomial Linear Algebra System. Univ. of Uisconsin Comp. Sci.

Dept. Tech. Report No. 1S:4, April 1372, 1B7 pages.

[19] G. E. Collins and 0. R. Hussar, The SAC-1 Polynomial Factorizat'on System, Univ. of Uisconsin Comp. Sci. Dept. Tech. Reprt No. 157, torch 1372.

[20] A. C. Hearn, REDUCE 2: A Syste." and Language for Algebraic Manipulation, Proc. Second Symposium on Symbolic and Algebraic Manipulation, pp. 128-133, Assoc. Comp. Mach., New YorK, 1971.

121] A. C. Hearn, An Improved Non-Modular Polynomial GCD Algorithm, SIGSAM Bulletin, A. C, M., Neu York, No. 23 (July 1372), pp. 12-15.

[22] L. E. Heindel, algorithms for Exact Polynomial Root Calculation, Univ. of Wisconsin Ph. D. Thesis, 13701370. 153 pages.

[23] L. E. Heindel, Integer Arithmetic Algorithme for Polynomial Real Zero Determination, Jour. A. C. M., Vol. 18. No. 4 (Oct. 1971), pç. 533-548. ,,..,.

.:.':'':;.

•' [253 _,Ki Â'.'HensBJ, Théorie der AI gebra j schen Zahlen. Chapter 4. Teubner; ;Le{pzÎ9,:;Ï308v7 ;;.,.-;•.

_«;;;-£ f; H^'iV't2Bl JEv^HbfJoui tzi--. liodû'i aPÏÂrl thmet'ip ', àndÇFÏ h Ue ,F i el d Theory: •/yA'i-JTjjtp'Ma'Vïn"^^^ il: and .Algebraic

V;;Msolpuration,.;p^^ 1887194, ::AB9oc..:Comp;.4Mach...:=Neu.York,: 1971.

;:;if"S ;:-; Ï27]^Di'E£;l

, Ï :'v ;••"• [28] "0.^ . E.V, Knuth, ..The Art of Computer Programming, Vol. II: SémlnûmBrJcall^isôpïthfts, Addison-Uealey, Reading," Mass., 1S63. -A-VI-14-

[231 J. D. Lipson, Chinese Remainder and Intarpolatl-sn Algorithme, Proc. Second Symposium on Symbolic and Algebraic Manipulation,pp. 372-391, Assoc. Comp. Mach., Neu York, 1371.

[301 R. Loos. A Constructive Approach to Algebraic Numbera, to appear.

E31; R. LOOB and G. E. Collins. Raaultant Alqorithme for Exact Arithmetic on Algebraiu Numbera, paper presented at S1AM 1973 Na*. Meeting, Hampton, V., (June 1973), to appear in SSAM Jour. Computat ion.

£32) U. A. Martin and R. Fateman, The MACSYMA Syatem, Proc. Second Symposium on Symbolic and Algebraic llanipulat ion, pp. 59-7S, Assoc. Comp. Mach., Neu York, 1371.

133) M. T. McClellan, The Exact Solution of Syatema of Linear Equations with Polynomial Coefficients, Proc. Second Symposium on Symbolic and Algebraic Manipulation, pp. 3S9-414, Assoc. Comp. tlach., Neu York, 1371.

[34] J. Hoses and 0. Y. Y. Yun, The EZ GCD Algorithm. Proc. A.C.n. 73, Aeeoc. Comp. Mach., Neu York, 1373, pp. 159-1SS.

[351 0. R. Hisser, Algorithms for Polynomial Factorization, Univ. of Uisconsin Comp. Sci. Dept. Tech. Report No. 134 (Ph. 0. Thesis), Sept. 1371, 174 pages.

[361 0. R. fiuesor, Multivariate Polynomial Factorization, Dept. Comp. Sci., Univ. of Texas, Austin, Tech. Report.

1371 J. R. Pinkert, Univ. of Uisconsin Comp. Sci. Dept. Ph. D. InesiF.

[381 R. H. Ri5.:h, Solution of the Problem of Integration in Finite Terms, Bull. AMS (Hay 1370), pp. E05-608.

[391 C. n. Rubald, Univ. of Uisconsin Comp. Sci. Dept. Ph. 0. Thesis.

[^81 A. Tarski, A Decision Method for Elemetary Algebra and Geometry, Berkeley, California, (May 195 J .

[411 B. L. Van der Uaerden, Modern Algebra, Vol. 1, trans, by Fred Blum, Frederick Ungar Publishing Co., Neu York, 1949.

[421 P. S. Jang and L. P. Rothschild, Factoring Multivariate Polynomials over the Inteqara, (submitted to Mathematics of Computation).

[431 H. Zasoenhaus, On Hensel Factori*£ .on, 1, Journ. Number Theory, Vol. 1, No. 1 (July 1963), pp. 291-311. •A-VII-1-

APPLICATION DF MECHANICAL THEOREM-PROVING

TO SYMBOLIC CALCULUS

M. BERGMAN H. KANOUI

Groupe d'Intelligence Artificielle Département de Mathématiques-Informatique U.E.R. de Lureiny 13288 MARSEILLE Cedex 2 FRANCE

ABSTRACT

A new programming language baseo on mechanical theorem proving is used to make Formal Manipulations. The design of a Symbolic Inte­ grator is given. A routine is described in detail and exemples are shown. Key words are: Symbolic Calculus, Theorem-proving.

I .INTRODUCTION

At the present tiriie, the 1st-0rder predicate-Calculus can be considered as a programming language, and this is the main idea of the Artificial Intelligence Group of Marseille which has designed and deve- lopped a; new programming language called PROLOG [PROgramming in LOGic). In facti the heart of the interpreter of this language is a irechanical Theorem-prover. We think that mechanical theorem-proving is an efficient tool w..ich, applied to-Formal Calculus may give good results. This approach distinguishes our .system from other formal calculus cystems. Though our experience is recent, it shows that one of the main advantages;is to program "like a mathematician" without giving one's attention to purely technical problems in programming.

First of all, we give a brief description of PROLOG.

II THE -PROGRAMMING LANGUAGE t-KÛLuG

,v. ; The, antdrjireter of. PROLOG is basically a trechanlcal theorem-prover written; now; in AlidOU W. ' V-'—ï-KvAj'stelfÉmB'rit. in PROLOG is a CLAUSE. -A-VI1-2-

A clause is a disjunction of LITTERALS. A littéral is an atomic formula of 1st-0rder logic preceded by a svtinl "•" LT "-" according to it's logical value: True or False. An e*eniple of a clause is:

(1) *A -B -C

where A.B.C are atomic formulas. [1! can be interpreted as:

"Far proving A. we must prove 3 and C*.

InoL'fcJ,

When the litterals are predicates, every variable occuring in the clause is universally quantified. In PRuinn. a variable is preceded by "*" to be distinguished from o LI it-1 symhols. fnr exe!-;.lr!i the clause

+Pta,*x) -Q(*x.*y) where a is a constant means:

V*x V*y(0(*x.*y) -*P(a,*x)).

Démonstration in PROLOG

The inference rule used by PROLOG to execute a program is the RESOLUTION RULE [or cut rule). This rule can generate a clause from two •parent-clauses" having a? firat littéral.1; Indentical atomic formulas with opposite signs. For exemple, from the set of clauses:

*A -B (which means B=»A)

-A iû (which means A=*C)

we can generate the RESOLVENT:

-B *C (which means B=»C)

Consider the two clauses :

(1) *l'[a,*x) -Q[*x.*y)

171 -Pl"z,b) «R(*z) -A-VÏI-3-

Va note that: • -the first litterals of each clause have the same predicate symbol,

-they have opposite signst -there exists a SUBSTITUTION that matches their arguments ;

If we substitute term a for variable *j. in (11 and term b for variable *x in S2), we obtain from (1) and (2):

(1)' «Pta.b) -Q(b.*y)

(21* -Pta.b) *R(a)

By applying the resolution rule, we get the resolvent:

•Rial -Q(b,*y) .

The substitution above is noted by:

{*z -» a i *x •* b) .

A program written in PROLOG Is an ordered set of COMMANDS which traBt files of clauses. The main command has the syntax:

DEMONSTRATE CA.B.Cl where : A is the name of the program file written in PROLOG , B is the name of the data file , C is the name of the output file .

Another cQmmam is OPERATORS which allows the user to dBfine his own operators by givii Ï their parity tunary or binary), priority and methods of evaluating >left-to-right or right-to-left}.

A fundamental property of PROLOG is its ability to manipulate tree structure's: programs,clauses,litterals and their arguments are of this type. This is very important in Formal Calculus. For exemple, the expression

sin (X 2 +11

is represented by the tree: g^N . I +

/\ 1 X 2 -A-VII-4-

Particularly in the case of Integration, ths computation often leads one to choose among several ways and, if the chosen way comes to an impasse, to backtrack and choose another way. This is done automatically in PROLOG by means of syntactic marks on the clauses.

Here it is better to give an exemple of automatic demonstration in PROLOG. Consider thB program:

r 1 *OERIVE(*y,0) -NUMBER(*y) .j

2 *OERIVE(Log*U,*V/*U) -0ERIVE(*U,*V) ..

3 «DERIVEtSin*W.*T.Cos*W) -DERIVE(*W.*T) ..

1 «DERIVECX + *N.*N.Xt(*N-1)) .. lu.'. PFPYVEtLog sin X+'j,*,:) /'*Ropl*z) - . .

"MUnHER" is ù io_^j2l predicate which is Evaluated directly by the program. It is cancelled oniy if its value is true, i.e. if its argument is really a number. the "/" determines the response part of the clause, which is obtained iff all the other litterals of the clause have been cancelled. The response part is then put in thB output file. The Data clause means:

"if the differentiate of log sin x+3 is *z, then return *z" or "differentiate lug sin.x+3 and return the result "

5 is resolved with 1 by the substitution:

{*y-»Log sin X+3 j *z-» 0) the resolvent is:

B -NU(1BER(LaE sin (X+3)) ARep(O) but Log sin X13 is not recognized as a number and the littBral -NUHEERt...) cannot be cancelled. ClausE 1 being terminated by syntactic mark :; the program backtracks and tries to resolve 5 with a clause other than clause 1. The program tri us to résolve 5 with 2i to do this it must unify Log"l) with Log sinlx+j) which is performed by the substitution: -A-VII-5-

{*U -»sin X+3 ,-*Z •* M//sin X+3) wa get:

7 -DERIVElsin X+3,*V) /

As before we cannot resolvs 7 with 1 because Bin X+3 Is not a number. Wa can nomorB resolve 7 with 2 because sin X+3 and Log«U are not uni- fiable IthB functional symbols are different). . 7 is resolved with 3 by the substitution:

{*W-*Xt3 i*V + *T. cos X+3) end gives:

B -DERIVE IX+3,*T) /«Repl*T.cos Xt3 /sin Xt3)

B can only resolved with 4 by :

{*N->3 i *T+3. X+C3-1J) ; in fact [3-D is evaluated as 2 and wa get

9 *Rep(3.X+Z.cos X+3 /sin X+3) in the outppttfile.

We can note that the irfichanism of unification porforms automa­ tically a pattern-recognition by selecting the clause which must be chosen to generate a resolvent end progress in the work. I» h 111! I I I I i

-A-VII-6-

III THE SYCCPHANTE SYSTEM

SYCOPHANTE is a symbolic Integrator syBtem In which the user can reach every procedure used by the syBtam. For exemple one can ask to factorize a polynomial or to compute the GCD of two polynomials by calling the corresponding predicate. Now, the whole system must ha loaded In cors but a new version of PROLOG will soon allow the user to program his own JCL. Also the system will he modular and conversationnal.

At the present time. SYCOPHANTE manipulates only functions of a single variablei the design takes its inspiration from MOSES"SIN. as described in (B) and (9).

To integrate an expression, the system tries several methods, one after another, by backtracking when one falls. First attempts are:

1st Stage

1) if thB integrand is a sum, tt checks the form f.g' • g.f and the result is given by f.gjif not, BBch term is integrated separately.

2) if the integrand is of the form [ïf. (x)]n where n Is a strall positive integer (n<4) the program expands the factors and comes back tD step 1.

3) an attempt is made to recognize the form u'.f(u) for the integrand whBre f is an elementary function.

2nd Stage

The program makes a pattern recognition of the integrand and calls specific routines. (Rational fractions, rational functions of exponentials or logarithms...).

3rd Stage

General methods of integration (RischiAlgorithm...) are attempted.

At present, 1st Stage is completed and nany of the methods of 2nd Stags have been written and tested. In fact, as a proof of the efficiency of our idea, WB hegan with the Rational Fractions Integration routine, which is the more difficult -A-VII-7-

to implement. It usas the classical HERMTE'S Reduction Algorithm (41, and the KRONECKER'S factorization algorithm (7). Several other methods ut the 2nd Stage are implemented, such aa Rational Functions of Exponentials, Rational Fractions tinea an exponential and Substitution for an integral power which treats integrand of the form XK.f(XK1) where f is an elementary function.

Ill AN EXEtfLE V» hope to show how it la "easy* to program in PROLOG. ThiB routine concerns the heuristic which guesses the integrand es the differential of a product. The problem is to recognize the form f-S' * E-*' for the integrand. This is the lissing of the procedure:

** INTEGRALE D'UNE SOMME DE DEUX PRODUITS.• 1; •INTSPC*A+*B»*T) -IPRODC»>A+*B»*T> .! 2: +INTSP(*A+*B,*T> -IPRODC*B+*A.*T> ..

3:.+!PR0D<*A.*F+*U>*T> -BAT101*A> -EUALC 1/*A.*C> -PRODUIT!*C**U.*V> ' -IP«0D<*F**V»«8> -PRODMTt*A#*C»»T> .1 4i *IPR0D<*F.*G+*U»*T» -DERIVEE! *F»*V> -DAPl*U.O> -DIVlDEt*U»*Vj*fc> -DEHlVEEf*W»*G> -PRODUIT<*F**"K#*T> .1 St +1PR0DC*F.*G+*U»*T> -DERIVESt*G»*V>-NQI»CONSY««C+F> -DIVIDE<*U»*V,*K> -DERIVEEC*fc*»F> -PR0DUltl*G>*l«**T> •• 6: +lPRODt*F+»U»«T> -DERI VEE« *F».*W> -DIVTDE£+U»«V -PRODUtTCX#*Fi*T) .. -A-VII-8-

The pattern-recognition is made in two steps:

Î) Verify that the integrand is a sum 2) Verify that the integrand is df the form f.g' + g.f'

Step 1 is done by clauses 1 and 2. Tndeed, the evaluation may be possible only if the integrand (1st argument of INTSP) is a sum, to permit unification with the data, clause. If yes, an attempt is made to demonstrate INTSP with clause 1, and procedure TPR0.D is called. The latter verifies Step 2 and proceeds as follows -If the integrand is of the form:

a.U *V where a is a constant, we compute a./(U * i. V) •

It.is clause 3 which makfeî the transformation and calls IPRDD with U • — i V as first argument. The syntactic mark .i of clause 3 permits the program to backtrack if a is not a constant, so that IPRQO treats now expressions of the form :

(!) U • V where U has no constant factor. Two cases are possible ;

-U is a_oroduct

clause 4 considers the first term of ti) i.e. U, as f.g" and guesses if the second term of ti) i.e. V, is of the form f'.g. For that, the program computes succesively:

i f • I - w . looks if W = g .

If not, an attempt is made with clause 5 which does the same but considers U as f'.g [backtracking is possible because clause 4 has the mark *i )» If none of clause 4 and 5 gives a result, the program backtracks and tries to evaluate INTSP by clause 2, which permuts U and V in (i). zy_^5 n?t a_pr2dy9t

The program looks if V = U'.X which Is now thE only solution- •A-VII-9-

The integrand is then of the form:

1.U • U'.X

and the result Is U.X.

Thi9 is done by clause 6.

As before, if the form of V has not boon recogn1tt*d as U'.X the program backtrac iks on clause 2. ThBre are some exemples treated by this heuristic:

t Jf=R is given by the clause *REP(SIGMAlf)-g) ,.)

ricvuEfk SORTIE

+ REPCS1GMA{ CCOS X> t5+-5.>.cCoS X5'4.£l«- X>~lCOS KliS.XJ ;.

+ RfcP< SI GMAC &.> t2.CCD5 X)'4..S1N X+-2.X.CC0S lO tr>) --* «2.C COS X>

-mEP.*,t2.E'X+3-X.EiX)=C3/2i .XiB-EtX) : .

+RÊPCS1GHACLO& X+1)=X-L06 X) ;.

+ RE.PCSIGMAILÛ6- Ht2+' J.

+RE.PX'aj j •

FtN T)U FICHftR SORTTE -A-vn-io-

IV SOME EXEMPLES

Ulntegratlon of Rational Fractions

FILHIIR to h Hi.

• REr-Cl-I l>m(,,/(A t;-+l) )=( -1/3) .LOG( A+ 1 )+( l/t) -LOPf. A. >&*-X+ 1) +( ( 3 r; 1 /f!

.i/o) ..-ixic-c t ate i/H)/3) . c, : - t/>i) > ;.

*htr( ti C.-if-t Aifi/t A t;,... + •<>> + ( -/-.) -LOC-C .\+ I) +/I.LOK it + V) ) ;-

+hhr > =y.u)G x+c -;/t-> ,c -4.X-:I>/

K1.VI U' rlUrll :-, tO,,1 It

2) Immediate Integration

Recognition of the form: u'.f(u) of tha integrand(1st Stage,Method 3))

FICHIER SORTIE

+REPC SI GMAC C COS E'X) ta.EtX.SIN EtX)=<-1/3) .CCOS EtX)T3> J.

+REP(SIGMAtEtX.C 1 + EiX) »-!)=• 1 .LOGC 1+EtX)) J.

+KEH(SIGMA(X.CXI2+UU 1/2))=C 1/3) .CXtS+1) t't3/2>) i.

+ REP(SIGMA( SIN X.COS X) =< 1/2) .t SIN X)»2) ».

tREPC SI GMACX K3/2) )=(2/5) .X»(5/2)) ; .

+HtP(SIGMfllX.Etxifi)=c 1/2) «Etxt2> ;.

FIN DU FICHIER SORTIE

3) Integration of rational functions of Exponentials

The program makes a pattern-racognltion of tha integrand, computes and carries out' "the substitution and computes the integral directly or calls another method. -A-VII-11-

F1CHIER SORTIE

«•CHGTDEVARCX = E»C I .

HACCX+l)/X.C3.Xt2+2))) j.

+CHGTDEVAR<;X=EiCCB/15).CX+l/4>)> + HEPCSIGMACC£iCC4/3).Xfl/3)+EU2.X+l/

2)>/C2+3.EtCC6/5).X+3/10)))=SIGMACC 15/2) .(Xt 14+X«9> /C 3.X tg + 2) ) > ;•

•CHGTDEWUtCX-EUC 1/2) .CX+2) ) > + HEPt SI GMAC < E»C C 1/2) .X + D + E'CX+2)/C2+3.

EK2.X+4)))=SlGMAC2.(X+l)/C3.Xi4+2)>) S .

+CHGTDEVARCX = EtX)+REPCSIGriA(EtCX+l)/C 1+EIX))=E.SIGMAt i/C 1+X))) i .

+REPCSIGMAC 10«X.EtX)=Cl/CLOG 10+1 ) ) .Etc C LOG 10+D.X)) ;.

FIN DU FICHIER SORTIE

V SOME FINAL REMARKS

Lliui others, we haVG been confronted .by; the' problem of simplification when carrying out formal manipulations. Far this, we defined a canonical form of an expression by giving a weigth to every functional symbol, so that the set of expeessions can be ordered. Two similar expressions then have the same form and this similarity is Very easily recognized by the unification mechanism of PROLOG. Naturally our system is not fully implemented. IprGgramminjbegan In January 73 and the first tests teak -place in May). We do not yet havs a good output interface and results are still difficult to read, but thB necessary improvements are being carried out. Me cannot now report impressive execution times because we used an experimental interpreteVb'f PROLOG, written in ALGOL W. A new version of PROLOG, which is more definitive is being written in FORTRAN. We hope that the execution times will be reduced by a factor of 20 to 30 (at présent, exemples given in III taKe between 3 and 200 soc. in execution on IBM 36D-B7 under CP-CMS). -A-VII-12-

VI BIBLIOGRAFHY

For Prolog and Mechanical Theorem-Proving

11) COLMERAUER A., KANOUI H. , PASERD R.. ROUSSEL P.. "Un système da Communication Homme-MachinB an Français* G.I.A., U.E.R. de Lurniny, Oct 1972

(2) NILSON N. J.. "Problam Solving Methods in Predicate Calculus" Mac Graw Hill. New YorK City, 1971

(3) ROUSSEL P.. 'Dsflnltlon et Traitement ds l'égalité Formelle en uémonstration Automatique" Thetis, U.E.R. de Lurniny, May 1972

For Mathematical Algorithms

(4) HARDY G.H., "ThB Integration of Functions a single variable" 2nd Ed. Can*.Univ. Press, Cambridge. England 1916

(5) K.NUTH D.E.. The Art of Computer Programming" Vol 1: Fundamental Algorithms Vol 2: Seminumarical Algorithms Addison Wesley 1969

(6) RISCH R.. "The Problem of Integration in Finite TermB" T-ans. AMS.Vol 139,May 1969, pp 167,189.

(7J VAN O.ER WAERDEN B.L. . "Modern Algebra" Ungar Publishing C°. N.Y. 1953

For Symbolic Calculus

(8) MDSES J. "Symbolic in egration" Thnsis, M.I.f., Cambridge. Mass, Dec.1967

'-i ProcsBdings of thB "Second Symposium on Symbolic and Algebraic Manipulation" Los Angeles. California,March 1972

(10JSLAGLE J.R.. "A HBurlstic Program that solve Symbolic Integration ProblFP"* in Freshman" Calculus" PhD DlsWt. M.I.T.,May 1961 -A-VIII-1-

SCIENTIFIC COMPUTING IN REAL TBte

Eric H. Roffman City Collera, City U^iversiti, New Vork

From my own work, and from the reports that we have heard this past weak from the other participants in this conference, it has hecome clear that the the amount of real time required to develop results usine computors is one of the most important limitations on the work that can be done, and that it Is an almaet universal problem, affecting the moat sophisticated as well as the most casual users. Moreover, mut'ft of the Mme spent is wasted time, as a result of the ir.^.edible inefficiency of most computer installations wj.th respect to considerations of the programmer18 lifetime.

By real time,I mean the number of days, weeks, hours, or years that the programmer either spends on computing, or does not. spend .on something else because he is in the m iddle" of "computing."

The time required for production of results cnuld already be drastically reduced by the implercentation of Just -A-VIi1-2-

a few Ideas which are well within the capabilities ef ourrent technology. I would like te mention seme simple possibilities fer Improvements In mest oemputlng COD-era. These Items may er may net exist somewhere. They should exist everywhere. They are not neoessarlly original, and certainly not exhaustive.

The purpose of this note Is primarily "pelltleiil" : to raise the consciousness of scientific users to the point where adequate facilities are demanded, and to stimulate Interest among systems programmers and directors to the point where adequate facilities beoeme generally available.

1) 3RAPKI3S: A fast turn-around, easy to use, plotting system should be universally available. It should be possible to call for a graph with something no more complicated than, for example: "CALL PLOT(X, Y)", nhere X and ï are already dimensioned arrays.

It should be possible to obtain plots on detaohed 8£ X 11 paper, and to obtain plots ready for photocopying for the printer. The turn-around for plotted output should be roughly the same as for printed output. -A-VIII-3-

The ayetejia vhloh are commonly available, Caicomp and CRT-to-35mm film aro too alow, too complicated, and do not produce convenient output at the present tine.

In addition to these basic requirements, very helpful additional features, which should be available at least somewhere in every geographical oenter (and freely shared between Institutions) would lie CRT-to-l6mm movie facilities, And a CRT plotting system whftth could be observed vislally by the programmer.

2) ON LINE PRINTING AND PL0TT2ÎS: It chculd be possible, as an option, to direct a small amount of output on-line to a line printer. This would enable the programmer to monitor the progress of hi? Job (B owing, for example, termination of a Job that was going wrong), and also allow Instantaneous debugging and immediate preparation for tha next run, without, however, compromising the ability of tha Job to also produce a lot of output in the normal time.

It would be helpful, for many types of Jobs, to nave available, on-line, a CRT plotting system which could be observed visually by the user. -A-V1I1-4-

Theae suFfreBtions do not require true Interaction between the programaar and tha system, nor do they require time sharing. They could b& implamentsd in baton mode.

3) DEBw'GiUNQ ASSISTANCE: There should be a syatema program which sutwaatleally takes oontrol when a program terminates abnormally, and traoes back through the program for Information to help explain the error. For example, it might note the statement it was working on «hen the error occurred, the values of the quantities involved in the stateme7it, and the way that those quantities had been defined. In addition it might note the values of ail DO loop temporary quantities, and give a record of subroutine aalls.

Such a listing oould save considerable programming time and avoid extra debugging runs.

4) JOB STATUS HOHITOR: There should be available, continuously, in the users' area, a monitor of Job priorities, Btatus, and dayfile aees-afvs* In addltlo... jobs shou'id be assigned an (accurately) estimated tine at which they will run.

These features are important because a substantial amount of real time can ba wasted either» waiting for JobB •A-VIII-5-

whlch «111 not run for hours, or leaving «hen a Job 1B about to run.

5) WORKING CONDITIONS: Although It may aeem a completely trivial Item to mention. In fact It doea not ex'.st at many Installations, and can be crucial for real time, efficient production of results: there should be comfortable, adequate workspace for programmers and enough keypunches for everjme.

In conclusion, let me reiterate that the primary purpose of this note is io

THIRD COLLOQUIUM OK ADVANCED COMPUTING METHODS IH TH£^"TICAL FKYSICS at Centre de Physique The'origue de Marseille. June 25 - 29, 1973

COMPUTERS IN PLASMA PHYSICS

K V Roberta

UKAEA Culham Laboratory, Abingdon. Berkshire, England.

ABSTRACT

Computers are used In plasma physics in many different ways. One of the most important and characteristic tasks has always been the solution of initial- value problems, in which the time evolution of real or idealized plasma systems is simulated on the computer. The basic particle and field equations are precisely known but are much too difficult to solve numerically in practice; therefore theoretical models have to be introduced. The first type of model, based un Vlauuv's equation lur Lite I-parLicle disLiibutlûn £uû*-tiûû ol <* collisionless plasma, has led to the technique of particle simulation, while the second type includes ' irious magnetohydrodynamic fluid modeïi which are solved by mesh techniques, although here much further numerical analysis needs to be done. Because the sti jctura "of an initial-value code can to a consider­ able extent be formalised there are great opportunities far symbolic manipula­ tion and automatic program constructioa. Two complementary methods are briefly mentioned» one based on Algol and the other on Fortran. -B-1-2

1_. I_n_' roducLior.

Computers are used in plasma physics in a great variety of ways, for example In the on-line cuntiol of apparatus and the recording and processing of experimental data, in the calculation of detailed 3-dlmensional magnetic fit-Id structures and charge-.', particle trajectories, and in a host of small- scale calculations aifi as the evaluation of algebraic formulae and the suluti.in .'t v;rdinar '; :'f ertnt ial equations. Graphical output has been exploited by plasma physicists for many years using both hardcopy and movie films, ana an interesting recent development has been simply to store an animated display as a string of characters in -n on-line file so that It could be examined at leisure at a fast Tektronix 4010 visual display terminal. Such term:nils hava considerable potential since they could also be useful for controlling the course of large numerical or algebraic calculations which might be too complex to run entirely unaided.

Fig.l illustrates the type of computer network which is installed at Culham at the present time and which is likely to be available at most large physics laboratories either now or in the near future. The details will vary from case to case and are not important. The significant point Is that one now has t> nulti-access system in which virtually all the information is stored on-line, and In which small and large computing jobs of all kinds can be initiated and controlled from character and graphics terminals which may be situated in user areas, in laboratories, in individual offices or even at home. The question is what use can be made of this for physics purposes.

I would like in this talk to consider one of the most characteristic tasks of computational plasma physics, namely the solution of Initial value problems. What we are attempting to do here Is to simulate the ttme-evolutlon of real or idealized plasma systems on the computer. The earliest calcula­ tions were made for systems with 1-dimersional symmetry, usually cylindrical or plane, and as computers grew larger there was a general move towards 2-dimeasional problems many of \?htch are of great practical interest In con­ trolled thermonuclear fusion research as well as in space physica and astrophysics. By no means all the difficulties associated with 2-dimensional calculations have been solved as yet, but computers continue to grow and so a small number of idealized 3-dimensional codes have already been de/eloped and used.

Other Important calculations In plasma physics deal with static or dynamic plasma equilibria *nd their linear or non-linear stability. In a -B-I-3- typical thermonuclear reactor simulation all these aspects will enter. We imagine the current switched on at the start of the pulse and the plasma heating up to reach the desired conditions. This is an evolution on a com­ paratively short time-scale which hopefully settles down to near-equilibrium. The equilibrium must be tested for stability against gross disturbances> and here linear stability theory can be used, but it is likely to be unstable against fine-scale perturbations which grow through the linear into the non­ linear regime, leading to weak turbulence and a consequent slow outward diffusion of plasma particles and energy. On a long tlmescale of a second or more tue composition gradually changes as the thermonuclear burning proceeds and so we have a slow evolution through a succession of quasi-equilibrium states.

Since this Colloquium is largely concerned with the use of algebraic and symbolic computing techniques in physics, part of my talk will deal with our attempts to formalize and automate the construction of initial value codes, both using Symbolic Algol and also some more practically oriented Fortran methods. For general accounts of the state-of-f-he-art in computational plasma physics the reader should consult the review volume ref.l and the con- (3 U) ference proceedings ref.2, together with two recent articles by Dawson

2. Plasma Models

A. plasma consists of a large number of charged particles obeying the equations of motion

m\ Ht*= ei(5 + Y x B) (2)

or their relativistlc equivalent, and interacting with electric and magnetic fields satisfying Maxwell's equations

BB - Curl E (3) St

i,5£= Curl B - An j (4) l r Bt

div B = 0

div E = 4nc2a (6)

where the charge and current density are defined by -B-I-4-

a(x) - ÇfX 6(x - xx.) (7) c

j(x) = Z fX vx 5(x - x^-) . (8)

\n principle the numerical techniques exist to solve these equations with any degree of accuracy required, i.e. they converge to the true solution in the limit At -* 0, Ax -* 0 subject: to appropriate stability conditions, where At is the time-step, and Ax is the apace-atep used to represent the functions E and B on a finite mesh. In practice the number of degrees of ~ 23 freedom is so large, e.g. 10 for the particles in a thermonuclear reactor and infinite for the electromagnetic field, that such a crude attack on the initial value problem could never hope to succeed. What we must do therefore is to replace the exact set of equations (l) - (8) by some kind of simplified theoretical model, in which only a much smaller number of relevant degrees of freedom are retained - 'relevant.' of course depending on the particular aspect under consideration - and then try to simulate the behaviour of this simplified model on the computer. Another way of looking at the difficulty is to examine the space and time scales involved. Plasma oscillations can occur on the scale of the Debye length (9) and the inverse plasma frequency -1 (10) P where n Is the electron number density, m and e the electronic mass and charge respectively, k is Boltzmann's constant and T is the temperature. For a reactor plasma of density 10 /cc and temperature 10 keV these are of -2 -12 order 10 cm and 10 sec, compared to macroscopic scales which are measured in metres and seconds. The plasma velocity of sound is about 10 cm/sec anri the Alfven velocity of magnetoacnustic waves some ten times larger than this, so that a wave can cross the system many times during the course of the calculation. Even larger ratios occur in space and astrophysics problems.

The derivation of theoretical plas.ua models from the basic equations Cl)-(B) is an intricate affair. However we can assume for the purposes of . • this talk that the plasma is to be described by a set of 1-particle distribution -B-I-S-

functions f,(x,v,t), one for each particle species i, satisfying Boltzmann equations

3f , of t . Sf "of- (u) §7 ' "-• *;*-"• Tv- L5FJ „ coll where the right-hand side describes 2-body collisions within thu plasma and Che acceleration » is defined by

a = ei - - (E + v x B) . (12)

mt - The corresponding charge and current distributions to be inserted in Maxwell's equations are given by the moments

i ^LJ"!1 Y£i(ï)dï • (14)

Two further alternative approximations are then usually made:

A. Vlasov's equation. The collision term on the right-hand side of (11) is neglected, yielding the Vlasov or 'collisionless Boltzmann equatim'

!É+ ï-i!+ 2-t| • ° •

The usefulness of this approximation is that for. hot plasmas the particle mean free paths are extremely long» so that for all but the slowest phenomena the collisions can be neglected. The Fokker-Planck equation is a generaliza­ tion of (15) in which the effect of collisions is retained on the right-hand side as a diffusion term. 2 B. Fluid model. Boltzmann1 s equation is multiplied by 1, v, v and inte­ grated over velocity space to give a set of moment equations, so that the plasma is now described in terms of familiar fluid variables such as density p, velocity u, ion and electron temperatures T., T . The collision term gives rise'to dissipative processes such as resistivity, heat conduction and viscosity. There are several fluid models of increasing complexity, and the validity of any such model depends on the problem under consideration, but they all share tXnt advantages of reducing the number of dimensions from 6 (phase space) to "/ i^al space), and of being able to treat macroscopic problems.

Model» A and B have given rise to two quite different methods of -B-I-6- numerical ."Dlution, which will now be outlined in §§ 3 and 4 respectively.

3. Numerical Solution of Vlasov's Fquation

Vlasov's equation (15) has a number of interesting properties which largely depend on the fact that it can be written in Hamiltonian form. In general we wish to solve a set of Vlasov equations,

-^- = [H11fil, (1 = 1,2, ...,N), (16)

one for eé.ch species of charged particle, coupled with Maxwell's equations which describe the behaviour of their collective electromagnetic fields. Here f.(tj,p_,t) is Che disCrii'ution function in n.-dimensional phase space for rhe ic" particle species, n. p are the n. coordinates and momenta, and H, is the particle Hamiltonian. The Poisson bracket of two dynamical variables A,B ts defined by

Ô r* nl = A ÔB 3B oA M,*

Recalling the Hamiltonian equations of motion

a - §£ • E - - â^ • (18)

we see that (16) is equivalent to Liouville's equation for a 1-particle system : df of. of. 3f IT ' "at + 3 ^ + t 1£ - °- <»>

In gener^*. the Hamlitonian H. will depend on the local electromagnetic fields through the scalar and vector potentials 9, A associated with the fields E, B , and since the charge and current functions q, j are to be computed as moments vc see that 'iach n ram ? he regarded as a functional of all the f^ Ci = 1,2 N).

The time-derivatives q, p may according to (19) be regarded as the components of a velocity in phase space, if we write this equation in the advective form

(20) ?ati + %-Vl * ° '

and from (18) we see that

ôq ôp

jç + - = 0, or Vç.vg = 0 . (21) -B-I-7-

An illuminating picture is therefore obtained by thinking of each distribution function aa the local denaity of an incompressible fluid which moves in the corresponding phase space with local velocity (q,g). Because this velocir.> depends on the f. through H we speak of a set of incompressible self- and mutually-interacting phase fluids, one for each species of particle. Mathematically we are faced with the initial value problem of solving the set of N coupled partial differential equations (19) or (20), each in a space of n. dimensions. The equations appear very simple but a number of diffi­ cult numerical problems arise, and in order to obtain a solution it is necessary to examine the specific features of the equations and to introduce a number of special numerical techniques, amongst which is particle simulation.

The fluid picture is particularly clear for the case of a single species of particles (electrons) in one space dimension x, interacting via their collective electrostatic field E - - otp/Sx where

where m is the electronic mass and e the charge (regarded as negative). For simplicity we use the velocity coordinate v in phase space rather than the momentum p = mv. The equations of motion (18) Li*an become

i = v, v = or = -E (x,t) (23) m

while the Vlasov-Liouville equation (19) is

dt ot ox m ov

The electric field is to be computed at each stage by solving Poisson's equation v^cp = -47TO- (25)

where a is the charge density, which can be written as to . 'ttLl^-mjljjto-l] . (26)

2 2 Here ID = (4nn e )/m 1B the square of the electron plasma frequency, and p o n is the mean density of the electrons which we assume tu be neutralized by a uniform background of fixed positive charge, lo determines the character­ istic timescale of the problem which the numerical solution has to follow. The charge density of the electrons at the point x at time t. Is/.oHtained by a velocity integral : -•1-8-

oo

o-(x.t) = n e I f(x,v,t)d\ , (27) o J —oa the space average of the integral being normalized to unity to ensure charge neutrality.

A continuous function f(x,v,t) can be represented graphically by con­ tours of constant f in th« 2-dlmensional (x,v) phase plane (Fig.2), Since df/dt = 0 the conteurs C move with the fluid and preserve their topology as the system evolves, so that no crossing or smearing occurs, and furthermore, the area enclosed between any two contours is a constant of the motion. Each point (x^.Vj) on a contour obeys the 'particle' equations

& ' \ • & - "«v" • (28)

This motion is of a very special kind, being a combination of a constant horizontal shear with a vertical shear which depends on position and time

The nature of the solutions may be seen by examining the 'frie-streaming' case, e = 0, when the particles are uncharged and so no longer interact with the field. Then the general solution of (24) is

f(x,vft) = f(x-v(t-to),v,to) (29)

ikx so that a Fourier component g(v)e at time t is translated into

, , ik(x-v(t-t_)) ,_n> g(v)e ° (30)

at any later (cr earlier) time t. This means that modes which have unlimited

:wave-number' k(t-t ) in the v-direction will tend to develop as time goep on, making it difficult to solve the Vlasov equation on a computer.

Eulerian difference method

Since (19) is simpLy the advective equation (20) In a generalized >space, it Is raturai to think of covering this space with a discrete E'.lier inn mesh, and solving the equation by one of the standard methods, e.g. ti e leapfrog scheme which for (24) would be

fn+l_fn-1 = _VVfn „ ).°1^(^ „ >

where x = |±Ax, v = WW, t = nAt. There are however serious problems:

(a) The machine time and storage space needed for problems in 2 and 3 space dimensions (4- and 6-dimensional phase space respectively), plus time are usually prohibitive. B-I-9-

(h) Difference techniques for solving the advective equation are not very accurate, sincp they distort the high wave- number modes.

(c) The high wave-number components in the v-direction rapidly go beyond the range of any reasonable mesh size.

Other methods of calculation must therefore be sought, and a good account of these is given in the review volume ref.l, with a further detailed descrip­ tion in the conference proceedings ref.2

WaterbaR method

One of the simplest is the waterbag method in «which the distribution function f(x,v) is chosen to be a step-function, so that the phase fluid consists of regions of uniform density f bounded by a finite set of curves C^ as illustrated in Fig.3. The state of the system is then completely defined by the position of the curves at any time, and it is unnecessary to calculate the motion of the phase fluid in the interior of the regiors. Fig 4 s'.iows the evolution of an unstable initial distribution

rl/v Cv /2

The waterbag model represents the curves C. by a set of Lagrangian points X,, v, satisfying (28) and for the purpose of display and of calcula- tin the charge integral (27) these are assumed to be joined by straight segments. The curves become longer and more contorted as time proceeds as seen in Fig,4, and we therefore add extra points in order to preserve numerical accuracy. Eventually more points are needed than the computer can handle and the calculation has to stop, unless some way can be found to simplify the curves (5).

Lagrangtan particle method : coarse-graining

Returning to more general distribution functions, we. see that there is no difficulty o£ principle in solving (19) or (24) by a Lagrangian method provided that the functions (q.p) °r (v,ar) are known, which would be true for independent particles moving in a prescribed external field. The distri- • bution function could be represented by a discrete set of points P* moving -B-ï-10-

ac»_ording to the equations of motion 118^ or (28), and each carrying its own value f. which is a constant of the ^o'.ton. The electric or magnetic fields to be used in the Lorentz force ter.n would be obtained by interpolation from an Eulerian raesl., and the value of f(a.p,t) at time t would be computed by averaging over tue m particles that happened to be in a finite cell Aq tip in phase space at chat instant of time (coarse-grai.iing) :

f(qiP,t) = -£ fx . (33) - m m A. The characteristic difficulties that usually arise with Lagrang^ai. techniques in multi-dimensional hydrodynamics are concerned with the distortion of the moving mesh cells, and in the present case there is no need to connect the

points P> together to form cells.

This Lagrangian method eliminates the problem (b) which was associated with an Eulertan finite difference scheme, while (c) is avoided by assuming

that we are really only interested in the coarse-grained average oe the dis­ tribution function, rather than its fine structure on a scale 1*86 than that of the chosen cell size. Problem (a) still remains, however, since in order to represent the distribution function accurately it is necessary to have a sufficient number of Eulerian mesh points in each direction of phase space, and at least one Lagrangian point in each cell. For multi-dimensional prob­ lems it therefore apptars tKat noc only cannot we represent the fine-scsled distribution function aci u-ateiy\ we cannot represent the coarse-grained distribution function either.

Partir,le simulation

The assumption which is made in the particle simulation method is that actually we need not be concerned with the distribution function, fine or coarse-grained, since this does not appear in the determining equations, but simply with moment integrals such as CO 03 J f dv , J vf dv (34)

which define the charge and current densities q,j to be used in calculating the collective electric and magnetic fields associated with a self-interacting syrjtem. These are functions only of the space-time coordinates (x,t) and therefore can be represented with reasonable accuracy on a fixed Eulerian mesh. Because the integration over velocity space may be expected to produce

a considerable smoothing, this allows us to reduce the n***nber of; velocity pGints to a reasonable number provided that a suitable algorithm can be found -11- for evaluating the integrals (34) from the current positions and velocities of a set of discrete Lagrangean points.

The HGP method for eleccrosr.,3tic systems

We now make a significant change in the meaning of the Lagrangian points P, . Instead of thinking of them as mathematical pointa within a continuous fluid of smoothly-varying density f, we discretize the distribution function so that it becomes a set of ô-f unctions :

f(g,D,t) =Ewx6 (q-qx(t))6 (P-Px(t)), (35) where w. is an appropriate weighting factor. With each point is associated a mass w, m and a charge w, e so that it behaves like a physical point particle. The. weight is often chosen to be the same for each species of 'simulation particles' and is'frequently much larger than unity, so that the system behaves like a set of physical particles with greatly enhanced collision rates. These pae^dG-physicai collisions lead to numerical errors which must be carefully examined and minimised if an accurate solution is to be obtained » since the approximation made in deriving the Vlasov equation is that the collision rate is zero.

The nearest grid point (NGP) method calculates the cVmrgo density simply by summing the charges in each Eulerian cell:

a ~ L w) e . (36) cell K

When the value of a associated with each Eulerian grid point has been deter­ mined, the potential (p is obtained by solving Poisson's equation

V2^ m .^a (37)

and then the electric field E is obtained by differencing EU) - - .W*+*»> - ?(*-**» . (38) 2ûx

The field ;is assumed to be uniform within each cell and is used to update the velocity according to + £• At E(x.n) (39) m K after which the particles can be moved one step using n+1 n • + te„x-* . XX = XX (40)

This results in. a rather neat leapfrog scheme in which the velocities are -B-I-12- defined at half-integral times, and all other quantities at integral times.

Area-weightinfi

Although the electric field used in the NGP method is influenced by the actual positions of the simulation particles, and is therefore subject to statistical fluctuations as the particles pass from cell to cell, the model does not include the full effect of physical point-particle encounters. For example, two simulation particles uithin the same cell exert no force on one another by jymmetry, nince each is assumed to be located at the cell centre. Nevertheless, the high-k modes in the electric field do appear with excessive magnitude and random phase, and chis can cause non-physical diffusion of the particles in both coordinate and velocity space in certain problems. To reduce these numerical errors the area-weighting or Cloud-in-Cell (CIC) method is often used. This may best be illustrated for the case of a rectangular Cartesian space mesh in 2 dimensions, with square cells of side Û (Fig.5). Instead of using point simulation particles as in the NGP method, we now assume them to be squares of dimension equal to the Eulerian cell size. Each 'particle' will then in general overlap 4 cells (1,2,3,4) as shown in the diagram, and the increments in che charges at the cell centres are chosen proportional to the areas of overlap»

6pL or kt , (i = 1,2,3,4).- (41)

This ensures that the charges vary continuously as the particles move frcri cell to cell. The electric fields which act on the particles are linearly interpolated in a similar way. There have been several detailed numerical comparisons of the relative accuracy of the NGP and CIC methods and of the amount of machine cime that they require.

Poisson's equation

One of the main problems in particle simulation lies in the solution of Poisson's equation (37). There is no difficulty in 1 dimension since (26) can be solved directly, but in 2 or 3 dimensions it is customary to involve a fast direct technique based on Fast Fourier Transforms or Recursive Cyclic Reduction, so achieving an order-of-magnitude saving in computer time over iterative methods. This means that the spatial geometry must be simplified, for example to a rectangular region with periodic boundary conditions.

Although not quite the fastest method, an attractive possibility is to use a double fast Fourier transform. This means that at every step Poisson's equation ia solved in the form -B-I-13-

9CM • ^ (42) and it is quite straightforward to modify this to some form

cp(k) «MMflflO (43) k* which will preferentially reduce the unwanted high-k modes. Such a modifica­ tion corresponds to choosing a specific 'shape' for the charge distribution of the simulation particle, e.g. a Gaussian.

The straightforward particle simulation method can only represent a microscopic region of physical space and time, especially for problems involv­ ing 2 or 3 space dimensions. The reason for this is that the plasma is subject to electron plasma oscillations on the scale of the inverse plasma frequency and the Debye length which the numerical calculation has to follow. It is usually only practicable to follow only a few hundred periods of oscillation at the most, and not more than (say) 50 Fourier modes in each space direction, e.g. on a 256 x 256 mesh. In order for the system of charged simulation particles to behave like a plrsma it is necessary for n k~ to be large compared to ucity (where m Is the number of space dimensions), so that for a 2-dimenslonal problem the total number of particles should be at least several tens of thousands. Finally, if ions as well as electrons are to be followed the time-scales of the calculation may need to be increased because ,m ion velocities are smaller by a factor-/—e » the square root of the mass ratio J raj ^ (r* 40 for protons).

All these factors make it necessary far particle simulation codes to be as efficient as possible and many sophisticated programming techniques have been developed. There are also numerical prescriptions for improving the accuracy of the calculation, and physical approximations for eliminating unwanted modes, e.g. to remove the high-frequency election plasma oscillations in a problem in which-only the low frequency ion waves are of interest.

Some of the techniques that are available are described in articles by Boris and Roberts and by Or ens et al . À balance should be sought between flexibility, development time, core requirements and computational speed. Codes should be flexible, so that minor conceptual modifications do not require significant révisions. Usually this means constructing them in a modular fashion. A considerable amount of computer time can be saved by pro­ gramming the inner loops in assembly language, both for the 'particle pusher'

which solves equations (39) and (40) and also fort the Poisson-solver, but elsewhere the code should be written so far as possible in higher-level language -B-I-14- in order to ensure machine-independence and good reliability. There a;e several advantages in requiring the number of grid points in each direction to be a power ot 2, since not only is this convenient for the Fast-Fourier- Transform techrique but it also enables ©any of the arithmetic operations to be carried out by shifts and masking instead of by the slower Instructions such as addition, multiplication and division. On some computers it is desirable to perform all the particle calculations in fixed-point integer arithmetic rather ta than floating point. Consideration should also be given to eliminating any binary digits that do not materially enhance the accuracy of the solution, so reducing both the machine tî ie and storage space needed. For many problems it is necessary ta keep the particle coordinates and velocities on backing storage (disc or tape), and to transfer •'hem in and out *** the core store for processing as required. This again is an area where a considerable degree of optimization can be achieved.

Many plasma problems have been attacked by particle simulation methods. Natural extensions of the electrostatic, non-relativistic, homogenous model discussed in this talk include (a) A fixed external magnetic field 8 which causes the particles to move in helices : dv m -=- » e(E + vxB _ ) . (44) dt ~ _ext (b) A self-consistent magnetic field generated by the particles themselves. (c) Interaction with electromagnetic waves. (d) Relatlvistic particle motion. (e) Generalized spatial geometry.

Electron plasma oscillations can be eliminated by assuming that the electron density satisfies a Boltzraann distribution

. -« e-**/kT« , (45) a o • while the rapid Larmor precession of the charged particles can be removed by working with the equation for the drift motion of the guiding centres. It remains true however that the short space- and time-scales are still a problem in all these Vlasov calculations. -B-I-15-

4. Fluid Models

Turning now to fluid problems, with a typical set of magnecohydradynamic (MHO) equati»-«(9) Continuity equation 3p/3t - -£ • pv (46)

Momentum equation 3(pv.)/3t = -3/3x.(p..) + vtfzpv. (47)

Magnetic equation 3B/3t = 2. * (v * JO + nV2B (48) Temperature equation 3T/3t = -V_ • (Tv) + (2 - y)TV • v + K?2! + (Y - Unj2/p + (Y-1)V[(V * v)2*^-^)2] (49) Pressure P.. « pTS. . + pv.v. + (B2/2)6.. - B.B. (50) ij ij i J ij 1 J Current j_ = V, » IS (51) there is more scope for algebraic manipulation than with particle codes because the basic differential .equations "are evidently expressed in symbolic vector form, independent of the particular choice of coordinate system. We would like to preserve this property if possible in the formulation of difference equations and in the construction of the code itself. A typical coordinate system may in fact be quite complex, depending «ither on the shape of -he apparatus (toroidal, spherical) or even on the instantaneous magnetic field. Some progress has been made with symbolic program generation which will be described in §5. However, the main limitation at present is that for many of the MHD problems of interest the necessary numerical methods have not yet been found.

The two principal difficulties are concerned with anisotropy in the physi­ cal phenomena, and with the high Alfven speed (B2/4np)*. Anisotropy arises from the fact that the propagation of heat, the motion of charged particles and some types of wave motion occur much more readily along the magnetic field than across it. If we attempt to represent such processes on the usual orthogonal finite difference mesh, and thi= >'«sh is not accurately aligned with the field, then numerical errors which ^derive from the large longitudinal time can seriously affect the calculation of the much smaller transverse terms which nevertheless may be the principal features of interest, for example the diffusion of heat or plasma across the magnetic S ield ill a plasma containment device. The solu­ tion appears to be to choose a more complicated difference mesh in which the field, itself defines one of the coordinate directions. A few such codes have beui written, but the algebra and numerical analysis become awkward when the magnetic field has a complex topology which may be changing with time. Symbolic methods might well be useful here. -B-I-16-

Regions where the plasma density p is small have a high Alfven speed which entails a rapid relaxation to pressure equilibrium

Vp = j_ x £ (52) where p is the plasma pressure. If processes such as diffusion are being solved on a long time scale, it may be necessary to allow all or part of the plasma to relax to pressure equilibrium at every timestep by solving the elliptic equation (52).

Most of the MHD codes that have been written so far take advantage of simplifying features of the particular physical problem to be solved, e.g.

1-dimensional symmetry, or a single field component Ba which is orthogonal to the 2-dimensional (r,z) plane of calculation ao that it cannot introduce any anisotropy. In order to illustrate a few of the techniques I shall discuss a very simple 3-diraensional example, namely the solution of the free-space Maxwell's equations 3E •5= = Curl B (53) dB •5= - - Curl E (54) div E_ = 0 (55) div ji = 0 (56) in rectangular geometry. For simplicity the velocity of light has been chosen to be unity and factors such as 4TT omitted.

We introduce a lattice consisting of all points

(t, x, y,z ) = (nAt, jA, kA, i&) (57) with integer (n, j, k, I). Mcrmally we would write the discretized variables as, for example, \U.l (58) or in Fortran EXCJ.K.L) (59) and a centred space difference would be represented as

E !!*+ *S.j.fc»i.*~ S.j.k-M (60) By 2A K ' or in Fortran (EX(J,K+1,L) - EX(J,K-1,D) * RDEL2 (61) where RDEL2 = 1/2& Co save a division. Clearly either (60) or (61) is much more long-winded than the vector notation used in (53)-(56) and in fact it materially slows up the construction of codes as well as making them less intelligible and introducing errors. -B-i-r-

The discussion may be simplified by using a symbolic notation. Let

L , L = (L , L , L ) (62) t — x* y* z be unit translation operators on the space-time lattice in each of the A directions. Then the centred difference representation can be written as

Tt =- 't - -TET- ' \ (53)

LJ —ÏÂ =-l <"> so that the difference analogues of (53) and (59) can be written in operator form as % ^ V E_ = ^ * II (65)

V B_ « -V * E_ . (66)

Operators may be considered to act also on lattice». If the full lattice consists of all points (57) then we find that the six variables must each be defined on a deparate sublattice, e.g.

E •*• (eoee), B •+ (oeoo)

E -*• (eeoe), B -*• (ooeo) y y E -+ (eeeo), B •+ (oooe) z z where for example (eeeo) denotes that n, j, k are even while S. is odd. This

can be checked by noticing that (for the x-components):

(E ) L (eoee) = (ooee), L (oooe) = L (ooeo) = (ooee) (68)

(B ) L (oeoo) - (eeoo), L (eeeo) = L (eeoe) = (eeoo) . (69)

We should also like to establish that (55) and (56) hold for all time as difference identities, £.E_=0, ^ . B = 0 (70)

provided that they are true initially. This can be seen by noticing that

are a commuting set of operators on lattice functions, and that

V (V . E) - ^ . (V E) = V_ . (7 * B) - 0 , (71)

as may readily be seen by expansion :

V (7 B -7 B) + (7 B -7 B)-7 (7 B -7 B) , (72) x^yz zy z x x z zzy yx'

«hen terms cancel in pairs. -B-I-18-

The properties of chis difference scheme have been studied by Bunemann » It can be coded very neatly in assembly language, using a Dotal of about 50 instructions for each space-time 'molecule1 of 6 points, and is therefore able to run at high speed even on a large lattice, assuming that this can be accom­ modated in the main store. There is a timestep limitation of the form

at < — (73) /3 corresponding to the fact that light that wishes to propagaLa across the dia­ gonal of a cube (/5 Û) must travel along the sides <3A> in order to do so. Explicit methods should be particularly suitable for relativistic problems, of vhich this is the simplest example, since there is an upper limit (the velocity of light) on all physical propagation speeds.

5. Symbolic Algol

Symbolic Algol (SA) is a technique for writing down a set of Algol state­ ments in symbolic form, equivalent to the original vector partial differential equations, which when executed will either ;

I. Solve the problem directly, at some cost in computer time. II. Generate an optimized code to be used for later runs.

In practice Symbolic Algol I (SAI) should be used for program development work and for short tests, while Symbolic Algol II (SAII) is to be used for larger production calculations (9). The conversion from a set. of equations snch as (46) - (51) to either SAI or SAII is 1-1, and can either be made by hand or automatically.

The SA technique exploits tain sophisticated features of the Algal 60 language which enable any existing compiler to he used as a powerful macro- processor and character generator. These include recursion, ".11 by name, side effects, and the ability to use furetions without explicit arguments. The symbolic notation which it provides is not entirely ideal, since (54) must for example be coded in SAI as AB[C, q] : = B - DT*CURL(E) ; (74) and in SA II as EQUATE (B, DIFF (B, MULT (DT, CURL(E)))) ; (75) whereat- one would prefer to write simply DB/DT = - CURL(E) ; (76) which is of course not legal Algol 60. A practical solution for the time being is to have a small preprocessor (actually itself a simple compiler written in Algol 60) tc convert any desired form such as (76) into (74) or (75) as required. -B-I-19-

Thls will enable the advantages of symbolic programming techniques to be tried out on virtually any computer system on an ad hoc basis, without the need for a special language or compiler, and when the requirements become clearer then an appropriate new symbolic language can be developed.

It SA Ï the electric and magnetic fields are represented by two arrays

real AE, AB [l : 3, 1 : NMESH]; (77)

where NMESH is the size of the mesh. The symbolic variables E, B are para- meterless procedures which pick up the correct array values specified by global variables C (current component) and Q (current mesh point):

real procedure E ; E:=AE[C,Q]; (78) real proeedi-.e B ; B:= AB[C,Q]; . (79)

These global variables are manipulated by translation operators EP,EM which are equivalent to L, L of §4;

real procedure EP(F); real F; (80) begin Q:= Q+DQ; EP: = F; Q:= Q-ilQ; end;

as well as rotation operators RP,RM, while an operator such as CURL is defined by real procedure CURL (A); real A; CURL:= RP(DEL(RP(A)))-RM(DEL(RM(A))); (81)

corresponding to a notation such as èA SA (Curl A), = s-1- - s-i (871 1 ôlti+ ôxi-

where (i,i+,i++) are in cyclic order with 1++ = i-, 1~ = 1+ . (83)

The DEL operator stands for V of (64) and is defined 1.' terms of EP and EM.

A SA I statement auch as (74) thus expands into a 'tree' • f procedure calls, some of which manipulate the component C and mesh position Q while others such as (78) extract the required array elements from the store. The code runs quite slowly because of the large number of procedure calls that are typically involved, but since the equations and procedure definitions are usually only one or two lines in length it is easy to write or to modify, and can be used for short tests on a small mesh. It is also highly modular, since in order to change the number of dimensions, the cooroi">ate system or the difference scheme it is for example not necessary to alter the basic equation (74). -B-I-20-

(9) SA II is qulce similar , the only difference being that instead of extracting an array value from the store and calculating with it, the program uses the numerical values of C and Q together with a character string such as 'E' or 'B' to form a computer instruction which is then transferred to an output file. Operators such as -, * must be capable of outputting their own 'names' and must therefore be written as ordinary Algol typed procedures DIFF, ;r.".I. An SA II generator la quite fast, taking only a feu seconds on an IBM 360/91 to prod'ice a 3-dimenaional MHD code in optimized assembler language for the equations (46)-(51).

6. Automation in Fortran

A considerable amount of automation can be Introduced for programs written In Fortran (or any other equivalent language) to make the development of new codes faster and more convenient.

Substitute facility The first technique to be described may appear obvious, but in fact it is of great practical benefit and I am always surprised that it is not more generally available. The Idea is simply that whenever a statement

// SUBSTITUTE (filename) (84) is encountered in the input stream, it is replaced by the contents of the named file. At Culham this has been available since 1963 and is now used mainly to refer to COMMON blacks so that only one on-line copy need be con­ structed and maintained, a great saving in time and effort for large programs. Previously this idea was however used as the basis of two quite sophisticated operating systems. For example, the user can always replace any sequence of coi.-rol statements by one single statement of the form (84), thus tidying up awkward JCL. The facility is recursive to a finite depth.

OLYMPUS The next idea is to recognize that all initial-value problems have a good deal in common with one another. The actual equations

|| = P(f) (85)

will vary from case to case but much of the program structure and nomenclature can remain the same, just as a good deal of classical or quantum-mechanical Hamiltonian theory 'oes not depend on the precise form of H. What we nave done at Culham therefore in to set up a standard scheme caljed OLYMPUS, which includes a commor main program and a set of common control and utility sub­ programs which are to be used with all initial-value codes, as well aa with -B-I-21- other codes which can conveniently be put into similar form. The control subprogram COTROL requires the use of other subprograms with names

1 1 CLEAR Clear variables and arrays 1 2 RESUME Resume from previous run 1 3 LABRUN Label the run 1 4 PRESET Set default values 1 5 DATA Define data specific to run 1 6 AUXVAL Sat auxiliary values 1 7 INITAL Define initial conditions (86) 1 8 START Start the run 2 1 STEPON Advance one timestep 3 X OUTPUT Control output 4 1 TE SEND Test for completion of run 4 2 ENDRUN Terminate the rur 5 1 REPORT Diagnostic reporting routine 5 .2 CLIST Print COMMON variables

which are to be written by the programmer, thus encouraging a standard struc­ ture and operating procedure which makes each individual program more intelligible to those familiar with the system.

Automatic Code Construction Once the structure has been standardized it becomes feasible to intro­ duce automation. We have found it useful to be very methodical about organizing, initializing and indexing the COMMON variables but this does of course take time* The proposal therefore is to develop a master index containing such information us Name of variable Meaning Type (if not implicitly defined) Occurrence in COMMON block Symbolic dimensions Main or auxiliary ? Preset value or definition Occurrence in NAMELIST Output requirements.

This would then be used as input ta a Fortran generator program which would automatically generate the appropriate Fortran statements to be used in the routines (Bfi), as well as indexes and COMMON blocks. For example to generate -h-I-22-

he definiLiou of any auxiliary variable, say

NXMl = NX-1 (87) wc use code such as

WRITE

FORMAT (7/ REPLACE INDCOM(S)') ,gg) FORMAT ('/*') at the beginning and end of a COMMON Index.

Once a line file OUTPUT has been generated In this way, the ICL fc/70 Hultijob system used at Culham allows all the files to be updated by typing the on-line command RUN OUTPUT(S) . (90)

]_. Concluding Remarks

The computing techniques now available to plasma physicists are in principle extremely powerful. Symbolic differential equations such as (76) could be typed on-line, together with commands defining the dimensionality, coordinate system, difference schemes and other information, and then automatically converted into optimized code using SA II. At the same time, the housekeeping details could be supplied in the form of a master index and then 'implanted1 in the complete program using a Fortran generator. While the program is running it could display graphical information enabling the physicist to steer its course. Such techniques are likely to be exploited in the immediate future; however there remain some difficult problems of numerical analysis that are as yet unsolved. -B-I-23-

References

1. A survey of numerical methods in plasma physics is contained in the review volume 'Methods in Computational Physics', Vol.9, 'Plasma Physics', ed. B Alder, S Fernbach S M Rotenberg, Academic Press, Hew York (1970).

2. Recent work on plasma simulation is covered by 'Proceedings of the Fourth Conference on Numerical Simulation of Plasmas', Naval Research Laboratory, Washington DC, November 1970, Office of Haval Research (1971).

3. J M Dawson, 'Contributions of computer simulation to plasma theory1 , Corap.Phys.Coram. Suppl.3 79 (1972)

4. J M Dawson 'Computer Simulation of Plasmas', Astrophysics and Space Science 11. 446 (1971).

5. HI Berk UV Roberts, 'The Waterbag Model', loc.cit.ref .1 pp.37-134.

6. For references see R W F.ockuey, "The Potential Calculation and Some Applications', loc.cit'.ref.1 pp.135-211.

7. J ? Boris & K V Roberts, "The Optimization of Particle Codes in 2 & 3 Dimensions', J.Comp.Phys. 4 552 (1969).

8. J H Orens, J P Boris & I Haber, 'Optimization Techniques for Particle Codes', loc.cit. ref.3 p.526.

9. M Petravic, G Kuo Petravic & K V Roberts, 'Automatic Optimization of Symbolic Algol Programs, 1.General Principles', Journ.Comp.Pnys.H) 503 (1972).

10. 0 Buneman, 'Fast Numerical Procedures for Computer Experiments on Relativistic Plasmas', in Relatlvl;-^c Plasmas - The Coral Gables Conference. University of Miami, ed. 0 Buneman & W Pardo, H A Benjamin, New York (196B).

11. K V Roberts & J P Boris, 'The Solution of Partial Differential Equations Using a Symbolic Style of Algol', Journ.Comp.Phys.8_ 83 (1971). GPO TELEPHONE NETWORK

Fig.l. Integrated Laboratory Computer Network -B-I-2S-

Flg.2, Representation of a continuous function by contoura

The contours Ck move with the Incompressible phase fluid and preserve topology and area. They may be represented by a set of points (*\,v\), j°iaed by straight-line segments and satisfying the particle equations of motion (28).

Flfl.3. Step-function distribution A step-function distribution of phase density is com­ pletely defined by the positions of the curves & » which move with the fluid and preserve area and topology as in Fig.2. -B-I-26-

NSS*'

Fig.4. Two-stream Instability. Evolution of the 2-stream instability in the phase plane, starting from the initial state (32) and calculated by the vaterbag method . The 'hole1 region between the upper and lower electron beams has been shaded for clarity. "-I-

K+l

J-' +i

-»• x

Flg.5. Area-welghtlng or CIC method The chdrge associated with the point F is allocated to the centres of the cells 1,2,3,4 In proportion to the areas of overlap A^, Aj,

Ao, AA . -8-J1-1- I » ^ SOME COMPUTATIONAL METHODS IN RROijP THEORY Joachla NEUBUSEB (University of'Aachen)

0. Introduction

In writing down the lecture delivered, I feel it needs apologies in all directions! to physicists, in particu.'.ar those in the audience, that the computing methods described here are still rather far from applications to computations in physics; to group theorists that this lecture was meant to give just an idea which kind of group theoretical ques­ tions so far lend themselves to an algorithmic treatment; and in general that in trying to achie-'e i-his, I may often have fallen to over-simplification.

In this lecture I shall discuss some "general purpose pro­ grams", 1 shall neglect algorithms specially designed to give information about a particular class of groups using their special properties. Some of these are surveyed in [10] and [49]. So I will e.g. not deal with the highly de­ veloped theory of the computation of the irreducible char­ acters and representations of the .symmetric groups, space groups, Lorentz-group etc.

Dealing with group theoretical algorithms and programs means to view group theory not under the aspect of relations be­ tween structural properties, usually taken oy a mathemati- -B-II-2-

cian, but with the aim to know groups concretely. Hence there are at once three questions: 1. How does one describe a single group? 2. How does one investigate it? 3. How can one construct all groups having certain properties?

?he lecture will follow this pattern, the main part will deal with question 2 and will be subdivided according to the n:

Section 2.5 will report the sad story of the availability of the implementations of these programs.

I will try to reward readers following all this tven to part 3 by a report on the classification of groups of a certain physical relevance.

1. Description of concrete groups

The first question to be discussed then is how a particular group can be specified. Already the term "a particular group" heeds explanation. For, when speaking e.g. of "the cyclic group of order h" one usually does not mean a single group but really the class of all groups isomorphic to the group of all cyclic permutations of the integers 1,2,3,4. -B-II-3-

For our "general purpose programs" this meaning of the term is appropriate in most cases.

By an old theorem of A. Ceyley each fjroup is isomorphic to a group of mappings. As the set to be mapped onto it­ self one chooses the set T of all riçht cosets of a sub­ group U of G. Then for each h e G, the mapping

t^ : Ug—Ugh is a bijection (permutation) of T, and the assignment

is a homemorphism of 1 into S„, the symmetric group on T. The kernel of 4., is the intersection of all subgroups of G conjufite to U. In the particular case that U is the uni- subgroup or G, this inter^r-t-Lon of course also is the unit subgroup and hence *,, ia an isomorphism So each isomorphism class of groups contains groups of map­ pings and hence can be described giving one of them. But very few isomorphism classes contain "full" groups of map­ pings like symmetric or alternating groups or full linear groups over fields ana have a "nice" characterization that way. This fact is perhaps best illustrated bv lifting the num- Der of isomorphism classes of groups of order 2 , which is known up to . n = 6: .order. 2 4 8 16 32 64 128 no 12 5 14 51 2G7 ?

In order to describe an isomorphism class of groups even without referring, to any of its possibly "uninteresting" -B-II-4 concrete groups of mappings one uses the description by generators and defining relations. AB this will be one central tool in the building of algorithms, this idea (for details see e.g. [15.^3]) shall be briefly sketched and introduced by an example: All the 6 permutations of the symmetric group S, can be generated from the two permutations a = (1 2 3) and b = (1 2), i.e. all these permutations are oDtainable as finite power products of a and o, e.g. (13 2)= a2, (1 3) = (1 3 2)(1 2) = a2b. Obviously the generators satisfy certain relations, e.g. a.J = I, b = 1, and (ab) = 1, where 1 denotes the unit element of the group. It is not as easy to prove that this set of relations suffices to characterize the isomor­ phism type of the group, i.e. that without further use of permutations one can derive from these relations alone that 2 2 the group consists of the elements 1, a, a , b, ab, a b and that these elements satisfy the following multiplica­ tion table:

1 a a2 b ab a2b

1 1 a a2 b ab a2b a a a2 1 ab a2b b a2 a2 1 a a2b b ab b b a2b ab 1 a2 a ab ab D a2b a 1 a2 a2b a2b ab b a2 a 1

A set of relations having this property is called a de­ fining set of relations of the group. -B-II-5-

This rather intuitive approach is formalized by the theory of free groups and presentations of groups. From a set of symbols X = [xAl e I|, where I is some index set, a corresponding set X' = lx^ |i e I| is defined and then the set of all "reduced" words y^y^'-'^!! is f ;med, where y. e X U X' and in which no sequence x.x.-1 r .-• x-.1 x occurs. It can be proved then that this set - reduced words together with the "empty word" (consisting of no x. whatsoever) is a group under the "multipliercion" of juxt­ aposition of such words and cancellation, : - necessary, of -1 -1 all occurrences of any x.xi and x, x.. This group, which obviously models the most general -y in which a group csn be penorated from certain of its el' jents, is called the free group F„ on the alphabet X. The importance of the free groups stems from the following easily proved îact:

If any group G can be generated i om elements a, which are in 1-1 correspondence to the x. , then the mapping n. sending each reduced, word in the x, into the correspond­

ing one in the a. is an epiraorjhism of Fx onto G.

The kernel of f is called thf relation normal subgroup

R , and any se.t R of elemen+5 of Fy which together with

f their conjugates in Fx gen rate R is called a set of defining relators for G with respect to if, and the set of all equations \rç = 1 with w e R, where w<$ denotes the "word in the a " corresponding to w, is called a set of defining relations for G with respect to the generators -B-ii-e-

a.. A pair (X, R) is called a presentation of G with respect to

A presentation of G can also Je used to describe sub­ groups of G: Let (X, R) oe a presentation of G with respect :o if, then by the horaomorphistn theorem for each subgroup IJ of G there exists a subgroup 0 of F„ uniquely determined by the properties:

1. 0* = U. 2. 0 > Pv

ar.u the coseto of U in G are ±n a 1-1 correspondence

WITT: +»IP cosets of 0 in F.,. The subgroup U of G

L'3.. L-.- t;eti :r*;.'f-i.: ~y any set L> of wordr in the alphabet X which together with R generates 0.

Summarizing v;e have:

1 . Lach fjroup G possesses a presentation, in general even cany of them for each generating set of G. So one can hope to characterize an isomorphism class of groups by a presentation that reflects some of the abstract properties of the groups of this class.

2. Conversely each presentation (i.e. each set X of symbols together with a set R of word; in these symbols) aefines a group, namely the fac­ tor group of Fy by the smallest normal subgroup of F,. containing R,

However, while for a group of mappings calculation with the elements may be tedious but is in principle always possi.ble, -B-1I-7- thio is not so for groups given by presentations. In 1911 M. Dehn specified three famous problems: (i) to find an algorithm which can decide- in a finite number of steps if a word in an alpha­ bet X defines the unit plement of a group de­ fined by a finite presentation (X, R), i.e. a presentation where X and R are finite sets,

(ii) to find an algorithm which can decide in a fi­ nite number of steps if two words in a certain alphabet X define conjugate elements in a group G defined by a finite presentation (X, R),

(iii) to find an algorithm which can decide in a fi­ nite number of steps if the groups defined by two finite presentations are isomorphic.

It must seem a fatal blow to the practical usefulness of presentations for group theoretical algorithms that P.S. Novikov proved in 1955 that even the seemingly most modest of Dehn's problems, the "word problem" (i), is al- gorithmically unsolvr' . in the worst possible sense, i.e. there exists a finitely presented group that will defeat any possible algorithm. (The other problems wers soon after also shown to be unsolvable.)

However, already an 1936 J.A. Todd and H.S.M. Coxeter [58] had describad a method to obtain information from a given presentataon which at least very often did work. This method and some variations of its idea will be described iu the next section. -B-II-8-

2. Algorithms for the investigation of a given group

2.1. Presentational algorithms

2.1.1. The Todd-Coxeter algorithm

Let a group G be given by a finite presentation (X, R) and a subgroup U of finite index n in G by a finite

set S of elements of Fx. Then the aim of the Todd- Coxeter method is to construct a table in which the cosets of 0, as defined in section 1 , -ire numbered by the inte­ gers 1, ..., n and which lists for each coset C, and each element x s X the number of the coset which contains the product y.x of an ilement y. e c, with x. From such a coset table the index of U in G, coset represent­ atives of 0 in F„ and hence of U in G and the map­ ping *,, of Caylsy's theorem can be read off. We remark

that the system of coset representatives of 0 in Fx can bo obtained as a so-called .'ichreier system, see e.g. [^3], p.93- This fact will be used in section 2.1.3.

The cosct taLle is constructed by a kind of trial and error procedure, using the fact that for each word w e R and

each coset C:, the product C±w = C, and that, if Ci = 0 and u s S, then C,u = C. . These facts are used in tentatively assigniig coset numbers to certain elements

of F.{ and altering t;.ese when further information is de­ duced. We c>n only illustrate the method here by a trivial example.

Let G have the presentation (X, R) where X = [x, y| and R = |x^, y , xyxy|. Let us try to enumerate the co- -B-II-9- sets of U defined by S = |y We define C, = C and successively C := C^x, C 2 3 ••= C2x. As we ha-e CUx CjX3 = C . 1 As y e S we have C1y = C..

If next we define C^ := C2y, then, as y e R, we have 2 C4y = C2y = C2" As xyxy e R we have c3 = C,xyxy and

hence C, = C^xyxy = (^yxy = C^xy = C2y = C^, i.e. C, = Using this we see that we have obtained the coset table:

X y

c1 c2 C1

C c2; .-C3 3

C3 C1 c2

So U has index 3 in G, the elements 1, x, y form a set of coset representatives, and the mapping *„ is defined by x—(1 2 3) *0:-y— (2 3}

The Todd-Coxeter algorithm is probably the most often imple­ mented group theoretical algorithm, and a number of differ­ ent strategies with respect to the sequence of definitions and the treatment of consequence relations have been devel­ oped in these implementations. As several reports on these and comparative studies of the behaviour are available, e.g. [13,18,36,37,33], no details shall be-given here.

It,can,.be,:prpy,ed. [46,5,9] that, whenever the index G:U is finite,;' then the Todd-Coxeter algorithm will eventually -terminate shaving,.produced-a correct coset fevble. Unfortu­ nately, it'- follows from the unsolvability of the word problem -B-II-1Û- that no a priori bound can be given for the number of steps until termination, so that from the nontermination after some finite number of steps no conclusion whatso­ ever can be drawn.

However, for most of the practically occurring presenta­ tions the Todd-Coxeter algorithm behaves surprisingly well. The power of some of its implementations may be illustrated by the fact that a backing store versicn implemented by Jane M. Watson in Canberra enumerated the cosets of a sub­ group of order 10 in a group of order 551040. The computa­ tion occupied an IBM 360/50 for 79.5 houri [13].

2.1.2. Sim.;' algorithm

Let again a group G ue given oy a finite presentation. As we aaw, the aim of the Todd-Coxeter algorithm is to deter­ mine the index of a subgroup of G given by a set of gener­ ating elements. A converse problem is to determine all sub­ groups of a given finite index in G by constructing a set of generators for each of them. This amounts to filling a coset table of a given size in all possible ways that are compatible with the defining relations of G by a branch and bound algorithm similar to the Todd-Coxeter procedure. This method has been proposed by Charles C. Sims [54-] and has since been implemented several times [40]. For each subgroup U of the prescribed index the output of the al­ gorithm is a system of generators and a system of coset rep­ resentatives of 0 which again can be obtained as a Schreier -B-II-11- system for use in the algorithm of section 2.1.3.

In contrast to the Todd-Coxeter algorithm the Sims al­ gorithm is bounded, but because the number of branches rises sharply with the index, this index must practically be below 100, in many cases even below 50, depending on the number of generators and the complexity of the rela­ tions in the presentation of G. The method is particular­ ly useful to find subgroups of finite index of finitely pre­ sented infinite groups. So it has been used to find such subgroups of space groups and thus to derive colour groups.

2.1.3. A Reidemeister-Schreier algorithm

In both the preceding algorithms the starting point was a presentation of G and some information about a subgroup U of G. The algorithms complement this information, so that after their performance a system of generators for U and a Schreier system of coset representatives of D is r. .-ailable. By a theorem of Reidemeister and Schreier, see e.g. [4-3], thm. 2.9, these informations suffice to obtain a presentation of U from the presentation of G, so that in principle it is possible to apply the Todd-Coxeter al­ gorithm and the Sims algorithm to U again and thus start an iteration. The practical difficulty is that already the

number":;pf^generators for. U obtained in the algorithm may be. large, and .;^hat this j? even mor>- true for the number of relations following from the exact_form of the Reidemeister- Sçlirëiër-/theorem,vSome, procedures have been designed and -B-II-12- implemented to reduce the number of relations [33]. Experiments showed that these procedures work quite well at the cost of usually producing among very reasonable ones some very long relations. In many of the cases tested these were jn fact redundant and repeated Todd-Coxeter runs could be used to single out in an interactive way a "good" presentation for U.

2.1.4. Cannon's algorithm

In the preceding algorithms the group was given by a presen­ tation, and further information on the group was sought. In many cases, however, a group is given concretely, e.g. by a set of permutations or matrices generating it, and a presen­ tation is wanted e.g. in order to find big subgroups with Sims' algorithm or a wore convenient permutation represen­ tation by the Todd-Coxeter algorithm. As pointed out with our introductory example of the presentation of S, it is easy to find relations holding for the given- generators, but it is difficult to prove that they charactei-ize the group, i.e. that they make up a presentation. This task has been solved in many individual cases in the literature by skilful and sometimes tedious arguments, e.g. [29], but such solutions were generally considered rather as a piece of art. It is vc-ry nice, therefore, that J.J. Cannon devel­ oped an algorithm that is able to solve this task automatic­ ally and even yields very concise presentations in most cases. -B-II-13-

Again I can only sketch the principal idea of the algorithm. From a given system lg^»gp<•••.g-l of concrete generators of G it is possible to construct the coset table of G wit' respect to the unit subgroup, the cosets of the -r.-t subgroup of course being nothing Vat '.he elements of G and the coset table h°nce listing the regular permutation representation of the generators. From this coset te Die one can find for each element g of G a word w (g„...,g )

in the generators g-|>..-,gn. Then it it. easily seen that

the i ' J-ions

1 vg(gv...,gn)gi(wggi(g1 gn))' = 1

for all g \s G, gi s lg-| . • • • ign! form a set of defining re­ lations of G. Of course this system is highly redundant.

So in Cannon's algorithm, described first [12J in the lan­ guage of so-called Cayley diagrams and in a modification in

[20], the procedure is much more refined. The w (g1,...,g ) are chosen shortest possible and the algorithm avoids to construct the great majority of redundant relations by tag­ ging off in advance consequence relaticns using techniques of the Todd-Coxeter implementations.

Because of the size of the coset table, the applicability of this algorithm is restricted to groups of order up to about 10 . Cnnnon has also implemented a second version of the basic idea which uses a coset table of G with respect

+c a proper subgroup U together with, a coset t&ule of U with respect to the unit subgroup. However, while the firs- version is proved xo work in all cases, the latter o::e may -B-II-14- fail, although in experiments the failures were rare.

£.1.5. Macdonald's algorithm

Recently I.D. Macdonald proposed and first implemented yet another algorithm [42], which again starts from a present­ ation of a gr.jp, but uses the entirely different technique of commutator collecting, first introduced by P. Hall [321.

Let G ûe a finite p-group, then G has a descending cen­ tral chain

G = H0 > H, > ... > H,M > Hn^+1 > ... > H^ > ... > ",ls = <1>

such that the H , i = 1,...,s, are the groups of the lower central series, and the remaining H^ are deterr l y the property that HI-I/HJ is the maximal elemental ai.clian :'aetor group of H. -i/H for all k = 1,...,s and 1 nk

all i = n, _^+1 , . . , ,n where nQ - 0.

Refining this chain to a chain

G = G0 > G-, > ... > Gr = <1>

where Gi_1/G. has order p and choosing for each

i = 1,...,r an element gi such that the coset <*<§< generates G^ _., /G, , one obtains a generating system

lg-|,...,grl 0- G with respect to which G can be de­ fined oy a system of relations

p i+1) (i r) s? = i. s- S^' ...g^ ' -1.

1 ;l,J+1) (l,d,r ) 1 [sr,gj = 1.- [Ej.glr E^' ---4 - = -> with 1 £ i < j < r, where O < v(i,j) < p and 0 < \_(i,j,k) < p. The £i..i of Macdonald's algorithm is to -B-II-15- construct from any given finite presentation of G a presentation of the above form from which the order of G and the structure of its lower central series can be read off.

The method is to construct successively defining relations of the above type for the factor groups G/H,. Assuming

this be done for G/tL, generators for H^/H, 1 are tentatively introduced corresponding to certain of the defining relations of G/Hj^ and commutator collecting is used to eliminate redundant ones because of general iden­ tities and the given relations for the whole group G.

The algorithm, details of which are too technical to be discussed here, has the main advantage over the Todd-Coxeter algorithm that it works multiplicatively, i.e. with each completed step the order of the :'known part" of the group rises by a factor, while the Todd-Coxeter algorithm works coset-wiae, hence essentially additively. Computing time does not even critically depend on the prime p but mainly only on the nilpotence class of the group. It is natural, therefore, that the Macdonald algorithm has soon found much interest, and extensions have been developed [1,60]. In particular its original restriction to minimal presentation:;

can be: removed at little extra cost [23] and it can then also'^b.e.used; to calculate the maximal nilpotent factor group of any finitely, presented finite group. -B-II-.16-

2.2. Permutatlonal algorithms

In this section I can only briefly hint at a series of powerful procedures for the investigation of permutation groups that have been developed and very suooeasfully used by C.C. Sims. Descriptions are given in [55i56], in par­ ticular [57], a summary can also be found in [20].

For a more detailed investigation of a permutation group G acting on the set Q = [1, 2,...,n| the group must "be available in a form satisfying three reo.uirements, formu­ lated by Sims in [55].

(i) It is efficient in storage, (ii) For any permutation h on Q It is easy to de­ cide whether or not h is in G. (iii) It is possible to run through the eler.mts of G one at a time without repetitions.

Sims solved this problem in the following way: G has a chain of subgroups G = G > G^ > ... > G = (1 ) where G. is the stabilizer of the numbers 1,...,i, that is, inductively defined, G. consists of all permutations of

G,_^ that fix l. Two elements of G-J-I are in the same coset of G. , if and only if they map i onto the same num­ ber, hence the cosets of G. in GJ_-I are in a natural 1-1 correspondence with the different images of i under all permutations of G-t -i • Using this it is easy to assign to an element of G4-1 th,e coset of G. to which it be­ longs. Choosing for each i = 1,...,n coset representatives -B-II-17-

Ë g s Ior the r cosets OI G i 1' i 2' ••"' i r. i " t in G. .. one therefore has for each element g a G a unique decompostion

When a system C = !g. . | i = 1,... ,n:, j, = 1 r,| of cosets representatives of the chain of stabilizers is listed, it is easy to check for a given permutation on Q if it belongs to G, and if it does, to find its decomposi­ tion. Also (iii) is satisfied.

Sims has described and implemented an algorithm to find from any given set S of permutations a system C for the group G generated by S; in particular this algorithm deter­ mines the order |G| of G which is |G| = i^r-.-.r . The philosophy is to use the above mentioned characterization of the cosets to find coset representatives and then the Reide- meistor-Schreier theorem to ootain generators for the sub­ groups. The details are fairly tricky, in particular in versions of the general idea implemented by Sims that can handle permutation groups of degree a few thousand. Using this basic technique Sims has further developed pro­ grams for the determination of structural details of large permutations groups, such as centralizers, intersections of subgroups etc.. The power of his methods is beBt illustrated by the fact that he made very essential use of them in his proof of the existence of a new simple group of order 51 765 179 004 000 000 predicted by R. Lyons, in which he had tb" handle "tb a great deal a permutation group of degree -B-II-18-

3906 and order 5 859 000 000.

2.3 Structural algorithms

2.3.1. The subgroup lattice

The algorithms described in the preceding sections can handle fairly big groups, but of course in most cases they only provide rather global information on the groups inves­ tigated, like the order of the group, certain chains of sub­ groups etc. It is fairly obvious that if one wants a more complete automatic analysis one will have to pay for this with restrictions on the size or/and the properties of the groups to be treated.

Perhaps an extreme requirement is to compute the lattice of all subgroups of a group together with detailed information about abstract and embedding properties of all the subgroups. A few different mechods for this task have been proposed. Experience so far has shown that those using more group theo­ retical ideas [9,21,47,48,50] are more efficient than the more combinatorial ones [41]. Again I can only sketch the idea of the first of the former ones, the so-called cyclic extension method which with many technical improvements seems still to be favouraole.

Its philosophy is that among the groups that are in the raiige of such a complete analysis - which are with present computers at the very best groups of order less than 50 000 - there are comparatively few, the so-called perfect groups, that do not -B-II-19-

possess a normal subgroup with a cyclic factor group of prime order. A perfect group mist have a factor group which is a non-commutative simple group; of these there are only 8 of order less than 3000 altogether, of orders 60, 168, 360, 504, 660, 109H, 2448, 2520, resp. So, start­ ing from the unit group one can find the majority of all subgroups of a finite group G by a "layerwise" construc­ tion. Assuming all subgroups whose order is the product of i primes known, all the non-perfect groups whose order is the product of i+1 primes are obtained as "cyclic exten­ sions" . If the subgroups are represented by characteristic functions, e.g. on the set of all cyclic subgroups of prime power order, redundant extensions can be avoided by checking in advance certain conditions on the already listed character­ istic functions. In the existing implementations perfect subgroups are then found by casewise inspection for certain subgroup situations.

These implementations are built In modules of which only the lowest in the hierarchy, i.e. those for multiplying, inver­ ting etc. of group elements depend on the nature of the group elements. So the same system of programs can handle groups of permutations, matrices over finite fields etc. and can easily oe adapted to handlR groups with still another kind of elements.

Some of "Lh'e implementations yield besides the lattice- relations of the subgroups also listings which subgroups are cyclic, abelian,. nilpotent, super soluble, soluble or -B-II-ZO-

perfectj normal or subnormal. Conjugate subgroups are marked, also the normalizers and centralizers of subgroups and certain characteristic subgroups like those of the upper and lower central series, etc. are identified.

Some of the biggest groups completely analized by these programs were the symmetric group S„ of order 50^*0 which has 11065 soluble subgroups and a 4-dimensional maximal finite unimodulai group of order 1152 which has 5191 subgroups.

2.3.2. The automorphism group

The first program for the determination of the automorphism group Aut G of a finite group G was written in 1963 by V. Felsch [19,22]. It built on a program for the deter­ mination of the subgroup lattice and used its results in a rather tricky iteration to choose a generating system S for G such that the number of generating systems S ' which could at all be images of S under automorphisms of G was minimal. The mappings remaining feasible after this "narrowing down" were then checked for the automorphism property in a process which again used "tagging off in ad­ vance" wherever possible. E. Altmann, E. Geller, and h. Ger- hards [30,31] have used P. Hall's theory of Sylow systems to divide the task for soluble groups into two parts. 'The first of these is the computation of coset representatives of the system normalizer, the second to compose those -8-II-21-

automorphisms stabilizing a Sylow system from the auto­ morphisms of the (often much smaller) Sylow subgroups. The latter are found by an adaption of Felsch's algorithm.

This composite method has worked very w 11, e.g. it com­ puted the automorphisE groups of certain soluble groups of orders 86A and 6048 to have orders 7- :496 and 108864, resp.

2.3-3. Partial structure analysis

As pointed out in 2.3.1, a complete analysis of a group is restricted by storage space and computing time, but also last not least by the mass of output. It is therefore desir­ able to have programs for a more directed partial structure analysis that can be used interactively. J.J. Cannon has first put together a system of such routines [11] containing or sometimes building on some of the algorithms mentioned above.

As basic, constructions his system contains programs for the following tasks:

(i) the determination of coset representatives for a given subgroup U of a group G, (ii) - the-generation of all group elements one at a time without repetition, (in) the determination of the centralizer of a given group element, (iv) the determination of the normalizer of a given surgroup U in G, •B-II-Zli-

(v) the dbtermination of the smallest normal sub­ group of G containing a given subgroup U of G, (vi) the determination of the classes of conjugate elements, (vii) the construction of the subgroup lattice of suf­ ficiently small groups.

In such an interactive system there may be (and in Cannon's system in some cases were) different programs available for each of the basic constructions from which the user can choose according to the situation he starts from, e.g. coset representatives car. be determined by the Todd-Coxeter algorithm if a presentation is given, but by one of Sims' procedures if a permutation group has to be dealt with.

The basic constructions are then used in programs to compute sone "interesting" subgroups. Among these are the Sylow subgroups and their normalizers, the so-called elementary subgroups, the Fitting subgroup, the groups of the lower -oc^'^i s .-'.'ids <~nri th-r t;fji";:rc-.

Also a program that determines the lattice of all normal subgroups of a given group can be built using some of the basic constructions.

The range of applicability of such partial structure pro­ grams depends of course on the way the group is given, but it clearly by far exceeds the range in which any total analysis can be done. -B-II-23-

2.4. Representational algorithms

2,4.1. Algorithms for characters

TiTie first aim in a project to study representations of a group G usually is the determination of the table of the characters of the irreducible complex representations of G, referred to as the character table of G. However, the data from which to start such a determination may be quite different. For explicitly ^^ven groups of moderate size one may assume that it is possible to determine the

classes (1 | = C1, ..., C of conjugate elements of G. From these in principle (although this may be rather tedious) the class multiplication coefficients c. .. defined by r C.C . = 5" c . ., C, can be found. Let h.. be the numDer of elements in C., 1 r and x ,...,x the absolutely irreducible characters. Let y.9 be the value of xJ for an element of C^. Then for each s = 1,...,r the r values w? = —f X? with 1 < i < r *1 2 satisfy the r equations

g/ci:jk "6 ikxj>xk = ° for 1 -ii; i ^r "

Hence the r vectors ws = (w^,.i.,w^), s = 1,...,r are

common eigenvectors of the matrices M., =- (ci 1k), J = 1,,..,r, and it can be shown that up to norming they Eire the only ones. -B-II-24-

This opens a possibility to compute the characters by numerically solving eigenvector problems. The method has Deen implemented, see e.g. [44,45], and worked well, if the number r of classes is not too big. Otherwise nu­ merical difficulties may occur. J.D. Dixon [17] has pro­ posed a nice way out of these difficulties by mapping the eigenvector problem over C onto a corresponding one over the finite field Z of p elements and then constructing from the solutions over Z the wanted solutions over C. This transfer is possible for certain primes bigger than the order of G. As the practical possibility of solving the characteristic equations over Z depends on the size of p, Dixon's method is the choice for groups of compar­ atively small order and many classes, while the computation over C may still be indispensable for groups with few classes uut /ery high order, uoth quite realistic situations.

2.4.2. interactive procedures Cor character.'.

In many cases, hovever, character tables are wanted of very big groups for which the direct calculation of the class multiplication coefficients would be an unsurmountable prob­ lem. Also in quite a few cases the construction of tentative character tables has been a very importanti-stepiin the,proof of the existence of a group with .prescribed^ pr.pp'erties. ,., This technique has in particular bèen%use"a;>in '"establîsfetiig^tliè::. existence of some new finite simple non-abéliaii groups... during -B-II-25-

the last years. For both such situations interactive programs have been developed almost simultaneously at different places, e.g. by D. Livingstons and ¥. Wynn at Birmingham, J. Conway and M.J.T. Guy at Cambridge, and A. Rudvalis at East Lansing. The basic philosophy of these programs is to make use in one way or other of the theorem that if x is a faithful character of a group G then all absolutely irreducible characters of G occur as constituent of some (tensor-)power of x. In principle such programs proceed building up a table of ir­ reducible characters and a list of compound characters which do not contain any of the already known irreducible ones as constituents. Starting from at least one faithful character of G, preferably of low degree, the program tries to find new characters by applying the following methods:

(i) Tensoring. (ii) Symmetrizing with an irreducible character of a permutation group, see e.g. [35]. For this proce­ dure information on the classes of certain powers of elements is required, (iii) Inducing from characters of a subgroup U. This requires knowledge on the fusion of classes of the subgroup U into the classes of G. (iv) Subducing from characters of a group containing G. This again requires knowledge on fusion.

Newly found irreducible characters are split off from -B-II-24-

This opens a possibility to compute the characters by numerically solving eigenvector problems. The method has been implemented, see e.g. [44,45], and worked well, if the number r of classes is not too big. Otherwise nu­ merical difficulties may occur. J.D. Dixon [17] has pro­ posed a nice way out of these difficulties by mapping the eigenvector problem over C onto a corresponding one over the finite field Z of p elements and then constructing from the solutions over Z the wanted solutions over C. This transfer is possible for certain primes bigger than the order of G. As the practical possibility of solving the characteristic equations over Z depends on the size of p, Dixon's method is the choice for groups of compar­ atively small order- and many classes, while the computation over C may still be indispensable for groups with few classes out /ery ".igh order, uoth quite realistic situations.

2.k,Z. Interactive procedures for characters

In many cases, however, character tables are wanted of very big groups for which the direct calculation of the clssà multiplication coefficients would be an unsurmountable prob­ lem. Also in quite a few cases the construction of tentative character tables has been a very important;,stèp^im-thesproof of the existence of a group with presçribed;;pi?qperties.'.-^This technique has in particular been .used^ in?establishing the,, existence of some new finite simple non-àbëliân groups during -B-Il-25-

the last years. For both such situations interactive programs have been developed almost simultaneously at different places, e.g. by D. Livingstone and W. Wynn at . Birmingham, J. Conway and M.J.T. Guy at Cambridge, and A. Rudvalis at East Lansing, The basic philosophy of these programs is to make use in one way or other cf the theorem that if x is a faithful character of a group G then all absolutely irreducible characters of G occur as constituent of some (tensor-)power of \. In principle such programs proceed building up a table of ir­ reducible characters and a list of compound characters which do not contain any of the already known irreducible ones as constituents. Starting from at least one faithful character of G, preferably of low degree, the program tries to find new characters by applying the following methods:

(i) Tensoring. (ii) Symmetrizing with an irreducible character of a permutation group, see e.g. [35]. For this proce­ dure information on the classes of certain powers of elements is required. (iii) Inducing from characters of a subgroup U. This requires knowledge on the"fusion of classes of the subgroup U into the classes of G. (iv) SuDducmg from characters of a group containing G. This again requires knowledge on fusion.

Newly found irreducible characters are split off from -B-II-Z6-

the known compound characters where possible, and it is checked with the help of scalar products of characters, if new irreducible characters can be found as integral linear combinations of compound ones. More man-machine interaction and more theory is brought in when these el­ ementary methods fail.

2.4.3. Representations

For application in quantum physics even more interesting than the characters are the irreducible representations of groups. Therefore, the problem of their determination has ueen studied also hy a great number of physicists. Re­ stricting attention here, as explained in section 0, to general methods, there are perhaps two main lines of attack.

If for a finite group the subgroup structure is sufficiently well known, one can try to get as many irreducible represen­ tations as possible by inducing representations of subgroups. A program with this basic philosophy is described in [4].

The other, more generally applicable idea is to develop methods for the reduction of non-irreducible representa­ tions and use these on known representations. Flodmark and aiokker have described such a procedure which does. chi.s with the regular representation assuming the character" table to be known [3.24,25]. Perhaps more pôwerfùï'are' âïgorlthzis given by J.R. Gabriel, best described' ' irr [27V28];':because they are applicable to an arbitrpry'représentation ;6f'a " group on which no fini~eness conditions are imposed and -B-II-27-

because they do not suppose the knowledge of the ir­ reducible characters. The basic lemma is the following simple fact: Let the group G have the representation D on the vectorspace V and let C be the commuting algebra of D, i.e. the set of all linear mappings if of V into V with D(g)ifi = ^(g) for all g s G. Then the eigenspaces of any tp e C are invariant under D(g). So Gaoriel describes an elaborate method to com­ pute the commuting algebra and then to use it to reduce D into its irreducible constituents. A closely related procedure had already been described by J.S. Frame [26] in 1960.

2.5. Availability

After talking about so many algorithms it is most natural to ask where their implementations are available. The answer is "a long and a sad tale". Generally algorithms of this kind need a lot of logical and integer operations, also they are expensive in storage space and computing tine. For all these reasons to make implementations applicable to somewhat interesting problems, many of them had to be' trimmed for efficiency and therefore be written in machine code. So some are obsolete meanwhile, others no longer fully available to their designers because these uoved place. Even the still working implementations are on different machines and in different languages.

With the improvement of methods and the availability of -B-II-Z8-

bigger and faster computers some of the reasons for this situation have become weaker. Therefore, two groups working in Sydney, Australia, and Aachen, Germany, resp. , have started a collaboration in building up a portable system of programs that eventually should incorporate all the described algorithms (and hopefully more new ones). The system is oased on a storage allocator, called the stack handler, written in FORTRAN that does all the adap­ tion to the particular machine. At present a stack handler exists for certain computers of the CDC-f aiaily. It should ne possible, however, to adapt it to any given computer in aoout three man-months. All the rest of the system is to be written in FORTRAN, but a user may cune it up for pro­ duction runs replacing critical parts by machine code. Parts of the system do exist [14], but its further devel­ opment, which hopefully will include a user-oriented handling language, will take a lot of more time.

Î. Classifications

There are very few algorithms for the classification of groups of certain types; however, some of the algorithms of section 2 can be and have been used for such purposes. R. James and J.J. Cannon [34] have thus classified:the groups of order p , p > 2. F.W... Sag. and J.W>.{ Wâmsley [53] have found.:minimal presentations ,for ;/toej^oups>qf ,., . order 2°. There.has also been a rumour for years: that, there exists a man by name of 2.R. Ro.demick (?) at the -B-II-29-

Jet Propuis..^n Laboratory, Pasadena, California, who has classified the groups of order 2', but the author's attempts to prove his existence by writing letters to the above address have failed so far.

Perhaps the most extensive application of computers to group theoretic classifications has been made in the de­ termination of the four-dimensional crystallographic groups. Starting from the 9 maximal finite unimodular groups de­ termined by E.C. Dade [16] it was first possible using among others the subgroup lattice program and a modifica­ tion of Felsch's ..automorphism group program to show that there are exactly 710 arithmetic crystal classes in k di­ mensions and to determine representative matrix groups for them. Also their classification into 227 geometric clas­ ses, 33 crystal systems and 23 crystal families was found and it was proved that there are 6k Bravais classes of lattices in ft.. Finally using an algorithm of Zassenhaus [G2] it has be shown that there are A783 affine classes of space groups in t\r and representatives have been listed [5,6,7,8,51,61]. As among these groups there are the so- called space-time groups, at least these applications may be of some physical interest.

References

1 Bayil'S, A,J., J. Kautsky, and J.W. Wausley; Computation in nilpoter.t groups (amplication). Proc. Second Internat. Ccnf. Theory of Groups, Canberra, August 1973. -B-II-30-

2 Birkhoff, G., and M. Hall, Jr.: Computers in algebra and number theory. SIAM-AMS Proceedings IV, Amer. Math. Soc, Providence, R.I., 1971. 3 Blokker, E.: A theory for the construction of the ir­ reducible representations of finite groups. IC/72/3, International Centre for Theoretical Physics, Trieste, 1972. 4 Brott, C, and J. Neubtlser: A programme for the calcu­ lation of characters and representations of finite groups. [39], pp. 101-110. 5 Brown, H., J. NeubUser, and H. Zassenhaus: On integral groups I. The reducible case. Nucsr. Math. 1j3 (1972), 386-399. 6 Brown, H., J. NeubUser, and H. Zassenhaus: On integral groups II. The irreducible case. Numer. Math. 20 (1972), 22-31. 7 Brown, H., J. NeubUser, and H. Zassenhaus: On integral groups. Ill: Normalizers. Math. Comp. 27_ (1973), 167-182. 3 BUlow, R., J. NeubUser, and H. Wondratschek: On crys­ tallography in higher dimensions. II. Procedure of computation in R^. Acta Cryst. A 27 (1971), 520-523. 9 Cannon, J.J.: Computation in finite algebraic structures. Thesis, Sydney, 1969. 10 Cannon, J.J.: Computers in group theory: a survey. Coram. ACK 1_2 (1969), 3-12. 11 Cannon, J.J.: Computing local structure of large finite groups. [2], pp. 161-176. 12 Cannon, J.J.: Constructxon of defx iig relators for finite groups. Discrete Math. £ (1973), 105-129. 13 J^nnon, : J. J., L.A. Diaino, G. Havas, and J.M. Watson: Iraple-aeiitâcion ana analysis OJ the Todd-Coxeter -B-II-31-

algorithm. Math. Comp. 27 (1973), 463-490. 14 Cannon, J.J., and J. Richardson: The GROUP system for investigating the structure of groups. Technical Report 8, Dep-c. Pure Math., U. Sydney, 1973. 15 Coxeter, H.S.M., and W.O.J. Moser: Generators and re­ lations for discrete groups. Springer, Berlin, 1972. 16 Dade, E.C.: The maximal finite group3 of 4 x 4 matrices. Illinois J. Hath. 9_ (1965), 99-122. 17 Dixon, J.D.: High speed computation of group characters. Numer. Hath. 10 (1967), 446-450. 18 Felsch, H.: Programmierung der RestklassenabzShlung einer-: Gruppe nach Untergruppen. Numer. Math. 2 (1961), 250-256. 19 Felsch, V.: Ein Programm zur Berechnung des Untergrup- penveroandes und der Automorphismengruppe einer endlichen Gruppe. Diplomarbeit, Kiel, 1963. 20 Felsch, V.: Programs for permutation groups, pp. 241- 250 in: Permutations. Mouton-Gauthier-Villars, Paris, 1974. 21 Felsch, V., und J. NeubUser: Ein Programm zur Berechnung des Untergruppenverbandes einer endlichen Gruppe. Mitt. Rhein.-Westf. Inst. Instrumentelle Math. Bonn 2 (1963), 39-74. 22 Felsch, V., und J. KeubUser: fiber ein Programm zur Be­ rechnung der Automorphismengruppe einer endli- ' chen Gruppe. Numer. Math. VL 0968) , 277-292. 23 Felsch, W.: Ein commutator-collecting Algorithmus zur Bestimmung einer Zentralreihe einer endlichen •':-. vp-^Gruppa. Staatsexamensarbeit, Aachen, 1974. 24 Flodmark, S., and E. Blokker: A computer program for calculation of irreducible representations of finite groups. Internat. J. Quantum Chem. Syia- -B-II-32-

posxum 1 (1967), 703-711. 25 Flodmark, S. , and E. Blokker: Symmetry adaption of physical states by means of computers, pp. 199- 2lg in: E.M. Loebl (éd.): Group theory and its applications, Vol. 2. Academic Press, New York, 1971. 26 Frame, J.S.: The constructive reduction of finite group representations, pp. 89-99 in: M. Hall, Jr. (éd.): 1960 Institute on Finite Groups. Amer. Math. Soc, Providence, R.I., 1962. 27 Gabriel, J.R.: Constructing bases for irreducible rep­ resentations of subgroups using Clebsch Gordon coefficients. Mimeographed notes, 1970. 28 Gabriel, J.R.: Numerical methods for reduction of group representations. [52], pp. 180-182. 29 Garbe, D., and J.L. Mennicke: Some renarks on the Mathieu groups. Canad. Math. Bull. 7 (1964), 201-212. 30 Geller, E.: Kin Programm zur Bestimmung der Automor- phismengruppen endlicher auflosbarer Gruppen. Bericht BMBW-GMD-51, Gesellschaft fur Mathematik und Datenverarbeitung, Bonn, 1971. 31 Gerhards, L., and h.. Altmann: A computational method i'or determining the automorphism group of a finite solvable group. [39], pp. 61-74. 32 Hall, P.: A contribution to the theory of groups of prime power orders. Proc. London Math. Soc . 3Ji (1933), 29-95. 33 Ha/as, G.: A Reidemeister-Schreier program. Proc. Second Intomat. Conf. Theory of Groups, Can­ berra, August 1973. •B-II-33-

34 James, R., and J.J. Cannon: The computation rf isomor­ phism classes of p-groups. Math. Comp. 23_ (1969), 135-1^*0. 35 Kerber, A.: Symmetrization of representations. Proc Second Internat. Coll. on Group Theoretical Methods in Physics, Nijmegen, June 1973. 36 Leech, J.: Coset enumeration on digital computers. Proc. Cambridge Phil. Soc. 5JJ (1963), 257-267. 37 Leech, J.: Coset enumeration. [39], pp. 21-35. 38 Leech, J.: Computer proof of relations in groups. Mimeographed notes, distributed at the Summer School on Group Theory and Computation, Galway, July'1973. 39 Leech, J. (éd.): Computational problems in abstract algebra. Pergamon, Oxford, 1970. 40 Lepique, E.: Ein Programm zur Berechnung vun Untergrup- pen von gegebenem Index in endlich prasentierten Gruppen. Diplomarbeit, Aachen, 1972. 41 Lindenberg, W., and L. Gerhards: Combinatorial con­ struction of the set of all subgroups of a finite group by composition of partial sets of its SUD- groups. [39], pp. 75-82. 42 Macdonald, I.D.: A computer application to finite p-groups. J. Austral. Math. Soc, to appear.

43 Magnus, W.f A. Karras, and D. Solitar: Combinatorial group theory: Presentations of groups in terms of generators and relations. Interscience, New York, 1966. 44 McKay, J.K.S.: A method for computing the simple char­ acters of a finite group. Mimeographed notes, 1966. -B-11-34-

45 McKay, J.K.S.: The construction 01 the character table oi a finite group from generators and relations. [39], pp. B9-1ÛÛ. 4b Mendelsohn, N.S.: An algorithmic solution for a word proolein in group theory. Canad. J. Math. JjS (1964), 509-51&. Correction. Canad. J. Math. 21 C965), 505. 47 NeubUser, J.: Untersuchungen des Untergruppenverbandes endlicher Gruppen auf einer programmgesteuerten elektronischen Dualmaschine. Numer. Hath. 2 (1960), 2B0-292. 48 NeubUser, J.: Bestimmung der Untergruppenverbande end­ licher p-Gruppen auf einer programmgesteuerten elektronischen Dualmaschine. Numer. Math. ^ (1961), 271-278. 49 NeubUser, J.: Investigations of groups on computers. [39], pp. 1-19. 50 Nsu'cttEer, J.: Computing noderately large groups: Some methods and applications. [2], pp. 183-190. 51 NeubUser, J., H. Wondratschek, and R. Btllow: On crys- ta3.1ography in higher dimensions. I. General def­ initions. Acta Cryst. A 2£ (1971), 517-520. 52 Petrick, S.R. (éd.): Proceedings of the second sym­ posium on symbolic and algebraic manipulation, March 23-25, 1971, Los Angeles, California. ACM, New York, 1971. 53 Sag, T.W., and J.W. Wamsley: Minimal presentations for groups of order 2n, n < 6. J. Austral. Math. Soc. 25. (1973), 461-469. 54 Sims, C,C.: Lecture delivered at the Conference on Computational Problems in Abstract Algebra, Oxford, Aug. 29 - Sept. 2, 1967. -B-IÏ-35-

55 Sims, C.C.: Computational methods in the study of oer- mutation groups. [39]. pp. 169-183. 56 Sims, C.C.: Determining the conjugacy classes of a permutation group. [2], pp.191-195. 57 Sims, C.C.: Computation with permutation groups. [52], pp. 23-28. 58 Todd, J.A., and H.S.M. Coxeter: A practical method for enumerating cosets of a finite abstract group. Proc. Edinburgh Math. Soc. (2) 5_ (1936), 26-34. 59 Trotter, H.F.: A machine program for coset enumeration. Canad. Hath. Bull. 7 (1964), 357-368. 60 Wamsley, J.W.: Computation in nilpotent groups (theory). Proc.' Second Internat. Conf. Theory of Groups, Canberra, August 1973- 61 Wondratschek, H., R. BUlow, and J. Neubtlser: On crys­ tallography in higher dimensions. III. Results in R. . Acta Cryst > A 2J_ ('371), 523-535. 62 Zassenhaus, H.: Uber einen Algorithmus zur flestimmung der Raumgruppen. Coram. Helv. Hath. 21. (1948), 117-141. -B-III-O-

^l(>

General Relativity and Symbolic Algebra

- by -

D. Barton

Computer Laboratoryt Cambridge -B-III-1-

1. Introduction

It is only during the past five years that manipulative algebra systems have been successfully employed in the calculations of general relativity and the reason for this dearth o" material is quite simple to understand. The actual manipulative algebra that most naturally arises in *-he area of general relativity is concerned with a very large set of elementary functions that allow many complicated simplification rules. It is the case that expressions involving a large set of elementary functions are very difficult to simplify. It is obvious that an algebra system will only be really useful when it can present its results in a fully simplified form and it is unfortunate that to do that for the set of expressions required in this branch of physics is very difficult indeed. It is because of the difficulty of this problem that very few special purpose algebra systetas have been constructed for relativity while many such systems have grown up in other fields and it is probably true to say that only when proven algebraic manipulation systems become freely available, and relativists are able to experience at first hand the computational power that they provide, will their use in the field became more irequent. Applications in this area have so far been centred around the field equations. These equations express the relationship between the geometrical structure of the four dimensional space and its material content, that is, the distribution of mass and energy. These field equations are extremely complicated even in physical ajLtuatio'v that are apparently simple; their solution is always a difficult and at p. esert frequently an impossible task. In very general terms they may be interpreted in three wa^s. In the first case we may suppose that we have completely defined the geometrical structure of the space we wish to investigate and proceed, via the field equations, to compute the distribution of matter. Another view is to assume a given distribution of matter and determine from the field equations the possible geometrical configurations that are compatible -B-III-2-

witfi that distribution. A course of action midway between these alternatives is to impose certain geometrical constraints upon the space Ce^g. axial symmetry) and other constraints on the distribution Of matter Ce.g, trrotational flowl and then discover from the field equations those solutions consistent vith the imposed conditions.

If we think simply in terms >£ the algebra involved we find that the field equations ->f çenerî 1 relativity are at the foundation of all our manipulative proolems and o"r first problem is to construct thêm in the computer. The aquations themselves are second order partial

differential equations definino the ten quantities g,4 J i = Oil,2,3,j = 0,1,2,3, that form a four dimensional syvvnetric array of functions of the four coordinates x1 of the Riemannian space. This array is called the coyariant metric and it defines the length of a line element in the space by the- relation

ds^ = g. .dx dar . "tj . - - As usual the repeated occurrence of a superfix and suffix .in an expression indicates summation over the values of that index in the range zero to three. Such, an operation is referred to as contraction and it is important to state clearly that it involves only tne algebraic operations of addition and multiplication. To obtain the field equations in terms of the covariant metric it is necessary to introduce a number of intermediate quantities that are defined in terms of that metric. We shall not discuss these quantities in detail but simply draw attention to their elementary algebraic properties that are useful when we come to program the corresponding algebra. We obtain the contravariant metric g1^ from the relation

9 Ojk " 6k

by inverting the matrix whose elements are g. .. It is important to. notice that to determine the contravariant metric we must effectively solve a set of linear equations with algebraic coefficients, and therefu^. we can normally expect the algebraic form of either the contravariant -B-III-3-

or the covariant metric to be substantially mora complicated than the other unless it should happan that both are diagonal. Furthermore, it la clear that the contravariant metric must contain the operation oi division in the expressions for its elements unless some fortunate coincidence makes this operator redundant. The algebra is therefore almost bound to be complicated.

W* are now able to define a three dimensional array of functions -ailed the Christoffel sysiols of the first kind. These quantities are

written Lijtkl ani'. are given in terms of thd first derivatives of the covariant metric by

\iJ 6xl «Xe /

where i,j and k range over 0,1,2,3. We note that this array of Christoffel

symbols is symmetric in the indices iaj and so there are at n» t 40 distinct algebraic expressions here, ft second array, the christoffel symbols of the second kind, is defined in terms of the first by

«if J= **W*&

and satisfies the same symmetry condition. Consider now the Riemann tensor that we fine b;

where i,3,k and Z range over 0,1,2,3. This tensor obviously depends on the second derivatives of the covariant metric and a naive inspection indicates that it is a four dimensional array with 256 elements.

It is clear that the elements of the Riemann tensor are likely to be algebraically complicated and so it is worth attempting to reduce the effort required for its computation as much as possible. In fact it may be shown that owing to a great number of symmetries there are only 20 distinct elements in the Riemann tensor." If we are to calculate the tensor on a computer it is absolutely essential to take advantage of -B-III-4-

thme symmatries because v;e anal. ..on perform far laas manipulation and requlr- far leas computer memory. °f coursa cheaper computing machines would make these gains less obvious, but at present there can be no doutt that they are well worth while, even when the extra programing effort required is taken into account. By performing two contractions on the Riemann tensor we obtain the Ricci tensor i?.. given 1-3 by Ij " qipj which is again symmetric in the indices i and j. Further contraction yields the Ricci scalar R where

and then the Einstein tensor is given by

The Einstein tensor is symmetric in i and 5, We observe from these definitions that the Einstein tensor G.. may be computed from tixe elements of the covariant metric by the operations of addition subtraction, multiplication and at most two differentiations. The division operator is required only for the inversion of the metric:. The energy momentum tensor T.. is a tensor describing the density of eu«rgy, matter and momentum throughout space and the field equations are

Because of the symmetry there are exactly ten of these second order partial differential equations. Throughout this section we assume that the functional form of the energy momentum tenso- has been defined by previous reference -.0 the physics of a particular problem and our discussion is limited to the ways in which a machine .an assist either with the explicit foraulation of the field equations (1) cr with their formal solution.

2. Tris field aquiriiona

The great majority of the computer aided work on the algebra of -B-III-S-

general relatlvlt" has cantrod around the 'empty apace' solutions to the f.'sld equations, f'at is to say, those solutions t"-* are valid in the absence •.•;' aa^t^r .

R.. and determine to withi-. the limits of the capabilities of its simplification algorithm whether or not the Ricci tensor was zero. I.? it was unable to discover zero it could print out the expressions for R . . and allow us to see for ourselves. Although this J .* frequently an impracticable proposition by hand, on a machine it is entirely possible. For an implementation all we require Is a subroutine that takes as its input the algebraic expressions for the covariant metric, and print- as its output the tensor elements /?... Let'Hi consider a simple example. Define the covariant metric by

ds* = -eP^dr^-rW-^sinZBdBZ+e^d** (3)

including the arbitrary unknown functions of r denoted by p (r) and q (r).

u 1 2 3 Here our coordinate system tx ,a; Jj: Jj: ) is to be interpreted as the

spherical polar systsm (i,r,83

M ff ( o ~

and obtain as output the nonzero elements "of the Ricci tensor

i?22 = l-e"P(l-'jrp'+ hrq' )

P 2 fl33 = {l-e" (l-'irp'+ >irq')}sin 8

S00--*~P*lèp' -B-m-6-

InspBction of th&se quantities shows that we have reduced the equations J, » 0 to the ordinary differential aquations p'+q' - O ) ^••1i •-•)•• J and these can be solved for p(r) and q(r). The results given above are classical but the example serves to demonstrate the power of an algebra system in this field. We may specialize a metric in any manner that seems physically desirable and then use the Ricci tensor subroutine to see if the field equations reduce to a more manageable form. Experience indicates that several weeks' tedious computation can be avoided by a few minutes' computer algebra on just such experiments as this.

Now we have been careful to point out that the facilities required by an algebra system to compute the Ricci tensor and the Einstein tensor from a giver, metric are elementary and very straightforward. However, we must expect an algebra system to experience difficulty over the simplficaticn of the results. These difficulties will increase with increasing complication of the metric and to alleviate this the actual algebra program written by the user for the calculation should take advantage of the symmetry of the various tensors. In figure 1 we reproduce a SCRATCHPAD 'program' for the calculation of a Ricci tensor. This 'program' demonstrates show beautifully the mathematical notation of the SCRATCHPAD language is suited to this type of work. Figure 2 shows the REDUCE program for the same calculation. The REDUCE and CAMAL results for the spherically symmetric metric (3) are included in figure 3 (a,b), All of these programs make tlu assumption that the metric presented as input is diagonal and that the inverse metric is given in explicit form. This assumption is made only in order to obtain the two arrays for the contravariant and covariant metrics and thereafter the programs are quite general. We have adopted this simplification because it greatly facilitates the understanding o. the programs. •B-III-7-

Appllcations in general relativity have been almost exclusively concerned with diagonal metrics and this concentration can of course be expected to disappear slowly. It is aainly a limitation imposed by one's ability to perforin the computations by hand and computers will render it far less important. In the case of a nondiagonal metric the contravariant metric can be computed by the algebraic analogue of gaussian elimination using a delayed pivotal division, the algorithm for which is due to Lipson (1969). It would be a simple matter to incorporate Lipson's algorithm into the programs presented here; indeed it exists as a library program in the REDUCE matrix package (Hearn 1970) . The programs for the calculation of the Ricci tensor presented in figures 1,2 can be thought of as library subroutines made available to physicists as part of the basic software associated with an algebra system-

As we remarked earlier, the principal algebraic problem that arises in the automatic calculation of a Ricci tensor from a given metric is that of the simplification of the result. If the metric is expressed entirely in terms of the elementary functions then this simplification problem may well be very difficult indeed. The reason for this is simply that the elementary functions satisfy a great number of identities and

the algebra systemp in attempting to simplify a given expression, must be prepared to meet any collection of these. The system obviously cannot maintain a list of every identity between elementary functions so a list of identities that in some sense 'spans' the set of all possible identities must be maintained. Again, using such a list, an algorithm cannot guarantee to simplify an arbitrary expression and so the method employed by system engineers is te choo3e a suitable list of identities, based on their experience, and try their best to simplify expressions with those, using more or less ad hoc methods. In many cases the list may be augmented by the physicist user, as in the LOT construction in REDUCE, but"-while this allows him to define rules that are otherwise

completely unknown to the system it gives him little control over the •manner in which these rules are matched against a given expression requiring simplification. If a system has a great number of rules simplification may •B-in-8-

frequently occur correctly and completely but it can be a time-consuming operation. If a system has few rules many expressions will remain unsimplified. There has been little work conducted on the efficiency of the various so-called simplification algorithms and such evidence as there is indicates that in any particular case it is very difficult to predict how much computer time will be spent on the activity. The physicist user can take some precuations that will tend to reduce the machine's simplification effort. Careful structuring of the metric so as to avoid the occurrence of rational functions will almost always have a desirable effect while the replacement of difficult functions by 'dummy' functions can simplify the machine's labour. To ill\istrate the latter point one observes that using the spherically symmetric metric (3) the calculation of the Einstein-tensor requires 14 seconds with thé CAMAL system while on replacing the functions p(f) and q(r) by their true functional forms, as defined by equations (4) namely: eP^-l - (2m/r)

"l-(2ra/rl where m is a constant, the same calculation requires 36 seconds.

3. Direct appliaations

The applications of algebra processors to the tensor algebra of general relativity has not been extensive. However, it will be clear that the algebra in S 2 is typical of the tensor manipulation that occurs in many branches of physics, and there is a small literature of publications covering a wider area than simply the field equations. Applications have been found in both newtonian and relativistlc mechanics but the great majority of computations undertaken in general relativity have been, nevertheless, directly associated with the derivation of the field equation.

The work of the following researchers is of importance in the broad area that contains the computations of §2: Brans (1967), Howard (1967a;b. 1971), Howard and Tashjian (1968), Neidleman (1967) and Walton (1965, 1966). other workers who have made extensive use of programs for the -B-ni-9-

darlvation o£ the field équations are D'Invemo (1969e,b), Pitch (1971), Bartle (1967), Kartle and Thome (1969), Thome aid Zimmerman (1967) and Safko (196B). Harrison (1969) has described an alternative derivation of the Riemann tensor to that given in il. Undoubtedly the most widely used system for these applications has been FORMAC (Tobey et al 1967), and using this language two large and successful library programs have been developed for the derivation of the field equations. The ALBERT program {Thome and Zimmerman 1967) was originally developed for the IBM 7090/7094 computers, and a system due to Clemens and Hatzner (1967) was developed independently for the same machines. Both of these systems encounter severe apace difficulties using FORHAC and this problem is reviewed in Fletcher et al (1967). The FORMAC space limitation is obviously serious, and the ALBERT program itself occupies the greater part of the machine when loaded with the FORMAC system. Thome and Zimmerman (1967) quote, in addition to the many problems that ALBERT can manage satisfactorily, a few metrics that during the computation of the field equations exhaust their machine's memory. Experiments with CAHAL have shown that these metrics lead to no trouble using a total of 28K of memory. The ALBERT system however has been very successfully usud for applications on the analysis of nonradial pulsation» of stellar models in a series of papers by Thome and others (Thome and Campolattaro 1967, 1968, Price and Thorne 1969, Thorne 1969a,b, Campolattaro and Thome 1970). Two other library programs for the coraputatioii of the Ricci and Einstein tensors have also been devei oped using LISP (McCarthy et al 1965), GRAD ASSISTANT (Fletcher 0.965, 196i , and ALAM (D'Invemo 1970). D'Invemo's system is extremely fast and h -is been used, for very extensive computations with great success {D'Invemo and Russell-Clark 1971a). An improved version of ALAH has now been programmed for ths CDC 6600 and 6400 machinas under the name CLAM (p'Inverno and Russell-Clark 1971b). Fitch (1971) has achieved considerable success vith._CjUIAL in :relativistic applications and various large âemonstràt on programs have been run with REDUCE.

There an be little doubt, that the space limitations of modern machines are a major problem when we come to compute the Riemann tensor and it is •B-III-10-

very difficult to give a reliable comparative guide to the various systems. Individual systems are generally designed to make the best use of the hardware configuration of a particular machine and in general when those systems are transferred to other machines, efficiency suffers. Again, for a system with a garbage collection on a paged machine it may well be a matter of policy to use a huge quantity of space, while this policy would prove disastrous in different circumstances. Nevertheless some systems are able to perform certain calculations that others find impossible and so there is some value in a comparison, however crude. D'Invemo (1969b) gives comparative statistics for several algebra systems that he haa used to calculate the Riemann, Ricci and Einstein tensors. We reproduce his results in table 1 and we have augmented them by the appropriate entries for CAM&L and REDUCE. The metric that forms the basis of the comparison is duB to Bondi et al (1962) and was central to their study of gravitational radiation namely:

da2 = ( 1^ - U^2e2YJdB2+2e2BdMdr+2I/r2e2Yd«de

-^(e^aeZ+e^sin^d*2) (5> where U,V,& and Y are functions of the coordinates u, v and 8.

4. Petrov classification

Since general relativity is defined to be coordinate Independent it is an area of active research to discover properties of metrics that are invariant under coordinate transformations. One such algebraic property is the basis of the Petrov classification (Petrov 1969) of a metric at each point. This classification is relevant to the study of gravitational radiation "(Pirani 1962). To illustrate the Petrov classification we define the Heyl conformai tensor in terms of the Riemann and; Ricci tensors and the covariant metric. This tensor C. .. - is given by

Cijkl = Rijkl+ 2**il?ljk-*il?lj*ilPli-*j1*ki)- 6*iS*filPtf-

It is easily seen that C.. = (P. . = QF"C . . = 0, and in the case where a metric is an impty space solution to the field equations, we have R.. = 0 -B-III-11-

and the Weyl tensor reduces to the Rienann tensor. He now write the two pairs of indices i,j and k, I of the Weyl tensor at. single indices a and 6 and" introduce the numbering system

1,0*1; 2,0+2; 3,0+3; 2,3+4: 3,1+5; 1,2+6 for these pairs. Then writing the covariant form of the Meyl tensor in this bivector space we have

C - 06 [L P

where a and 0 = 1,...,6 arid M,R3L and P are 3x3 matrices. It may be easily verified that the Weyl tensor is antisymmetric in the pairs i,j and, since

Cijkl = cUij fc) we may deduce that K and P are symmetric and that L •= Jr. s little algebra also demonstrates that the Weyl tensor satisfies the i lentity

ijkl iklj iljk and, in our new notation, this implies that N is trace free. Finally because C. = 0 1-3 it follows that S - IT ,M = - F and trace M = O. Thus we may write

M S c °ae " ijki " s _M

It therefore follows that the matrix Q = *f*-iff(i= -1) contains all the essential information of the Weyl tensor-at a given po-^t and it is the multiplicity of the eigenvalues of this matrix that determines the Petrov type of the metric.

i i -»tf >0

Figure 4. The Penrose diagram. -B-in-10-

very difficult to give a reliable comparative guide to the various systems. Individual systems are generally designed to make the best use of the hardware configuration of a particular machine and in ganeral when those systems are transferred to other machines, efficiency suffers. Again, for a system with a garbage collection on a paged machine it may well be a matter of policy to use a hf"e quantity of space, while this policy would prove disastrous in different circumstances. Nevertheless some systems are able to perform certain calculations that others find impossible and so there is some value in a comparison, however crude. D'Inverno (1969b) gives comparative statistics for several algebra systems chat he has used to calculate the Riemann, Ricci and Einstein tensors. We reproduce his results in table 1 and we have augmented them by the appropriate entries for CAWAL and REDUCE. The metric that fonra the basis of the comparison is due to Bondi et al (1962) and was central to their study of gravitational radiation namely:

te2 = ( ^! - tf2r2e2V W+2e*Bdadr+2tfr2e2Yd«d9 -r2(e2Ydez+e"ZYsln26d(ji2) tS) where V,V, B and y are functions of the coordinates u, r and 9.

4. Petrav classification Since general relativity is defined to be coordinate independent it is an area of active research to discover properties of metrics that are invariant under coordinate transformations. One such algebraic property is the basis of the Petrov classification (Petrov 1969) of a metric at each point. This classification is relevant to the study of gravitational radiation fPirani 1962). To illustrate the Petrov classification we define the Weyl conformai tensor in terms of the Riemann and: Ricci tensors and the covariant metric. This tensor C... , is given by

cim - hm* 2igiiRik-3ikRié%-^ii-3jiRH^ TPittkft-àfitf •

It is easily seen that C,. = (F. . = f^C . . = o, and in the case where a *3 VPS qvpO metric is an impty space solution to the field equations, wë have S.. = o 1*3 -B-in-11-

and the Weyl tensor reduces to the Riemann tensor. We now write the two pairs of indices i,j and k,l of the Weyl tensor M single indices a and 8 and introduce the numbering system 1,0*1; 2,CH-2; 3,0+3; 2,3*4: 3,1+Si 1,2*6 for these pairs. Then wrltlny the oovanant form of the Weyl tensor in this bivector space we have C « fM " where a and 8 = 1,...,6 and M,N,L and P are 3*3 matrices. It may be easily verified that the Weyl tensor is antisymmetric in the pairs i,3 and, since

%-kl = Cklij m

we may deduce that U and P are symmetric and that L «• W . A little algebra also demonstrates that the Weyl tensor satisfies oie identity

ijki iXia 11.3k

and, in our new notation, Hiis implies that ff is trace free. Finally because C. = O 13

it follows that ff » a 3M = - P and traco M «= o. Thus we may write

M N Cai = Cigkt

It therefore follows that the matrix Q = M+i»(i= -1) contains all the essential information of the Weyl censor at a givsi point and it is (-lie multiplicity of the eigenvalues of this matrix that determines the Vetxoy type of the metric. ,1

-*o

Figure 4. The Penrose diagram. -B-III-12-

The classification is summarieed in the Penrose diagram (Penrose i960) figure 4, where the progressive levels of specialization are indicated by arrows. The metrics of type I are called algebraically general and the remainder are specialized in various ways. Now to classify a given metric it is only necessary to determine the multiplicity of the eigenvalues of the matrix Q whose elements are functions of the xeuric. it is obviously possible to state this problem in terms of c-i-rtain àlgebraxu identities that must be satisfied by the elements of y and thus we ca/i classify b. metric simply by discovering which, if any, of a set of known identities its elements satisfy. It is unprofitable to display the identities themselves because they are elementary, and because in practice this particular method is not implemented on the computer. Our purpose in describing it was to introduce a simple description of the Pe^rtv classification which otherwise involves more complicated aiathaniatics and co draw attention to tne ract tiiaL die problem reduces Lo that of establishing identities between the elements of the covariant .i-Etric. The c*thod suitable for practical work on the computer involves spinor algebra ana is aescribed in Pirani (1964Ï . Details of the complete algorithm fcr the computer are presented in D'laverno and Russell-Clark {1971a).

J. .tLiJo/ijcJ upviications Harrison (1359) published a paper in which he listed all the possible solutions to the empty space field equations (4.2) that were separable in terms ex three coordinates. Harrison discoveredthese solutions by writing trie covariant metric in \;he form

and directly substituting this form into equations (2) by hand. Ei was then able to deduce ordinary differential équations foi the -4. and H, and solve those to obtain the explicit functional form of the possible metrics, in --11, Harrison proposed about 40 solutions to the field equations. Some of these were simple in their algebraic structure while others were very complicated. These metrics have been the subject of two independent -B-in-13-

successful and parallel investigations by 0 ijnverno and Russell-Clark (1971a) using ALAM and by Fitch (1971) usiuv, .""MAL. The purpose of these investigations, probably representing the largest single application of syubclic alç-îbr^ systems to general relativity, was to complete a Petrov classification of those of Harrison's metrics that proved to be true solutions to the empty space field equations. Both investigations detected certain errors in Harrison's work and rejected some of the metrics that are not empliy space solutions. Subsequently the Petrov types of all the metrics have been determined and D'lnverno and Russell-Clark (1971a) have also computed the KJ liners ley class of those that are type D. The two investigations lead to identical results in all cases. As was demonstrated in 54, the Petrov classification reduces to ascertaining that certain identities are satisfied between the elements of the metric, and this reduces in turn to a problem in simplification. Both groups of workers have carefully developed their simplification techniques in order that their systems should do as well as possible, but both have failed to achieT.3 complete success. Furthermore, on those occasions when the machine was unable to determine whether or not a particular expression reduced tD zero it was not always advantageous to print the offending form and attempt to decide by eye, because it frequently occurred that the expression itself was printed over tens of pages and a human being is little better than a machine at simplifying such forms. In these very difficult cases both wo'kers substituted numerical values into the expressions concerned to détermine whether or not they were' identically zero. While this procedure is not always absolutely rigorous, there can be no serious doubt of the authority 6£ their results in this case. We present in table 2 some statistics obtained by Pitch (1971) from his work with CANAL on this problem. In particular we draw attention to the tmount of time spent attempting to simplify complex expressions in certain cases beforo the system gives up and numerical techniques have to be itsed. In the table the Harrison's metrics are numbered following his paper (Harriscn 1959) .

There have been a few other complicated applications of algebra -B-in-14-

systems to general relativity. O'Inverno has studied perturbations of the metric (5) and Safko (1968) has shown Kelvin's (1964) universe to be stable 'inder small perturbations. Stewart and Ellis (1968) have suggested a technique for the solution of the field equatiuns in the presence of matter that could in principle be programmed (Barton and Fitch 1971) and D'Inverno and Fitch have each computed formal series for the four unknown functions that appear in Bondi's cotric (5). This work Is unpublished. However, it is clear that those problems of general relativity that are not composed of elementary tensor algebra are in general too conr>1icated for general purpose symbol manipulation systems at present. Table I. A comparison of various algebra systems computing the Ricci tensor and Einstein tensor for the metric of Bondi et aJ(1962)

Multiplication Computation Memory Word-length Cycle time time time required System Machine (bits) (Ms) (ys) (s) (10* words) ilotes

ALAM D'lnverno (1969b) ATLAS 1 48 50 A large amount of the time is spent printing the results

CLAM CDC 6600 D'Inverno and Russell-Clark (1971b)

FORMAC IBM 7094 1800 Not available Clemens and Matzner (1967) approximately

GRAD ASSISTANT IBM 7090 2.4 34 1020 Not available Fletcher (1965) approximately

CAMAL 48 Barton et al (1970a) REDUCE 36 360 Hearn (1970) Table 2. \he Computing time and "memory requirements of CAMAL when classifying some of the Harrison metrics -n the TITftN computer (word length 48 bits, store cycle time 4 us}.

Petrov classification Numerical Ricci scalar techniques Computer computer necessary memory for Harrison Computation memory time er time (10 words) simplification metric (10"' words) (s) numb.-r (s) 14 No 12 54. 4 I-A-l 17.6 24 No 15 366.4 1-B-i.a 67.2 34 Ho 17 Bll- 4 I-B-4 61.4 26 NO 14 631.. 8 " III-5 30.4 17 Yes 17 82 .6 I-B-3 67.4 18 Yes IP f> .6 II-C-4 214.4 20 Yes 19 223 .6 III-6 160.4

* Mainly «pent on simplification -B-nit-17-

BARTON D,BOURNE S R and PITCH J P 1970a Comput.J. 13 32-9 BARTON D and I ITCH J P 1971 Communs .Ass ..^omput.Mach 14 542-7 BARTON O and FITCH J P 1972 Reports on Progress in Physics 35 235-314 BLAIR F W.GRIESMER J H and JENKS R D 1970 Proc.ACH In.Comput.Symp. (Berlinghoven: Gesellschaft fur datenverarbeitung) 2 393-420 BONDI H,VAN DER BURG M G J and HETZNER A W K 1962 Prac.R.Soc.A 269 21-52 'WANS C H 1967 J.Ass.Comput.Mach. 14 45-62 JAMPOLATTARO A and THORNE K S 1970 Astrophys.J. 1S9 847-58 CLEMENS R and MATZNER R 1967 University of Maryland Tech.Report Nc: 635 D'INVERNO P 1 1969a Ph.D. Thesis London University D'Inverno R A 1969b Comput.J. 12 124-7 D'.tHVERMO R A 1970 ALAM Programmer's Manual King's College London D'INVERNO R A and RUSSELL-CLAKK R A 1971a J.math.Phys. 12 121,8-63 D'INVERNO R A and RUSSELE-CLARK p. A 1971b CU"; Prograwner's Manual King's College London FITCH J P 1971 Ph.D.. Thesis Cambridge University FLETCHER J G 1965 University of California Laurence "Hadiation Lab. Report UCRL-1 FLETCHER J G 1966 Coranuns .Ass .Comput.Mach. 9 p552 FLETCEFR J G,CLEMENS R,MATZNER R.THOENE K S and ZIMMERMAN B A 1967 HARRISON B K 1959 Physics.Rev. llo 1285-96 HARRISON G H 1969 J.Comput.Phys. 4 594-600 H?RTLE J B 1967 Astrophys.J. 150 1005-29 HARTLE J B and THORNE K S 1969 Astropbys.J. 153 807-34 HEARN A C 1970 REDUCE User's Manual, Stanford Artificial Intellegence Project MEMO AIM-133 HOWAHD J C 1967-ï NASA Tech.Note D-3939 HOWARD J C 1967b Communs.Ass .Comput.Mach. 10 543-8 HOWARD J C 1971-NASA Tech.Note D-6233 HOWARD J C and TASHJIAN H 1968 Cciimuns .Ass .CÔmput.Mach. 11 B14-8 LIPSON J p 1368 Proç.Summer Institute in Symbolic Mathematical Computational Cambridge Mass. 233-303 MCCARTHY J.ABRAHAMS P W.EDWARDS D J,HART T P and LEVIN M I 1965 LISP 1.5 •;'.Programmer's Manual 2nd. edition MIT Press MELVIN; M; A ! 1964 Phys.Lett. 9 65-8 •NEIDLEMAN £;D: 1967 Communs.Ass.Comput.Mach. 10 167-8 ^;pkNRCÈE,R;;i960 Ann.Phys.10 171-201 ;^P2TROVJA;^;i969'.•Einstein Spaces (New Yorkiohdon:Pergamon)

i; ; . PIRAtAiF:;ÀE1962.. RecenJ; Developments in GeneralRelativity (New York London: • ' " Pergambh) pp89-105 -B-III-18-

PIRANI F A E 1964 Brandeis Summer Insittute In Theoretical Physics 1 (Englewood Cliffs_Prentice Hall Ine) 249-373 PRICE R and THORNE K S 1969 Astrophys.J. 155 163-82 SAFKO J L 1968 Phys.Lett. 28A 347-8 STEWART J H and ELLIS G F R 1968 J.Math.Phys. 9 1072-82 TRORNE K S 1959a ".strophys. J. 158 1-16 THORNE K S 1969b Astrophys.J. 158 997-1019 THORNE K S and CAMPOLATTARO A 1967 Astrophys.J. 149 591-611 THORNE K S and CAMPOLATTARO A 1968 Astrophys.J. 152 673 THORNE K s and ZIMMERMAN B A 1967 Jt.Tech.Rep. California Institute of Technology Pasati^n^ TOBEY R G.B-MCER J,CREWS R.MARKS P and VICTOR K 1967 PL/1 FORMAC Interpreter User's Reference Manual WALTON J J 1965 University, of Califnomia -Research Labs, Rep. 14177 WALTON J J 1966 communs. Ass .Coaput.Mach. 9 B64-9 -B-III-19-

CI,.I,K,L,P) IN (0,1,2,3) G=f) 0<1,1>»F.XP(PCR)> G=R**2 fi<3,3>=(R*SIM(U))«*2 fi=-EXP(0(R)) X=T X<1>=R X<2>«U X<3>=V G DFSIM(U)=COSfU) DFCr)S(U)=-SIN(U) 0FEXP(R)=F.XPCR) DFP(R)=PP(R) DFn(R)=On(R' nFPP(R)=PPP(R) nFnn(R)=naa(R) XDF=1

P.A:K1,,!,K>=GAM IF I < .) C\!KI,,l,!t.> = (OF>G+DF>G-nF>G)/2 IF I >- J GAiKl,l,K> R<;l,.J>«0 R<;l,l>=l/G XSUM=1 GAIXI,,I;K>=GAH IF I < .1 GAM=SUH

G<;K

»GAM_ IF I >= J GAM<1,1;1> GAM<1,1;1> GAM<1,1;2> GA.M<1,1;3> R=-R<.I,I,K,I.> IF I < ,1 R=-R IF K < L R=R IF I+lt*.l < K+I»*L " R=0 IF (I = J) OR (K = L) R=nF>GAM<,l,L, l>-nF>GAM _ +SUM

GAIKd,K;P>*GAM ; -SUM

GAM*GAM _ IF I > J S K > LA l+U*J >» K+U*L R-R<.1,I> IF I < J R=SUM

SUMG<;P,L>*R IF 1 >- J

Figure 28. The computation of the Ricci tensor using SCRATCHPAD (Blair et al 1972).

U^vf? y V It */& 1S Preaented as **J Here the user has typed all the text including the definition of differentiation on sine, cosine, expand tne unknown functions pM and q(r). ir the program were run it would pknt out

Ho results -re available. -B-III-20-

COMMENT HERE WE INTRODUCE THE CQVARIANT AND CONTRARIANT METRICS! ARRAY GGI3.3)-H(3<3)iX(3)S FOR i:=o:3 uo FOR J:=O:3 DO 6ô(i»J):=H(lrj):=o$ 66(0.0):=E*»(Q1(X(D))S _ .._ _ GGll.l>:=-E**tPltXns GG<2.2>:=-XU)*2» 65(3»3) :=-Xlll*2*SINlX(2> .*2S _. _ _ FOR i:=o:3 oo H(I.H:=I/GG!I»I)Î .IF I UNEQ J LET DF(HMX< I) > »X< JJ )=0i OFiQKX(I) ) »XC J) )=01. _ . COMMENT GENERATE v.HRIST0FF£L SYMBOLS AND STORE IN ARRAYS _ CS1 AND CS2I _ ...... _ ARRAY cSU3i3i31iCS2(3.3.3)S FOR I:=O:3 DO FOR J:=I:3 DO BEGIN FOR K:=(l!3 QO

CSKj.ltK) := CSHI,J>K>: = (DFtOStI>K>_>X(J))»pFtG6(j>K).X(I)> -DF(GG(l,d),XtK)))/2l FOR K;=0Î3 00 CS2U>IiK> := CS2U.J«K> := FOR P := 0:3 SUM H(K.P)*CS1(I«JIP) ENOI '" ~"

^COMMENT NOW COMPUTE THE RIEMANN TENSOR AND STORE IN R

ARRAY R(3.3»3.3)S FOR i:=o:3 DO FOR j:=o:3 Do FOR K:=0:3 DO FOR L:=0:3 DO J(Jt»J»K»L)!so»_ FOR I:=O:3 DO FOR J:=I+I:3 OO FOR K:=I:3 DO __FOR L'.=K+i:lF K=I THEN J ELSE 3 DO BEGIN RIJ.I.L.K1 := R!IrJ,K.L) := FOR Q := 0:3

SUM GGIIrQ)*lDF(CS2(KtJ.Q>tX(L))-DF(CS2(JiUQ>tX(K>> • FOR P:=0:3 SUM iCS2(P»L,Q)*CS2(K»J.P) -CS2(PrK.Q)»CS2(L.J»P)))S LET R(I.JtL.K) = -RU»JfKrL)l..._ LET RU.I.K,L>= -R(I»J,K.L)I IF 1=K AND J<=L THEN GO TO A* R(K.L.IfJ) := RCLiKiJ.I» != R(IrJ,KiL)S LET R(L,K,I,J) = -R(I,JrKrL)S LET R(KtL»J»I)= -R(I»JiK»L)l ... AJ ENDS ._.. . _. COMMENT NOW COMPUTE AND PRINT THE RICCI TENSORI

ARRAY RICCH3.3)* ~ ~~" FOR i:=o:s DO FOR j:=o:3 Do WRITE RICCI(J,I) ;= RICCHI»*Rt8ti»pyj)»

The computation of the Kiccl tensor using. REDUCE, Here the vector X(0) , X(l), X(2), X(3) stands for the coordinates t,r,Q,$. The covariant metric is the - array GG and the contravariant metric is called H. In REDUCE the array G is reserved for programs using the QED library. -B-Ill-21-

2 CQKXÏi)) -

RICCI(0,0) •- RICCIC0f0) *• - ,XU)) *E Pl(XU)>) (Ql(X(l)J - PI

- l/4*DF<9lCXa)>tXU>>*DFCPl(XU)),XCl>>*E >> (-1) (QHX(D) - P1CXCI))) + DF),X *E + 1/2* )

DF(QHX(l)),XCl)tX

2 RICCIU,1> «- RICCIO,!) «- 1/4*DF(Q1(X(1)),X(1)) - l/^DFCQUXCD),

XCl))*DF),XÇn,Xt C-i) X(D)*X(1)

( - PKXO)»

RICCK2.2) * RICCK2P2) •• l/2*DF(9i *XU )*E ( - PKXU») ( - PICXCl))) - t/2*DF(Pl(X( >),X<1))*X

( - PUX(l))) HICCIC3,3) «- :nCCIC3,3J «- 1/2*DFCQ1 CX<1>>,XCI))*XU>*E 2 C - PKX(1)>) 2 t6IN(X(2)> - t/2*DF) C - PKXC1ÏJ) 2 2 +E *SIN(X(2)) « SINCXC2))

The rès-Its produced by the REDUCE program displayed in figure 29. The aut ir when writing the program of figure 29, made an error in tt.e sig of the Riemann tensor and consequently the results printed here have the wrong sign. The results produced by a CAMM, program fov the Rlemann tensor.

aicel Tensor Rise) -i/«p" [b)q' lbj»iep[_pit,)*nib)i »qi(B)«xpl-plbl+n[b]]/lb> •l/*q'[b]»S exp!-plb]+q(bl] *l/2q'* (t>]expl«ptbl*qtbJl

Hill] I/*P' tt>)V tb] »p'{D]/(t>( -l/«q' lbj'2 «l/2q«'[61

R[22] 1 *l/2Djitblexpt-Plb]I -l/2bqitb)exp[-plb]] -expl-p(b).

H [ 33 1 i/2bpi (blatniaPa exp[-p[b)l -1/abqt(blaintc)»2 «xpt-ptD]] tsinlol'3 •aln(a)'3 expI-pCb]]

Tln« la 7.6 -B-IV-1-

GENERAL REVIEW OF STATISTICAL MECHANICS

J.P. HANSEN Laboratuire de Physique Théorique et Hautes Energies

ORSAY

ABSTRACT

Ve give a review of selected topics in computer simulations of many- body systems, covering some important work done over the last 2 years.

This includes computations of depolarized scattered light spectra from simple fluids, equilibrium and non-equilibrium simulations of transport phenomena leading to the determination of transport coefficients, the study of fluids of diatomic homonuclear molecules and the computation of the equilibrium properties and phase transitions of dease ionized matter.

Laboratoire associé au CENTRE NAT [ONAL DE LA RECHERCHE SCIENTIFIQUE -B-IV-2-

l) Introduction.

Very efficient computer simulation methods hav* been developed as

early as the mid-fifties, to study the equilibrium and time-dependent 2 4 properties of classical systems of 10 - 10 molecules. These methods have

been presented at the previous Colloq'.'ia on Advanced Computing Methods in

Theoretical Physics by U. Levesque and -"ill therefore not be re-examined

in detail. We only briefly recall that equilibrium properties are generally

computed as canonical ensemble averages by a Monte Carlo method, first

proposed by Metropolis et al. [l]. This method can be generalized to the

study of the ground-state of many-boson systems, either in the framework

of a variational calculation, or by "exact" solutions of the Schroedinger

equation. The latter scheme, due to M.L. Kalos, has been presented to

you by D. Levesque, at the last colloquium.

Time-dependent properties of classical many—particle systems, e.g.

transport phenomena,are studied through a second simulation procedure,

called "Molecular Dynamics"; here Newton's equations of motion are solved

numerically for systems of several hundred (recently even several thousand)

molecules interacting through a generally pair-vise additive force law.

This method was first developed for hard-sphere systems by Alder and

Wain**right [2] and later generalized to systems with continuous forces

by Rahman [3] and Verlet [4],

Until the late sixties these two simulation methods were generally

used to study the thermodynamics, phase transitions and equilibrium as veil

as tirae-dependant correlation functions of systems of particles interacting

via isotropic, central and short-range forces, e.^ . systems of hard spheres

and Lennard - Jones systems; Montecarlo methods were also applied s-to the study of spin systems. Recover in recent years the interest has •B-IV-3-

shifted towards slightly more complicated system», or tovards properties of the simpler systems for «hich only recently experimental data became

available. The purpose of this review is to present selected results

obtained during the past 1 - 2 years, and which in the author's opinion

have already proved, or vill turn out '. be very important. Spin systems

are not included in this review.

In section 2 we briefly reviev the recent calculations of transport

coefficients, and of depolarized light scattering, for hard-sphere and

Lennard _ Jones fluids.

In section 3 recent work on diatomic homonuclear liquids is reviewed.

Section 4 is devoted to a brief -'escription of recent work on xhe

classical one-component plasma, taken as a model for dense stellar matter. -B-IV-4-

2) Optical, &nd _tranej>ort nropertiet of simple mono-atonic liquida

In this section ve briefly review some recent molecular dynamics

calculations of optical and transport properties of simple mono-atomic li­

quids s the molecular interaction is generally taken of the hard-sphere cr

Lennard-Obnes type, and these model-systems are supposed to describe rare-

gas systems. The computational techniques used in these calculations are

not new, but they were applied for the first time to the study of new phe­

nomena. For that reason we shall only briefly present the essential re­

sults.

a) Eepolarized light scattering :

B.J. Alder. J.J. We is and H.L. Strauss [5] have computed the in­

tensity and the spectrum of the depolarized light scattered from inert

mono-atomic fluids. The scattering in a system of spherical atoms is due

to dipoles produced by a fluctuating anisotropic field ; the anisotropy is

due to tvo causes : the asymmetric density fluctuations of the atoms in the

liquid and the distortion of the electron density distribution of the atoms,

due to collisions. The first effect is purely statistical-mechanical and

can be simulated by molecular dynamics computations. The second effect is

much harder to estimate theoretically. For that reason the authors have

neglected the change in polarizability due to the distortion of the electron

distributionsi i.e. they have assumed a constant polarizability. Their cal­

culations thus only measure the effect of density fluctuations in the liquid

on the intensity and band shape of the depolarized scattered light ; compa­

rison with experiment can then establish the relative importance of the po­

lar izahility distortion. -B-IV-5.

The light scattering intensity per atom, if there is no electro­ nic distortion, is proportional to the dimensionless quantity

5 -T<(X,T- )> i1> H f where G is the hard sphere diameter (or the Lennard-Jones potential paxa- netBi), T-- is a second-rank tensor, defined by :

Q

X, / =. OC, -yL, % t and K-' is the distance between particles i and j :

brackets in ( 1 ) denote the statistical average, which is estimated by the

molecular dynamics runs. It is clear from (1) and (2) that the competed

averages include pair, triplet and quadruplet terms ; the triplet ead qua-

druplet contributions to the 0 increase rapidly with increasing density

and tend to cancel the pair contributions, vhich reflects itself in a de­

crease of the scattered intensity at high densities.

The band shape of the spectrum is obtained by Fourier transfor­

mation Df the induced dipole-induced dipole tensor autocorrelation func­

tion : ^ = <[i.5H[ift>-

The'results of Alder, Veis and Strauss can be summarized as folljvs : at

high density the calculated intensity is an order of magnitude larger than

experimental data, vhich leads to the conclusion that the distortion of

the polarizebility of individuel atoms due to collisions produces an aniso-

tropy 'vhich opposes and finally almost .cancels the dipolar anisotropy due -B-IV-6- to density fluctuations in determining the intensity of the depolarized light scattering.

The band shapes however are in remarkable agreement vith expéri­ mental data for the various rare gases, and the broadening of the spectra vith increasing density agrees quantitatively vith experiment. Current computations on the spectrum of depolarized light scattered from rare—gas solids, done at Orsay by Klein, Veis and the author, yield equally good agreement vith experiment.

b) Transport coefficients from the Green-Kubo relations anC non-

equilibrium molecular dynamics :

The Green-Kubo relations relate the transport coefficients, like

the shear viscosity fl s and the thermal conductivity K . to the integral over all time of the time autocorrelation function of the appropriate dyna­ mical variables . For instance the shear viscosity is given by :

where

and *-*„<*, is any off-diagonal elamsnt of the microscopic stress tensor :

•+V£ ia the momentum of particle i and F^ is the total force acting on

that particle. 'B-IV-7-

The correlation function &,„(£) is found to decay rather slow- ly vith time, and for that reason L*vesque, Verlet and Ktokijarvi [6] made a very long molecular dynamics run for liquid Argon near the triple point, integrating the equations of motion for 10 time steps, which corresponded

-9 to a total time of 10 sec. ; this vas sufficiently long to ensure a negli­ gible truncation error in the integral (4). The computed shear viscosity differs by about 25 % from experiment, but the thermal conductivity differs by a factor of 2. These discrepancies may be due to the inadequacy of the simple Lennard-Jones potential to describe the interaction between atoms in liquid Argon.

An alternative way of calculating the shear viscosity of simple

liquids vas proposed by Gosling, Me DouaId and Singer [7]. These authors

observed the change in the dynamical behaviour of a Lennard—Jones system

as the result of the imposition of a steady external field, in a situation where the magnitude of the response induced is a measure of the transport

coefficient of interest (linear response). They applied this idea to ' ae

calculation of the shear viscosity of a Lennard-Jones fluid, in which the

measured quantity is the drift velocity resulting from an imposed shearing

force. This force is oho sen to act in the x-direction and its amplitude

varies sinusoidically with z as ;

X^i^) ~ ? <* UIVW-WL.) B c

'n. is an integer, L the box length, and the applied force verifies the

usual periodic boundary conditions imposed on the system. Tho lineari: ?d

Navier-Stokes equation then yields for the velocity field :

I1" F -B-IV-8'

i.e. the resulting steady-state drift Telocity profile is also sinusoidal,

in phase vith "FotC'V i sod vith an «nplituis direotly proportional to

P0 and lnrarssly pro^artional to *}fi This allows a measure of the

shear viscosity. Under triple point conditions, thess authors find good agreement vitb the result of Leveso.ue et al. They also reproduce the ex­ periment»! feature th.t at high densities, n falls rapidly as T increases, vhereac at lover densities, f) increases alovly as T increases.

A similar non-equilibrium molecular dynamics computation has re­

cently been reported by Ashurst and Hoover [s]. These authors moreover com­

puted the non-equilibrium pair distribution function. -B-IV-9-

"M Molecular dynamics study of diatomic homonuclear liquids.

Among the recent attempts to extend the molecular dynamics technique to syatems of polyatomic molecules, the most complete and successful is the work by Barojas, Levesque and Quentrcc [9] on diatomic bomonuclear liquids. The molecular interaction potential used by these authors is the so-callsd diatomic potential ("dumbell" model) : each molecule is pictured as having two centers of force at a fixed distance 2d from each other; the interaction between any 2 molecules i and j is then characterized by the potential w.. ;

~i ' •>-» (9)

\^(_r^ is chosen to be the familiar Lennard - Jonc potential :

(10)

For N, molecules, which the authors were modeling, the parameters

£ ,

= Boltzmonn's constai t)

P. A = 0-"5.a^a- <*"

The simulations vere done for a system of 500 molecules in a cubic

box, vith periodic boundary conditions, along two isochores : one at the -B-IV-10- trip."i point density .'? Nj, and we at the boiling point density.

The positions of 2 atoms of molecule i are

•g» ^ "5. _ A ^ (11) vhere A. is the center-of-maBs (CH) position vector, and u.. the

unit molecular orientation vector, characterized by the 2 polar angles, 6t-

and (p .

The total kinetic energy of the system reads :

If ve denote by T . the force betveen the CM. of molecules

? ~ i- 2. *•• \ ^ p. "J {13 a) i and j, the equations of motion read :

6. = ,we. cse.fp. - i_ Z. —* (13 b)

(13 c)

These equations of motion are replaced by finite difference equations, and solved numerically on the computer. The 3 first equations (13 a) present no new difficulties vith respect to the techniques developed by Rahman [3] and Verlet [4] for monoatomio systems. -B-IV-11-

Tha algorithm is simply :

7.(t*e*)= i£>-*\^-^-w^-^i £>> * oo**) (i4)

The corresponding velocity ia given by *. tit)- ^LW) ~ ^ ^ ~ °0^ <-a, : Q_ CsA- Two new difficulties arise for the solution of the angular equations of

motion. First, the velocities appear explicity in equations (13 b) and

(13 c) and the algorithm must be changed as follows :

First one solves (13 b) by :

btvr. e.it-)~*e(i-> ÇAH - ±Z ^^ I - o(^) (i5) 1s fc i -* ^ •**• J

The corresponding velocity is then calculated by :

Finally (13 c) can be integrated, yielding : !<*. b in è LH (f U-) - i è. ^; \ -vOC***) S c v : ^dL^^act-, $« * <& J (16) and the corresponding velocity is

Si*"

(16 a) •B-IV-12-

The choice oi these equations yields a good stability of the integration algorithm, as is illustrated by the excellent conservation of the total energy and the total linear momentum of the system (to at least 4 signifia cant digits), for a reasonable choice of the time increment : v> \0 s*c . \ The second difficulty arises from the presence of the factor •» s ^ e i • in the computation of *P. , when O. is nearly O or T7 * t *

Levesque and co-workers avoided this difficulty by malting a change of the coordinate system when D- approached O or Tt . More specifically when 0 < 9 * — or ^L ^ 6v * ~ they changed the definition of the polar coordinates of ^^ , or vice versa.

"ne initial conditions for the integration p icess are selected in such a way that the positions of the molecular CM &nà ee.ch molecular orientation correspond exactly to tnnse of the soiid nitrogen aC phase.

Furthermore, translational and angular velocities are chosen according to a Maxvell distribution.

With the abo\e algorithm, Levesque et al. generated several thousand integration steps, under various temperature, cud density conditions, to compute bot> equilibrium and time-dependent properties of the model.

The equation-of-state vas obtained through a ytraightforward generalization of the virial formula. Along the 2 isochures which they

studied, the equation-oi'-soete and interna} energies are in reasonable

agreement with experimental nitrogen data. The computed static structure factor : -B-IV-13-

(IT)

is also in good agreement with experimental neutron - and X ray - diffraction data.

Finally the authors studied the velocity of the C .M. and the reorientational self-correlation functions (s.c.f.)

The self-corre?_ation of a dynamical vairable A(t) attached to individual particles, is defined by :

ro ~T /K» r 'i_ (18)

The molecular CM velocity s.c.f. has a general behaviour quite

similar to "that of monoatomic liquids, exhibiting a large negative plateau

at low temperatures. However near triple point the s.c.f. exhibits two

minima which can be associated with 2 very different behaviours of the

s.c.f. at small times. One relaxation behaviour is related with the

component parallel to Uv (.0) and the other one to the perpendicular

component. F ctj - F" ft) *- a ^'"V-) XOA ^ ' CMV U J C« (19)

where

F CM -B-IV-14-

' I a) is •> unit -,-nctor perpendicular to <*. (o) .

The reorientational s.c.f., associated with the molecular orientation vectors ^ L^ » exhibit an essentially exponential behaviour for times _ -11 larger than ^ '° sec. in all the studied cases; there is no observable hydrodynamic - type long tail relaxation of the reoriontational s.c.f.

This vork vas recently extendeo by B, Quentrec to the solid phase;

he found a sudden decrease of the rotational order parameter under density -

temperature conditions close to the allotropie transition from the °< (FCC)

phase to the B (HCP) phase. Similar calculations have been mode on a CO

model by Gibbons and Klein. -B-IV-15-

4) A Monte Carls study of the classical one-component plo-Bma.

The classical one-component plasma (o.c.p.) is a system of N point ions, obeying classical statistical mechanics, and embedded in a uniform background of opposite charge, to ensure charge neutrality and cancel long-range divergences at infinity. The model is a reasonable first approximation for superdense stellar matter, e.g. white darf interiors or the outer layers of neutron stars. In this case the uniform background is provided by the highly degenerate electron gas. In fact, under conditions ( T - VO7. Vo ° * -, j> s ^o y / c«* ^ it is easily checked that b. « V " «a Z- << \ Ou \ where /\ is the thermal de Broglie wave-length of the ions, a the average -» V* -r- inter-ionic distance ( a =( \ ) and V the Fermi temperature Vnj> J of the electrons; the first condition ensures that the ions behave classically, the second that the electrons are highly degenerate.

A first extensive study of xhe classical o.c.p was made by Brush,

Safelin and Teller in 1966 [10], The great merit of their work was to propose

an ingeneous treatment of the long range tail of the potential, taking into

account all of the periodic images of the ions containpd in the initial

cell; the "bare" Coulomb interaction is then replaced by an effective short

range potential which will be referred to as the Ewald potential. It is

obtained by using the well-known Ewald convergence technique to the sum : -B-IV-16-

In this ' JH tho first term represents the interactions between particle i and particle j, as veil as all the periodic images of 3 obtained through translations in the 3 directions by multiples of L, the edge of the initial cubic cell (the sum over V* denotes a sum over all vectors with integer coordinates); the second term represents the interaction of particle vith the uniform background.

The Ewald convergencei technique yields the result : 0 *& O ) - — \ 1? - , p- - v ^,t-. ] (21) here erfc d*mutes the usual error - function complement and the primed sum means that the term \ = (0,0,0) is excluded. In expression (21) both sums are rapidly convergent and inclusion of only a few terms is sufficient to ensure a high accuracy. However from the computational point of view, this potential presents two difficulties. First, a direct computation of the first few terms of the sums is still much too time consuming if the potential has to be computed many million times in the course of a Monte Carlo simulation. Moreover the potential is anisotropic, although it is invariant under all symmetry tran* formations of the cube, by construction. There are two ways of solving this computational problem.

A first method is to tabulate the Ewald potential on a 3-dimensional grid,

baking full advantage of the cubic symmetry) this reduces the fraction of the cube over which the potential must be tabulated to l/48 of the total volume (irreduc ible first BrîUouin zone). Despite this important reduction, -B-IV-17-

oentral memory requirements are still large for achieving a reasonable accuracy usine linear interpolation. The second method consists in expanding

Che Ewald potential in its natural basis, *.e, Kubic harmonics [ll]. We ha*>e used the following truncated, optimized expansion :

* u r8 J (22)

where the l£ (T) (.UOjU-j i( 9 ) are radial functions, chosen -•n-r* as simple polynomials multiplied by •£. , with coefficients chosen so as to minimize the difference betveen (21) and (22) over the whole irréductible Brillouin zone. A very good precision is thus obtained (the relative error in the total energy for any configuration never exceeds

10 ). The O". (5*)a*e tabulated as a function of r, allowing a speedy implementation of the Monte Carlo algorithm.

We have applied this method to the computation of the equation of state, specific heat, Helmholtz free energy and other thermodynamic picperties, of systems of 16, 54, 128 and 250 ions both in the fluid and the solid phase

[12, 13]- It can be easily shown that the properties of purely Coulombic

systems do not depend on temperature and density separately, but only on

their combination :

(23)

Thus, the properties along one isotherm determine.by 3imple scaling,

the properties in the whole p - T plane. In particular the melting density

along one isotherm determines the complete melting line (which is a straight -B-IV-18-

line if J melting ia plotted versus T„,,\t,„, ). Our Monte Carlo simulations have determined the slope of the melting line to be

P~ •=. ^t *>0 It is moreover easily shown that alon,; the melting line quantum corrections .ncraaae as T increases. For that- reason the melting line departs from a straight line at high T and actually curves back towards the T = 0 line. This result was obtained by assuming everywhere the validity of the familiar Lindemann melting criterion [14], The phase diagram obtained in [14] is probably the first proposed on theoretical grounds in whic: the tulid phase occupies only a finite fraction of the plane. Inclusion of dielectric effects due to the responsive screening of the background, does not alter the qualitative shape of the phase diagram

[13].

We also found that at the cristallization density, the structure

factor of the fluid is surprisingly similar feo that of a hard sphere fluid

near cristallization, despite the extreme difference between the pair

interactions [15].

A molecular dynamics study of the one—component plasma is presently

under way, to determine the transport coeeficients and dynamic structure

factor of dense ionized matter. It should be noted that the Ewald summation

is useless in thi3 case, because the resulting effective forces are non-

central and hence there is a non-conservation of total angular momenxom

which results in non-conservation of the total internal energy of the

system. For that reason we have replaced the usual periodic boundary

conditions by spherical boundary conditions recently proposed by C. laenberg. -B-IV-19-

EEFERENCES

[l] N. Metropolis, A.tf. Rosanbluth, M.N. Rogenbluth, A.M. Teller and

E. Teller. J. Chem. Phys. 21, 1087 (1953)

[2] B.J. Alder and T.E. Wainvrighi; J. Chem. Phys. 31., 459 (1959)

[3] A. Rahman : Phys. Rev. 136, A 405 (1964)

[4] L. Verlet : Phys. Rev. .159, 98 (1967)

[5] B.J. Alder, J.J. Weis and H.L. Strauss : Phys. Rev. A, 7, 281 (1973)

and to be published

[6] D. Levesque, L. Verlet and J. Klirkijarvi, Phys. Rev. i 7, I960 (1973)

[7] E.M. Gosling, I.II. McDonald and K. Singer, to be published

[8] V.T. Ashurst and V.G. Hoover : to be published in Computers and

Fluids Journal

[9] J. Barojas, D. Levesque and B. Quentrec : Phys. Rev. 7_, 1092 (1973)

[10] S.G. Brush, H.L. Sahlin and E. Teller : J. Chem. Phys. 45, 2102 (1966)

[11] P.C. Von der Lage and H.A. Bethe : Phys. Rev. 71., 612 (1947)

[12] J.P. Hansen : Phys. Letters 4J_ A, 213 (1972) and tn be published in

Phys. Kev. A (1973)

[13] E.L. Pc21ock and J.P. Hansen : to be published in Phys, Rev. A (1973)

[14] J.P. Hansen, B. Jancovioi and D. Schiff : Phys. Rev. Letters ^2, 991 (1972) [15] J.P. Hansen and D. Schiff : Molecular Physics (1973), under press. -B-V-l-

THIRD COLLOQUIUM ON ADVANCED COMPUTING METHODS IN

THEORETICAL PHYSICS, MARSEILLES. (June, 1973) .

A WATERBAG METHOD FOR FLUID CIMULATIONS by David Potter and G. H. Tuttle, Physics Dept., Imperial Collegei London t.W.7.

Abstract Point Lagrangian methods in one dimension have been extended to tvro and three dimensions by defining contours and surfaces in two and three dimensions respectively. In twc dimensions, by using the concept of a contour or "waterbay" rather than a point, an orrhogonal lagrangian space may t 2 defined. Thus the advantages of both a Lagrangian mesh nd orthogonal co-ordinates can be obtainel.

An 'exact' matrix method of determining the orthog ,al co-ordinates at each timestep -.•ill t presented. Imp cit methods, by which the advective equr tions may be resc ved on this space, will be introduced and stable solutions otained under conditions considerably exceeding the Courant- rriedrichs- Lewy will be shown.

The application of such a waterbag method to n

1. Introduction

Ir _ 2-d;iiensional fluid problems, the use of point Lagrangian methods has been extremely successful, to the extent that at the present time most one-dimensional calculations are carried out on a Lagrangian mesh UUchtmyer and Morton, 1967) . The advantages of a Lagrangian mesh are twofold. First, the fluid equations take their simplest form in the local 'Lagrangian' frame of the fluid and, second, the difficult problem of treating the advective terms i<5 immediately overcome.

Attempts to extend the idea of a point Lagrangian mesh to two and three dimensions have largely been successful. The major difficulty has been the effect of s^ear in the multidimensional fluids, which rapidly prodv ;e a non-orthogonal ill-defined mesh on which accuracy is qu c-kly lost.

These difficulties arise since the concept of a point Lagrangian method, approximate in one-dimension does not extend to two or more space dimensions. In the waterbag method described here, we define rather a set of contours of the function of interest, f say, in two- dimensions, and correspondingly a set of surfaces in three dimensions. Along the contours of f, the function f doee not vary. Thus the advectisn of f has an effect only perpendJ ular to the contours. This degree of freedom, -8-V-3-

therefore, allows the construction of the lines orthogonal to the contours and a time-dependant orthogonalfsed

Lagrangain mesh is thereby always defined.

We shalï illustrate the method by referring to the particularly simple, but interesting example of an incompressible fluid in the plane r. = (x,yO. Such a system may be described by a pseudo-sealer vorticity ç(x,y) which satisfies the advective equation:

11 +

gt V.V5 = 0 (1)

where v is the velocity field of the fluid which may be determined from a stream function i|j{x,y) :

(2)

z V «> = -£ (3)

In.the waterbag method, we may define ? finite

number of contours of the vorticity £ (Fig.l), in which each

contour C. is defined on the computer by a finite number of

points i, ; :G (XviXi) • *t may be shown that no two lines cr

vorticity. may cross and that the topology of the system is -B-V-4- jreserved.

Thus/ v;ithout altering the distribution ï , the points i may always be moved along the lines j to define at each timestep natural or "logical" coordinates which are orthogonal on the real space r = (x,y) . Such an orthogonalisation procedure has been devised (potter and Tuttle, 1973), and a resume of the method is included hero (sections 2,3). In section (4) we describe an implicit method for the solution of the advective equations on the natural coordinates 1 = 1 (1 » j ). -B-V-5-

2. Formulation of Genareliaed Orthogonal Coordinates.

We consider these natural coordinates 1 = J;(x,y) as functions of the real space r = f(x,y) (Figs. 2,3). If X is orthogonal in r, the functions i and j satisfy:

, 3i, = , cose. ,3 j, = -eln8

1 3 3X y h , »X y h

,jj.. = etne ,8j-, = cose (4)

l 1 ayv k ' ayv hJ

3 where e is the angle between e. and ex and h and h are the usual scale factors defined by:

dr2 = (hSii)2 + (h^j)2 .(5)

If -the points i are specified on the outer boundary, j'-='•! in R, (the boundary conditions) , an interpracion of the equations (.4) inwards-will define i on the next line j = 2 . Thus by considering pairs of j-lines in sequence the orthogonal i-lines may be marched inwards in a sequence of J-i operations. -B-V-6-

In the finite mesh case the fun.-.tion e is unknown. Eliminating 0 from equations (4), an elliptic equation for the function i is obtained:

h1 ai, + Sfh1 3i, = 0 (6) 3X hJ ax ay hJ 3y

This is a non-linear equation since h ft? is a function of i and j (egs. 5) , and generally equation (6) admits of an infinite set of solutions. There will certainly be a unique correspondence between the i points on j and j+1» if in this region no sources or sinks for i exist. It can be shown that this condition is fulfilled when h /b? has this particular functional form (Potter and Tuttle, 1973);

hi — = f(l) g(j> (7)

Inserting this expression in equation (6) and using equations (4) we obtain:

_i.f{l) 31, + _»{£(1) 9l} = 0f sx ax 3y ay

It follows that a function p=p(i) may be defined: ~

^ = f(D (8) di -B-V-7- where p satisfies Laplaoe'a equation,

72P - 0. (9)

From equations {7) and (8), it follows that if g is positive p is a monotonicaliy increasing function of i, while if g is negative p is a monotonicaliy decreasing function of i. The form of the function p between j and j+1 is represented in Figure (4) . For each value of i exists a unique value of p. If p is solved between j and j+1, for each point i on j there exists a unique value of p s ; i with which the point i on j+1 may be associated. Thus all the non-orthogonal pointe along the curve may be interpolated as a function of p to have the same values as the points on the outer curve. The points on the inner curve j+1 will then lie on the orthogonal lines i.

3. The Matrix Solution of the Orthogonal Coordinates.

Laplaces equation for the function p(i) is to be satisfied between each pair of j-lines, j and j+1, in sequence where the boundary coordinates are of the Neumann type :

1E.W» 0. (10) -B-V-8-

The region 1B not Qlmply-conneoted so that a branch cut (B) must be introduced. Green's Theorem (Courant and Hillbert, 1966) is used to express p on j and j+1 by the solution c f integral equations (Potter and Tuttle, 1973):

p(i,j) = lfp(k,j)d0kl + l^>(v,j+l)d(8>i + Up0Bi j j+1

pU.j+L) = l|p(k,3)d0kii + i^p(v,j+l)d(8vu + 1 P0B)i

(11)

d0^. is the infinitesimal angle subtended by the boundary at the kth point from the ith point (Fig. 5> while 0„. is the angle subtended at the branch cut from the point 1. &p is the discontinuous charge in p across the branch cut.

With a finite number I of pointr on each curve j and j+1i the equations (11) become a matrix equation of dimension 21:

(I - A)£ = c (12) -B-V-9-

wbere |j » 2- SM an(} the knovm vector a i: ÂP » aP ~ &£} X - A is a matrix in accordance with the well established theorem, that in the Neumann problem p is only determined up to an arbitrary conE.ant. The constant is not germaine to our argument and we mfiy readily obtain a non-singular matrix equation by replacing the first equation by £,=0.

The matrix elements of A are simply the angles subtended by the arc at each point to every other point on the pair of curves (Fig.5) and it is essential that the difference evaluation of the angles is defined in such a vay so as to conserve angle, (for example as illustrated in Fig. 5). In the solutions illustrated (Figs 6,7) the matrix equations are solved by the Gauss elimination method, (Potter 1973).

Once the mesh has been orthogonalised the area

h /b? and length elements of each cell (i,j) are readily determined:

hV = ^lx,y) •*(i,j) (13) -B-V-10-

4. Solution of the Advective Equations

On such a Lagrangian mesh, the advective terms in the fluid variables are automatically incorporated in the Lagrangian time derivative — = — + v. V . dt at

On the other hand,, the motion of the contours Is described by advective equations for the motion of the real space r_ relative to the fluid:

dr dt

and thus,

dr + J^CY , h ) - 0 dt

d=r + Jlj <»'£> = 0 (14)

dt Ji;. (x.y)

In more explicit form, x and y satisfy:

1 fa* -2 3jfc ix 1 -* + -f^V^ —M " * ** * == Q ° (15) dt hiV \»i aj aj aij -B-V-ll.

d£ i law ay By &r + (16) dt h1? IaL aJ 3J *"

where ^ is the stream function as before and h /b? is the area of the cell surrounding the point h h3. The stream function V is determined at each timestep by the solution of thf matrix form of Poisson's Equation defined on the orthogonal mesh (i,j). It remains to solve the advective equations (15) and (16).

An implicit fora of the equations (15) and (16) n+l _ n is used over the timesteps At fc t ( which i3 bath time-centred and space-centred:

xn+l + __» ..n+1 ..n+1 « ' Bb1? 1(t^O " *i-1.5) Ui.D+l " "i.j-l1

n+1 „n+l > (*<'i,j+ ., l vi,j-l*<.-i-l'> lM+l,tX j *i-l,j'

at vv,U *«_! J K 4J Sh^ÎThJ i+i,j ri-i.j', .»*i,j+i *i.i-i

'i i - Vj-i1 (xi+i.j " xi-i,j' u fj+

(17) -B-V-12-

and a similar equation for y is obtained. The ric.1-'-- ij hand-side of equation (17) is a known function and the left- hand side defines a linear set of simultaneous algebraic equations in xn+1 at each point, i,j. The resultant matrix equation involves a tridiaginal operator along each row i and each column. The alternating-direction-implicit method of Peaceman and Raelford (Varga, 1962) may therefore be applied to the solution of these matrix equations.

Using conventional numerical stability analysis (Richtmyer and Morton, 1967), it is easily shown that the eigenvalues of the amplification matrix for the system of equations (17) are each identically equal to one. Thus in principle there is no limitation on the timestep and no Courant-Friedrlchs-L-wy condition to be satisfied.

On the other hand, the spectral radius p of the iteration in the ' ADI' method depends explicitly on it. If w is the relaxation parameter, then it is easily shown that the eigenvalue of each Fourier mode

it2nkj + 2TT11> J I

in the ADI iterative matrix is: -B-V-13-

(w -

(w + \) + i hi siniij

(w - %) + i . sin*

v^t 1

(w + k) + i hi sin-n­

(18) it follows that the optimum value of the relaxation parameter is always w = %•

It is Immediately clear fiom equation (18) that in a near equilibrium situation where 1(1 •«, i|iCO» the velocxcy perpendicular to the contours is zero (v = 0) so that all

are

In summary in one timestep, the waterbag methods

described :can"allow flows which exceed very considerably the Courant-Friedrichs-Lewy condition. -B-V-14-

5. Applications to Hydrodynamics and Magnetohydrodynamics.

Figure (8) illustrates solutions obtained for an incompressible fluid problem - the diochroton instability. As is well established (Christianson , 1972) , the equilibrium situation of a ring of vorticity describing a sheared rotation is unstable. Figure (8) illustrates the development into

the non-linear phase of the dominant m = 2 mode. It is to be noted that large timesteps have been taken in this simulation, such that flow occurs hall way around the ring in one timestep. The Courant-Friedrichs-Lewy condition is violated by more than a factor of 16.

In Figure (9) an example of the application of the wateri .._ thod to magnetohydrodynamics is illustrated. Here, contours of the magnetic vector potential are taken, so that the lines illustrated represent field lines. The resultant tensional Alfven waves may be treated explicitly. Again the Courant-Friedrichs-Lewy condition on the Doppler shifted Alfven wave can be considerably violated.

The particular solutions shown illustrate'dipolar flow in the Tokamak poloidal plane. The solutions provide

an explanation of the formation of the Tokamak pinch,sand in

some instances the occurence of a double magnetic -well»..,-:... 4 mill! Illl.. IL

-B-V-15-

Figure Captions.

1. Contours of stcte variable wh ch define one coordinate, the j-liner..

2. Natural co-ordinates in rea space.

3. Representation of real spa .e in natural coordinates.

4. Form of function p(i) I- tween two j-lines.

5.

6. Non-orthogonal (upper and orthogonal (lower) coordinate systems.

7. Stages during orthogonalisation procedure.

8. Diochroton instability in non-linear phase.

9. Development of pol idal field in a toroidal geometry. B-V-16-

Referencea.

Christiansen, J. (1971). Report CLM-R 106, UKAEA, Culham Laboratory. Abingdon, Berks, England.

Courant, R. , and Hillbert, D. (1966) "Methods in Mathematical Physics", Vol II, John Wiley, New York, p.252.

Potter, D. E., (1973) "Computational Physics", John Wiley, New York and London.

Potter, h. "Î., and Tuttle, G. H. (1973) "On the Construction of Discrete Orthogonal Coordinate?," submitted to the Journal of Computational Physics.

Rlchtmyer, R. D., and Morton, K. W. (1967). "Difference Methods for Initial-Value Problems", John Wiley, New. York and London.

Varga, R. S. (1962), "Matrix Iterative Analysis" Englewood Cliffs, New Jersey; Prentice Hall. -B-V-17-

VORTICITY

3.9BErH

EOKÎQUW HtlOHlS i .zsawu

73/06/18. IB-I8.λ

F.3 1- -B-V-18-

^, Surf act

ifct.yl-aixHX*\y' _ _ X _ _ _ — -

/ y iconstant

/\ l R /^"^

r.0 a

j=J 1

,r -L, r lieu die r-^ 'xll Jl " .1 .«rata P Itm t s llL. uiu... ^ <» f I \ 1 \ 1 / „ i ..,/ ;

p«t»3 ^••ft.

•6t-A-a- -B-V-ZO.

(b! O-*

•p.3 s- -B-V-21-

r,3é>

« mm I fp7

&&•

•Mi*.

iff/.- ^è-

F^f -B-V-22-

^f\ S -ti-V-id-

{{((cyM

\r<-K I i / 1 [\{\L))1)\ K\\\\

*F [ELD LUif I I i .'.et *IKÎ

\ • \ \ < -•'/ !

._ii *a -B-VI-O-

!\

ALAM/CIAH and some Applications of

Computer Al-ebra Systems to Problems it

General Relativity

- by

K.A. Bussell-Clark

(The Computer laboratory, University of Cambridge) -B-VI-1- Intreduction

General Relativity, by its very nature and in common with other field theories, involves a great deal of tedious algebraic calculation.

For some years now, computer algebra systems have been available to help in this respect t-id, in this report, I shall be mainly concerned with one of these systems, ALAM/CLAM.

I have divided this paper into three parts. Part A presents a historical survey of the development of the system, a brief description of its features and,: finally, a critical assessment. ALAN and CLAK have been used in many problems in General Helativity; the vast majority

of these belong to a set of standard calculations which I have termed

"metric applications". However, four large non-standard applications

have been attempted successfully and these are descrihed in Fart B. To

my knowledge, CAMAL is the only other system which has been used extensively

for work in Relativity. Since I moved to Cambridge, I have been involved

in two research projects in which CAMA1 has played an important role

and details of these are given in Part C, -B-VI-2-

Unloos otherwise stateO, I shall us» the following conventions:

Qrttkt lower sas* fer tensor Indiois In th» rang* 1 - 3l ••(• W,p,.,.

Latin, lower case for tensor indices in the range 0 - 3; e.g. Ct^p,...

Latin, upper case for apinor indices in the range 0-1; e.g. ft,ftjBjB,...

Frace indices will he denoted by a ~ under the appropriate letter; e.g. Q.A,...

Round and square brackets denote syraaietrization and anti-symmetrization

respectively; e.g. ft ^ mj. {^ * ft^ > fi^ a _L (ft^ - ftjj .

The space-tijne signature is taken as C+ ).

The paper by Bondi, van der Burg and Metzner [ 3 ] on axi-symmetric

(reflection symmetric) radiative systems will be referred to as BVM and the metric,

ds* - (VrVP- UVV*)dua + ae4PdkuÀr' +ÎUp*ea*auié

described therein will be called the 3VM metric. The metric functions,

"Jj V;p and Y are dependent upon the variables U, \P and 8

only. ill H&fen.:. II!,,il . I ,. Ul I I. I , ,i iiiliUNiii .i .1,1 i .'.Mil i,. H

-B-VI-3- Part A : The ALAM and CLAH System»

(i) Hiatoriobl fuar'.ata CLAK is the final form in the development of ALAH, an algebra system designed especially to aid research work within the field of General Relativity. The circumstances under which ALAH was conceived have directly affected the final design of CLA>; and so I shall first of all say something about these.

ALAN was constructed by R. A. d'Inverno within the Relativity research group at King's College in London. As a result, the terns of référence were such that a working system was required in as short a time as possible so that it could then be utilised in research. Therefore, in order to save having to write the-whole system from scratch, a decision was taken to employ the data structure, I/O routines and some system functions of an already existing language, LISP. The system itself was not written in LISP because, even if a compiler had been available at the time, it was doubtful whether the required efficiency could be attained. Thus ALAM was written in the LISP assembler, LAP • within D.3. Kussell's LXSPDEC66 [25] on the Atl^s 1 in London.

From the beginning An.J-i was under continual development as the problems it was applied to became increasingly more complex. Eventually, the time came when consideration liad to be given to transferring the system from the Atlas 1 to its successor, a C3C6600, and this proved to be a welcome breathing space to rethink its future. It had been found that the most cc-maonly requested use of ALAri had been what I shall term -B-VÏ-4-

"oatric applications". JIhe«» or* oalculation» which take au their initial data the ten independent components of the oovariant metric tonsor and produce the ourvative tensor or field equations» However, in

order to program in ALAM, a knowledge of LISP was necessary and often a knowledge of LAP as well ir. order to patch the system. With such a poor user interface it was quits understandable that researchers, with metrics

to process, preferred to a..: either d'Inverno or myself to do the work

for them! One ob ,ious solution would have been to develop a suitable language to drive the system but neither the time nor the facilities

(an on-line and filing system for instance) were available to do this.

However, this was not deemed to be necessary because, for metric applications, a command language would suffice equally well. With this

in mind CLAM was written and the final result is a flexible and extremely

simple system for this type of application.

The main command is I-EE8IC which takes as its argument -i list of the

ten independent components of the metric tensor g ., aan d computes and prints

out all the independent components of the quantities

There are also conniODds for defining the independent variables, functional

dependence and substitutions; cu^nands for halting the action of Î-SÎEIC

at various points in its process and for calculating any further required

expressions. A two-part manual [10] hasbeen,written for^th'eifobmiand*'• •'.,'-!'.-..••••.'

language and it has been found that the reader, with no^previous programming

experience, is able to write a program to calçulate^Wëifàh'oyQr'^ànîiixes'ii'V'-'.'"

for a simple metric after only about half ah:hour's?'3tûdy.),*!ffiiS:aitairjmeht "v:

of this goal-has been onevof ^our prijicipà\ aiife;from"^h^ -B-VI-r -

The CLAM system ie wriLSen in COMPAS, within the University of

Texas CDC LISP System Clo3. Two versions exist; CLAM 2.0 is the standard version for metric applications using the command language.

There is no way for the programmer to referei -e explicitly those functions dealing with simplification, differentiation "c, AU unnecessary code, list structure, buffers and tables of tn LISP system have been edited out in order to save store. The system is approximately 10K words in length and is the one referred to by the manual. A second version,

CLAM 2.0, still retains all the LIST' interpreter and compiler interface and CPJI be used for non-metric applications as well (it contains CLAM 2.0 as a subset). Thus, programs can be written in LISP using CLAM functions, compiled and then executed. However, I feel the demand for this version is limited as it suffers from the same drawback a'S ALAM; very few people

are willing to learn LISP. As a result, no manual has been or will be

written for it.

Full details of the ALAM and CLAM systems can be found in d'lnverao

[ Tf, 15 ], d'Inverno and Hussell-Clark [ 16 ] and Bussell-Clark [ 26 ]. -B-VI-6-

(ii) aie Command Syetam

Bather than give a detailed description of the CUM system here,

I shall present a simple, almost trivial, example of the use of tho command language and use it to explain some of its most salient features.

Q The program (Fig. 1) is designed to calculate the K1x-]3 a» ^2323 components of the Biemann tensor for the Schwarzsehild metric

The program will run in well under 1pK and take less than a second to execute on a CJ3C6600. The output is shown in Fig. 2.

Description of Program

Command

(1) defines T (t) to be the x° variable, E (r) to be the x variable

and so on. E and P are used to stand for 6 and

(2) defines A to be an arbitrary function of one variable, r.

(3) defines A to be equivalent to the common factor expression, r-2E,

as well. In CLAM, the division and factorisation problems are

partially overcome by using atoms to represent common factor

expressions internally. For example, if the expression

(r - 2m Kr - 2m)"1

were to be given to CLm-l, it would be simplified to

r(r - 2m)"n - 2mCr - 2m)"1

and not unity as required. However, if the atom A ware to represent

this factor on input, and thus internally, then the example expression

would now be AA and this would produce the required cancellation. -B-VI-7-

A and its derivativts ara only substituted for when an «xprossion is output and then only when a switch has been set (see coamand (9)). CO Every scalar or tensor quantity has a unique atomic name associated

a with it. For instance, the quantities Qob q Q ^"bc and

°obcA are referred to in CLAX by G—, 'G*, G*+, GAKH— and H respectively. This coanand prevents the components of g, g and f .' from being printed out in the forthcoming calculations.

Thc fs u} ^"o usually output as a check on input. (5) causes the action of METRIC to be halted after it has calculated

(6) METRIC is given as data the ten independent components of g , and proceeds to calculate and define all the quantities C 1 ) up

to and including {Pt,} (taking notice of command (5)) but only printing out {p , ] (taking notice of conmand CO). (7) and (8) The components of a tensor quantity are stored in a hierarchical tree structure which is attached as APVAL to the relevant atom. These two comoands set the APVAL'e of G— and G++ ab to NIL anc'. so the store occupied by the components of g . and g will be reclaimed at the next garbage collection. The deterainant of 8 ti Si is lost automatically by the systea as it is never needed

again after {g } have been determined. On the other hand, {J"1. „1 . arë:still required in order to calculate the two Sieœann tensor components.

;-.;•---_: ïîhesefjtwovit!OQDiîiidsiàre inserted in this prograc to show how valuable "space can \\e saved.especially when processing roore eonplicated oetrics.

: /Obviously, ::initbis case, the [g .] and [ga } will occupy very little ï...'^ store and..tae ;eoiB3ands could have been oaitted. -B-VÏ.-8-

(9) Wh«n MBTKIC prints out £sftb}, thtt atom A Will bt lift

unsubstituted for. After this command has been interpreted,

A and its derivatives will be replaced, along with further

simplification, by r-2m and its corresponding derivatives on

all subsequent output.

of the fiionla 1I (10) and (11) cause the components H..,., and R2^5 ' i

tensor to be calculated and printed, out.

A number of other commands ars available within the CLAK system but the most important one which has not been used in the prof^-am just described is SUBSTITUTE which defines substitutions (e.g. COS1 G = I —Sm*6 ) for the simplification function. -a-vi-s-

(iii) Critique

So end thin summary, I shall attempt to present an objective

appraisal of the ALAM and CLAM systems. The unsuitabiiity of LIS? as a

high-level language has already been commented upon in Part A (i) and

this inconvenience has been minimised in CLAM by the use of the command

language. The format in vhieh algebraic expressions are input also leaves

something to be desired. As the amount of input to the system is usually

small compared to the amount of output, it was originally considered that

this format would provide a simple and unambiguous method of input and

storage of algebraic egressions in LISP list format. However, for those

applications which require large amounts of data, the conversion to

Polish format is very tedious and the resulting program is not easy

to read for checking purposes. Output, on the other hand, is in a three

line format which can be read easily (to my knowledge, ALA" wes the

first system .to incorporate this feature),

USP list structure provides a natural and simple method of list

processing.but it is very inefficient in store usage. In algebraic

manipulation it is often the cose that two or more pieces of data

naturally belong together and hence xt would be mora efficient to pack

the information into consecutive locations in store rather than joining

by pointers. The-CAMAL system [ 1 ] provides a good illustration of this

" technique.- Thus, because of the data structure, some of the large

calculations which ALAl-i and CLAK have accomplished have extended the

resources of the machine to the limit. ,.

However, despite the. above criticisms, ÂLAM and CLAK have performed -B-VI-10- calculationa in Helativity which many other systems would he incapable of carrying out and this must be its ultimata justification. For metric applications, the basic version is very easy to use; a fact which has been established from feedback from users.

CLAM is also extremely fast. Tile measurement of statistics of algebra systems poses many problems (see Fitch and Garnett [7 3 for instance) but I think it is true to say that there are no systems in existence which are appreciably faster for this type of work (see Barton and Fitch [2] p. 285). As an example, I present the statistics for a standard test probler., the 3VK metric. In order to calculate and print out in a reasonable format all the independent components of the set ( 1 ) for the BVK metric given only the [g } as initial data,CIAr'. takes 18 seconds CP time in *fOK words of store on the CDC66GO (although the program will run in less store). -B-VI-11-

Part B: Application of ALAM/CL/U!

(i) Metric Applications

Metric applications have been by far the most requested use of

ALAK and CLAM. The usual procedure is to produce the basic fora of a metric containing arbitrary functions by considering a particular physical situation or by appealing to isoraetries and then to use an algebra system

to calculate the Ricci or Einstein tensor so that conditions on the arbitrary functions can be found for an empty space solution or for a physically realistic energy-momentun distribution. After d'Invemo had constructed his first working system, he processed many such metrics on his oan behalf or for researchers and visitors at icing's College, London

and a description of the work can be found in his thesis [ if ]. Worthy

of note is that A1AM detected four errors in calculations in the 3VM paper.

• Since that time, metric applications have become commonplace and

CLAM and CAHAL are now continually being used for this purpose. As a

result, I do not think it iE worth, saying any more on this topic and I

shall proceed by describing some non-standard applications.

iij Variational Principle

It is usual in physics to demand that possible motions of a systesi

be duriyed^frora a variational principle* For our purposes, ue may define

on actionW byj-

\whwë';.1;h"a''IflS!:ansiita-Ii".is a function'of the co-ordinates v. , a set of field

: ,yaiviables y,'(A=1,.;..ti:) and their derivatives up to the second order: -B-VI-12-

The principle of stationary action, , then leads to the following equations ;

It is well known that if we choose the Kinstein Lagrangian, L = -^-g E and vary the action with rc-spect to 3 (=y„:A=1,...,10) then these equations are precisely the Einstein field equations.

d'Inverno [4] considered it of interest to investigate the result of varying the action with respect to -ihe four arbitrary functions in the 3VH metric. AL/u-'. was used to calculate the Sinstein Lagran^ian for this metric and subsequently to compute the four equations ( 2 ) with y. = {U,V,jS,^ ]. The interesting feature of this work is that d'lnverno developed a routine for performing functional differentiation. The routi -.e is similar to the ordinary differentiation function in ALA!*î/C-LÂM but uses the LIS? function ZQUAL to test for a particular functional dependence within an algebraic e:cpression.

The final result was half-expected; the equations ( 2 ) reduce.ir ; , . ^ this case ti the 3ondi îiain equations, 5,..= •?••,•,- ^22~ ^V° "* -B-VI-13-

(iii) A Perturbation of the BVH Metric In their paper BVM give the first few terms of the expansions in 'r of the metr-_e functions UjV 6 and V i the form of the expansions being determined by the requirement that the vacuum field equations be satisfied. d'Inverno [14], with the help of ALAM, was able to carry these expansions up to the eighth order using an iterative technique based on the algebraic form of the Bondi Main Equations. The expansions are not very interesting in themselves but, if we denote them by

( Cnjftnj £„ and £ are functions of U and Q ) then d'Inverno investigated a perturbation of these of the form

n fl-2(cn+cn)r- t p-2,(^4.50^,

C C„ .dn Cn., -jt„ also functions of U and 6 ) which will produce a non-zero energy-momentum tensor, 'abl^j^* i"h)

By doing this, he was seeking a possible description of a region, surrounding

a gravitating source, wliich is occupied by s. fluid or plasma of low

density, i He assumed further a perfect fluid,

where, for such an energy distribution it is easy to show that the physical

components of Î . in its eigenfrarae of one tin.elike (=Uv and three

spacelike vectors are -B-VI-14-

ALAM was used to determine the series expansions, up to and

including terms in r of the physical components of T fc in the BVM orthonormal frame for varr.ous orders of perturbation. Again an iterative procedure was adopted to avoid calculating unv;anted terms. Different cdtrs of perturbation were not superimposed as this would have made the problem too conplex to handle but, even so, before the resulting eigen­ value equations could be solved further simplifying assumptions had to be made.

The final result was negative in that no physically realistic energy-momentum tensor was found for the particular forias tried. The

eigenvalue equations kept prodr-iin;» null eigenvectors and so the energy

distribution could not be a perfect fluid. Such a solution, if it

exists, must come out of superimposing various orders of perturbation or

by assuming more general forms for a perturbation. ^ I i * I il, I il I I I II I II , i I I h I , i !, ,,! | i ,|. Dj ; |. .

-B-VI-15-

iv) The Harrison Metrics

In 1959i Harrison *C12] published a set of forty exact solutions

to the vacuum field equations. He found these by seeking solutions

of the form

a* = n.b^*o,«o «£(*•">•) i.e. of diagonal linked-pair form, possibly allowing the existence of

waves travelling in the x or v? directions or both. Twenty of his

solutions are non-degenerate in the sense that they appear to depend

on three variables; the remaining twenty were found tc be expressible as

functions of only two or less variables.

The amoijit of algebra involved in solving the field equations for

this particular form of metric by hand was enormous (ref. Harrison [11])

and so a natural reaction would be to check the solutions using a

computer. The check was a direct one; A1AK was used to calculate the

Ricci tensors for the forty metrics. Of the forty, four were found to

be non-vacuum but the remainder are indeed vacuum solutions.

An important point to bear in' mind about these ce tries is that they

were obtained by imposing conditions on the co-ordinates and hence the

particular choice of co-ordinate syscem nay mask any interesting physical

properties;:;: Two possible ways of analysing, the se netrics in an invariant

':•• ;.Qanner«"WoUldbe ito'find their isoraetries by solving Killing's Equations

or to;determine their-Pëtrov types. The former piece of work has been

;\.;;^ unly isometry possessed by :

- .*• P^:S*^?Sqhfdégenerite^ to the abswc of the x J

;;'Y:;":;-coi.brdinateV:i'"'ïi • '.^'v "-• -.'".••'• :..•:••'"•"-.. •••>•.- •ajRuts-

The physical interprétation of tha Patrov clarification stams mainly from tha work of Çachs [27]. Ua was abla to show that tha Btensan tensor for physically realistic fields representing outgoing radiation from bounded sourc-.s displays the following asymptotic form

R = i\lr-' tir"1 -vILr-* + Ir^+lV6 f Ofr"*1) c -. o o o t where r is an affine parameter along an outgoing ray and each of the coefficients N, III, II, I and I* is of the Petrov type denoted by its o o o o o kernel letter. This is the well known Peelsng-Off Sheorem and it follows

from this that solutions for radiating fields must be Petrov Type I„ It was therefore interesting to see if any of the Harrison metrics satisfied

this condition.

The local symmetry group of spacertirae is the connected part of

the homogeneous lorentz group 0(1,J) and under the action of this group

the irreducible parts of the Riemann tensor R . , are abed

Ci) ths trace-free part (Weyl tensor) : C . .

(ii) the trace-free p&rt of R , :Hv-rg.H * ab all 4 "ab (iii) 'the trace of B. : R ab

In empty space the last two parts reduce to zero and. .so the Weyl tensor can be considered to be the free gravitational part of the curvature and the Petrov classification consists of an analysis of^this object. The best algorithm, for computational purposes follows from the double covering of 0(1,3) by 3U2, C ). the group of 2 x 2 unioiodular-complex

matrices. : We can endow the space-tine manifold with a spinor-structure , -B-VI-17-

by requiring that the tangent space at each point be a two-dimensional complex vector space whose symmetry group is SL(2,© ). Spinor fields can be built up by taking tensor products and real tensor fields are simply those spinor fields which are invariant under complex conjugation,

ïurthermore, a little spinor algebra shows that only spinors totally symmetric in all their dotted and in all their undotted indices are irreducible under SL(2,C ). From these considerations and much algebra, the irreducible decomposition of B , can be shown to be

C . . » "^f e.. e- -+• "

(Here, I have adopted a convention due to Penrose [23] whereby a tensor label is identified with a pair of spinor labels: Q = f)Â V>= BB etc.) whera ;£»-„_. » X..!! and l\ are totally symmetric among their dotted and undotted indices and hence irreducible. It turns out that the classification of the Weyl tensor can be achieved far more succinctly by investigating Y rather than C , , directly.

.Any symmetric spinor can be decomposed canonically into a symmetrized product of. 1 - spinors

/^«BCt>= «(ftPs tfc^ «y, <3>

whore °*_ p Y_ and 0 are termed the principal spinors of *n8ct) and each determines one of the principal null directions of C . .. The

Petrov classification is obtained by classifying ^-BRCQ according to -B-VI-18-

the multiplicity of distinct principal apinora it pocaessta; tha number of combinations possible being equal to the number of partitions of k.

irtition of 4 Petrov Type Form of %Btp

[1111] I

[211] II

[22] D

[31] III PO N [-] 0

It follows from ( 3 ) that the necessary and sufficient condition for an arbitrary spinor «^ to be a principal spinor of J-ftsc$A6G£}> is

With any choice of spin frame 6 6- the equation becomes

and writinc ^~ = (i l) and defining

ô_ S2SS J \~ SSSi. •> *" 29it •* z" 2!JLt J >t = Xi.Ii.-j we obtain

The algorithm for Petrov type now reduces to investigating the aultiplicity of the roots of this quartic. For this to be done, however, wé oust -B-Vl-19-

X fir«t of «11 be' able to eor-ut. the set {^9 ,*%\ J~%./ 2'*i'%t\ If ye choose a null tetrad [la, na, ma, m a} defined in terms of the spin frame by

** _ ft ft Ck-AA a H À _- A A the j; "s become the familiar Newcan-Penrose quantities [213

*•© ^-abcd * m Jl wi ,

b c < T, = Cabcdrn A m * ,

i, b c % -C«kcAn iB n iK*l which are easily determined £rom a given metric together with a suitable null tetrad. The remainder of the algorithm belongs to quartic theory. Analogous to quadratic theory, various conditions on certain quantities constructed from the determine the nature of the roots of ( k ). Note that it is not necessary to find the roots themselves; in general, this would be very difficult to do as the I*S are algebraic expressions. The complete algorithm ready for coding, can be found in d'lnverao and Hussell-Clark [17] and, in more detail, in Russell-Clark [26].

Using this algorithm, all the Harrison metrics were classified. For a given metric, ALAH was used to calculate the U'eyl tensor (which, except for the four non-vacuum solutions,' is equal to the Kiemann tensor) and then, given a null tetrad, ALAK proceeded to determine the five T*S and from them the quantities required to test for Petrov type. Of the -B-VI-20-

forty metrics, twenty five ware found to be type I, fourteen are type D and on* ia flat apaca. The typa I solutions therefore bicorne candidittts

for physically realistic radiative solutions but, due to their complexity in form, the significance of these is far from clear.

Kinnersley [18] has found all tvpe D vacuum solutions and has classified

them in an invariant manner. It was therefore of interest to find the

Kinnersley class to which each of the type D Harrison metrics belongs.

To do this, it was nacessary to determine the transformations from

Harrison's co-ordinates to those of Kinnersley and this task was helped

by the fact that the for these metrics had already been calculated

by ALA" and so, from ( ^ ), their principal null directions in Harrison's

co-ordinates were known. Of the fourteen metrics, only eight were found

to be distinct. This is a consequence of seeking solutions in a co­

ordinate dependent manner.

Full details of this section can be found in references [1?3 and [26].

Part of the work was also carried out in Cambridge by Fitch [6 ] using

CA14ÂL and he obtained identical results to those presented here. -B-VI-21-

(v) The Landau-Lifshitz Pseudotensor

In the past, one of the ways of describing the intrinsic energy of the gravitational field has been by using psecdo tensors. Many different pseudotensors exist in the literature but the one I shall be concerned with here is that of Landau and Lifshitz [ 19 D, t , which is defined by requiring that the energy-momentum complex T = C~9M~^* + t ) satisfy the conservation law X >b =0 -A total ^-momentum,

P , can be defined in terms 01' T by

ta*à% •b'V and it can be shown, for instance, that this reduces to the expected value of (m, 0, 0, 0) for the Sohuarzschild metric. Fi.-theraore, Kpller [ 20 ] and Goldberg [ 9 ] have applied the corresponding definitions of ^-momentum in terras of the Kpller and Einstein complexes respectively to radiating systems (more precisely, BVM systems) and have obtained

where MtU Q) is the 3ondi mass aspect function. This value for p agrees with Bondi1 s own conjecture [ 5 3 and can be derived by alternate methods, (see, for example, Sachs £ 28 D and Taiaburino and Winicour C 29 ])•

Furthermore, in the genrral radiative situation where no global symaetries

arepresent,. Sachs C 28 ] has shown that the corresponding p transforms

as a Loreatz free vector under 3MS transformations. This property also

follows from group theoretic considerations as the supertranslations (of

which the translations are a subgroup) form an Abelian normal subgroup

of the BUS group and their factor group is the homogeneous Jjsrentz croup.

A satisfactory definition of angular noEentum, on the other hand, is sore -8-VI-22-

diffioult to find M th» homogeneous Lorents group ie not normal and BO we should expect the angular momenta to mix with all the supermoaenta under" a generalBMS transformation. However, various definitions do exist and it is interesting to compare their results for radiating systems.

The fact that the Landau-IAfschitz complex, T , is symmetric

•tacib enables an , r\ , to be constructed from it in a natural manner:

Jv with conservation law (jjc> *t J _'=0 . 0ne restriction when using pseudotensors is that it is necessary to work in a co-ordinate system which is asymptotically Lorentzian and all calculations described from now on were carried out in such a system. The two conservation laws and

Gauss's Theorem allow us to write the flux of It-momentum and angular

momentum across a 2-sphere (with unit normal ÏI ) at future null infinity + y :

It was not certain, at this stage, that the Landau-Lifshitz quantities

would produce sensible results for radiating systems and it was therefore

decided to test them by calculating ( 6 ) and ( 7 ) for a system with BVM

. has the following asymptotic form -B-VI-23-

<•%» %fa t°b - •£ *•£* OCr-)

(2) and d'Inverno [T* ] used ALAM to determine ta from the explicit formula for t given is [ 15 ] (a single glance at the formula is enough to see that a hand calculation would be out of the question!). Upon inserting C2lb the value of t into ( g ), the retarded time derivatives of (5) were obtained; in particular,

du 1L° J the Bondi mass loss formula.

(3 In order to calculate ( 7 ), tl b is also required because of the extra X** (s (tt*r pjinBcoa» rsi

1 dti'V cm.* s Ç\M"S Q dU*. ~ du. eAu. Again, this was anticipated from the nature of the BVM solution. In fact,

one should expect the stronger conditions that M = \\ - 0 froa the axial

symmetry and H = 0 from the reflection symmetry bot these cannot be -B-vi-a4-

proved from the method described above; only their tima•dérivativas ere possible.

At this point it was realised that a technique due to Keller [20 3 could also be applied in calculations involving the Landau-Lifshitz nseudotensor and would allow H itself to be determined. The method consists of writing long expressions in a vary compact form and a calculation bj hand was eventually passible. This time, the general axi- symmetric situation was considered so that we would expect a non-zero component of angular momentum (M1 2 ) about the axis of symmetry. The final result was similar to those of Ilewman and Unti [ 22 ] and Tamburino and winicour C 29 j ; all three give values of H and M containing the terms

respectively,

vhere N(u}6) and P(M5©} are the 3ondi Eass-dipole and spin-dipole aspects (

by integrals of terras bilinear in the "ews functions, c(U}6 ) and dCu^O ), and their derivatives with respect to 6 • Probably the best definition of angular momentum we have at the moment is the Tamburino-Winicoui one referred to above. They define their h-momenta, angular momenta and supermomenta explicitly in terms of the descriptors of the 3KS group and their corresponding M has the ".iditional property of being constant in the retarded time. This might be considered natural on account of the J'^Q. global Killing field.

. "The main role of the computer in this investigation was "hat of ohecking -fl-VI-25-

the plausibility of the landau-Lifshita definitions, when applied to radiative systems, at a tics when no other way could be seen of doing it. Details of this aestion can be found in Russell-Clark [ 26 3. -8-VI-26-

Part C: Borne Recent Applications i) Finsler Spaces One of the basic assumptions of the theory of General Eelativity

is tr;e Hiemannian hypothesis which assumes that space-time is a four dinensional diffarentiable manifold M along with an indefinite Hiemannian metric Cl^ulœVXfeM. Hartley [13] has examined how essential this hypothesis is t> --placing it hy the weaker Fins'..er hypothesis which allows the metric to be a function of direction as well as position. If we denote by x (. does not necessarily imply differentiation with respect to a parameter) a vector in the tangent spc/je at x, then a Finsler

metric is of the form CL,^ {jx.ssc\ .

On accounl; of this extra functional dependence, four connections,

Xafec , T^bc. )Cabt , C^ can be defined along

with G" , &\ > P^ ,rV , P*^ *nd P«%t which are various combinations of "the previous four and of -hernselves. Proceeding

further, three curvature tensors, K ^MI , R fetd ^ S ^CJ can be constructed, each one having a set of syom<. tries similar to, but not the same as, those of the Kiemann tensor» Trike the metric, all these quantities are functions of x and x and their actual definitions can be found in Hartley [13] or Kund C24].

In classical General Belativity there are two -coraion ways of deriving the Einstein field equations: -B-VI-27-

i) Iron an notion prinoiplt using th« Ein«tîin

Lagseagian v~*ï "

or, ii) by arguias from t'as contracted Blanchi identitiea, Gr°V=0. The situation in Fiasler space is not so clear cut. It is not obvious»

for instance, what is a suitable definition of the action and there are

at least three 'different curvature tensorsi In spite of this difficulty,

Hartley has managed to produce a feu sets of suitable vacuum field

equations (the criterion for suitability is that they admit solutions

which are not necessarily iiiemannian,) by appealing to arguments similar

to (i) and (ii). It is not necessary to state the equations here; it

is sufficient to know that they include various contractions of K bed-R (,c and $ bc4 •

Hartley was interested to laiow whether any of his field equations

would adrait a solution which is a stationary, spherically symmetric ELnsler

perturbation of the Schwarzschild aetric. He chose to worlc with a metric

of the form

9ab(~,*) = g*ab(*) +• ftW^G*-,*}

where Q -. is the Schwarsschild metric, € is B smaTJ. parameter t and, with co-ordirates (t,**»^^ ),

/-V(r» ^w)! -

O ! 0 *^ ! — 1

Even for this simple metric, a hand calculation of the field equati -B-Vt-28.

prohibitive because of the extra quantities and functional dapendenca in Finaler geometry. Hartley therefore asked J. p. Slteh and nyeslf whether this could be done by computer and a number of subroutines were written in CAMAL to determine the quantities in .lis field equations,

The calculations were carried out to first order in £ and the resulting expressions were long and complu. There were .'» large number of non-

anI a 1 vanishing components; 78 components of K btt» ^ ^-'- ^ components

of its contraction KLJ = K. uQJ were non-zarc.

Unfortunately, the outcome was a negative result. Hartley w.;« able to show that no Finsler perturbation of the-form given above exists for any of his field r Rations. Obviously, a more general perturbation could be tried but it would appear that- tho resulting field equations would be so complex as to become intractable. Pull details of this section are to be found in the admirable work of ilartley [13!. ii) The Sato-Tomicatsu Solution

Hrnst [5 j has shown that the line element of a stationary, axi- symmetric vacuum solution of the field equations can be written in the form

***= -fVK^ + da1) -fr ^d/j-^dt-wd^f" (S) where f,

fe%* - 1)7% = 2\*S?%'V% (9) -B-VI-29-

Zn s«n»rul, oolucioi.s of this equatii-n «fê dlffloult to find but, by

imposjnG *i- oi.-i'iitioa that c, =usi. be rial, nany solutions are sily

obtainable !

A simple complex solution t j .' o ) is 5^ = px - i^y which

corresponds to the K«rr metric; here (x,y) are prolate spheroidal

co-ordinates related to the cylindrical pilars (p a ) by

p = K (x.1- l)yi(l- ^f* , 4 = yocij (-10)

and p*.+ a =1 . Sato and ïomimatsu [50] hare recently discovered

further solutions of the Ernet equation of the form

'.-..•.V/fr. where 0( and ' p are complex polynomials in x and y. îhese solutions

form à family in which each is characterised by an integer par-jneter 0^1.

The" metric' corresponding to 0 = 1 is Kerr but those corresponding to

are new. 'The higher 0 is the more complex the expressions

-"'"OCi'and^p:; become a!%ébVaicalïy and consequently, the resulting metrics

also. "However, the qualitative properties of the metrics for O ^O

(are. not very'differeni: from those of the metric for 0=2. and so it is

of primary interest to investigate this case first of all. This has wee,.

done by G. W. Gibbons ar.d r.yself f S] and again the CAHAL system proved to

be a' ine'stinable worth.

For 0S1 i Oi and 6 are given by ^B-TI-30-

ond tho citric function arc

a J- ft/B , « - 2mclC(l-irt/ft , e * -bjiftf-iff) oil

when A,E and C ar* lengthy polynomials in » and y and m is a eonstan . related to tha K. in equations! 10 ) by % ss lTXp/2. .

For 3t<£ X , the solution has an ergospherfa which lies betwaçn the two surfaces given by the roots of A = 0 and a ring singularity at the root of B(x,y»o)-0 which coincides with the inner surface of the on ifr-e v equator (yO) . Of interest here, though, an three parts of our investigation for which we relied upon the CAMAL system.

(a) The surface x =* 1

In their paper, Sato and Tomiraatsu claimed, by analogy with the Karr solution, that this surface is an , which can be defined oc the. boundary of the past qf future null infinity. It follows immediately that an event horizon must be a null surface, a property of which is that it can contain no timeiike vector. However, it can easily be shown that both/ th* Killing vectors XCL and S~ become parallel and are timelike on X « 1 and hence the surface cannot be "null. Futhermore, it 1? not difficult to p«w also that the induced (degenerate) metric is Lorentiian there.

Suspecting a curvature singularity therefore, we used CAMAL to calculate the physical components of the Rlemann tensor in'an orthonoTMl frame «tx • I The programming was fairly straightforward but a. point wci'th noting is that a typical compone , contained terms with povera of

. ^Ot-Xj in th°ir denominators and so 1'Hospital's rule had to be applied1 to such terms the correct number of times. •B-VI-31-

All conponenta, however, were found to be finite and ao presumably the solution is extendible through x - 1.

(b) Causality violation

If we interpret 0 as the angular co-ordinate then, where Q is

negative, there are closed timelike. curves. We used CAMAL to show that

3Tr--j£0-!f) F (*,,,), where F is a polynomial of degree 10 in x and 6 in y. This result is by no

means obvious from substituting the metric functions ( 11 ) into the line

element ( 8 ). It seemed unlikely that F could be fact oris sd algebraically

and so we resorted to numerical techniques to solve F » o. There is only

one root for x > 1 which coincides with the ring singularity for y = O and 2 with the "poles" of x • 1 at y • 1. It lies inside the inner surface cf

the ergosphere for intermediate values (see diagram).

ring singularity

ring singularity

t.and ea dimensions suppresses"-.

The algorithm described in Section B(iv> was programmed in CAMBL -B-VI-32-

and the nitric wae found to be Pitrov type i.

I have not attempted hare to describe thoae parts of our investigation in which we eaployed aumerieal techniques] I wish only to stress that the availability of an algebra systen had been very important. Other researchers who had looked at this metric had been severely handicapped by its algebraic complexity. •S-VI-33-

Eafsrencas

1. Barton D., Bourne S.B. and Fitch J.P., Coop.J. rj, 32 (1970).

a. Barton D. and Fitch J.P., Sep.Prog.Phys., 3jj, 235 (1972).

3. Bondi H., van der Burg H.G.J, and Ketaner A.W.K., Proe.Boy.Soc, A269, 21 (1%2). '

4. Collinson CD., Proe.Camb.Phil.Soc., éO, 259 (1964).

5. Ernst F.J., Phys.Bev,, 10?, 1175 (1968).

6. Fitch J.P., An Algebraic Manipulator, University of Cambridge (Thesis), (1971). 7. Fitch J.P. and Garnett 0.J., Proc.ACM Int.Comput.Symp., Venice, (1972). 8. Gibbons G.tf. and Sussell-Clark 2.A., Phys.Bev.Lett., JO, 398 (1973). 9. Goldberg J.N., Phys.Hev., 131, 1367 (1953). 10. Greenawalt S.H.-, Kbrxiis J.B. and Singleton D.J., She University of Texas 6400/6600 LISP 1,5, Austin Computation Centre, Release TEK-2, (1969). '"••' 11. Harrison B.K., ïàcact Three-Variable Solutions of the Field Equations of General Kelativity, Princeton University (Thesis), (1959). 12. Harrison B.K., Phys.Eev., 1lS, 1285 (1959). 13.' Hartley D.A., Finsler Geometry and General Eelativity, King's College, London (Thesis', (1973). 14. d'lwerno S.A., The application-of algebraic manipulation by cor aiier to some problems in General Eelativity, King's College, Lor < an (Thesis), 11970). 15. d'Inverno R.A., Coop.J., 12, 124 (1969). 16. d'Inverno E.A. and EussâlI-Clark E.A., The CLAM Programmer's Manual, Parï 1, King's College, London (1971). Part 2, University of Cambridge Computer Laboratory (1972).

17. d'l verno E.A. and Russell-Clark E.A., J.Math.Phys., 2=» 125& (1971). 18. Kin evslty W,, J.Math.Fhys,,: 10, 1Ï95 (1969). -B.VI-34- •

Landau L.D. and Lifihitz E.H., The Classical Theory of Fields, Pergamon (Third Edition, 1971). , •

Moller C, Mat. Pye. Medd. Dan. Via. Selak., 34, No.3 (196,4).

Newman E. and Penrose n., J.Ksth. Phya., ,3, 566 (1962).

Newman E. and Unti T.W.J., J.Hath. Phys., £, 1806 (1965). Penrose P., The Structure of Space-Tin*, in Batelle Rencontres, Ed. De Witt CM. and Wheeler J.A., Benjamin, Inc. (1968).

Rund H., The Differential Geometry of Pinaler Spaces, Springer- Verlag (1959).

Russell D.B., ATLAS LISP, Atlas Computer Laboratory, Chilton, Didcot, Berks. (1966).

Russell-Clark R.A., The application of algebraic manipulation by computer to some problems in gravitational radiation theory. King's College, London (Thesis), (1973).

Sachs R.K., Proc.Roy.Soc., A270, 103 (1962).

Sachs R.K., Phys.Rev., 128, 2851 (1962).

Tamburino L.A. and Winicour J.h., Phys.Rev., 150, 1039 (1966).

Tomimatsu A. and Sato H., Phys.Rev.Lett., 29_, 1344 (1972). :i*r bm *ï- ivSiB-.VI_33>i

CLAM PROGRAM:

(J) VARIABLES CT ft E P) C2) FUNCTION (A CR3 3 C3) FACTOR CA C+ R C- C* C2 1) M)))) C4) NOPRINT CC*G* G++ GAM+—)) C5) STOPAFTER CGAM+--3 C6) METRIC CC C* A '** K C- Cl 1)))) 0 0 0 C- C* R C** A C- Cl 1))))) 0 0 C- C** R C2 1))) 0 )) C- C* C** R C2 1)) C** CSIN E) C2 1)))) C7> LOSE CG—) C8) LOSE CG++3 C9) SWITCHFAC CONS C10) CALCULATE CR CI 3 I 33) Cll) CALCULATE CR C2 3 2 33)

Fig. 1 -B-VI-3S- CLAM OUTPUTS

-1 G =AR 00

0 mit 01

G =0 02

G =0 03

-1 G = -RA 11

G =0 12

G =0 13

2 G = -R ilC

G =0 23

2 2 G = -R SIN (E) 33

a -i e R =<1/2>RSIN CEXB-2M) -U/2)SIN «E> 1313

S R =-àMIîi,i.\ ic.} 2323

Bcâ -B-VTI-1- |f V /

THE INTERACTION OF sni ITM< )KI>

E.H. ROFFMAN"

Both the Korteweg de Vrles'(EdV) equation

U-t + HA* +UXXX =0 (,)

and the elne-Oordon (BQ) equation

Of = -3/nfvp) (a) have special solutions, called solltons, which are localized In space and have a fixed profile far all time. Both equations also have the property that solution axlst which at i * - «o aay be described as a collection of solitons moving toward each other, and at, i * + >*> as a collection of solitons moving away rrom each other.3 It is very remarkable that the solitons in the flaal state have the same internal structure and the saisie velocltliis as those In the initial state. There In a relative chance In position, W no momentum transfer.

There have been some beautiful analytical studies il of these equations, recently. However, many of the interest leg pj-ojva^tiee were originally discovered by

4( E.H. ROFFMAN, College of the City of New York -B-VÏI-2-

nuinerloal Integration.

We bave Investigated the case of equations which, like the sine-Gordon and Eortaweg de Vrles equations, have localized solutions, but for ahloh the Interaction of solitons results in both a transfer of momentum and In a change in the Internal structure o.'f the Interacting solltons.

We do not yet know whether the final state consists only ' i cf solitons, or of both solitons and waves. A Lorentz invariant differential equation which admits solutions containing only solitons, and which allows interactions with non trivial scattering, 1. e. for which momentum transfer occurs, would generate a relativistlcally T Invariant theory of interacting, classical particles.

The Korteweg de Vries equation arises as an approximation

in a variety of physical contexts including plasma physios, the theory of water waves, and the properties of ooupled non linear oscillators'•--,•*. The slne-Oordon equation arises as an approximation in the theory of the Josephson effect, -B-VII-3-

the study of self-Induced transparency, and other phenomena.

Equations of the type ue study arise from the alne-Gordon equation when higher order terms are taken Into account. They also occur as the equations of motion of a self-interacting, scalar, charged, classical field, and as the equations of motion of an electric field In certain semi-conductors.

We shall dlsouss the results we have obtained on the non linear, charged, Klein Gordon (U1KG) equation by means of numerical Integration.

In the third paragraph we shall discuss an Interpretation of some of these results, and note that they open up the possibility of some interesting phenomena.

Of great Interest in particle physics is the relation of these localizes solutions to solutions of the quantized field equations. Vfe shall briefly dlsouss a model In which a quantized system has a localized struoture analogous to that of the classical system. -B-V11^*-

II

The specific equation we studied «SB

P(>» positive definite. If the energy is positive semldeflnlte (as It 1B for the sine-Qordon equation), then there Is a degenerate ground state, and then real valued solutions exist which are localized after identification of different ground states (e. g. the slne-aordon equation sol it one go to zero at JT* - -o and to 37T as X * + «o . ¥ ~ O and

The equation (3) admits localized solutions of the form

f(xj) = e""* Of*) (¥ where &'(°) = O 0(x) —>o

The frequency:"•'"" u) is restricted by -B-VÏI-6-

1 7

We chose an Intermediate value of U)> u) = ig . Then @ satisfies

x ©%> = ecx) [i - ,j - m e * su e*] (S

This equation may be easily Integrated.

We then study the evolution of an Initial state of the fora e K 8(cE*-*i-st) a)

where ( ^ c. ) la a Lorentz transformation, G ~ S - / \/ = vc_ Is the velocity, and we Investigate the Interaction as a function of C , which is equivalent to the ratio of kinetic energy to rest energy of each of the solltons at X * - co when they are Isolated from each other. We use Bymmetrlc lnitlrl conditions (1. e. scattering In the aanter of mass ayBteu.). We Integrate the equation numerically. -B-WTI-7-

There are several featureB which make this equation difficult to study numerically. There Is, fir it of all, the fact that a large number of points muBt be uaed. ThlB Is '••joauae the Integration must be studied over a large region of the X-axla (since the solltone are moving and cover large distanças over a long period of time), while the density of mesh pclntB muat be very Mgh for sufficient accuracy. At least twenty points must be used ovar the region where a soliton is 5% or more of its abaolute value. AB the enerijy increases, Lorentz contraction reduces this distance, so the deiiBlty of mesh points increases as the energy rlaes.

A second protlem la that the solutioA function is complex value and the integration method must be very good to Dbtaln sufficient accuracy for the phase.

We used a leapfrog method to obtain a provisional value for the function at each time step, and then UBed an Implicit method to obtain the final value. Empirically, thlB scheme had about the same effect a§ using a leapfrog method alone, with double the num'oer of points. -B-VII-8-

The properties of the solutions varied considerably, depending on the value of the Initial energy. For C = 1.025, C = 1.05, and C = 1.1, the Incoming solitone bind together so that, at least for tines long compared to the time It woull take them to pass transparently through each other, the; do not form a state with two free solltons at all. The new resonant state has A different Internal structure than that of either of the Initial solltons.

An Interpretation and some applications of this result are discussed In paragraph III.

For C = 1.2, 0 = 1.3, S = 1.5, C s 1.7, and 0 = 2.C, the behavior was qulta different. The two inooming solitone appear to pass through each other, and then emerge. There are several interesting affecta that oocur In this orocess. First, there is some material which remains at the center of mass after the two solitons have passed through each other. This material decays, sending out small, isolated waves with high velocity which subsequently interact with the two final solltonB. Seoondly, the final solitone (which are not really solltons, in the senao •i'at they are interacting with the higrf velooity waves Just described) -B-VII-9-

are executing internal notions and look very much like a travelling version of the resonant state described above. Thirdly, the final aolltona are not travelling with their Initial valoclty, they travel more slowly. Finally, the exact struoture of these solutions changes considerably aa the Initial energy Is changed.

For C = 12.0 and C = 18.0, which might be called high energy, there la still a d.'.fferent behavior. The two solitons pass through each other without effecting much change. The final velocities are very oloae to the initial velocities, and thero is no perceptible material lert over in the center of mats after the interaction, and no observable new structure in the final Bolitons. -B-VII-10-

III

The fact that Bolltons bind at low energies has soma Interesting applications.

We suggest that it is possible to construct many different types of systems in which, by sending two pulses slmu .taiBoualy into an appropriate material, a Bingle, stationary pulse may be trapped Inside (which will remain for times long compared to the time it takes a pulse to move freely through the materia] ). A third pules could be used to read or extract the pulse stored Inside. Suoh a device could be used for Information storage, and possible even energy storage.

Among the systems which might be constructed to have this property are systems which, to first order, are described by the Bine-Qordon equation, such as systems which IX admit self-induced transparency, in which case the pulse is 13 a light pulBe, and Josephson Junctions, In which case the pulse ii: electrical. Another system which can have this property Is an appropriate semi-conductor, under the Influence of a light pulse. In this case, the equation of motion is equivalent to the non linear, charced, Klein Gordon equation -B-VII-1'-

and the pulariaàtion of the light Is equivalent to the phase of a complex solution! function.

The non linear Klein Gordon equation may be considered to be t. perturbed sine-Gordon équation. If we consider the differential equation

Qf = - f (ml -"X(V

+/5(fff + -- ) (7^ theft tie transformation

allows it* coefficients Hi and A to he adjusted at will, except that the signs rema; a fixed ThuB, by scaling, any tvo equations with the same sign structure are equivalent up to "Ifth order, 1. è. tf>(

Z.-j is well known that the sine Gordon aquation has a family ,of solutions Khibfc "may be written in the form

r v x-t •* &{*•) 1 ? SIM£ [ Ca,ct)-a,t*))pc + i +5.a)) + a,«Ja,«JJj -B-VII-12-

where ftjft) and $(i) are, In fact, Independent of time.

With apen'al cholcea of these constante, we obtain it n-irtioîjlar solutions ot the form -,[j. SIMHVU ~| - 1 - (W yr^i) = V tan I v cosiTTx / °= ^> - v2-

w'aicn aesorioes tne scattering of a soliton ard an "antl-sollton" (an "antl-sollton" is <27T at tf* -ao , and zero at x*+co , while a soliton is the opposite); and'

which describes a bound state of the same system.

We interpret our results for the NIKS equation in the following way: for the perturbed aine-aordon equation, with a periodio perturbation

Of"- - 5/n(ip) + /^Slfl3(tp) + (//)

equàtioB (?) is an approximate solution In vhioh, however, -B-VIÏ-13-

d(t) and £ft) vary with time. The exaot solution of the perturbed Bine-Gordon equation looks like ( fOQ) for t * - ao and like (lob) tor t & O , in the case we are considering.

Oaloulatlons using this approximation,IB an d a similar approximation for the case of a non-perlodlc perturbation, confirm thlB Interpretation and sho'/ that the way that the Bolltons become trapped at low energies is the following. The term with a negative sign in the potential acts ae a potential well, lowering the potential energy when the two Bolitons are close together. However, after the solitons have passed through eaoh other and are trying to separate they nay be prevented from doing so for two reasons. First, internal changes In structure raise the potential energy barrier as the solitons try to aove apart, and secondly SKae of the Kinstie energy la transferred from horizontal motion to internal kinetic energy, so that if the kinetic energy was low enough to begin with, it will fall to a point where It Is not sufficient to enable the solltone to break out of the potential well.

the system is described exactly by the sine Gordon -B-VIT-14-

oquation, then &({) and 5(c) are constants, BO this effeot can not oooui'. The physical systeai must have higher jrder terms. It does net matter whether the perturbation la periodic or not. ao binding may occur In either case.

For these système, and for the non lirsar semi-conductor deocrlbsd above, two pulaes should be sent in slmultaneoualy from the two ends of the material. Thsn a standing pulae villi remain at the point of Interaction. -B-VII-15-

IV

It is of interest to see that localized solutions can appear In quantized as well as classical systems. We shall very briefly indicate a model In which such solutions if may hi exhibited.

Suppose there is a finite set of J" points, with the zeroth and J" points identified. Suppose that at each point if there is an operator

with elgenstateB lNs£

and suppose that the eiiergy eigenvalues have the following properties:

= 0 Eo O <«) £A < 3E, 03) -B-VII-16-

Thla energy spectrum la like the potential energy function for the classical field with localized solution?, it grows less fast than linearly for small values of A' , and then grows rapidly.

A solution of the equation

Zk Hk V- E? 0*) is simply a state of the form

s ^= /*})» •••*/A/J>T %••*• (IS-)

we nay define a charge operator Q , and an "excitation number" operator Jy by

ti%iNr=(ziNj) %..* (it) -B-VII-17-

Conslder now a typical state with charge one and excitation number -three. There are two types. Type (1/6) has the lower energy, because of the energy spectrum.

]? Wk h>® @/'>© ®/-*>® •• /'> ®/o> Q?a)

J ^ lo>& ••© /a>ô• - © /-i> */o> = fe + 5, ) l^.-v-f The effect of the non linear energy spectruia la to create an attractive delta-function potential tending to keep positive excitations close tcriether.

If we have a raising and lowering operator

J e> ,/A/> =• //V±/> ^/g) then the operator

'K^kH 0?) can changa the excitation number, or shift the location of an excitation, but it cannot change the charge. B-VII-18-

The operator

Z[Hk +M3L- S»

no» has elgenatates whloh conslat of superpositions o.f terms with the same charge, but different numbers of excitations. In the lowest elgenstatea, there la a tendency for the excitations, In the Internal degrees of freedom, to stay close together. Because of tranalation invariance, thla localization does not appear aa explicitly as it does In the classical case.

Because of translation Invariance, we may write an eigenstate with momentum p , and charge one, in thé form t- 5, e'pf"° % Lai)

It Is the ..'unction Tt^ which is localized. '(^ may be written -B-VII-19-

The coefficients CL? are amotion of the separation of the excitations from one another. These coefficients are largest whan the excitations are close together.

Because this is a discrete system, and because the energy values of the basis functions (7.5"") aie ordered, this system may be conveniently studied by considering only the lowest energy states, and using numerical methods to dlago ialize the operator ( 3.0 ). -B-Vri-20-

REFERENCES AMD FOOTNOTES

1. For a review see A, Jeffrey and T. Kakutanl, SIAH Review,

1*, 582 (197°

2. For a review Bee 0. L. Lamb, Jr., Revlavs of Modern Physics, 43, 99 (1971)

3. For the Kdv equation see G, 3. Gardner, J. H. Green, M. D. Kruskal, and R. M. Miura, Phya. Rev. Lettei-s, ^2, 1095 (1967) For the a3 equation see P. J. Caudrey, J. D. Gibbon, J. C. Ellbectt, and R. K. Bullouçh, Phys. Rev. Letters, J50,

237, (1973), and M. J. Ablowitz, D. J. Kaup, A. C. Newell, and H. Segur, Phys Rev. Lettera, 30, 1262 (1973) .

4. In addition to the references listed In footnote (3), see P. D, Lax, Communications on Pure and Applied Mathematics, 21, 467 (1958) and V. E. Zakharov and L. D. Fadeev, translated from Functional Analysis and Its Applications, Vol 5, No 4, p 18 Oct-Dec 19T1.

5. N. J, Zabueky and I . D. Kcuakal, Phys. Rev. Letters, 15. i40, Uyc5i, j. A. Parrln- ana T. H. R. Skyrme, Nuclear PhyeicB, 3J., 550 (1962), and F. A. Hopf, C. K. Rhodes, 3. L. Lamb, Jr . and M. 0. Scully, Phys. Rev., A3, 758, (1971) -B-VII-21-

6. That it Is not only waves has been iroved. See K. H. Roffman, Bulletin of the American Mathematical Society, 76, 70, (1970)

7. A general dlacusalon of this scattering Is given in E. H. Rofrman, "Relatlvlstlo Non Linear Differential Equations, Part I. Analytical Results;" 1969 CGNY Preprint, unpublished, and E. H. Roffman, in Proceedings of the 1969 Boulder Summer School in Theoretical Physics, Qordon and Breach, 1973.

8. See reference (1) for a review.

9. See reference (2) for a review.

10. See references (6) and (7) for the details.

11. See E. H. Roffman, "The Interaction of Localized Solutions of a Complex Hon Linear Klein aordon Equation" (to be publlahed) for more details. See also references (5).

12. See reference (2), and also S. L. McCall and

E. L-. Hahn, Phys. Rev. ±S£, 457, (.969)

13. See reference (2) and alBO A. C. Scott, Nuovo Clmento, 49B, 24l (1970) and B, D. Josephaon, Adv. Phya VA, 419 (1965). -B-VII-22-

14. See N. Tzoar and J. I. Qersten, Fhys Rev. Letters, 28, 1203,(1972).

15. See Reference (2).

16. 3ee Reference (2). See also Perrlng and Ckyrme, Reference (5),

17. See Reference (2).

18. A detailed discussion of approximation methodB will be published elsewhere.

19. A more detailed discussion la «lven In E. H. Roffman, "A Non Relativlstlc Model of Particles as Bound States of a Field*','(to be published). -B-VIÎI-1-

COMPUTER SIMULATION OF A FIRST-ORDER OR A DISCONTINUOUS PHASE TRANSITION IN THE TWO-DIMENSIONAL ONE-SPIN-FLIP ISING MODEL*

by

E. Stoll T. Schneider

IBM Research Laboratory Zurich, Switzerland

ABSTRACT: It is the purpose of this work to shed some light onto the physics of discontinuous phase transitions by means of a computer sim­ ulation. We consider the two-dimensional one-spin-flip Ising model. Calculations are presented of the equation of state and the decay rate of metastable states. The numerical data reveal the existence of long- lived metastable states in this model. Furthermore, we present snapshots of the temporal development of spin configurations during a discontinu­ ous phase transition, indicating how spin clusters form, coalesce and disintegrate, and how the nucleation process takes place.

*Third Colloquium on Advanced Computing Methods in Theoretical Physics, Marseille, France, June 25-29, 1973. To be published in the Proceedings.

June 21, 1973 -B-VIII-2-

I. THE KINETIC ISING MODEL AND THE MONTE CARLO TECHNIQUE

Although first-order or discontinuous phase transitions are «ell known every-day phenomena, like the evaporation cf liquids, the melting of solids, the magnetization reversal in a ferromagnet.etc., the physical nature is not yet well elucidated . The reversible thermodynamics enables one to study such systems in the neighborhood of such trans­ itions. So, we may calculate the free energy of both phases, and we find that the branch point of both energy curves determines the trans­ ition point. The mechanism of these transitions, however, as well as an extrapolation of such energy curves into the metastable region are related with the dynamical properties of the systems. Therefore, it is

not possible to investigate such proper':es with the equilibrium thermo­ dynamics, là this paper, we use numerical methods to obtain some insight into the cause of discontinuous transitions. In doing so, we investigated a simple sysLein, namely, the kinetic two-dimensional square Ising model or 3 the Glauber model by means of the Honte Carlo technique.

The Hamiltonian E of this model depends on two parameters, the exchange parameter J and the external field U,

X = - J E u u - y H I v , p. = t 1. (1)

The system is thought to be in contact with a heat bath which induces random flips of the spins from one state to another. indicates a sum over the nearest-neighbor pairs of sites on the lattice. Tn the original Glauber model, considered here, only one spin is permitted ïc flip at a time. To formulate this model, we introduce the probability P(u. u ) of finding the Ising spins in the configuration (v^, ..... M } and the transition probability K. (u.-> -p.) thst the j-th spin flips from u. to - u.. (Such a system is drawn in Fig. 1.) -B-VIII-?-

o a o • • o • • • • o • • o o • • • o • o o • • • o o • • • o • • o • o o o • o o Heat bath T

Fig. 1. Assembly of Ising spins forming a two-dimensional square lattice in contact with a heat bath of temperature T to flip the spins at random.

The time dependence of P is assumed to be r^verned by the master „. 4-6 equation

d* N

-tP(y;i, .... uN } t) = »(-Y "j) PCt^ -vj, ••• "H ; t)

-Z W(u + -u ) PCUj^, . .;, u , ..., UH 1 t) (2)

TJie first sum corresponds to the total number of ways that the system can flip into the state {u , ..., u ), vherea3 the second sum corres­ ponds to the total number of ways that the system can flip out of the state {y, ..., u } . In equilibrium the left-hand side of Eq.(2) is equal Le "ero. A stronger condition is the principle of detailed balance which »-"ser i that

u WC- Vj+Uj) PQCM^ ••-. - Vy •••. KH) = « C^- ~ j)

(3) W —» Y ••• V- -B-VIII-4-

P„(M0 ,1 » .. -. ON denotes the probability of finding the Ising spins in

the configuration {v.t • ••« VjJi when the system is in equilibrium.; . Observing that

B 1 Vl V -""*. 8--k„T " (4) a we used the following expression for W(u,->- -p.) which suffices Eqs,(3) 7 8 J J and (4)'"0 j - exp (2BM.E,), if 2f3u.E. < 0 W(u.--u.) -JTs , JJ J J (5) otherwise

where the local field E. is defined by

J B £ 1J 1 W 1 .

TS = - is the flipping time of a free spin a^ is chosen arbitrarily.

The method of simulation is as follows: one starts with the input data, such as nearest-neighbor interaction J, external field H, temperature I. number of spins H and an initial Ising spin configuration (see FÏg.2). "' Then one chooses a spin by a random number and calculates the transition probability for flionine. If « /, . i «.„ • • ' ri • *• ' '' ••- uppmg. ir wya ~ l, the spin is flipped. The process is continued by choosing the next spin again by random number. If W /- < 1 the j th spin is flipped only if W./c, equals dr,«ce«d. a random number

between 0an d 1. However, ifWj /a is smaller than this random number, the spin ls not flipped. Again che prooess ig ^^ fay choosing ^^ spin by random number. In this manner a sequence of H spin configurations

is generated. For further aPPl1Cations one saves every N th configuration generated by these Monte Carlo sLeps.where N is the number of spins. The whole procedure is then repeated M times. From the definition of the

transition probability W(Uj* -„., i„Eq . (s), Ule seqU(mce o£ "^ con_

figurations corresponds to a time lapse i, units oft \ On this basis, we «ay thru define time-dependent averages such as f„ o,-der parameter ' "(t) " s J.^0 - ï ^V V • '<7> -B-VIII-5-

(startj

input dala J,H,T,N,M X Initial configuration r

Fig. 2. Flowchart of tha Honte Carlo process. -B-vrn-6-

When the system fluctuates in a limited ran'.e only, around a temporary equilibrium betveen the times t and t . we can define a time average n m ^ of the type

i r m (t) dt (8) m n t n which corresponds to the canonical ensemble average of the order para­ meter in an infinite system.

In a finite system such canonical ensemble averages vanish for zero external fields. The system may undergo, at some time T .a "discontinuous transition". But for ystems which are not too small and temperatures which are not too near T , the time T exceeds any reasonable computing time. In our simulation runs we used time intervals of 10 T or Honte s Carlo steps per spin to decide if a system was in equilibrium or not. In the range of 10 T we could well reproduce the solution of the spontan- 9 10 eous magnetization or order parameter of Yang ' . As it is plotted in Fig. 3(a), we could extrapolate the curves of the calculated equation 9 of state into the region of metastable states . For larger negative fields, the "umklapp" times T becomeshorter and we get in Fig. 3(b) a well-determined curve for the reciprocal times. This curve can be 11 -13 proven from the predictions derived from the nucleation theory

log TR - 1 /'|'AH| • (9)

The extremely long "umklapp" "times"*' for small negative fields - AH R does not allow for a more precise investigation of the t (AH) in this region.

To elucidate those processes, we used the graphical display unit 2250 as a window into the computer. We observed a system of 220 K 220 spins with periodic boundary conditions -B-VIII-

(OJ

-0.02 -0.01 0 0.01 0.02

1A„ 0"a(MCS/spinf4 (b) - N.« PRH -0.02 I-0.04 0 T*T H (Film)

Fig. 3(a) Computed equation of state for a 220 x 220 square Ising ; lattice with nearest-neighbor interactions subjected to periodic boundary conditions, at T/T = 0.958. c (b; Computed decay rate of the metastable states for the system defined above. -B-Vlll-8-

In the first state of this computer run, as noted in Fig 4, we started with a system where all spins pointed upwards.

Fig.4 Schematic- sketch of the order-parameter development during the movie. The magnetisation is plotted as a function of applied field and as a function of tem­ perature, respectively. The order parameter equals one. In the absence of an external field, the heat bath;is switched on at a temperature near the Curie temperature of T/T = 0.958. ; -B-VIII-9-

Due to the transition probabilities W(u.-* -u.), the system evolves towards an equilibrium with v = 0.814. If we were willing to wait an infinitely long time» a first-order or discontinuous phase trans­ formation would occur. To accelerate this process, we switched on

a negative field of (y_H/k T)= - 0.015 with x0 in the region of 450 T . il B K s So we were able to observe the whole process in a relatively short computing time.

DESCRIPTION OF THE MOTION PICTURE 13

"A picture says more than a thousand words"

In the spirit of this Chinese proverb, we prepared a motion picture demonstrating the temporal development of spin configurations during a discontinuous phase transition in the two-dimensional kinetic Ising model. The film shows in detail how spin clusters form, coalesce and disintegrate, and how the nucleation process takes place.

Observation of this film demonstrates the following feature : 1. We start from the initial configuration u(t = 0) = +1, at zero external field (Fig. 5). Due to the interaction with the heat bath with temperature T/T •= 0.958, the 220 x 220 square Ising system, subjected to periodic boundary conditions , relaxes very fast towards thermal equilibrium with mean magnetization ji = 0.8U, 2. In.this equilibrium state, small clusters of down-spins are distributed over the background of up-spins. ihey reach a relatively small size, decay and appear again at a dilierent location, viUtouL- "P;.a pronounced'tendency for further growth (Fig. 6), Consequently, '..;•"•• large clusters ofthe other phase have a rather small chance cf occurring (Fig. 7), -B-vin-io-

M t

•**W ""3-^ ^ — i 1 h* "RE? -J? n _33ï J 3

-f—n*-r-fn| r^W-f-rti f— -a- c 1 4

Fig. 5. Initial configuration P(IFO) = +1 at H = 0. -B-VIIl-11-

M M t

*n«i7ii XiiBi.r~ai-d ^Jt^^Mtf^^*l^ i ililiÉI. ill i>i*> +4

. 3^i§fe^ stf^-kg** EOHii

XWÏ)P*>** 1 c T , » hiiwiuir -ws.- ^-fT-rtM t i'1rsaJj 3=ftTca JÏÏ K»*^~VË*"> >^r—tl**nV %p:W* l JÏJ13 *=*•#— S«f •rat?»-*»- jTV-»FJîr(M*«i*H** J3i5«H SU *~3îïSj: 1 no a_d IB-PM ai &XKS A -ir jtsEtfWfcjTt-Ti-firsa rs^ ^T3

t— . . .— .... fe_- ^ ~* Tic —zirzL-x _ . . 3Tl jq , _*fr* tea*—^-JJH-I—«—«HP»fc-i-~ï- _*rtn-ffMTH«i'wi /2T-1..M f=^Et3LT i T—t ai J-ratast-nja ~if x s^fiaA-a.!"^!-- ._ _ . j^» _ __

l Esnt firmes*-or. _ . soufra" s t"wmiiimiM"fcai''u'irp'-w-Eeiit'irf». f u» ••?•"—trr~iiii »fnn_tii miL

6. Ê^anshot of an equilibrium -sp n configuration at 1 - 0 and T/T = 0.958; small spin- iovn clusters are vi- ule -B-viII-12-

M V t H

ftyf •» « * — -aj-»

«• i. ,ii TJ

I* -» J*»!" I 51,0 pur i_ -noam

EB-h^-BLZL !... .. J

Fig. 7. Snapshot of an equilibrium configuration in which, by chance, a relatively large spin-down cluster occurs. -3-VIII-13-

Now we switch-on an external field of strength r-- = - 0.015 antiparallel to the orientation of the predominant spin-up distribution. In the presence of this field, the system is meta­ stasis. However, in the chosen applied field a re cher shorr. life­ time of this metastable state (see Fig. 3) is expected. Ihe processes associated with this decay should shed some light onto the essential phenomena connected with a discontinuous transition. After some delay, clusters of the new phase show a pronounced tendency to grow, due to the applied field (Fi;. S). This growth brings with it a reduction of the total surface of che clusters and hcr.ee a lowering of the total, energy carrying the system over the free-energy barrier. Later on, the tendency for further growth becomes more pronounced in the sense that certain clusters are able to reach a critical size which seems to prevent them from dissociation. At this stage one also finds amalgamation of clusters (Fig. 9), leading to a strongly interacting cluster gas. The clusters which reach this critical size represent the embryos of the new phase * Such embryos, which grow due to the reversal of spins of the other phase at the border and by linking with surrounding small clusters, are often denoted as the "nuclei" of the new phaBe (Fig. 10).

In the next stage, the nuclei continue to grow and associate so that a "macroscopic" cluster is formed, which in turn indicates that nucleation of the new phase has taken place (Fig. 11). However, within this "macroscopic" cluster, small clusters o£ the old phase appear and disappear, indicating that local equilibrium has already- been reached within this "macroscopic" cluster. The remaining,-temporal development' is mainly characterized by further growth of the "macroscopic" cluster and the origination and dis­ integration of small clusters of the initial phase within the "macroscopic" cluster (Fig. 12). -B-VIII-14-

M [> t H

ie

Fig. 8. Snapshot of a nonequilibrium spin configuration in the presence of an applied field u H/k T » - 0.01S, -which guarantees a reasonably short lifetime of the metastable state. As a consequence, the spin-down clusters exhibit a tendency to grow after some delay, In fact, the spin-down clusters are distinctly larger than in zero""£ield (Fig.*" 7), -B-VIII-15-

y t H

i : "VTi"n»-rrqi--- - Pft .-««Sana*, 7 iw^L^^Hâiœ^ïâsl JhS!!g|Jte3

ll•KiHiKEii5!jç»»Hl*^c.ï*^^•»^^1r*^JPlÈ^*xy•^' -JF-areas-, -,Tîa5i-P»iîJ Pi )'Blr*.5iftJ^r jg^ ; . — —Egg^a no

,"-'^-n".^j.iiyiarii^a'.'i:s>~ie

Fig. 9* Snapshot of a nonequilibriura s;>in configuration in which the amalgamation.of two clust'rs has just occurred. -8-VIII-lf-

M M t H

iGV *••

^TV­ 'S a-sri? jwauisajt r ins. , J „ •^1TW*FM-J"L..™ "ft5l'fr'"Ku--c* J 1 400 if" r +

w* ffl J 1- t£*rifi- K «wT-hiïiiwreEi 1-^*3 i JHj*'*~-k '^-WKHiArt Irt L wins, JWJ •fMSPIgLr

*Stf «#»* ^ ^

Fig. 10. Snapshot of a nonequilibrium spin configuration in which several embryos of the new phase are clearly visible. •8-VIII-17-

M 1"H

«Bffl

W WSSa.

Î6F

•W^Ftf 50Ô * ~5 _ 4L i&uJI.uJi5Eit«Mjr flB3-*,"3ÉHE&3 "ftc "s^jgjgatr -£zL M

T~T rsn*i i„ -""•sa. WEB SLrin it ar JS»I

riw"taH» ET iP.'4i.--j tj

Fig. ^11. Snapshot of a nanequilibrium spin configuration where embryos link together forming a "macroscopic" cluster o£ .the new spin-down phase. Within this "macroscopic"

: cluster,, small clusters of the old phase are seen. -B-VIII-18-

•*.*•'%

•**' ;. .v.

(,00 •;*:*fr

v . .^r Y *, . . 4» . Jr. ftai^*. - ^ *<«£»•

• , -mi" vu.-* •.- «. . . •* . *-„.» "' - ./ / -*

Fig. 12. The "macroscopic" cluster covers the «hole-system and the i*ld phase appears in terms of small dart clusters. -B-VIII-19-

••* •*':" ,''•••! " it"

'•'•.-T1-. ;i^ • % . * -i •" • • 1000 *•'.'•. "- • •. ••- *'*.. '*rjiiï 1 .•. *;ï-' " .'."*• " * -"f . i .• i • '• ..>•" • & h. .-.t '. - 1i ..- ' . :"fP' v *' . • •;•_ v v^.K-. >' :*"-'. * " • *. • - r '' '" -JdT' \. • - '*•.'-•. :'." .* •: .V. ' • •. :Ms "•^£-_ * * i . "*. • ,*V.\- " !*. iW w#y- r- -*•. "!""-•* W- -J *•".* - ••>-'• •. ? *.*''-v .«.'--•r " •

Fig., jl'3. Snapshot of an Equilibrium spin configuration of the new spin-down phase at u„H/k_T - - 0,015. -B-VIII-20-

8. Finally, the "macroscopic" cluster covers the whole Byatem, with inclusions of Bmall clusters of the old phase which appear and disappear. This stage represents the new equilibrium phase. In fact, the pattern consists of small clusters of up-spihs distributed over the background of down-spins (Fig. 13).

Finally, let us point out that we computed this motion picture for two reasons. Firstly, we thought it worthwhile to demonstrate the evolution cf an equilibrium state and of a discontinuous phase transition in a simple system. We feel that the film gives a good pictorial illustration of these processes. Secondly, however, we hope that the film will stimulate theoretical work in this area.

We acknowledge stimulating discussions with G. Benedek, K. Binder, P. Heller, P. Meier, K.A. Huiler, H. Huller-Krumbhaar, St, Sarbach and H. Thomas. -B-VIII-21-

REFEKENCES

Griffiths R.B., Weng C.Y. and Langer J.S., Phya. Rev. 149, 301 (1966)

danger J.S., Ann. Phys. (N.Y) 45, 258 (1969) 3 Penrose 0. and Lebovitz J.L., J. Stat. Phys. _3> 211 (1971)

^Glauber R.J., J. Math.Phys. 4, 294 (1963)

Kawasaki K., in Phase Transitions and Critical Phenomena, edited by C. Domb and M.S. Green (Academic, New York, 1972) 2, p.443 6 Su2uki M. and Kubo S.H., J, Phys. Soc. Japan 24_, 51 (1968)

Fosdick L.D., Methods in Computational Physics, edited by B. Alder (Academic, New York, 1963), Vol.1, p.245 a Metropolis N., Rosenbluth A.W., Rosenbluth M.N., Teller A.H. and Teller E,, J. Chem. Phys, 21, 1087 (1953)

Stoll E. and Schneider T., Phys. Rev. A6, 429 (1972)

10 Yang C.N.,. Phys. Rev. 85, 808 (1952)

Feder J., Russel K.C., Lothe J. and Pound G.M., Adv. :.i Physics 15, 117 (1966)

Binder K. and Stoll E., Phys. Rev. Letters, _3l, 47 (1973) For a more detailed discussion of the motion picture and the state -"of"ar't'-'in ;tbefield of first-order transitions, we refer to:

; fi" Sïhneide'r àhd É. Stbll, Proceedings of the Mato Advanced Study Institute on "Anharmonic Lattices, Structural Transitions and Melting",(Noordho££, Leiden, 1973, to be published). -B-IX-1- HONTE CARLO CALCULATION WITH SELFCONSISTENT FIELD BOUNDARY CONDITION: A METHOD FOR THE DETERMINATION OF CRITICAL EXPONENTS

by H. MUller-Krumbhaar K. Binder

Physikdepartment E 3.4 der Technischen Universitât MUnchen D-8046 Garching, West Germany

ABSTRACT: The mean field and Bethe approximations to magnetic phase transitions are generalized systematically by treating a large cluster of spins, where an ef'active field acts on the surface of the cluster.

The magnitude of t .is field is determined in an iterative process by the consistency condition, that the gradient of the order parameter

at the s-:Lt^c^ be zero. The stai. stical mechanics of the central cluster is treated by Monte Carlo techniques. While standard Fonte

Carlo methods are exact with respect to finite systems (apart from statistical errors)» the present method approximates an infinite system very well. It is shown, that critical e^qjonsnts B,Y,S,v, etc.

can be determined with good accuracy. The methed is easily generali­

zed to "semiinfinite systems" (with a free surface). The limitation

of accuracy, very close to the critical point,is discussed with regard

to the dynamics of stochastic processes.

Present addrers: IBM Research Laboratory, Zurich, Switzerland -B-IX-2-

1. INTRODUCTION

Considerable attention ia paid to the properties of various syntens 1-3 •

near their critical points . The analytic techniques of statistical

mechanics provide exact solutions for a few very idealized model sys­

tems only; these models exhibiting second order phase transitions are

the twodimensional Ising models in zero field ' , the spherical model , 7 6

certain ferroelectric models and the 8-vartex model in two dimensions ,

No such exact solutions exist for more realistic model systems, and

a^roximate or numerical techniques have to be used. Ti most simple approximation which is rather straight forward also to

be applied in cases where the model Hamiltonian is rather complicated, 9 10 is the mean field approximation ' ; ir is known however, to yield 1-3 poor results for the critical properties . Thus most information on critical properties is based on nutiarical expansion techniques as • 11 .12 high and low temperature series expansions , and "Wilson" expansions , Since the latter technique is based both on the validity of the scal^ 1-3 ing and universality hypothesis , it yields information on the crit­ ical exponents only, while one is. also interested in critical temper­ atures and critical amplitudes, s:aling functions etc. of the model systems under considerstion. In principle one may get this information -B-IX-3-

uiing the high and low temperature aeries expansions, these expansions are cotnplicatod and inpractical if the mc 'el Hamiltonian contains many parameters. T .nfcermore, in a few cases, no low temperature expansions exist, which can be extrapolated to th critical temperature T (e.u., c in the case of the classical Heii.enbe.£ model).

One expects, that these disadvantages could be avoided, if one could improve the above mentioned mean '*.eld approximation Kubstaut j

The first attenpt to do this is îe BPW-approx'.mation : One treats the interaction in a small cl'- er of spins exactly and replaces the effect of the interactions beuween the cluster and the rest of the crystal by an effective field. The cluster consists uf one ca.-.cral spin and its nearest neighbors. The magnitude -of the effective fifld is determined by the con stency condition that the order parameter of

the central position an its neighbors are equal. Although the result­

ing description, tif the magnetic phase transition is improved consider­

ably in comparison v Lh the simple mean field approximation, it io

still 'unsatisfactory in comparison with the series expansion and with

experiments.

It s the mam lea of the "selfconsisLem." Monte Carlo method (SMC)

that one may generalize thic approxication sysLeniaticaliy by treating

large clusters, whose properties can be calculated by recent computa­

tional techniques as the Monte Carlo method" , mis approach is con- \ -B-IX-4-

1-3 «istent with the observation , that near the critical point •...actu­ ations become longranged. Only if these longranged fluctuations are properly taken ir.tc account, a correct description of critical phenomena can be expected. One may argue, that this feature is alec achieved using the Monte Carlo method in its conventional form with periodic boundary conditions. We «how however that the selfconsistent field boundary condition provides a quicker convergence ta the thermo- dyn^iic limit H •* » (H is the number of spina of the cluster Further­ more rhe order parameter in vslldefined while in the conventional meth­ od with r-riodic boundary conditions (PMC) it may be difficult to de­ fine a local order parameter,, because of the rotational invariance of the Hamiltonian (Heisenberg model).

In the following sections we describe the properties of the "selfcon-

sistent" Monte Carlo method; since most of the results have been pre­

sented in previous publications , we summarize the main points

only.-We restrict the discussion to the classical Heisenberg ferro-

magnet but consider thu possibilities of generalizations briefly in

section 5.

In section 2, we discuss the Hamiltonian and general properties of a

system with a selfconsistent field boundary condition.

In section 3, we discuss the Monto Carlo process and the iteration -B-IX-5-

procedure. Intending an application to critical phenomena, the acci~

racy of the method n.aar T is investigated. Tliis is done in sec- c tion A^with respect to the dynamics of stochastic -^>dels.

In section 5, we compare some results on the Heisenberg mode tc

corresponding calculations with periodic boundary conditions and we

outline the main advanfages and disadvantages of our neu computation

procedure.

Finally, section 6, contains a hrief summary of results so far ob­

tained from applications of this technique to different problems.

2. FINITE SYSTEMS WITH SELFCONSISTEHT FIELD BOUNDARY CONDITION'

Consider a classical Heisenberg magnet in an external raû^netic field H

Then thn "amiitonian of <_ system with an infinite number of magnetic

mompntj gu„S."S (S. being a unit vector in the direction of the Ji 1 l spin) is--written- as

' .2 - - . V- J. . s. S. - gp„S"- H I S. . (I! . ', ii i i B ': i ifj i

: : > .-> :TôJapprpxii^t'é' ui.s^>'Sysceii \iie consider a finite sul-sysLuj. vi-rii v.

./-spins-. The exchange interactions of the surface of tliis suiisystcci -B-IX-6-

vith the surrounding pari of the system are replaced by an effective

field H ,, acting "r"-. the surface sspin s of the subsystem only. (This eferf procedure is illustrated in Fig, 1.

,.SELrCONSISTENT"SURFACE-CONDITION EFFECTIVE FlELD:|*=0 /(. f\ î f f \ \\ i i

J—a» i \ ^ f / f f t

fît f/"tf? 1

(a) (b) (c)

Fig. 1: Spin configurations in a subsystem of N spins of an in­ finite Heisenberg magnet (a), in a system of N spins with periodic boundary conditions (b), in a system of H spins with selfconsistent field boundary conditions (ç), -B-IX-7-

ïhen the Hamiltonian is written as

SHC I J.. S. t. - T J,J.i-!j]„ * -- I J,, t îs- I J,t îs "2 s. s. 1J l J 1J x i|j£V i|j«0 J ijij « 1 3 i i«0 (2)

2 Z - guB S • H J S,. - E»B S • H X°S. . l"X i-l,J«0

Hers the bulk of the system is denoted by V, its surface by 0. It

is assumed, that N spins are situated at the surface. Spins at edges

snd corners have to be counted twice or threefold, respectively, in a

sc-lattice.

Vf.L*i «Vrl*! » H,-*,""o • (3)

v i«V o 1*0

the consistency condition which determines H is given by

Z < SQ > = < S^ > for all H,T. (4)

Because of Eq. (4) thé effective field in the Hamiltonian Eq. (2) de- peridSjimplicitly both oh H and T. It is seen that this leads to singularities at some temperature T . For instance, the suscepti- c bility ; X„ 3 < SZ > (5) -B-IX-8-

ii derived from the definition of the cenouic expectation value

Tr {exp (- *SMC /k tt • A }

< A > == § , {6> Tr {exp (- K51"- /kT) } B using Eq.(A) in the form

< -à( < s„2 > - < siz »> + » • rr11 " »• <7> eff

This yields faîy (8V)2 Z 2 »^ (s *T " \-iTr- * < 0 > ' Ti FI ~ B z 2 z z <(Sl ) > - (8) 2 2 Z 2 For a finite system, all correlations < (S ) > ,< (S. ) > and

Z Z l•s < S S > are everywhere finite. A divergence of x brought about o 1 by a zero of the denominator in Eq. (8).

. 13 As a simple example we mention the BPW-approximation , where the bulk

of the system is a single spin, and the surface contains its q nearest

neighbors. Then the Hamilton!an simplifies to

JPW z z x .-a Ï U - gp, s H I s - guB s •- H Ï s. (9) i=j i=l i»l itv '...;;; . i«o j«0 •B-IX-9'

but Eq. (8) remains valid. It is then easy to cast Eq. (8) in an ex­ plicit form which is found for H •+ 0 to be

2 W2 (£ )

3k„T , ,,,2J , ^ , .. .2.2J , (10) q (irT5 (q_1) (k~T) B B where i(x) denotes the Langevin function

i(x) - coth (x) - 1/x . (li)

It is seen that Eq. (10) implies a divergence

+ 1 + Xj - X 'T/Tc - l)" , I * Tc (12)

BPW at a critical temperature T = T , which is given by

• B c -

Since Eq. (12), results from Eq.(8) for arbitrary N the objection

arises t how one can use this method to derive nontrivial exponent

estimates if it always yields this trivial mean field result in the

close neighborhood of T . The answer will be (section 5) that the c region of temperatures around T , where Eq. (12) actually shows up,

becomes very small if N is large enough. Outside this mean~field

region on' then finds undefined "effective critical exponents"

which do have fie desired nontri-vial values. This observation is ctn- -B-IX-10-

•istent with the requirement that in the thermodynamic limit N •* »,

vhere the boundary condition is irrelevant, the mean field behavior

must be absent*

3. MOHTE CARLO PROCESS FOR A "SELFCONSISTENT" SYSTEM

For N > 1 one has to resort to computational techniques to derive v

explicit results from the model Hamiltonian Eq. (2). It is well estab­

lished that the statistical mechanics of a finite system can be studied 14 17 conveniently using the Honte Carlo method ' , In our case we have

the complication that the consistency condition Eq, (4) must also be

satisfied. We achieve this requirement in the following way :

The Honte Carlo process is started from some given initial configu­

ration of spins using an arbitrary starting value for the effective

field. New configurations are generated according to some specified

transition probability W. This transition probability is quite ar-

bitrary apart from the requirement, that it should fulfill a detailed

balance condition in relation to the canonic equilibrium distribution.

Denoting a point in the phase space by x, thin equation ^s

H(x * x" ) • exp { - *(x)/k„T } - W(jt'+,x) • exp {r.*.(•»••.)/kjr}-. (14)

B "' '" .'•'•.•. --'-yt;:v; IS' -" :-••

.;- • • •- ::._14 . . and a simple choice which satisfies F,q. (14Ï is found to bev ; -B-IX-11-

V'i - x') - exp 0 - 3t(x' -J if ?.(x' [*<> k T B (15) . 1 otherwis

Generating M phase space points x with a Markov process using 14 17 Eq. (15) it is shown * that the expectation value of some quan­ tity A (Eq. (6) ) is approximated by A : 1 M 'Â - - I A (I ) . (16) vl

7 1 We use Eq. (16) to derive estimates for '• and • .-. > . If a Z Z "meaningful difference" between S and S is obtained we use this difference to adjust the effective field in order to satisfy

Eq. (4), and repeat this part of the calculation once more. By "mean­

ingful difference" we denote a difference , whose statistical signi­

ficance S exceeds S = 1, where

I T^ - i Jû s v + c« s,y'

2 2 z 2 by (<5S ) and ($5 )*" we denote *_he estimates for the statistical o 1 2 Z 17 errors of S and S, respectively . If the effective field at o 1

f this- i th step of iteration was given by H ff(i)> the effective

field for the next step of iteration is givi---- by -B-IX-12-

ITERATCN;

Heff is reduced:

01 \t

Hetf is reduced:

{H f = =0 4H =4 * 0 1 i

Fig. 2a): Distribution of the local order parameter... across a film of thickness L during the course ,pf the iteration procedure (schematic) in the paramagnetic region. The mag­

nitude of the effective 'eld H f,d) a' the i'th iter­ ation is indicated bv thi oroken »'-'-ow._ (See also.Fig. 2b). -B-IX-13-

b.) T

J—»-l

> h'etf is reduced:

. A<**B> • 1*1, • •

Heff'i+11 y//////////A IT 01. .:. :./„- ==

Fig, 2b): Iterative adjustment of the effective field in the - ferromagnetic temperature region. Ihe hatched region indicates the "bulk" (v^ of the model system. The cross (at) denotes the value of the sur(ace_ layer.jiagnetiiat.ion_. '. , the dashed dotted 1inè"represents the bulk magnetization . -B-IX-14-

Z Z s -^ S - S ».«(i+1> " Heff<*> •{ i+ "if Tz^ » • <16>

o

If S - S™10 < o, hovever, we keep H (i) but replace the number

of configurations M(i) by M(i) - 2 H(i). This iteration is repea­

ted until the relative difference between the estimates is small

eno agh, i.e.» |l " S^/s/i i 0.01 (19)

which is usually achieved after about six steps of iteration .

4. ACCURACY AND CONVERGENCE PROPERTIES

In order to have good convergence it is important that the estimates Z 2 Z 2 for the statistical errors (SS ) and (6S, ) have reasonable o 1 accuracy. These estimates are obtained from the Mrrkov sampling pro­

cedure using the standard methods of statistical cata analysis .

while one wants to work, with a rather small number of configurations

M in order to save computing time, M must be lr.rge enough so that 7 7 2 2

(SS ) and (5S ) are accurate enough. The necessary M can be

estimated "a priori" if one us s the dynamic interpretation of the

Markov process. . Relating the scale of configuration, numbers v__to

a scale of time t, the probability F that the system is in the -B-IX-15-

EXTRAPOLATION OF MAGNETIZATIOM

Q8-- +

0.5--

3 .«"ÇféLo-**M _^S*2-z£^--~'^

I

Fig. 3: Surface magnetization < S. >(•) and bulk magnetization < Sz > (+) plotted versus 1/^7 at J/kJT • 0.36 for N = 64. -B-IX-16- itate x • (x,t) is determined by a master equation

4-P(î,t) - - fdx" { W(K+5t') ?(t,t)-Vix<-^)V(P,t)) . (20) at

In the case of the Heisenberg model where the transitions consist of single spin rotations (classical model) Eq.(20) reduces to

^p»! vtJ " - jj àC'i waW Hai 'h V^ (21)

+ I U aL \naL * a/i nult ni n„,t ) i»l J where the n, denote the polar angles of the unit vector S.. From 17 2 Eq.(20) one derives the estimate < SA > for the error of an average A,

<6A2> =/nN*AA<1+ 2' WT> (22) where n is the number of Monte Carlo steps per particle (N - M/K) and X.. is the static fluctuation of A! AA

*AA-0< -2> • (23>

B

The time is measured in units of an arbitrary scale t (T • 1 cor­

responds to one Monte Carlo step/spin). The relaxation time T,,,, of

the variable A is defined by

T«A6A 2 '— V J dt ( - 2) . (24) - -J -B-IX-17-

Eq. (22) ia only valid if

ToA«A 'T " n » (25)

this is also precisely the condition that a meaningful error estimate

may be obtained from the Markov chain. Eq. (25) provides an a priori

estimate for the necessary M, since t . mav be estimated from the oAoA theory of the dynamics of stochastic models , defined in terms of a master equation.

For several observables A, x». "ill be found to diverge near the critical point

y *AA"*M • U-T/T Ï < (26)

and also the associated relaxation cime will diverge

'«ASA - ''SAM. ' I1""!.! " , (27)

. 19 with

A,. > v

AA - AA • (28)

Near Tc .it is implied by Eqs. (22), (26), (27) tnat

2 CY + <6A > * |l- f/Tc|~ AA V _ ^

Eq. (29) implies a "critical slowing do-jn of convergence". Because of this effect practical calculations are restricted to temperatures ',.'_•' .•....-.(.u.Jj:;_|UL*J.jAillJliNlll, lilllUllJiiJIlJIJIIIlJ,!

-B-IX-16-

atate x - (x,t) il dsnerminad by a aastar equation

~ P(ï,t) - - /dï' { «(JMÎ') PCÎ.D-WCx'^PCx'.t)} , (20)

In the case of the Eeisenberg model, where the transitions consist of

single spin rotations (classical model) Eq.(2Q) reduces to

fe*<«! *%.*) "-.If AD[ «t'VV *®i ni V0 +

(21) + I [d n, wt'n. + n.) Pfli, n f^.t ) i-i j , -*- where the fi. denote the polar angles of the unit vector 3.. From i " i 17 2 Eq.(20) one derives the estimate < ÔA > for the error of an average A,

= uiXAA(1 + 2' W*> <22>

where n is the number of Monte Carlo steps per particle (N » M/N)

and x.. is the static fluctuation of A: AA

*AA-rr< -*A>2> • <23>

B

The time is measured in units of an arbitrary scale T (T • 1 cor­

responds to one Monte Carlo step/spin)a The relaxation time T.._. of oAtSA the variable A is definzd bv no TSA5A"~2 V2 - \ <*t C - 2) . (24) - J

»« ^^^m^mwwm * - -B-lX-17-

?.q. (22) is only valid if

rmk / T »» » , (25) this is also precisely the condition that a meaningful err r estimate may be obtained from the Markov chain. Eq. (25) provides an priori estimate for the necessary M, since T. nay be estimated from the theory of the dynamics of stochastic Œodels , defined in terns of a master equation.

For several observables A, x»* will be found to diverge near the critic?! point

and also the associated relaxation tine will diverge

with19

V-YAA * ' (28>

Hear: Tc_ it-is iaplied by Eqs. (22), (26), (27) that

2 M M ••» |l- T/T.I . (29)

Eq.(29) implie- a "critical slowing down of convergence". Because of this effect practical calculations are restricted to temperatures -B-IX-18-

|l- T/T | > 0.01 . (29) c ^

Therefore the sharp critical point implied by our method (Eqs,(8),

(12) ) cannot be reached in practice.

It is useful to remember which way our iteration scheme leads to Z Z . = « 0 in the paramagnetic region. This is illustrated in o 1 Fig. 2), choosing as a hypothetical example a film of thickness L which is infinite in the other dimensions. The magnetization induced

by the effective field H f is always a function which decreases Z Z with distance 1 and therefore = cannot be fulfilled with 1 o nonzero magnetization (if L is much larger than the correlation length Ç it is possible to estimate by • Ç/L as ex- o 1 plained in the figure).

Z

In tha ferromagnetic region the local order parameter will have, about its bulk value , the spontaneous magnetization, in the

central part of the film. If H f, is large, will exceed , Z while for small values of H „. the surface magnetization is ef f 1 ZO always smaller than the bulk magnetization , Here the iteration con­ verges to .

As an example we show in Fig. 3) the convergence of; bulk and surface

magnetization as a function of l/t? for a very small system (N = 64). •B-IX-19-

Dua to tha imall numbar of bulk spins (N -8,') a large number of

iterations is necessary.

5. DETERMINATION OF CRITICAL EXPONENTS

Asymptotically for T + T our method yields the (wrong) mean field c exponents, yet outside a very small temperature region around T the c correct nontrivial exponents are found. This fact is illustrated in 2 Fig. 4) with respect to the order parameter. We plot versus l-T/'T on a double logarithmic scale where exponents shew up as the

slope of straight lines. Three values of N are shown. As indicated

in the figure, the convergence of the critical temperature T (H) to c its limit T (») (as determined from high temperaf-jre series ex- ' ' - '.'; • 21 22 pansions ' ) is very rapid. It is seen that the exponent B has ;i value close to 1/3 for T not to close to T , while closer to T a , ,,.-.. c c changeover to the mean field behavior with B " 1/2 occurs. The rela­ tive temperature ÀT/T where the slope changes to the mean field • c value decreases vith increasing linear dimension of the system, as ex­

pected from the general arguments presented in suction 2.

We now have to compare these results with the more simple calculations,

where tha Honte Carlo method with periodic boundary conditions is -B-IX-ZO-

1.0

Rtlatlvt timptralurt AT/TC, wher» slops chorçpi to mecn fltld- bihavlour, dtcreans with Increasing lin«f dimension of the sysletn,

as-

N = J/kBTc » j>* 64 0.342 Monte Carlo S 3 =» 512 0.3W flKO.33tO.02 It] =?4096 0.345 1.0 HT-Scries =s 0.3458 0.7

aos- hrff •0.5

-0.3

0,02- 02 1.0

Fig. 4: Log-log plot of the square of the order parameter versus the relative temperature difference for three values of system size N. The effective field h gu„SH /.Ï is also eff Ù err

shown (note that h£ff ^0,7 ). For this plot different val­ ues of J/k_T CK) nave been used as indicated.

23 24 used. * . First we note that in this case no singularities occur; th<= critical anomalies are rounded off. This effect is more drastic than the change-over to mean field behavior which occurs in our method.

Another problem is the definition of an order parametei. In the theroo- -B-ZX-21-

dynamic limit it is defined by

1 N Z lim lim < — I S. > » < n > ' > o for T < T , (31) H-i-oK-*."!»!1 c while

1 N Z lin + * » Z S. > = o for all T,N, (32) H -f o " i«l

This difficulty is usually circumvented by taking the root mean square ...... 23,24 magnetization ' i w

1=1 which also has the property

but in practice this convergence is by far slower than the convergence

of the SMC method ' ' . Eq. (32) is a consequence of the fact, that

all1directions are equivalent. This difficulty is absent in the SMC

method since the direction of the effective field also determines the « . direction of the spontaneous magnetization. This fact is rather impor­

tant since in the SMC method the local order parameter in zero field

is accessible to the calculation and therefore spin pair cor­

relations in longitudinal and transverse direction relative to the

iiagnetization, can be defined properly (this will be explained in more - . 29 detail elsewhere ). •B-IX-22-

So far wa have restricted most of our discussion to tha Beiaenbarg model. A generalization about other cases, e.g., the Ising model, is fairly straightforward. It should be noted that Eq. (32) applies to the Ising case as well, but here rather welldefined "metaatable" states exist: starting the Monte Carlo averaging with a state of magnetization reversal before a time which is very large compared with Z the usually available computing time. In this case averages may 23 26 27 be calculated directly, even using periodic boundary conditions ' * .

Summarizing the advantages of the SMC method it can be Bald that it yields a quicker convergence to the thermodynamic limit than other types of Monte Carlo calculations, it allows for a study of local quantities as well,and a distinction between longitudinal and trans­ verse quantities is straightforward. A treatment of more complicated

systems with several parameters in the Hamiltoniau is possible.

The disadvantages are: the iteration procedure is more complicated

and also somewhat more time-consuming. This leads to a slight reduction

of the "net advantage" of fast convergence to the thermodynamic

limit . The SMC method can be applied only if the nature of the

order parameter is known before any calculation (e.g.,, ferro-, anti-

ferromagnetic), ; -B-IX-23-

6. SURVEY OF APPLICATIONS

So far applications exist only for simple cubic classical Heisenberg

ferroraagnetgnetes both i n aero and nonzero field, with nearest 15,16,25,29 28 and next-nearest neighbor interaction.

As an example we show the determination of critical exponents y and

5 in Pig. 5, Here the susceptibility X- above I is given in

a log-log plot as a function of 1-T It and the magnetization at T

is given as a function of gu SH/J.

X'.Y = 13640.03

002 - 005 0.1 02 0.5 0.05 01 0.5 1.0

(a) (b)

Fig. .'i: Log-Log plot of the suszeptibility xT Cb) {'and thé critical isotherm (a), according to Kef. 16. "B-IX-24-

It is seen that

X = |E"Î ' G-" (1- T,/!)"1,36 , o = 0.61(gv S.H/J)V5-3 (35) T B c B

i.e., Y ^ 1.36, 6 £ 5.3. Obviously, xT is in reasonable agreement 22 with high temperature series expansions . No such expansions are

available for the critical isotherm or the phase boundary (Fig. 4) of

a sc-lattice. Apart from these exponents end amplitudes the scaling

function was also calculated , and it was shown that the suscenti- 29 hility below Ic behaves like

*L B If * •,-* • c»>

as expected from 3pin wave theory. Also the correlation length K

and the associative exponent v have been determined 30 , as well as 29 v' below Tc , where the structure of spin pair correlations had to

be analyzed. Note that good agreement with available experiments was founs .,3d 0.

Other applications relate to the local order parameter distribution

in homogeneous systems. The distribution of magnetization near a 31 missing spin was studied . It was found that the expone.it of the local order parameter B, had the same va"ue as in the bulk. This is -in contrast to the exponent of '-he order parameter near a free surface 32 which is found to be S = 3/4 . As a'i example we plot in Fig. 6) the -B-ÏX-25-

magnetization m(z) of a 16 x 16 - 16-aystea as a function of dia- 32 tance z from the free surface at J/k„T » 0.40 , Here the effective ft field boundary condition was used on the plane opposite to the free surface only, while periodic boundary conditions had to be used on the other surfaces. Again the slow decay of the spin deviation

(| - n(z) | •>> const. Vz) is in accordance with 32 a spin wave treatment 0.75-

m

/fTloo

0.50- *r

HEISENBERG

0.25

-SURFACE LAYER

=*z ATOMIC LAYERS 1 , / 0 5 10 . - Fig. 6: Magnetization n.(z) as a functiiii of distance z fro» sftH sur-, face in a simple cubic Heisenberg ferromagnet at J/k_T^TS40, according to Ref. 32. -B-lX-26-

RE7ERENCBS

Hl.E. ïiaho-r, Rep, Prog. Phys, 30, 615 (1967).

2 , >

H.E. Stanley, "Introduction to Phase Transitions end Critical Phenom­

ena" (Clarendon, Oxford 1971).

C. Domb, M.S. Green, "Phase Transitions and Critical Phenomena"

(Academic, New York 1972),

4L. Onsager, Phys. Rev. 65, 117 (1944).

SC.S. Yang, Phys. Rev. JJ5, 809 (1952).

6T.H. Bulin, M.Kac, Phys. Rev. 86, 831 (1952).

See e.g., the contribution of E. Lieb in Vol. I of Ref. 3.

8R.J. Baxter, Ann, Phys. (USA) 7C_, 193 (1972).

J.S. Smart, Effective Field Theories of Magnetism" (Saunders,

London 1966).

R. Brout, "Phuse Transitions" (Benjamin, New York 1965).

C. Domb, Adv. Phys. 19_, 339 (1970), and references contained therein.

12K.G. Wilson, Phys. Rev. Utters 28, 548 (1S72).

J""fii Sethe, Proc. Roy. Soc. (Loadon) A 150, 552 (1935)$

'' H. Peierls, Proc. Roy, Soc. A 154. 207 (1936); P.R. Weiss, Phys,, Rev.

,'7£. 1*93 (1948). -B-IX-27-

14 H, Kstropolis, A.W. Rosenbluth, H,N. Rasenbluth, A.H. Teller,

E. Teller, J. Chem, Phys. 21, 1087 (1953).

15H.KUller-Krusibhaar, K. Binder, Z. Physik 254. 269 (19/2).

K, Binder, H. Miiller-Krurobhaar, Phys. Rev. B7_, 3297 U973).

H. MiUlei-Krumbhaar, K. Binder, J. Statist, Phys. 8_, 1 (1973). 18 K, Feller, "Introduction to Probability Theory and its Appli­ cation" (New York, 1966).

R. Abe, R. Hotano, Progr. Theor. Phys. (Kyoto) _41, 941 (1969).

20 For a discussion of the surface properties of magnets see e.g.,

K. Bindev, P.C. Hohenberg, Phys. Rev. B6, 3461 (1972).

Z1P.J. Wood, U.S. Rushbrooke, Phys. Rev. Letters _J7, 307 (1966).

2D.S. Ritchie, M.E. Fisher, Phys. Rev. BS, 2668 (1972).

23K. Binder, H. Rauch, Z. Physik 219, 201 (1969).

E.E. Watson, Y Blume, G.H. Vineyard, Phys. Rev. 181, 811 (1969). 25 H. MUller-Krumbhaar, K. Binder, Intern. J. Magnetism 3, 113 (1972).

AC. 2. Stoll, K. Binder, T. Schneider, Pliys Rev. B_, (to be published).

'27 K.:Binder (preprint).

K. Binde», H. MUller-Krumbhaar, (to be published)

29 H. Miiller-Krumbhaar, (to be published).

irni's:::==- I n ••• -B-IX-28'

30H. MUller-Krinrishaar, K. Binder, Intern. J. Magnetism (in preBB).

31V, Wildpaner, H. Rauch, K. Binder, J. Phys. Chem. Solids (in press).

32K. Binder, P.C. Hobonberg, (to be published).