excalc.tex 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584
  1. \documentstyle[11pt,reduce]{article}
  2. \title{EXCALC: A System for Doing Calculations in the Calculus of Modern
  3. Differential Geometry}
  4. \author{Eberhard Schr\"{u}fer \\
  5. Institute SCAI.Alg \\
  6. German National Research Center for Information Technology (GMD) \\
  7. Schloss Birlinghoven \\
  8. D-53754 Sankt Augustin \\
  9. Germany \\[0.05in]
  10. Email: schruefer@gmd.de}
  11. \begin{document}
  12. \maketitle
  13. \index{EXCALC package}
  14. \section*{Acknowledgments}
  15. This program was developed over several years. I would like to express
  16. my deep gratitude to Dr. Anthony Hearn for his continuous interest in
  17. this work, and especially for his hospitality and support during a
  18. visit in 1984/85 at the RAND Corporation, where substantial progress
  19. on this package could be achieved. The Heinrich Hertz-Stiftung
  20. supported this visit. Many thanks are also due to Drs. F.W. Hehl,
  21. University of Cologne, and J.D. McCrea, University College Dublin, for
  22. their suggestions and work on testing this program.
  23. \section{Introduction}
  24. \index{differential geometry}
  25. {\bf EXCALC} is designed for easy use by all who are familiar with the
  26. calculus of Modern Differential Geometry. Its syntax is kept as close
  27. as possible to standard textbook notations. Therefore, no great
  28. experience in writing computer algebra programs is required. It is
  29. almost possible to input to the computer the same as what would have
  30. been written down for a hand-calculation. For example, the statement
  31. \begin{verbatim}
  32. f*x^y + u _| (y^z^x)
  33. \end{verbatim}
  34. \index{exterior calculus}
  35. would be recognized by the program as a formula involving exterior
  36. products and an inner product. The program is currently able to
  37. handle scalar-valued exterior forms, vectors and operations between
  38. them, as well as non-scalar valued forms (indexed forms). With this,
  39. it should be an ideal tool for studying differential equations,
  40. doing calculations in general relativity and field theories, or doing
  41. such simple things as calculating the Laplacian of a tensor field for
  42. an arbitrary given frame. With the increasing popularity of this
  43. calculus, this program should have an application in almost any field
  44. of physics and mathematics.
  45. Since the program is completely embedded in {\REDUCE}, all features and
  46. facilities of {\REDUCE} are available in a calculation. Even for those
  47. who are not quite comfortable in this calculus, there is a good chance
  48. of learning it by just playing with the program.
  49. This is the last release of version 2. A much extended differential
  50. geometry package (which includes complete symbolic index simplification,
  51. tensors, mappings, bundles and others) is under development.
  52. Complaints and comments are appreciated and should be send to the author.
  53. If the use of this program leads to a publication, this document should
  54. be cited, and a copy of the article to the above address would be
  55. welcome.
  56. \section{Declarations}
  57. Geometrical objects like exterior forms or vectors are introduced to the
  58. system by declaration commands. The declarations can appear anywhere in
  59. a program, but must, of course, be made prior to the use of the object.
  60. Everything that has no declaration is treated as a constant; therefore
  61. zero-forms must also be declared.
  62. An exterior form is introduced by\label{PFORM} \index{PFORM statement}
  63. \index{exterior form ! declaration}
  64. \hspace*{2em} \k{PFORM} \s{declaration$_1$}, \s{declaration$_2$}, \ldots;
  65. where
  66. \begin{tabbing}
  67. \s{declaration} ::= \s{name} $\mid$ \s{list of names}=\s{number} $\mid$ \s{identifier} $\mid$ \\
  68. \s{expression} \\
  69. \s{name} ::= \s{identifier} $\mid$ \s{identifier}(\s{arguments})
  70. \end{tabbing}
  71. For example
  72. \begin{verbatim}
  73. pform u=k,v=4,f=0,w=dim-1;
  74. \end{verbatim}
  75. declares {\tt U} to be an exterior form of degree {\tt K}, {\tt V} to be a
  76. form of degree 4, {\tt F} to be a form of degree 0 (a function), and {\tt W}
  77. to be a form of degree {\tt DIM}-1.
  78. If the exterior form should have indices, the declaration would be
  79. \index{exterior form ! with indices}
  80. \begin{verbatim}
  81. pform curv(a,b)=2,chris(a,b)=1;
  82. \end{verbatim}
  83. The names of the indices are arbitrary.
  84. Exterior forms of the same degree can be grouped into lists to save typing.
  85. \begin{verbatim}
  86. pform {x,y,z}=0,{rho(k,l),u,v(k)}=1;
  87. \end{verbatim}
  88. The declaration of vectors is similar. The command {\tt TVECTOR}\label{TVECTOR}
  89. takes a list of names. \index{TVECTOR command} \index{exterior form ! vector}
  90. \hspace*{2em} \k{TVECTOR} \s{name$_1$}, \s{name$_2$}, \ldots;
  91. For example, to declare {\tt X} as a vector and {\tt COMM} as a vector with
  92. two indices, one would say
  93. \begin{verbatim}
  94. tvector x,comm(a,b);
  95. \end{verbatim}
  96. If a declaration of an already existing name is made, the old
  97. declaration is removed, and the new one is taken.
  98. The exterior degree of a symbol or a general expression can be obtained
  99. with the function \label{EXDEGREE} \index{EXDEGREE command}
  100. \hspace*{2em} \k{EXDEGREE} \s{expression};
  101. Example:
  102. \begin{verbatim}
  103. exdegree(u + 3*chris(k,-k));
  104. 1
  105. \end{verbatim}
  106. \section{Exterior Multiplication}
  107. \index{"\^{} ! exterior multiplication} \index{exterior product}
  108. Exterior multiplication between exterior forms is carried out with the
  109. nary infix operator \^{ } (wedge)\label{wedge}. Factors are ordered
  110. according to the usual ordering in {\REDUCE} using the commutation
  111. rule for exterior products.
  112. \example\index{EXCALC package ! example}
  113. \begin{verbatim}
  114. pform u=1,v=1,w=k;
  115. u^v;
  116. U^V
  117. v^u;
  118. - U^V
  119. u^u;
  120. 0
  121. w^u^v;
  122. K
  123. ( - 1) *U^V^W
  124. (3*u-a*w)^(w+5*v)^u;
  125. A*(5*U^V^W - U^W^W)
  126. \end{verbatim}
  127. It is possible to declare the dimension of the underlying space
  128. by\label{SPACEDIM} \index{SPACEDIM command} \index{dimension}
  129. \hspace*{2em} \k{SPACEDIM} \s{number} $\mid$ \s{identifier};
  130. If an exterior product has a degree higher than the dimension of the
  131. space, it is replaced by 0:
  132. \begin{verbatim}
  133. spacedim 4;
  134. pform u=2,v=3;
  135. u^v;
  136. 0
  137. \end{verbatim}
  138. \section{Partial Differentiation}
  139. Partial differentiation is denoted by the operator {\tt @}\label{at}. Its
  140. capability is the same as the {\REDUCE} {\tt DF} operator.
  141. \index{"@ operator} \index{partial differentiation}
  142. \index{differentiation ! partial}
  143. \example\index{EXCALC package ! example}
  144. \begin{verbatim}
  145. @(sin x,x);
  146. COS(X)
  147. @(f,x);
  148. 0
  149. \end{verbatim}
  150. An identifier can be declared to be a function of certain variables.
  151. \index{FDOMAIN command}
  152. This is done with the command {\tt FDOMAIN}\label{FDOMAIN}. The
  153. following would tell the partial differentiation operator that {\tt F}
  154. is a function of the variables {\tt X} and {\tt Y} and that {\tt H} is
  155. a function of {\tt X}.
  156. \begin{verbatim}
  157. fdomain f=f(x,y),h=h(x);
  158. \end{verbatim}
  159. Applying {\tt @} to {\tt F} and {\tt H} would result in
  160. \begin{verbatim}
  161. @(x*f,x);
  162. F + X*@ F
  163. X
  164. @(h,y);
  165. 0
  166. \end{verbatim}
  167. \index{tangent vector}
  168. The partial derivative symbol can also be an operator with a single
  169. argument. It then represents a natural base element of a tangent
  170. vector\label{at1}.
  171. \example\index{EXCALC package ! example}
  172. \begin{verbatim}
  173. a*@ x + b*@ y;
  174. A*@ + B*@
  175. X Y
  176. \end{verbatim}
  177. \section{Exterior Differentiation}
  178. \index{exterior differentiation}
  179. Exterior differentiation of exterior forms is carried out by the
  180. operator {\tt d}\label{d}. Products are normally differentiated out,
  181. {\em i.e.}
  182. \begin{verbatim}
  183. pform x=0,y=k,z=m;
  184. d(x * y);
  185. X*d Y + d X^Y
  186. d(r*y);
  187. R*d Y
  188. d(x*y^z);
  189. K
  190. ( - 1) *X*Y^d Z + X*d Y^Z + d X^Y^Z
  191. \end{verbatim}
  192. This expansion can be suppressed by the command {\tt NOXPND D}\label{NOXPNDD}.
  193. \index{NOXPND ! D}
  194. \begin{verbatim}
  195. noxpnd d;
  196. d(y^z);
  197. d(Y^Z)
  198. \end{verbatim}
  199. To obtain a canonical form for an exterior product when the expansion
  200. is switched off, the operator {\tt D} is shifted to the right if it
  201. appears in the leftmost place.
  202. \begin{verbatim}
  203. d y ^ z;
  204. K
  205. - ( - 1) *Y^d Z + d(Y^Z)
  206. \end{verbatim}
  207. Expansion is performed again when the command {\tt XPND D}\label{XPNDD}
  208. is executed. \index{XPND ! D}
  209. Functions which are implicitly defined by the {\tt FDOMAIN} command are
  210. expanded into partial derivatives:
  211. \begin{verbatim}
  212. pform x=0,y=0,z=0,f=0;
  213. fdomain f=f(x,y);
  214. d f;
  215. @ F*d X + @ F*d Y
  216. X Y
  217. \end{verbatim}
  218. If an argument of an implicitly defined function has further
  219. dependencies the chain rule will be applied {\em e.g.} \index{chain rule}
  220. \begin{verbatim}
  221. fdomain y=y(z);
  222. d f;
  223. @ F*d X + @ F*@ Y*d Z
  224. X Y Z
  225. \end{verbatim}
  226. Expansion into partial derivatives can be inhibited by
  227. {\tt NOXPND @}\label{NOXPNDA}
  228. and enabled again by {\tt XPND @}\label{XPNDA}.
  229. \index{NOXPND ! "@} \index{XPND ! "@}
  230. The operator is of course aware of the rules that a repeated
  231. application always leads to zero and that there is no exterior form of
  232. higher degree than the dimension of the space.
  233. \begin{verbatim}
  234. d d x;
  235. 0
  236. pform u=k;
  237. spacedim k;
  238. d u;
  239. 0
  240. \end{verbatim}
  241. \section{Inner Product}
  242. \index{inner product ! exterior form}
  243. The inner product between a vector and an exterior form is represented
  244. by the diphthong \_$|$ \label{innerp} (underscore or-bar), which is the
  245. notation of many textbooks. If the exterior form is an exterior
  246. product, the inner product is carried through any factor.
  247. \index{\_$\mid$ operator}
  248. \example\index{EXCALC package ! example}
  249. \begin{verbatim}
  250. pform x=0,y=k,z=m;
  251. tvector u,v;
  252. u _| (x*y^z);
  253. K
  254. X*(( - 1) *Y^U _| Z + U _| Y^Z)
  255. \end{verbatim}
  256. In repeated applications of the inner product to the same exterior
  257. form the vector arguments are ordered {\em e.g.}
  258. \begin{verbatim}
  259. (u+x*v) _| (u _| (3*z));
  260. - 3*U _| V _| Z
  261. \end{verbatim}
  262. The duality of natural base elements is also known by the system, {\em i.e.}
  263. \begin{verbatim}
  264. pform {x,y}=0;
  265. (a*@ x+b*@(y)) _| (3*d x-d y);
  266. 3*A - B
  267. \end{verbatim}
  268. \section{Lie Derivative}
  269. \index{Lie Derivative}
  270. The Lie derivative can be taken between a vector and an exterior form
  271. or between two vectors. It is represented by the infix operator $|$\_
  272. \label{lie}. In the case of Lie differentiating, an exterior form by
  273. a vector, the Lie derivative is expressed through inner products and
  274. exterior differentiations, {\em i.e.} \index{$\mid$\_ operator}
  275. \begin{verbatim}
  276. pform z=k;
  277. tvector u;
  278. u |_ z;
  279. U _| d Z + d(U _| Z)
  280. \end{verbatim}
  281. If the arguments of the Lie derivative are vectors, the vectors are
  282. ordered using the anticommutivity property, and functions (zero forms)
  283. are differentiated out.
  284. \example\index{EXCALC package ! example}
  285. \begin{verbatim}
  286. tvector u,v;
  287. v |_ u;
  288. - U |_ V
  289. pform x=0,y=0;
  290. (x*u) |_ (y*v);
  291. - U*Y*V _| d X + V*X*U _| d Y + X*Y*U |_ V
  292. \end{verbatim}
  293. \section{Hodge-* Duality Operator}
  294. \index{Hodge-* duality operator} \index{"\# ! Hodge-* operator}
  295. The Hodge-*\label{hodge} duality operator maps an exterior form of degree
  296. {\tt K} to an exterior form of degree {\tt N-K}, where {\tt N} is the
  297. dimension of the space. The double application of the operator must
  298. lead back to the original exterior form up to a factor. The following
  299. example shows how the factor is chosen here
  300. \begin{verbatim}
  301. spacedim n;
  302. pform x=k;
  303. # # x;
  304. 2
  305. (K + K*N)
  306. ( - 1) *X*SGN
  307. \end{verbatim}
  308. \pagebreak
  309. \index{SGN ! indeterminate sign} \index{coframe}
  310. The indeterminate SGN in the above example denotes the sign of the
  311. determinant of the metric. It can be assigned a value or will be
  312. automatically set if more of the metric structure is specified (via
  313. COFRAME), {\em i.e.} it is then set to $g/|g|$, where $g$ is the
  314. determinant of the metric. If the Hodge-* operator appears in an
  315. exterior product of maximal degree as the leftmost factor, the Hodge-*
  316. is shifted to the right according to
  317. \begin{verbatim}
  318. pform {x,y}=k;
  319. # x ^ y;
  320. 2
  321. (K + K*N)
  322. ( - 1) *X^# Y
  323. \end{verbatim}
  324. More simplifications are performed if a coframe is defined.
  325. \section{Variational Derivative}
  326. \index{derivative ! variational} \index{variational derivative}
  327. \ttindex{VARDF}
  328. The function {\tt VARDF}\label{VARDF} returns as its value the
  329. variation of a given Lagrangian n-form with respect to a specified
  330. exterior form (a field of the Lagrangian). In the shared variable
  331. \ttindex{BNDEQ"!*}
  332. {\tt BNDEQ!*}, the expression is stored that has to yield zero if
  333. integrated over the boundary.
  334. Syntax:
  335. \hspace*{2em} \k{VARDF}(\s{Lagrangian n-form},\s{exterior form})
  336. \example\index{EXCALC package ! example}
  337. \begin{verbatim}
  338. spacedim 4;
  339. pform l=4,a=1,j=3;
  340. l:=-1/2*d a ^ # d a - a^# j$ %Lagrangian of the e.m. field
  341. vardf(l,a);
  342. - (# J + d # d A) %Maxwell's equations
  343. bndeq!*;
  344. - 'A^# d A %Equation at the boundary
  345. \end{verbatim}
  346. Restrictions:
  347. In the current implementation, the Lagrangian must be built up by the
  348. fields and the operations {\tt d}, {\tt \#}, and {\tt @}. Variation
  349. with respect to indexed quantities is currently not allowed.
  350. For the calculation of the conserved currents induced by symmetry
  351. operators (vector fields), the function {\tt NOETHER}\label{NOETHER}
  352. \index{NOETHER function}
  353. is provided. It has the syntax:
  354. \hspace*{2em}
  355. \k{NOETHER}(\s{Lagrangian n-form},\s{field},\s{symmetry generator})
  356. \example\index{EXCALC package ! example}
  357. \begin{verbatim}
  358. pform l=4,a=1,f=2;
  359. spacedim 4;
  360. l:= -1/2*d a^#d a; %Free Maxwell field;
  361. tvector x(k); %An unspecified generator;
  362. noether(l,a,x(-k));
  363. ( - 2*d(X _|A)^# d A - (X _|d A)^# d A + d A^(X _|# d A))/2
  364. K K K
  365. \end{verbatim}
  366. The above expression would be the canonical energy
  367. momentum 3-forms of the Maxwell field, if X is interpreted
  368. as a translation;
  369. \section{Handling of Indices}
  370. \index{exterior form ! with indices}
  371. Exterior forms and vectors may have indices. On input, the indices
  372. are given as arguments of the object. A positive argument denotes a
  373. superscript and a negative argument a subscript. On output, the
  374. indexed quantity is displayed two dimensionally if {\tt NAT} is on.
  375. \index{NAT flag}
  376. Indices may be identifiers or numbers.
  377. \example\index{EXCALC package ! example}
  378. \begin{verbatim}
  379. pform om(k,l)=m,e(k)=1;
  380. e(k)^e(-l);
  381. K
  382. E ^E
  383. L
  384. om(4,-2);
  385. 4
  386. OM
  387. 2
  388. \end{verbatim}
  389. In the current release, full simplification is performed only if an
  390. index range is specified. It is hoped that this restriction can be
  391. removed soon. If the index range (the values that the indices can
  392. obtain) is specified, the given expression is evaluated for all
  393. possible index values, and the summation convention is understood.
  394. \example\label{INDEXRANGE}\index{EXCALC package ! example}
  395. \begin{verbatim}
  396. indexrange t,r,ph,z;
  397. pform e(k)=1,s(k,l)=2;
  398. w := e(k)*e(-k);
  399. T R PH Z
  400. W := E *E + E *E + E *E + E *E
  401. T R PH Z
  402. s(k,l):=e(k)^e(l);
  403. T T
  404. S := 0
  405. R T T R
  406. S := - E ^E
  407. PH T T PH
  408. S := - E ^E
  409. .
  410. .
  411. .
  412. \end{verbatim}
  413. If the expression to be evaluated is not an assignment, the values of
  414. the expression are displayed as an assignment to an indexed variable
  415. with name {\tt NS}. This is done only on output, {\em i.e.} no actual
  416. binding to the variable NS occurs.
  417. \index{NS dummy variable}
  418. \begin{verbatim}
  419. e(k)^e(l);
  420. T T
  421. NS := 0
  422. R T T R
  423. NS := - E ^E
  424. .
  425. .
  426. .
  427. \end{verbatim}
  428. It should be noted, however, that the index positions on the variable
  429. NS can sometimes not be uniquely determined by the system (because of
  430. possible reorderings in the expression). Generally it is advisable to
  431. use assignments to display complicated expressions.
  432. A range can also be assigned to individual index-names. For example,
  433. the declaration
  434. \begin{verbatim}
  435. indexrange {k,l}={x,y,z},{u,v,w}={1,2};
  436. \end{verbatim}
  437. would assign to the index identifiers k,l the range values x,y,z and
  438. to the index identifiers u,v,w the range values 1,2. The use of an
  439. index identifier not listed in previous indexrange statements has the
  440. range of the union of all given index ranges.
  441. With the above example of an indexrange statement, the following
  442. index evaluations would take place
  443. \begin{verbatim}
  444. pform w n=0;
  445. w(k)*w(-k);
  446. X Y Z
  447. W *W + W *W + W *W
  448. X Y Z
  449. w(u)*w(-u);
  450. 1 2
  451. W *W + W *W
  452. 1 2
  453. w(r)*w(-r);
  454. 1 2 X Y Z
  455. W *W + W *W + W *W + W *W + W *W
  456. 1 2 X Y Z
  457. \end{verbatim}
  458. In certain cases, one would like to inhibit the summation over
  459. specified index names, or at all. For this the command
  460. \index{NOSUM command}
  461. \hspace*{2em} \k{NOSUM} \s{indexname$_1$}, \ldots;\label{NOSUM}
  462. and the switch {\tt NOSUM} are \index{NOSUM switch}
  463. available. The command {\tt NOSUM} has the effect that summation is
  464. not performed over those indices which had been listed. The command
  465. {\tt RENOSUM}\label{RENOSUM} enables summation again. The switch {\tt
  466. NOSUM}, if on, inhibits any summation. \index{RENOSUM command}
  467. \label{INDEXSYMMETRIES} \index{INDEXSYMMETRIES command}
  468. It is possible to declare symmetry properties for an indexed quantity by
  469. the command {\tt INDEX\_SYMMETRIES}. A prototypical example is as
  470. follows
  471. \begin{verbatim}
  472. index_symmetries u(k,l,m,n): symmetric in {k,l},{m,n}
  473. antisymmetric in {{k,l},{m,n}},
  474. g(k,l),h(k,l): symmetric;
  475. \end{verbatim}
  476. It declares the object {\tt u} symmetric in the first two and last
  477. two indices and antisymmetric with respect to commutation of the given
  478. index pairs. If an object is completely symmetric or antisymmetric,
  479. the indices need not to be given after the corresponding keyword as
  480. shown above for {\tt g} and {\tt h}.
  481. If applicable, this command should
  482. be issued, since great savings in memory and execution time result.
  483. Only strict components are printed.
  484. The commands symmetric and antisymmetric of earlier releases have no
  485. effect.
  486. \section{Metric Structures}
  487. \index{metric structure} \index{coframe}
  488. A metric structure is defined in {\bf EXCALC} by specifying a set of
  489. basis one-forms (the coframe) together with the metric.
  490. Syntax:\label{COFRAME}
  491. \begin{tabbing}
  492. \hspace*{2em} \k{COFRAME} \=
  493. \s{identifier}\s{(index$_1$)}=\s{expression$_1$}, \\
  494. \> \s{identifier}\s{(index$_2$)}=\s{expression$_2$}, \\
  495. \> . \\
  496. \> . \\
  497. \> . \\
  498. \> \s{identifier}\s{(index$_n$)}=\s{expression$_n$} \\
  499. \> \hspace{1em} \k{WITH} \k{METRIC} \s{name}=\s{expression}; \\
  500. \end{tabbing}
  501. \index{euclidean metric} \index{COFRAME ! WITH METRIC}
  502. This statement automatically sets the dimension of the space and the
  503. index range. The clause {\tt WITH METRIC} can be omitted if the metric
  504. \index{COFRAME ! WITH SIGNATURE}
  505. is Euclidean and the shorthand {\tt WITH SIGNATURE \s{diagonal elements}}
  506. \label{SIGNATURE} can be used in the case of a pseudo-Euclidean metric. The
  507. splitting of a metric structure in its metric tensor coefficients and
  508. basis one-forms is completely arbitrary including the extremes of an
  509. orthonormal frame and a coordinate frame.
  510. \example\index{EXCALC package ! example}
  511. \begin{verbatim}
  512. coframe e r=d r, e(ph)=r*d ph
  513. with metric g=e(r)*e(r)+e(ph)*e(ph); %Polar coframe
  514. coframe e(r)=d r,e(ph)=r*d(ph); %Same as before
  515. coframe o(t)=d t, o x=d x
  516. with signature -1,1; %A Lorentz coframe
  517. coframe b(xi)=d xi, b(eta)=d eta %A lightcone coframe
  518. with metric w=-1/2*(b(xi)*b(eta)+b(eta)*b(xi));
  519. coframe e r=d r, e ph=d ph %Polar coordinate
  520. with metric g=e r*e r+r**2*e ph*e ph; %basis
  521. \end{verbatim}
  522. Individual elements of the metric can be accessed just by calling them
  523. with the desired indices. The value of the determinant of the
  524. \index{determinant ! in DETM"!*} \ttindex{DETM"!*}
  525. covariant metric is stored in the variable {\tt DETM!*}. The metric
  526. is not needed for lowering or raising of indices as the system
  527. performs this automatically, {\em i.e.} no matter in what index
  528. position values were assigned to an indexed quantity, the values can
  529. be retrieved for any index position just by writing the indexed
  530. quantity with the desired indices.
  531. \example\index{EXCALC package ! example}
  532. \begin{verbatim}
  533. coframe e t=d t,e x=d x,e y=d y
  534. with signature -1,1,1;
  535. pform f(k,l)=0;
  536. antisymmetric f;
  537. f(-t,-x):=ex$ f(-x,-y):=b$ f(-t,-y):=0$
  538. on nero;
  539. f(k,-l):=f(k,-l);
  540. X
  541. F := - EX
  542. T
  543. T
  544. F := - EX
  545. X
  546. Y
  547. F := - B
  548. X
  549. X
  550. F := B
  551. Y
  552. \end{verbatim}
  553. Any expression containing differentials of the coordinate functions will
  554. be transformed into an expression of the basis one-forms.The system also
  555. knows how to take the exterior derivative of the basis one-forms.
  556. \index{spherical coordinates}
  557. \example (Spherical coordinates)\index{EXCALC package ! example}
  558. \begin{verbatim}
  559. coframe e(r)=d(r), e(th)=r*d(th), e(ph)=r*sin(th)*d(ph);
  560. d r^d th;
  561. R TH
  562. (E ^E )/R
  563. d(e(th));
  564. R TH
  565. (E ^E )/R
  566. pform f=0;
  567. fdomain f=f(r,th,ph);
  568. factor e;
  569. on rat;
  570. d f; %The "gradient" of F in spherical coordinates;
  571. R TH PH
  572. E *@ F + (E *@ F)/R + (E *@ F)/(R*SIN(TH))
  573. R TH PH
  574. \end{verbatim}
  575. The frame dual to the frame defined by the {\tt COFRAME} command can
  576. be introduced by \k{FRAME} command. \index{FRAME command}
  577. \hspace*{2em} \k{FRAME} \s{identifier};\label{FRAME}
  578. This command causes the
  579. dual property to be recognized, and the tangent vectors of the
  580. coordinate functions are replaced by the frame basis vectors.
  581. \example\index{EXCALC package ! example}
  582. \begin{verbatim}
  583. coframe b r=d r,b ph=r*d ph,e z=d z; %Cylindrical coframe;
  584. frame x;
  585. on nero;
  586. x(-k) _| b(l);
  587. R
  588. NS := 1
  589. R
  590. PH
  591. NS := 1
  592. PH
  593. Z
  594. NS := 1
  595. Z
  596. x(-k) |_ x(-l); %The commutator of the dual frame;
  597. NS := X /R
  598. PH R PH
  599. NS := ( - X )/R %i.e. it is not a coordinate base;
  600. R PH PH
  601. \end{verbatim}
  602. \index{DISPLAYFRAME command} \index{tracing ! EXCALC}
  603. As a convenience, the frames can be displayed at any point in a program
  604. by the command {\tt DISPLAYFRAME;}\label{DISPLAYFRAME}.
  605. \index{Hodge-* duality operator}
  606. The Hodge-* duality operator returns the explicitly constructed dual
  607. element if applied to coframe base elements. The metric is properly
  608. taken into account.
  609. \index{Levi-Cevita tensor} \ttindex{EPS}
  610. The total antisymmetric Levi-Cevita tensor {\tt EPS}\label{EPS} is
  611. also available. The value of {\tt EPS} with an even permutation of the
  612. indices in a covariant position is taken to be +1.
  613. \section{Riemannian Connections}
  614. \index{Riemannian Connections}
  615. The command {\tt RIEMANNCONX} is provided for calculating the
  616. \index{RIEMANNCONX command} \label{RIEMANNCONX}
  617. connection 1 forms. The values are stored on the name given to {\tt
  618. RIEMANNCONX}. This command is far more efficient than calculating the
  619. connection from the differential of the basis one-forms and using
  620. inner products.
  621. \example (Calculate the connection 1-form and curvature 2-form on S(2))
  622. \index{EXCALC package ! example}
  623. \begin{verbatim}
  624. coframe e th=r*d th,e ph=r*sin(th)*d ph;
  625. riemannconx om;
  626. om(k,-l); %Display the connection forms;
  627. TH
  628. NS := 0
  629. TH
  630. PH PH
  631. NS := (E *COS(TH))/(SIN(TH)*R)
  632. TH
  633. TH PH
  634. NS := ( - E *COS(TH))/(SIN(TH)*R)
  635. PH
  636. PH
  637. NS := 0
  638. PH
  639. pform curv(k,l)=2;
  640. curv(k,-l):=d om(k,-l) + om(k,-m)^om(m-l);
  641. %The curvature forms
  642. TH
  643. CURV := 0
  644. TH
  645. PH TH PH 2
  646. CURV := ( - E ^E )/R
  647. TH %Of course it was a sphere with
  648. %radius R.
  649. TH TH PH 2
  650. CURV := (E ^E )/R
  651. PH
  652. PH
  653. CURV := 0
  654. PH
  655. \end{verbatim}
  656. \section{Ordering and Structuring}
  657. \index{ordering ! exterior form} \index{FORDER command}
  658. The ordering of an exterior form or vector can be changed by the
  659. command {\tt FORDER}.\label{FORDER} In an expression, the first
  660. identifier or kernel in the arguments of {\tt FORDER} is ordered ahead
  661. of the second, and so on, and ordered ahead of all not appearing as
  662. arguments. This ordering is done on the internal level and not only
  663. on output. The execution of this statement can therefore have
  664. tremendous effects on computation time and memory requirements. {\tt
  665. REMFORDER}\label{REMFORDER} brings back standard ordering for those
  666. elements that are listed as arguments. \index{REMFORDER command}
  667. An expression can be put in a more structured form by renaming a
  668. subexpression. This is done with the command {\tt KEEP} which
  669. has the syntax \index{KEEP command}\label{KEEP}
  670. \hspace*{2em} \k{KEEP}
  671. \s{name$_1$}=\s{expression$_1$},\s{name$_2$}=\s{expression$_2$}, \ldots
  672. The effect is that rules are set up for simplifying \s{name} without
  673. introducing its definition in an expression. In an expression the system
  674. also tries by reordering to generate as many instances of \s{name} as
  675. possible.
  676. \example\index{EXCALC package ! example}
  677. \begin{verbatim}
  678. pform x=0,y=0,z=0,f=0,j=3;
  679. keep j=d x^d y^d z;
  680. j;
  681. J
  682. d j;
  683. 0
  684. j^d x;
  685. 0
  686. fdomain f=f(x);
  687. d f^d y^d z;
  688. @ F*J
  689. X
  690. \end{verbatim}
  691. \index{exterior product}
  692. The capabilities of {\tt KEEP} are currently very limited. Only exterior
  693. products should occur as righthand sides in {\tt KEEP}.
  694. \section{Summary of Operators and Commands}
  695. Table~\ref{EXCALC:sum} summarizes EXCALC commands and the page number they are
  696. defined on.
  697. \begin{table}
  698. \begin{tabular}{l l r}
  699. \index{"\^{} ! exterior multiplication} \index{wedge}
  700. \^{ } & Exterior Multiplication & \pageref{wedge} \\
  701. \index{"@ ! partial differentiation}
  702. @ & Partial Differentiation & \pageref{at} \\
  703. \index{"@ ! tangent vector}
  704. @ & Tangent Vector & \pageref{at1} \\
  705. \index{"\# ! Hodge-* operator}
  706. \# & Hodge-* Operator & \pageref{hodge} \\
  707. \index{\_$\mid$ operator}
  708. \_$|$ & Inner Product & \pageref{innerp} \\
  709. \index{$\mid$\_ operator}
  710. $|$\_ & Lie Derivative & \pageref{lie} \\
  711. \index{COFRAME command}
  712. COFRAME & Declaration of a coframe & \pageref{COFRAME} \\
  713. \index{d ! exterior differentiation}
  714. d & Exterior differentiation & \pageref{d} \\
  715. \index{DISPLAYFRAME command}
  716. DISPLAYFRAME & Displays the frame & \pageref{DISPLAYFRAME}\\
  717. \index{EPS ! Levi-Civita tensor}
  718. EPS & Levi-Civita tensor & \pageref{EPS} \\
  719. \index{EXDEGREE}
  720. EXDEGREE & Calculates the exterior degree of an expression & \pageref{EXDEGREE} \\
  721. \index{FDOMAIN command}
  722. FDOMAIN & Declaration of implicit dependencies &\pageref{FDOMAIN} \\
  723. \index{FORDER command}
  724. FORDER & Ordering command & \pageref{FORDER} \\
  725. \index{FRAME command}
  726. FRAME & Declares the frame dual to the coframe & \pageref{FRAME} \\
  727. \index{INDEXRANGE command}
  728. INDEXRANGE & Declaration of indices & \pageref{INDEXRANGE} \\
  729. \index{INDEX\_SYMMETRIES command}
  730. INDEX\_SYMMETRIES & Declares arbitrary index symmetry properties & \pageref{INDEXSYMMETRIES} \\
  731. \index{KEEP command}
  732. KEEP & Structuring command & \pageref{KEEP} \\
  733. \index{METRIC command}
  734. METRIC & Clause of COFRAME to specify a metric & \pageref{COFRAME} \\
  735. \index{NOETHER function}
  736. NOETHER & Calculates the Noether current & \pageref{NOETHER} \\
  737. \index{NOSUM command}
  738. NOSUM & Inhibits summation convention & \pageref{NOSUM} \\
  739. \index{NOXPND command}
  740. NOXPND d & Inhibits the use of product rule for d &
  741. \pageref{NOXPNDD} \\
  742. \index{NOXPND "@ command}
  743. NOXPND @ & Inhibits expansion into partial derivatives &
  744. \pageref{NOXPNDA} \\
  745. \index{PFORM command}
  746. PFORM & Declaration of exterior forms & \pageref{PFORM} \\
  747. \index{REMFORDER command}
  748. REMFORDER & Clears ordering & \pageref{REMFORDER} \\
  749. \index{RENOSUM command}
  750. RENOSUM & Enables summation convention & \pageref{RENOSUM} \\
  751. \index{RIEMANNCONX command}
  752. RIEMANNCONX & Calculation of a Riemannian Connection &
  753. \pageref{RIEMANNCONX} \\
  754. \index{SIGNATURE command}
  755. SIGNATURE & Clause of COFRAME to specify a pseudo- & \pageref{SIGNATURE} \\
  756. & Euclidean metric & \\
  757. \index{SPACEDIM command}
  758. SPACEDIM & Command to set the dimension of a space &
  759. \pageref{SPACEDIM} \\
  760. \index{TVECTOR command}
  761. TVECTOR & Declaration of vectors & \pageref{TVECTOR} \\
  762. \ttindex{VARDF}
  763. VARDF & Variational derivative & \pageref{VARDF} \\
  764. \index{XPND command}
  765. XPND d & Enables the use of product rule for d & \pageref{XPNDD} \\
  766. & (default) & \\
  767. \index{XPND ! "@}
  768. XPND @ & Enables expansion into partial derivatives & \pageref{XPNDA} \\
  769. & (default)
  770. \end{tabular}
  771. \caption{EXCALC Command Summary}\label{EXCALC:sum}
  772. \end{table}
  773. \newpage
  774. \section{Examples}
  775. The following examples should illustrate the use of {\bf EXCALC}. It is not
  776. intended to show the most efficient or most elegant way of stating the
  777. problems; rather the variety of syntactic constructs are exemplified.
  778. The examples are on a test file distributed with {\bf EXCALC}.
  779. \index{EXCALC package ! example}
  780. {\small
  781. \begin{verbatim}
  782. % Problem: Calculate the PDE's for the isovector of the heat equation.
  783. % --------
  784. % (c.f. B.K. Harrison, f.B. Estabrook, "Geometric Approach...",
  785. % J. Math. Phys. 12, 653, 1971)
  786. % The heat equation @ psi = @ psi is equivalent to the set of exterior
  787. % xx t
  788. % equations (with u=@ psi, y=@ psi):
  789. % T x
  790. pform {psi,u,x,y,t}=0,a=1,{da,b}=2;
  791. a := d psi - u*d t - y*d x;
  792. da := - d u^d t - d y^d x;
  793. b := u*d x^d t - d y^d t;
  794. % Now calculate the PDE's for the isovector.
  795. tvector v;
  796. pform {vpsi,vt,vu,vx,vy}=0;
  797. fdomain vpsi=vpsi(psi,t,u,x,y),vt=vt(psi,t,u,x,y),vu=vu(psi,t,u,x,y),
  798. vx=vx(psi,t,u,x,y),vy=vy(psi,t,u,x,y);
  799. v := vpsi*@ psi + vt*@ t + vu*@ u + vx*@ x + vy*@ y;
  800. factor d;
  801. on rat;
  802. i1 := v |_ a - l*a;
  803. pform o=1;
  804. o := ot*d t + ox*d x + ou*d u + oy*d y;
  805. fdomain f=f(psi,t,u,x,y);
  806. i11 := v _| d a - l*a + d f;
  807. let vx=-@(f,y),vt=-@(f,u),vu=@(f,t)+u*@(f,psi),vy=@(f,x)+y*@(f,psi),
  808. vpsi=f-u*@(f,u)-y*@(f,y);
  809. factor ^;
  810. i2 := v |_ b - xi*b - o^a + zeta*da;
  811. let ou=0,oy=@(f,u,psi),ox=-u*@(f,u,psi),
  812. ot=@(f,x,psi)+u*@(f,y,psi)+y*@(f,psi,psi);
  813. i2;
  814. let zeta=-@(f,u,x)-@(f,u,y)*u-@(f,u,psi)*y;
  815. i2;
  816. let xi=-@(f,t,u)-u*@(f,u,psi)+@(f,x,y)+u*@(f,y,y)+y*@(f,y,psi)+@(f,psi);
  817. i2;
  818. let @(f,u,u)=0;
  819. i2; % These PDE's have to be solved.
  820. clear a,da,b,v,i1,i11,o,i2,xi,t;
  821. remfdomain f,vpsi,vt,vu,vx,vy;
  822. clear @(f,u,u);
  823. % Problem:
  824. % --------
  825. % Calculate the integrability conditions for the system of PDE's:
  826. % (c.f. B.F. Schutz, "Geometrical Methods of Mathematical Physics"
  827. % Cambridge University Press, 1984, p. 156)
  828. % @ z /@ x + a1*z + b1*z = c1
  829. % 1 1 2
  830. % @ z /@ y + a2*z + b2*z = c2
  831. % 1 1 2
  832. % @ z /@ x + f1*z + g1*z = h1
  833. % 2 1 2
  834. % @ z /@ y + f2*z + g2*z = h2
  835. % 2 1 2 ;
  836. pform w(k)=1,integ(k)=4,{z(k),x,y}=0,{a,b,c,f,g,h}=1,
  837. {a1,a2,b1,b2,c1,c2,f1,f2,g1,g2,h1,h2}=0;
  838. fdomain a1=a1(x,y),a2=a2(x,y),b1=b1(x,y),b2=b2(x,y),
  839. c1=c1(x,y),c2=c2(x,y),f1=f1(x,y),f2=f2(x,y),
  840. g1=g1(x,y),g2=g2(x,y),h1=h1(x,y),h2=h2(x,y);
  841. a:=a1*d x+a2*d y$
  842. b:=b1*d x+b2*d y$
  843. c:=c1*d x+c2*d y$
  844. f:=f1*d x+f2*d y$
  845. g:=g1*d x+g2*d y$
  846. h:=h1*d x+h2*d y$
  847. % The equivalent exterior system:
  848. factor d;
  849. w(1) := d z(-1) + z(-1)*a + z(-2)*b - c;
  850. w(2) := d z(-2) + z(-1)*f + z(-2)*g - h;
  851. indexrange 1,2;
  852. factor z;
  853. % The integrability conditions:
  854. integ(k) := d w(k) ^ w(1) ^ w(2);
  855. clear a,b,c,f,g,h,x,y,w(k),integ(k),z(k);
  856. remfdomain a1,a2,b1,c1,c2,f1,f2,g1,g2,h1,h2;
  857. % Problem:
  858. % --------
  859. % Calculate the PDE's for the generators of the d-theta symmetries of
  860. % the Lagrangian system of the planar Kepler problem.
  861. % c.f. W.Sarlet, F.Cantrijn, Siam Review 23, 467, 1981
  862. % Verify that time translation is a d-theta symmetry and calculate the
  863. % corresponding integral.
  864. pform {t,q(k),v(k),lam(k),tau,xi(k),eta(k)}=0,theta=1,f=0,
  865. {l,glq(k),glv(k),glt}=0;
  866. tvector gam,y;
  867. indexrange 1,2;
  868. fdomain tau=tau(t,q(k),v(k)),xi=xi(t,q(k),v(k)),f=f(t,q(k),v(k));
  869. l := 1/2*(v(1)**2 + v(2)**2) + m/r$ % The Lagrangian.
  870. pform r=0;
  871. fdomain r=r(q(k));
  872. let @(r,q 1)=q(1)/r,@(r,q 2)=q(2)/r,q(1)**2+q(2)**2=r**2;
  873. lam(k) := -m*q(k)/r; % The force.
  874. gam := @ t + v(k)*@(q(k)) + lam(k)*@(v(k))$
  875. eta(k) := gam _| d xi(k) - v(k)*gam _| d tau$
  876. y := tau*@ t + xi(k)*@(q(k)) + eta(k)*@(v(k))$ % Symmetry generator.
  877. theta := l*d t + @(l,v(k))*(d q(k) - v(k)*d t)$
  878. factor @;
  879. s := y |_ theta - d f$
  880. glq(k) := @(q k) _| s;
  881. glv(k) := @(v k) _| s;
  882. glt := @(t) _| s;
  883. % Translation in time must generate a symmetry.
  884. xi(k) := 0;
  885. tau := 1;
  886. glq k := glq k;
  887. glv k := glv k;
  888. glt;
  889. % The corresponding integral is of course the energy.
  890. integ := - y _| theta;
  891. clear l,lam k,gam,eta k,y,theta,s,glq k,glv k,glt,t,q k,v k,tau,xi k;
  892. remfdomain r,f,tau,xi;
  893. % Problem:
  894. % --------
  895. % Calculate the "gradient" and "Laplacian" of a function and the "curl"
  896. % and "divergence" of a one-form in elliptic coordinates.
  897. coframe e u = sqrt(cosh(v)**2 - sin(u)**2)*d u,
  898. e v = sqrt(cosh(v)**2 - sin(u)**2)*d v,
  899. e phi = cos u*sinh v*d phi;
  900. pform f=0;
  901. fdomain f=f(u,v,phi);
  902. factor e,^;
  903. on rat,gcd;
  904. order cosh v, sin u;
  905. % The gradient:
  906. d f;
  907. factor @;
  908. % The Laplacian:
  909. # d # d f;
  910. % Another way of calculating the Laplacian:
  911. -#vardf(1/2*d f^#d f,f);
  912. remfac @;
  913. % Now calculate the "curl" and the "divergence" of a one-form.
  914. pform w=1,a(k)=0;
  915. fdomain a=a(u,v,phi);
  916. w := a(-k)*e k;
  917. % The curl:
  918. x := # d w;
  919. factor @;
  920. % The divergence:
  921. y := # d # w;
  922. remfac @;
  923. clear x,y,w,u,v,phi,e k,a k;
  924. remfdomain a,f;
  925. % Problem:
  926. % --------
  927. % Calculate in a spherical coordinate system the Navier Stokes equations.
  928. coframe e r=d r, e theta =r*d theta, e phi = r*sin theta *d phi;
  929. frame x;
  930. fdomain v=v(t,r,theta,phi),p=p(r,theta,phi);
  931. pform v(k)=0,p=0,w=1;
  932. % We first calculate the convective derivative.
  933. w := v(-k)*e(k)$
  934. factor e; on rat;
  935. cdv := @(w,t) + (v(k)*x(-k)) |_ w - 1/2*d(v(k)*v(-k));
  936. %next we calculate the viscous terms;
  937. visc := nu*(d#d# w - #d#d w) + mu*d#d# w;
  938. % Finally we add the pressure term and print the components of the
  939. % whole equation.
  940. pform nasteq=1,nast(k)=0;
  941. nasteq := cdv - visc + 1/rho*d p$
  942. factor @;
  943. nast(-k) := x(-k) _| nasteq;
  944. remfac @,e;
  945. clear v k,x k,nast k,cdv,visc,p,w,nasteq,e k;
  946. remfdomain p,v;
  947. % Problem:
  948. % --------
  949. % Calculate from the Lagrangian of a vibrating rod the equation of
  950. % motion and show that the invariance under time translation leads
  951. % to a conserved current.
  952. pform {y,x,t,q,j}=0,lagr=2;
  953. fdomain y=y(x,t),q=q(x),j=j(x);
  954. factor ^;
  955. lagr := 1/2*(rho*q*@(y,t)**2 - e*j*@(y,x,x)**2)*d x^d t;
  956. vardf(lagr,y);
  957. % The Lagrangian does not explicitly depend on time; therefore the
  958. % vector field @ t generates a symmetry. The conserved current is
  959. pform c=1;
  960. factor d;
  961. c := noether(lagr,y,@ t);
  962. % The exterior derivative of this must be zero or a multiple of the
  963. % equation of motion (weak conservation law) to be a conserved current.
  964. remfac d;
  965. d c;
  966. % i.e. it is a multiple of the equation of motion.
  967. clear lagr,c,j,y,q;
  968. remfdomain y,q,j;
  969. % Problem:
  970. % --------
  971. % Show that the metric structure given by Eguchi and Hanson induces a
  972. % self-dual curvature.
  973. % c.f. T. Eguchi, P.B. Gilkey, A.J. Hanson, "Gravitation, Gauge Theories
  974. % and Differential Geometry", Physics Reports 66, 213, 1980
  975. for all x let cos(x)**2=1-sin(x)**2;
  976. pform f=0,g=0;
  977. fdomain f=f(r), g=g(r);
  978. coframe o(r) = f*d r,
  979. o(theta) = (r/2)*(sin(psi)*d theta - sin(theta)*cos(psi)*d phi),
  980. o(phi) = (r/2)*(-cos(psi)*d theta - sin(theta)*sin(psi)*d phi),
  981. o(psi) = (r/2)*g*(d psi + cos(theta)*d phi);
  982. frame e;
  983. pform gamma(a,b)=1,curv2(a,b)=2;
  984. index_symmetries gamma(a,b),curv2(a,b): antisymmetric;
  985. factor o;
  986. gamma(-a,-b) := -(1/2)*( e(-a) _| (e(-c) _| (d o(-b)))
  987. -e(-b) _| (e(-a) _| (d o(-c)))
  988. +e(-c) _| (e(-b) _| (d o(-a))) )*o(c)$
  989. curv2(-a,b) := d gamma(-a,b) + gamma(-c,b)^gamma(-a,c)$
  990. let f=1/g,g=sqrt(1-(a/r)**4);
  991. pform chck(k,l)=2;
  992. index_symmetries chck(k,l): antisymmetric;
  993. % The following has to be zero for a self-dual curvature.
  994. chck(k,l) := 1/2*eps(k,l,m,n)*curv2(-m,-n) + curv2(k,l);
  995. clear gamma(a,b),curv2(a,b),f,g,chck(a,b),o(k),e(k),r,phi,psi;
  996. remfdomain f,g;
  997. % Example: 6-dimensional FRW model with quadratic curvature terms in
  998. % -------
  999. % the Lagrangian (Lanczos and Gauss-Bonnet terms).
  1000. % cf. Henriques, Nuclear Physics, B277, 621 (1986)
  1001. for all x let cos(x)**2+sin(x)**2=1;
  1002. pform {r,s}=0;
  1003. fdomain r=r(t),s=s(t);
  1004. coframe o(t) = d t,
  1005. o(1) = r*d u/(1 + k*(u**2)/4),
  1006. o(2) = r*u*d theta/(1 + k*(u**2)/4),
  1007. o(3) = r*u*sin(theta)*d phi/(1 + k*(u**2)/4),
  1008. o(4) = s*d v1,
  1009. o(5) = s*sin(v1)*d v2
  1010. with metric g =-o(t)*o(t)+o(1)*o(1)+o(2)*o(2)+o(3)*o(3)
  1011. +o(4)*o(4)+o(5)*o(5);
  1012. frame e;
  1013. on nero; factor o,^;
  1014. riemannconx om;
  1015. pform curv(k,l)=2,{riemann(a,b,c,d),ricci(a,b),riccisc}=0;
  1016. index_symmetries curv(k,l): antisymmetric,
  1017. riemann(k,l,m,n): antisymmetric in {k,l},{m,n}
  1018. symmetric in {{k,l},{m,n}},
  1019. ricci(k,l): symmetric;
  1020. curv(k,l) := d om(k,l) + om(k,-m)^om(m,l);
  1021. riemann(a,b,c,d) := e(d) _| (e (c) _| curv(a,b));
  1022. % The rest is done in the Ricci calculus language,
  1023. ricci(-a,-b) := riemann(c,-a,-d,-b)*g(-c,d);
  1024. riccisc := ricci(-a,-b)*g(a,b);
  1025. pform {laglanc,inv1,inv2} = 0;
  1026. index_symmetries riemc3(k,l),riemri(k,l),
  1027. hlang(k,l),einst(k,l): symmetric;
  1028. pform {riemc3(i,j),riemri(i,j)}=0;
  1029. riemc3(-i,-j) := riemann(-i,-k,-l,-m)*riemann(-j,k,l,m)$
  1030. inv1 := riemc3(-i,-j)*g(i,j);
  1031. riemri(-i,-j) := 2*riemann(-i,-k,-j,-l)*ricci(k,l)$
  1032. inv2 := ricci(-a,-b)*ricci(a,b);
  1033. laglanc := (1/2)*(inv1 - 4*inv2 + riccisc**2);
  1034. pform {einst(a,b),hlang(a,b)}=0;
  1035. hlang(-i,-j) := 2*(riemc3(-i,-j) - riemri(-i,-j) -
  1036. 2*ricci(-i,-k)*ricci(-j,K) +
  1037. riccisc*ricci(-i,-j) - (1/2)*laglanc*g(-i,-j));
  1038. % The complete Einstein tensor:
  1039. einst(-i,-j) := (ricci(-i,-j) - (1/2)*riccisc*g(-i,-j))*alp1 +
  1040. hlang(-i,-j)*alp2$
  1041. alp1 := 1$
  1042. factor alp2;
  1043. einst(-i,-j) := einst(-i,-j);
  1044. clear o(k),e(k),riemc3(i,j),riemri(i,j),curv(k,l),riemann(a,b,c,d),
  1045. ricci(a,b),riccisc,t,u,v1,v2,theta,phi,r,om(k,l),einst(a,b),
  1046. hlang(a,b);
  1047. remfdomain r,s;
  1048. % Problem:
  1049. % --------
  1050. % Calculate for a given coframe and given torsion the Riemannian part and
  1051. % the torsion induced part of the connection. Calculate the curvature.
  1052. % For a more elaborate example see E.Schruefer, F.W. Hehl, J.D. McCrea,
  1053. % "Application of the REDUCE package EXCALC to the Poincare gauge field
  1054. % theory of gravity", GRG Journal, vol. 19, (1988) 197--218
  1055. pform {ff, gg}=0;
  1056. fdomain ff=ff(r), gg=gg(r);
  1057. coframe o(4) = d u + 2*b0*cos(theta)*d phi,
  1058. o(1) = ff*(d u + 2*b0*cos(theta)*d phi) + d r,
  1059. o(2) = gg*d theta,
  1060. o(3) = gg*sin(theta)*d phi
  1061. with metric g = -o(4)*o(1)-o(4)*o(1)+o(2)*o(2)+o(3)*o(3);
  1062. frame e;
  1063. pform {tor(a),gwt(a)}=2,gamma(a,b)=1,
  1064. {u1,u3,u5}=0;
  1065. index_symmetries gamma(a,b): antisymmetric;
  1066. fdomain u1=u1(r),u3=u3(r),u5=u5(r);
  1067. tor(4) := 0$
  1068. tor(1) := -u5*o(4)^o(1) - 2*u3*o(2)^o(3)$
  1069. tor(2) := u1*o(4)^o(2) + u3*o(4)^o(3)$
  1070. tor(3) := u1*o(4)^o(3) - u3*o(4)^o(2)$
  1071. gwt(-a) := d o(-a) - tor(-a)$
  1072. % The following is the combined connection.
  1073. % The Riemannian part could have equally well been calculated by the
  1074. % RIEMANNCONX statement.
  1075. gamma(-a,-b) := (1/2)*( e(-b) _| (e(-c) _| gwt(-a))
  1076. +e(-c) _| (e(-a) _| gwt(-b))
  1077. -e(-a) _| (e(-b) _| gwt(-c)) )*o(c);
  1078. pform curv(a,b)=2;
  1079. index_symmetries curv(a,b): antisymmetric;
  1080. factor ^;
  1081. curv(-a,b) := d gamma(-a,b) + gamma(-c,b)^gamma(-a,c);
  1082. clear o(k),e(k),curv(a,b),gamma(a,b),theta,phi,x,y,z,r,s,t,u,v,p,q,c,cs;
  1083. remfdomain u1,u3,u5,ff,gg;
  1084. showtime;
  1085. end;
  1086. \end{verbatim}
  1087. }
  1088. \end{document}