cantens.tex 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602
  1. %% ----------------------------CANTENS.TEX---------------------------------
  2. %
  3. % This is a LaTeX 2.09 file.
  4. % To process it do:
  5. % latex cantens
  6. % latex cantens
  7. % latex cantens
  8. % makeindex cantens
  9. % latex cantens
  10. %%
  11. \documentstyle[reduce, art11,makeidx]{article} % Specifies the document style.
  12. \setlength{\parindent}{.5cm} % Fixes the indentation of the \par command.
  13. \setlength{\parskip}{2mm} % Fixes the skip of the \par command.
  14. \renewcommand {\textwidth}{12cm} % Changes the width of the text.
  15. \renewcommand {\textheight}{18cm} % Changes the height of the text.
  16. %\renewcommand{\arraystretch}{1}
  17. \baselineskip 10pt
  18. %\footnotesep1cm
  19. %\hoffset -0.9cm
  20. \voffset -1.0cm
  21. \headsep10mm
  22. \newcommand{\nl}{\hfill\newline} % Convenient to write arbitrary
  23. % stretched lines.
  24. % May be put after the begin document.
  25. \newcommand{\none}{\nonumber \\}
  26. \newcommand{\be}{\begin{equation}}
  27. \newcommand{\ee}{\end{equation}}
  28. \newcommand{\bea}{\begin{eqnarray}}
  29. \newcommand{\eea}{\end{eqnarray}}
  30. \newcommand{\bver}{\begin{verbatim}}
  31. \newcommand{\ever}{\end{verbatim}}
  32. \newcommand{\beas}{\begin{eqnarray*}}
  33. \newcommand{\eeas}{\end{eqnarray*}}
  34. \newcommand{\qd}{\dot q}
  35. \newcommand{\pp}{\dot p}
  36. \newcommand{\ghp}{{\cal P}}
  37. \newcommand{\bq}{\begin{quotation}}
  38. \newcommand{\eq}{\end{quotation}}
  39. \newcommand{\bi}{\begin{itemize}}
  40. \newcommand{\ei}{\end{itemize}}
  41. %\newcommand{\tit}[1]{{\bf\underline{#1}}~:\hfill\\[5pt]}
  42. \newcommand{\tit}[1]{{\bf #1} \hfill\\[10pt]}
  43. %\newcommand{\f}[1] {{\tt #1}}
  44. \newcommand{\underidx}[2]%
  45. {\renewcommand{\arraystretch}{.5}
  46. \begin{array}[t]{c}
  47. #1 \\
  48. {\scriptstyle #2}
  49. \end{array}
  50. \renewcommand{\arraystretch}{1}}
  51. \newcounter{letter}
  52. \def\theequation{\thesubsection\ \arabic{equation}}
  53. \setcounter{equation}{0}
  54. \newcommand{\eqletter}{\hfill (\theequation\alph{letter}) }
  55. \newcommand{\eql}{\nonumber &\eqletter \cr
  56. \addtocounter{letter}{1}}
  57. \newcommand{\beal}{\setcounter{letter}{1} \begin{eqnarray}}
  58. \newcommand{\eeal}{\addtocounter{equation}{1}
  59. \end{eqnarray}}
  60. \renewcommand{\ttindex}[1]{{\renewcommand{\_}{\protect\underscore}%
  61. \index{#1@{\tt #1}}}}
  62. \tolerance=1000
  63. \makeindex
  64. \begin{document}
  65. \thispagestyle{empty}
  66. \title{{\tt CANTENS}\\
  67. A Package for Manipulations \\
  68. and Simplifications of Indexed Objects}
  69. \date{}
  70. \author{H. Caprasse\\
  71. Institut de Physique \\
  72. Sart-Tilman, B-4000 LIEGE\\
  73. email: {\tt hubert.caprasse@ulg.ac.be}
  74. }
  75. \maketitle
  76. \section{Introduction}
  77. {\tt CANTENS} \ttindex{CANTENS} is a package that creates an environment
  78. inside {\tt REDUCE}\ttindex{REDUCE}
  79. which allows the user to
  80. manipulate and simplify expressions containing various indexed objects
  81. like tensors, spinors, fields and quantum fields.
  82. Briefly said, it allows him
  83. \begin{itemize}
  84. \item[-] to define generic indexed quantities which can eventually depend
  85. implicitly or explicitly on any number of variables;
  86. \item[-] to define one or several affine or metric (sub-)spaces, and to work
  87. within them without difficulty;
  88. \item[-] to handle dummy indices and simplify adequatly expressions
  89. which contain them.
  90. \end{itemize}
  91. Beside the above features, it offers the user:
  92. \begin{enumerate}
  93. \item Several invariant
  94. elementary tensors which are always used in the applications involving
  95. the use of indexed objects like {\tt delta, epsilon, eta} and the
  96. generalized delta function.
  97. \item The possibility to define any metric and to make it bloc-diagonal
  98. if he wishes to.
  99. \item The capability to symmetrize or antisymmetrize any expression.
  100. \item The possibility to introduce any kind of symmetry (even partial symmetries)
  101. for the indexed objects.
  102. \item The choice to work with commutative, non-commutative or anticommutative
  103. indexed objects.
  104. \end{enumerate}
  105. In this package, one cannot find algorithms or even specific objects
  106. (i.e. like the covariant derivative or the SU(3) group structure constants)
  107. which are of
  108. used either in nuclear and particle physics.
  109. The objective of the package is simply to allow
  110. the user to easily formulate {\em his algorithms} in the {\em notations he likes
  111. most}.
  112. %\newpage
  113. The package is also conceived so as to minimize the number of new commands.
  114. However, the large number of new capabilities inherently implies that quite
  115. a substantial number of new functions and commands must be used. On the other
  116. hand, in order to avoid too many error or warning messages the package
  117. assumes, in many cases, that the user is reponsible of the consistency of its
  118. inputs.
  119. The author is aware that the package is still perfectible and
  120. he will be grateful to all people who shall spare some time to communicate
  121. bugs or suggest improvements.
  122. The documentation below is separated into four sections.
  123. In the first one, the space(s) properties and definitions are described.
  124. In the second one, the commands to geberate and handle
  125. generic indexed quantities (called abusively tensors) are illustrated.
  126. The manipulation and control of free and dummy indices is discussed.
  127. In the third one, the special tensors are introduced and their properties
  128. discussed especially with respect to their ability to work simultaneously within
  129. several subspaces.
  130. The last section, which is also the most important, is devoted entirely to
  131. the simplification function \index{CANONICAL} CANONICAL. This function
  132. originates from the package {\tt DUMMY} \ttindex{ DUMMY} and has been
  133. substantially extended . It takes account of
  134. all symmetries, make dummy summations and seeks a ``canonical''
  135. form for any tensorial expression. Without it, the present
  136. package would be much less useful.
  137. Finally, an {\bf index} has been created. It contains numerous references
  138. to the text. Different typings have been adopted to make a clear
  139. distinction between them. The conventions are the following:
  140. \begin{itemize}
  141. \item Procedure keywords are typed in capital roman letters.
  142. \item Package keywords are typed in typewriter capital letters.
  143. \item Cantens package keywords are in small typewriter letters.
  144. \item All other keywords are typed in small roman letters.
  145. \end{itemize}
  146. When {\tt CANTENS} \ttindex{CANTENS} is loaded, the packages
  147. {\tt ASSIST} \ttindex{ASSIST} and {\tt DUMMY}\ttindex{DUMMY} are also
  148. loaded.
  149. \section{Handling of space(s)}
  150. \index{space}
  151. One can work either in a {\em single} space environment or in
  152. a multiple space environment. After the package is loaded,
  153. the single space environment is set and
  154. a unique space is defined. It is euclidian, and has a symbolic
  155. dimension equal to {\tt dim}.
  156. The single space environment is determined by the switch
  157. ONESPACE\index{ONESPACE} which is turned on.
  158. One can verify the above assertions as follows \index{WHOLESPACE\_DIM}:
  159. \begin{verbatim}
  160. onespace ?; => yes
  161. wholespace_dim ?; => dim
  162. signature ?; => 0
  163. \end{verbatim}
  164. One can introduce a pseudoeuclidian metric for the above space by the
  165. command SIGNATURE \index{signature} and verify that the signature is indeed~1:
  166. \begin{verbatim}
  167. signature 1;
  168. signature ?; => 1
  169. \end{verbatim}
  170. In principle the signature may be set to any positive
  171. integer. However, presently,
  172. the package cannot handle signatures larger than 1.
  173. One gets the Minkowski-like space metric\index{Minkowski}
  174. $$
  175. \left(\begin{array}{cccc}
  176. 1 & 0 & 0 & 0 \\
  177. 0 & -1 & 0 & 0 \\
  178. 0 & 0 & -1 & 0 \\
  179. 0 & 0 & 0 & -1
  180. \end{array}
  181. \right)
  182. $$
  183. which corresponds to the convention of high energy physicists.
  184. It is possible to change it into the astrophysicists convention using
  185. the command GLOBAL\_SIGN \index{GLOBAL\_SIGN}:
  186. \begin{verbatim}
  187. global_sign ?; => 1
  188. global_sign (-1);
  189. global_sign ?; => -1
  190. \end{verbatim}
  191. This means that the actual metric is now $(-1,1,1,1)$.
  192. The space dimension may, of course, be assigned at will using the function
  193. \index{WHOLESPACE\_DIM} WHOLESPACE\_DIM. Below, it is assigned to 4:
  194. \begin{verbatim}
  195. wholespace_dim 4; ==> 4
  196. \end{verbatim}
  197. When the switch \index{ONESPACE}ONESPACE is turned off, the system {\em assumes} that this default
  198. space is non-existent and, therefore, that the user is going to define the
  199. space(s) in which he wants to work.
  200. Unexpected error messages will occur if it is not done.
  201. Once the switch is turned off many more functions become active. A few of them are
  202. available in the algebraic mode to allow the user to properly conctruct
  203. and control the properties of the various (sub-)spaces he is going to define
  204. and, also, to assign symbolic indices to some of them.
  205. \index{DEFINE\_SPACES}DEFINE\_SPACES is the space constructor and
  206. \ttindex{wholespace}{\bf wholespace}
  207. is a reserved identifier which is meant to be the name of the global space
  208. if subspaces are introduced.
  209. Suppose we want to define a unique space, we can choose for its any name but
  210. choosing {\bf wholespace} will be more efficient. On the other hand, it leaves
  211. open the possibility to introduce subspaces in a more transparent way.
  212. So one writes, for instance,:
  213. \ttindex{signature}\ttindex{indexrange}
  214. \begin{verbatim}
  215. define_spaces wholespace=
  216. {6,signature=1,indexrange=0 .. 5}; ==>t
  217. \end{verbatim}
  218. The arguments inside the list, assign respectively the dimension, the signature
  219. and the range of the numeric indices which is allowed.
  220. Notice that the range starts from 0 and not from 1. This is made to conform with
  221. the usual convention for spaces of signature equal to 1. However, this is not
  222. compulsory.
  223. Notice that the declaration of the indexrange may be omitted if this is the
  224. only defined space.
  225. There are two other options which may replace the signature option.
  226. They are \ttindex{euclidian}{\bf euclidian} and \ttindex{affine}{\bf affine} they
  227. have both an obvious significance.
  228. In the subsequent example, an eleven dimension global space is defined
  229. and two subspaces of this space are specified.
  230. Notice that no indexrange has been declared for the entire space.
  231. However, the indexrange declaration is compulsory for subspaces otherwise
  232. the package will improperly work when dealing with numeric indices.
  233. \begin{verbatim}
  234. define_spaces wholespace={11,signature=1}; ==> t
  235. define_spaces mink=
  236. {4,signature=1,indexrange=0 .. 3}; ==> t
  237. define_spaces eucl=
  238. {6,euclidian,indexrange=4 .. 9}; ==> t
  239. \end{verbatim}
  240. To remind ones the space context in which one is working, the use of the
  241. function \index{SHOW\_SPACES}SHOW\_SPACES is required. Its output is an
  242. {\em algebraic value} from which the user can retrieve all the informations
  243. displayed. After the declarations above, this function gives:
  244. \begin{verbatim}
  245. show_spaces(); ==>
  246. {{wholespace,11,signature=1}
  247. {mink,4,signature=1,indexrange=0..3},
  248. {eucl,6,euclidian,indexrange=4..9}}
  249. \end{verbatim}
  250. If an input error is made or if one wants to change the space framework, one
  251. cannot directly redefine the relevant space(s). For instance, the input
  252. \begin{verbatim}
  253. define_spaces eucl=
  254. {7,euclidian,indexrange=4 .. 9}; ==>
  255. *** Warning: eucl cannot be (or is already)
  256. defined as space identifier
  257. t
  258. \end{verbatim}
  259. whih aims to fill all dimensions present in {\tt wholespace}
  260. tells that the space {\tt eucl} cannot be redefined. To redefine it effectively,
  261. one is to {\em remove} the existing definition first using the function
  262. \index{REM\_SPACES} REM\_SPACES\ which takes any number of space-names as
  263. its argument. Here is the illustration:
  264. %\end{document}
  265. \begin{verbatim}
  266. rem_spaces eucl; ==> t
  267. show_spaces(); ==>
  268. {{wholespace,11,signature=1},
  269. {mink,4,signature=1,indexrange=0..3}}
  270. define_spaces eucl=
  271. {7,euclidian,indexrange=4 .. 10}; ==> t
  272. show_spaces(); ==>
  273. {{wholespace,11,signature=1},
  274. {mink,4,signature=1,indexrange=0..3},
  275. {eucl,7,euclidian,indexrange=4..10}}
  276. \end{verbatim}
  277. Here, the user is entirely responsible of the coherence of his construction.
  278. The system does NOT verify it but will incorrectly run if there is a mistake
  279. at this level.
  280. When two spaces are direct product of each other (as the color and Minkowski
  281. spaces in quantum chromodynamics), it is not necessary to introduce the
  282. global space {\tt wholespace}\ttindex{wholespace}.
  283. ``Tensors'' and symbolic indices can be declared to belong to a specific space
  284. or subspace. It is in fact an essential ingredient of the package and make it
  285. able to handle expressions which involve quantities belonging to several
  286. (sub-)spaces or to handle bloc-diagonal ``tensors''. This will be discussed in the next section.
  287. Here, we just mention how to declare that some set of symbolic indices belong
  288. to a specific (sub-)space\index{subspaces} or how to declare them to belong
  289. to any space\index{spaces}.
  290. The relevant command is \index{MK\_IDS\_BELONG\_SPACE} MK\_IDS\_BELONG\_SPACE
  291. whose syntax is
  292. \begin{verbatim}
  293. mk_ids_belong_space(<list of indices>,
  294. <space | subspace identifier>)
  295. \end{verbatim}
  296. For example, within the above declared spaces one could write:
  297. \begin{verbatim}
  298. mk_ids_belong_space({a0,a1,a2,a3},mink); ==> t
  299. mk_ids_belong_space({x,y,z,u,v},eucl); ==> t
  300. \end{verbatim}
  301. The command \index{MK\_IDS\_BELONG\_ANYSPACE} MK\_IDS\_BELONG\_ANYSPACE
  302. allows to remake them usable either in {\tt wholespace}\ttindex{wholespace}
  303. if it is defined or in anyone among the defined spaces.
  304. For instance, the declaration:
  305. \begin{verbatim}
  306. mk_ids_belong_anyspace a1,a2; ==> t
  307. \end{verbatim}
  308. tells that a1 and a2 belong either to {\tt mink} or to {\tt eucl} or
  309. to {\tt wholespace}.
  310. \section{Generic tensors and their manipulation}
  311. \index{generic tensor}
  312. \subsection{Definition}
  313. The generic tensors handled by {\tt CANTENS}\ttindex{CANTENS} are objects
  314. much more general than usual tensors. The reason is that they are not supposed to
  315. obey well defined transformation properties under a change of coordinates.
  316. They are only indexed quantities. The indices are either
  317. contravariantly (upper indices) or covariantly (lower indices) placed.
  318. They can be symbolic or numeric. When a given index is found both
  319. in one upper and in one lower place, it is supposed to be summed over
  320. all space-coordinates it belongs to viz. it is a {\em dummy}\index{dummy}
  321. index
  322. and {\em automatically recognized} as such.
  323. So they are supposed to obey the summation rules of tensor calculus.
  324. This why and only why they are called tensors. Moreover, aside from
  325. indices they may also depend implicitly or explicitly on any number of
  326. {\em variables}\index{variables}. Within this definition,
  327. tensors may also be spinors, they can be non-commutative or anticommutative,
  328. they may also be algebra generators and represent fields or quantum fields.
  329. \subsection{Implications of \index{TENSOR}TENSOR\ declaration}
  330. The procedure TENSOR which takes an arbitrary number of identifiers as argument
  331. defines them as operator-like objects which admit an arbitrary number of indices.
  332. Each component has a formal character and may or may not belong to a
  333. specific (sub-)space. Numeric indices are also allowed. The way to distinguish
  334. upper and lower indices is the same as the one in the package
  335. \ttindex{EXCALC}{\tt EXCALC} e.g. $-a$ is a lower index and $a$ is an
  336. upper index.
  337. A special printing function has been created so as to mimic as much as possible
  338. the way of writing such objects on a sheet of paper.
  339. Let us illustrate the use of \index{TENSOR} TENSOR:
  340. \begin{verbatim}
  341. tensor te; ==> t
  342. te(3,a,-4,b,-c,7); ==>
  343. 3 a b 7
  344. te
  345. 4 c
  346. te(3,a,{x,y},-4,b,-c,7); ==>
  347. 3 a b 7
  348. te (x,y)
  349. 4 c
  350. te(3,a,-4,b,{u,v},-c,7); ==>
  351. 3 a b 7
  352. te (u,v)
  353. 4 c
  354. te({x,y}); ==> te(x,y)
  355. \end{verbatim}
  356. Notice that the system distinguishes indices from variables on input
  357. solely on the basis that the user puts variables {\em inside a list}.
  358. The dependence can also be declared implicit through the \REDUCE\ command
  359. \index{DEPEND}DEPEND which is generalized so as to allow to declare a tensor
  360. to depend on another tensor irrespective of its components. It means that only {\em one}
  361. declaration is enough to express the dependence with respect to
  362. {\em all its components}.
  363. A simple example:
  364. \index{DF}
  365. \begin{verbatim}
  366. tensor te,x;
  367. depend te,x;
  368. df(te(a,-b),x(c)); ==>
  369. a c
  370. df(te ,x )
  371. b
  372. \end{verbatim}
  373. Therefore, when {\em all} objects are tensors, the dependence declaration
  374. is valid for all indices.
  375. One can also avoid the trouble to place the explicit variables inside a list if
  376. one declare them as variables through the command \index{MAKE\_VARIABLES}
  377. MAKE\_VARIABLES.
  378. This property can also be removed%
  379. \footnote{One important feature of this package is its {\em reversibility}
  380. viz. it gives the user the means to erase its previous operations
  381. at any time. So, most functions described below do
  382. possess ``removing'' action companions.} using
  383. \index{REMOVE\_VARIABLES}REMOVE\_VARIABLES:
  384. \begin{verbatim}
  385. make_variables x,y; ==> t
  386. te(x,y); ==> te(x,y)
  387. te(x,y,a); ==>
  388. a
  389. te (x,y)
  390. remove_variables x; ==> t
  391. te(x,y,a); ==>
  392. x a
  393. te (y)
  394. \end{verbatim}
  395. If one does that one must be careful not to substitute a number to such
  396. declared variables because this number would be considered as an index and
  397. no longer as a variable. So it is only useful for {\em formal} variables%
  398. \index{variables}.
  399. A tensor can be easily eliminated using the function
  400. \index{REM\_TENSOR}REM\_TENSOR. It has the syntax
  401. \begin{verbatim}
  402. rem_tensor t1,t2,t3 ....;
  403. \end{verbatim}
  404. \subsubsection{Dummy \index{dummy} indices recognition}
  405. \index{dummy}
  406. For all individual tensors met by the evaluator, the system will analyse
  407. the written indices and will detect those which must be considered dummy
  408. according to the usual rules of tensor calculus. Those indices will be given
  409. the {\tt dummy} property and will no longer be allowed to play the role
  410. of {\em free} indices unless the user removes this dummy property.
  411. In that way, the system checks immediately the consistency of an input.
  412. Three functions are at the disposal of the user to control dummy indices.
  413. They are \index{DUMMY\_INDICES}DUMMY\_INDICES, \index{REM\_DUMMY\_INDICES}
  414. REM\_DUMMY\_INDICES and \index{REM\_DUMMY\_IDS}REM\_DUMMY\_IDS.
  415. The following illustrates their use as well as the behaviour of the
  416. system:
  417. \begin{verbatim}
  418. dummy_indices(); ==> {} % In a fresh environment
  419. te(a,b,-c,-a); ==>
  420. a b
  421. te
  422. c a
  423. dummy_indices(); ==> {a}
  424. te(a,b,-c,a); ==>
  425. ***** ((c)(a b a)) are inconsistent lists of indices
  426. % a cannot be found twice as an upper index
  427. te(a,b,-b,-a); ==>
  428. a b
  429. te
  430. b a
  431. dummy_indices(); ==> {b,a}
  432. te(d,-d,d); ==>
  433. ***** ((d)(d d)) are inconsistent lists of indices
  434. dummy_indices(); ==> {d,b,a}
  435. rem_dummy_ids d; ==> t
  436. dummy_indices(); ==> {b,a}
  437. te(d,d); ==>
  438. d d
  439. te % This is allowed again.
  440. dummy_indices(); ==> {b,a}
  441. rem_dummy_indices(); ==> t
  442. dummy_indices(); ==> {}
  443. \end{verbatim}
  444. Other verifications of coherence are made when space specifications
  445. are introduced both in the ON and OFF onespace environment. We shall
  446. discuss them later\ttindex{onespace OFF}\ttindex{onespace ON}.
  447. \subsubsection{Substitutions, assignements and rewriting rules}
  448. \index{LET}\index{rewriting rules}
  449. The user must be able to manipulate and give specific characteristics
  450. to the generic tensors he has introduced. Since tensors are essentially
  451. \REDUCE\ operators\ttindex{REDUCE}, the usual commands of the system are
  452. available.
  453. However, some limitations are implied by the fact that indices and,
  454. especially numeric indices, must always be properly recognized before
  455. any substitution or manipulation is done. We have gathered below a set of
  456. examples which illustrate all the ``delicate'' points.
  457. First, the substitutions\index{SUB}:
  458. \begin{verbatim}
  459. sub(a=-c,te(a,b)); ==>
  460. b
  461. te
  462. c
  463. sub(a=-1,te(a,b)); ==>
  464. b
  465. te
  466. 1
  467. sub(a=-0,te(a,b)); ==>
  468. 0 b
  469. te % sub has replaced -0 by 0. wrong!
  470. sub(a=-!0,te(a,b)); ==>
  471. b
  472. te % right
  473. 0
  474. \end{verbatim}
  475. The substitution of an index by -0 is the {\em only one} case where
  476. there is a problem. The function SUB replaces -0 by 0 because it does
  477. not recognize 0 as an index of course. Such a recognition is
  478. context dependent and implies a modification of SUB
  479. for this {\em single} exceptional case. Therefore,we have opted, not do do so
  480. and to use the index 0 which is simply !0 instead of 0.
  481. Second, the assignements. Here, we advise the user to rely on the
  482. operator\ttindex{ASSIST}\index{==}$==$%
  483. \footnote{See the {\tt ASSIST} documentation for its description.}
  484. instead of the operator \index{:=}$:=$. Again,
  485. the reason is to avoid the problem raised above in the case of
  486. substitutions. $:=$ does not evaluate its lefthandside so that -0 is
  487. not recognized as an index and simplified to 0 while the $==$ evaluates both
  488. its lefthandside and its righthandside and do recognize it.
  489. The disadvantage of $==$ is that it demands that a second assignement
  490. on a given component
  491. be made only after having suppressed {\em explicitly} the first assignement.
  492. This is done by the function \index{REM\_VALUE\_TENS}REM\_VALUE\_TENS
  493. which can be applied on any component. We stress, however, that if one
  494. is willing to use -!0 instead of -0 as the lower 0 index, the use of $:=$
  495. is perfectly legitimate:
  496. \begin{verbatim}
  497. te({x,y},a,-0)==x*y*te(a,-0); ==>
  498. a
  499. te *x*y
  500. 0
  501. te({x,y},a,-0); ==>
  502. a
  503. te *x*y
  504. 0
  505. te({x,y},a,0); ==>
  506. a 0
  507. te (x,y)
  508. te({x,y},a,-0)==x*y*te(a,-0); ==>
  509. a
  510. ***** te *x*y invalid as setvalue kernel
  511. 0
  512. rem_value_tens te({x,y},a,-0);
  513. te({x,y},a,-0); ==>
  514. a
  515. te (x,y)
  516. 0
  517. te({x,y},a,-0)==(x+y)*te(a,-0); ==>
  518. a
  519. te *(x + y)
  520. 0
  521. \end{verbatim}
  522. In the elementary application below, the use of a tensor avoids the
  523. introduction of two different operators and makes the
  524. calculation more readable.
  525. \begin{verbatim}
  526. te(1)==sin th * cos phi; ==> cos(phi)*sin(th)
  527. te(-1)==sin th * cos phi; ==> cos(phi)*sin(th)
  528. te(2)==sin th * sin phi; ==> sin(phi)*sin(th)
  529. te(-2)==sin th * sin phi; ==> sin(phi)*sin(th)
  530. te(3)==cos th ; ==> cos(th)
  531. te(-3)==cos th ; ==> cos(th)
  532. for i:=1:3 sum te(i)*te(-i); ==>
  533. 2 2 2 2 2
  534. cos(phi) *sin(th) + cos(th) + sin(phi) *sin(th)
  535. rem_value_tens te;
  536. te(2); ==>
  537. 2
  538. te
  539. \end{verbatim}
  540. There is no difference in the manipulation of numeric indices and numeric
  541. {\em tensor} indices. The function \index{REM\_VALUE\_TENS}REM\_VALUE\_TENS
  542. when applied to a tensor prefix suppresses the value of
  543. {\em all its components}. Finally, there is no ``interference'' with
  544. i as a dummy index and i as a numeric index in a loop.
  545. Third, rewriting rules. They are either global or local and
  546. can be used as in \REDUCE\ttindex{REDUCE}.
  547. Again, here, the -0 index problem exists each time a substitution
  548. by the index -0 must be made in a template.
  549. \index{FOR ALL ... LET}
  550. \begin{verbatim}
  551. % LET:
  552. let te({x,y},-0)=x*y;
  553. te({x,y},-0); ==> x*y
  554. te({x,y},+0); ==>
  555. 0
  556. te (x,y)
  557. te({x,u},-0); ==>
  558. te (x,u)
  559. 0
  560. % FOR ALL .. LET:
  561. for all x,a let te({x},a,-b)=x*te(a,-b);
  562. te({u},1,-b); ==>
  563. 1
  564. te *u
  565. b
  566. te({u},c,-b); ==>
  567. c
  568. te *u
  569. b
  570. te({u},b,-b); ==>
  571. b
  572. te *u
  573. b
  574. te({u},a,-a); ==>
  575. a
  576. te (u)
  577. a
  578. for all x,a clear te({x},a,-b);
  579. te({u},c,-b); ==>
  580. c
  581. te (u)
  582. b
  583. for all a,b let te({x},a,-b)=x*te(a,-b);
  584. te({x},c,-b); ==>
  585. c
  586. te *x
  587. b
  588. te({x},a,-a); ==>
  589. a
  590. te *x
  591. a
  592. % The index -0 problem:
  593. te({x},a,-0); ==> % -0 becomes +0 in the template
  594. a
  595. te (x) % the rule does not apply.
  596. 0
  597. te({x},0,-!0); ==>
  598. 0
  599. te *x % here it applies.
  600. 0
  601. \end{verbatim}
  602. \begin{verbatim}
  603. % WHERE:
  604. rul:={te(~a) => sin a}; ==>
  605. a
  606. rul := {te => sin(a)}
  607. te(1) where rul; ==> sin(1)
  608. te(1); ==>
  609. 1
  610. te
  611. \end{verbatim}
  612. \index{variables}
  613. \begin{verbatim}
  614. % with variables:
  615. rul1:={te(~a,{~x,~y}) => x*y*sin(a)}; ==>
  616. ~a
  617. rul1 := {te (~x,~y) => x*y*sin(a)}
  618. te(a,{x,y}) where rul1; ==> sin(a)*x*y
  619. te({x,y},a) where rul1; ==> sin(a)*x*y
  620. rul2:={te(-~a,{~x,~y}) => x*y*sin(-a)};
  621. rul2 := {te (~x,~y) => x*y*sin(-a)}
  622. ~a
  623. te(-a,{x,y}) where rul2; ==> -sin(a)*x*y
  624. te({x,y},-a) where rul2; ==> -sin(a)*x*y
  625. \end{verbatim}
  626. Notice that the position of the list of variables inside the rule
  627. may be chosen at will. It is an irrelevant feature of the template.
  628. This may be confusing, so, we advise to write the rules not as
  629. above but placing the list of variables {\em in front of all indices}
  630. since it is in that canonical form which it is written by the simplification
  631. function of individual tensors.
  632. \subsection{Behaviour under space specifications}
  633. \index{spaces}
  634. The characteristics and the behaviour of generic tensors described up to now
  635. are independent of all space specifications. They are complete as long as
  636. we confine to the default space which is active when starting {\tt CANTENS}.
  637. However, as soon as some space specification is introduced, it has some
  638. consequences one the generic tensor properties. This is true both when
  639. \index{ONESPACE}ONESPACE is switched ON or OFF. Here we shall describe
  640. how to deal with these features.
  641. When onespace is ON, if the space dimension is set to an integer, numeric
  642. indices of any generic tensors are forced to be less or equal that integer
  643. if the signature is 0 or less than that integer if the signature is equal to 1.
  644. The following illustrates what happens.
  645. \ttindex{onespace ON}
  646. \begin{verbatim}
  647. on onespace;
  648. wholespace_dim 4; ==> 4
  649. signature 0; ==> 0
  650. te(3,a,-b,7); ==> ***** numeric indices out of range
  651. te(3,a,-b,3); ==>
  652. 3 a 3
  653. te
  654. b
  655. te(4,a,-b,4); ==>
  656. 4 a 4
  657. te
  658. b
  659. sub(a=5,te(3,a,-b,3));
  660. ==> ***** numeric indices out of range
  661. signature 1; ==> 1
  662. % Now indices range from 0 to 3:
  663. te(4,a,-b,4);
  664. ==> ***** numeric indices out of range
  665. te(0,a,-b,3); ==>
  666. 0 a 3
  667. te
  668. b
  669. \end{verbatim}
  670. When onespace is OFF\ttindex{onespace OFF}, many more possibilities to control the input or to
  671. give specific properties to tensors are open.
  672. For instance, it is possible to declare that a tensor belongs
  673. to one of them. It is also possible to declare that some indices
  674. belongs to one of them. It is even possible to do that
  675. for {\em numeric} indices thanks to the declaration
  676. \ttindex{indexrange}indexrange
  677. included optionally in the space definition generated by
  678. \index{DEFINE\_SPACES}DEFINE\_SPACES.
  679. First, when onespace is OFF, the run equivalent to the previous one is
  680. like the following:
  681. \index{DEFINE\_SPACES}\index{SHOW\_SPACES}\index{MAKE\_TENSOR\_BELONG\_SPACE}
  682. \index{REM\_SPACES}
  683. \begin{verbatim}
  684. off onespace;
  685. define_spaces wholespace={6,signature=1); ==> t
  686. show_spaces(); ==> {{wholespace,6,signature=1}}
  687. make_tensor_belong_space(te,wholespace);
  688. ==> wholespace
  689. te(4,a,-b,6); ==>
  690. ***** numeric indices out of range
  691. te(4,a,-b,5); ==>
  692. 4 a 5
  693. te
  694. b
  695. rem_spaces wholespace;
  696. define_spaces wholespace={4,euclidean}; ==> t
  697. te(a,5,-b); ==> ***** numeric indices out of range
  698. te(a,4,-b); ==>
  699. a 4
  700. te
  701. b
  702. define_spaces eucl={1,signature=0}; ==> t
  703. show_spaces(); ==>
  704. {{wholespace,5,signature=1},
  705. {eucl,1,signature=0}}
  706. make_tensor_belong_space(te,eucl); ==> eucl
  707. te(1); ==>
  708. 1
  709. te
  710. te(2); ==> ***** numeric indices out of range
  711. te(0); ==>
  712. 0
  713. te
  714. \end{verbatim}
  715. In the run, the new function \index{MAKE\_TENSOR\_BELONG\_SPACE}
  716. MAKE\_TENSOR\_BELONG\_SPACE
  717. has been used.
  718. One may be surprised that {\tt te(0)} is allowed in the end of
  719. the previous run and, indeed,
  720. it is incorrect that the system allows {\em two} different components to
  721. {\tt te}.
  722. This is due to an incomplete definition of the space. When one deals
  723. with spaces of integer dimensions, if one wants to control numeric indices
  724. correctly {\em when} onespace is switched off {\em one must also give the
  725. indexrange}\ttindex{indexrange}.
  726. So the previous run must be corrected to
  727. \begin{verbatim}
  728. define_spaces eucl=
  729. {1,signature=0,indexrange=1 .. 1}; ==> t
  730. make_tensor_belong_space(te,eucl); ==> eucl
  731. te(0); ==>
  732. ***** numeric indices do not belong to (sub)-space
  733. te(1); ==>
  734. 1
  735. te
  736. te(2); ==>
  737. ***** numeric indices do not belong to (sub)-space
  738. \end{verbatim}
  739. Notice that the error message has also changed accordingly.
  740. So, now one can even constrain the 0 component to belong to
  741. an euclidian space.
  742. Let us go back to symbolic indices\index{symbolic indices}.
  743. By default, any symbolic index belongs to the global space or to all
  744. defined partial spaces. In many cases, this is, of course, not consistent.
  745. So, the possibility exists to declare that one or several indices
  746. belong to a specific (sub-)space. To this end, one is to use the
  747. function \index{MK\_IDS\_BELONG\_SPACE}MK\_IDS\_BELONG\_SPACE.
  748. Its syntax is
  749. \begin{verbatim}
  750. mk_ids_belong_space(<list of indices>,
  751. <(sub-)space identifier>)
  752. \end{verbatim}
  753. The function \index{MK\_IDS\_BELONG\_ANYSPACE}MK\_IDS\_BELONG\_ANYSPACE
  754. whose syntax is the same do the reverse operation.
  755. Combined with the declaration \index{MAKE\_TENSOR\_BELONG\_SPACE}
  756. MAKE\_TENSOR\_BELONG\_SPACE, it allows to express all problems
  757. which involve tensors belonging to different spaces and do the dummy
  758. summations correctly.
  759. One can also define a tensor which has a \index{bloc-diagonal}
  760. ``bloc-diagonal'' structure.
  761. All these features are illustrated in the next sections which describe specific
  762. tensors and the properties of the extended function \index{CANONICAL}CANONICAL.
  763. \section{Specific tensors}
  764. The means provided in the two previous section to handle generic tensors
  765. already allow to construct any specific tensor we may need. That the package contains
  766. a certain number of them is already justified on the level of conviviality.
  767. However, a more important justification is that some basic tensors are so
  768. universaly and frequently used that a careful programming of these improves
  769. considerably the robustness and the efficiency of most calculations.
  770. The choice of the set of specific tensors is not clearcut. We have tried
  771. to keep their number to a minimum but, experience, may lead us extend it
  772. without dificulty. So, up to now, the list of specific tensors is:
  773. \begin{list}{-}{\parsep 0in \itemsep 1pt}
  774. \item {\tt delta} tensor\ttindex{delta},
  775. \item {\tt eta} Minkowski tensor\index{Minkowski}\ttindex{eta},
  776. \item {\tt epsilon} tensor,\ttindex{epsilon}
  777. \item {\tt del} generalised delta tensor,\ttindex{del}
  778. \item {\tt metric} generic tensor metric.\ttindex{metric}
  779. \end{list}
  780. It is important to realize that the typewriter font names in the list are
  781. {\em keywords} for the corresponding tensors and do not necessarily correspond
  782. to their {\em actual names}.
  783. Indeed, the choice of the names of particular tensors is left to the user.
  784. When startting \ttindex{CANTENS}{\tt CANTENS} specific tensors are NOT
  785. available.
  786. They must be activated by the user using the function
  787. \index{MAKE\_PARTIC\_TENS}MAKE\_PARTIC\_TENS whose syntax is:
  788. \begin{verbatim}
  789. make_partic_tens(<tensor name> , <keyword>);
  790. \end{verbatim}
  791. The name chosen may be the same as the keyword.
  792. As we shall see, it is never needed to define more than one {\tt delta}
  793. tensor but it is often needed to define several {\tt epsilon} tensors.
  794. Hereunder, we describe each of the above tensors especially their
  795. behaviour in a multi-space environment.
  796. \subsection{ DELTA tensor}
  797. \ttindex{delta}
  798. It is the simplest example of a bloc-diagonal\index{bloc-diagonal}
  799. tensor we mentioned in the
  800. previous section. It can also work in a space which is a direct product
  801. of two spaces. Therefore, one never needs to introduce more than one
  802. such tensor. If one is working in a graphic environment, it is advantageous
  803. to choose the keyword as its name. Here we choose {\tt DELT}.
  804. We illustrate how it works when the switch \index{ONESPACE}onespace is
  805. successively switched ON and OFF.
  806. \ttindex{onespace ON}
  807. \begin{verbatim}
  808. on onespace;
  809. make_partic_tens(delt,delta); ==> t
  810. delt(a,b); ==>
  811. ***** bad choice of indices for DELTA tensor
  812. % order of upper and lower indices irrelevant:
  813. delt(a,-b); ==>
  814. a
  815. delt
  816. b
  817. delt(-b,a); ==>
  818. a
  819. delt
  820. b
  821. delt(-a,b); ==>
  822. b
  823. delt
  824. a
  825. wholespace_dim ?; ==> dim
  826. delt(1,-5); ==> 0
  827. % dummy summation done:
  828. delt(-a,a); ==> dim
  829. wholespace_dim 4; ==> 4
  830. delt(1,-5); ==> ***** numeric indices out of range
  831. wholespace_dim 3; ==> 3
  832. delt(-a,a); ==> 3
  833. \end{verbatim}
  834. There is a peculiarity of this tensor, viz. it can serve to represent
  835. the Dirac {\em delta function}\ttindex{delta function}
  836. when it has no indices and an explicit variable dependency as hereunder
  837. \begin{verbatim}
  838. delt({x-y}) ==> delt(x-y)
  839. \end{verbatim}
  840. Next we work in the context of several spaces:
  841. \ttindex{onespace OFF}
  842. \begin{verbatim}
  843. off onespace;
  844. define_spaces wholespace={5,signature=1}; ==> t
  845. % we need to assign delta to wholespace when it exists:
  846. make_tensor_belong_space(delt,wholespace);
  847. delt(a,-a); ==> 5
  848. delt(0,-0); ==>1
  849. rem_spaces wholespace; ==> t
  850. define_spaces wholespace={5,signature=0}; ==> t
  851. delt(a,-a); ==> 5
  852. delt(0,-a); ==>
  853. ***** bad value of indices for DELTA tensor
  854. \end{verbatim}
  855. The checking of consistency of chosen indices is made in the same way as for
  856. generic tensor. In fact, all the previous functions which act on generic tensors
  857. may also affect, in the same way, a specific tensor. For instance, it was
  858. compulsory to explicitly tell that we want {\tt DELT} to belong to the
  859. wholespace \index{MAKE\_TENSOR\_BELONG\_SPACE} overwise,
  860. {\tt DELT} would remain defined on the {\em default space}.
  861. In the next sample run, we display the bloc-diagonal property of
  862. the \ttindex{delta} delta tensor\index{bloc-diagonal}.
  863. \begin{verbatim}
  864. onespace ?; ==> no
  865. rem_spaces wholespace; ==> t
  866. define_spaces wholespace={10,signature=1}$
  867. define_spaces d1={5,euclidian}$
  868. define_spaces d2={2,euclidian}$
  869. mk_ids_belong_space({a},d1); ==> t
  870. mk_ids_belong_space({b},d2); ==> t
  871. % c belongs to wholespace so:
  872. delt(c,-b); ==>
  873. c
  874. delt
  875. b
  876. delt(c,-c); ==> 10
  877. delt(b,-b); ==> 2
  878. delt(a,-a); ==> 5
  879. % this is especially important:
  880. delt(a,-b); ==> 0
  881. \end{verbatim}
  882. The bloc-diagonal property of \ttindex{delta}{\tt delt} is made
  883. active under two conditions. The first is that the system knows
  884. to which space it belongs, the second is that indices must be
  885. declared to belong to a specific space\index{spaces}.
  886. To enforce the same property on a generic tensor, we have to make
  887. the \index{MAKE\_BLOC\_DIAGONAL}MAKE\_BLOC\_DIAGONAL declaration:
  888. \begin{verbatim}
  889. make_bloc_diagonal t1,t2, ...;
  890. \end{verbatim}
  891. and to make it active, one proceeds as in the above run.
  892. Starting from a fresh environment, the following sample run
  893. is illustrative\index{MAKE\_BLOC\_DIAGONAL}:
  894. \begin{verbatim}
  895. off onespace;
  896. define_spaces wholespace={6,signature=1}$
  897. define_spaces mink={4,signature=1,indexrange=0 .. 3}$
  898. define_spaces eucl={3,euclidian,indexrange=4 .. 6}$
  899. tensor te;
  900. make_tensor_belong_space(te,eucl); ==> eucl
  901. % the key declaration:
  902. make_bloc_diagonal te; ==> t
  903. % bloc-diagonal property activation:
  904. mk_ids_belong_space({a,b,c},eucl); ==> t
  905. mk_ids_belong_space({m1,m2},mink); ==> t
  906. te(a,b,m1); ==> 0
  907. te(a,b,m2); ==> 0
  908. % bloc-diagonal property suppression:
  909. mk_ids_belong_anyspace a,b,c,m1,m2; ==> t
  910. te(a,b,m2); ==>
  911. a b m2
  912. te
  913. \end{verbatim}
  914. \subsection{ETA\ Minkowski tensor}
  915. \ttindex{eta}\index{Minkowski}
  916. The use of \index{MAKE\_PARTIC\_TENS}MAKE\_PARTIC\_TENS with the
  917. keyword {\tt eta} allows to create a Minkowski diagonal metric tensor in a
  918. one or multi-space context either with the convention of
  919. high energy physicists or in the convention of astrophysicists.
  920. Any {\tt eta}-like tensor is assumed to work within a space
  921. of signature 1. Therefore, if the space whose metric, it is supposed
  922. to describe has a signature 0, an error message follows if one is
  923. working in an ON onespace \ttindex{onespace ON}\ttindex{onespace OFF}
  924. context and a warning when in an OFF onespace context.
  925. Illustration:
  926. \index{SIGNATURE}
  927. \begin{verbatim}
  928. on onespace;
  929. make_partic_tens(et,eta); ==> t
  930. signature 0; ==> 0;
  931. et(-b,-a); ==>
  932. ***** signature must be equal to 1 for ETA tensor
  933. off onespace;
  934. et(a,b); ==>
  935. *** ETA tensor not properly assigned to a space
  936. % it is then evaluated to zero:
  937. 0
  938. on onespace;
  939. signature 1; ==> 1
  940. et(-b,-a); ==>
  941. et
  942. a b
  943. \end{verbatim}
  944. Since {\tt et(a,-a)} is evaluated to the corresponding {\tt delta} tensor,
  945. one cannot define properly an {\tt eta}\ttindex{eta} tensor without a
  946. simultaneous introduction of a {\tt delta} tensor. Otherwise one gets
  947. the following message:
  948. \begin{verbatim}
  949. et(a,-a); ==> ***** no name found for (delta)
  950. \end{verbatim}
  951. So we need to issue, for instance,
  952. \begin{verbatim}
  953. make_partic_tens(delta,delta); ==> t
  954. \end{verbatim}
  955. The value of its diagonal elements depends on the chosen
  956. {\index{GLOBAL\_SIGN}global sign. The next run illustrates this:
  957. \begin{verbatim}
  958. global_sign ?; ==> 1
  959. et(0,0); ==> 1
  960. et(3,3); ==> - 1
  961. global_sign(-1); ==> -1
  962. et(0,0); ==> - 1
  963. et(3,3); ==> 1
  964. \end{verbatim}
  965. The tensor is of course symmetric \index{symmetric}.
  966. Its indices are checked in the same way as for a generic tensor.
  967. In a multi\_space context\index{spaces}, the {\tt eta} tensor must belong
  968. to a well defined space of \index{signature}signature 1:
  969. \ttindex{onespace OFF}
  970. \begin{verbatim}
  971. off onespace;
  972. define_spaces wholespace={4,signature=1}$
  973. make_tensor_belong_space(et,wholespace)$
  974. et(a,-a); ==> 4
  975. \end{verbatim}
  976. If the space to which {\tt et} belongs to is a subspace\index{subspaces},
  977. one must also
  978. take care to give a space-identity to dummy indices which may appear inside
  979. it. In the following run, the index {\tt a} belongs to {\tt wholespace}
  980. \ttindex{wholespace}if it is not told to the system that it is a dummy
  981. index of the space {\tt mink}:
  982. \begin{verbatim}
  983. make_tensor_belong_anyspace et; ==> t
  984. rem_spaces wholespace; ==> t
  985. define_spaces wholespace={8,signature=1}; ==> t
  986. define_spaces mink={5,signature=1}; ==> t
  987. make_tensor_belong_space(et,mink); ==> mink
  988. % a sits in wholespace:
  989. et(a,-a); ==> 8
  990. mk_ids_belong_space({a},mink); ==> t
  991. % a sits in mink:
  992. et(a,-a); ==> 5
  993. \end{verbatim}
  994. \subsection{EPSILON tensors}
  995. \ttindex{epsilon}
  996. It is an antisymmetric \index{antisymmetric} tensor which
  997. is the invariant tensor for the unitary group transformations in
  998. n-dimensional complex space which are continuously connected to the
  999. identity transformation. The number of their indices are always stricty
  1000. equal to the number of space dimensions.
  1001. So, to each specific space is associated a specific {\tt epsilon} tensor.
  1002. Its properties are also dependent on the signature of the space.
  1003. We describe how to define and manipulate it in the context of a
  1004. unique space and, next, in a multi-space context.
  1005. \subsubsection{ONESPACE is ON}
  1006. \ttindex{onespace ON}
  1007. The use of \index{MAKE\_PARTIC\_TENS} MAKE\_PARTIC\_TENS places it, by default, in an
  1008. euclidian space if the signature is 0 and in a Minkowski-type space if
  1009. the signature\index{signature} is 1.
  1010. For higher signatures it is not constructed.
  1011. For a space of symbolic dimension, the number of its indices is not
  1012. constrained. When it appears inside an expression, its indices are {\em all}
  1013. currently upper or lower indices. However, the system allows for
  1014. mixed positions of the indices. In that case, the output of the system
  1015. is changed compared to the input only to place all contravariant indices
  1016. to the left of the covariant ones.
  1017. \begin{verbatim}
  1018. make_partic_tens(eps,epsilon); ==> t
  1019. eps(a,d,b,-g,e,-f); ==>
  1020. a d b e
  1021. - eps
  1022. g f
  1023. eps(a,d,b,-f,e,-f); ==> 0
  1024. % indices have all the same variance:
  1025. eps(-b,-a); ==>
  1026. - eps
  1027. a b
  1028. signature ?; ==> 0
  1029. eps(1,2,3,4); ==> 1
  1030. eps(-1,-2,-3,-4); ==> 1
  1031. wholespace_dim 3; ==> 3
  1032. eps(-1,-2,-3); ==> 1
  1033. eps(-1,-2,-3,-4); ==>
  1034. ***** numeric indices out of range
  1035. eps(-1,-2,-3,-3); ==>
  1036. ***** bad number of indices for (eps) tensor
  1037. eps(a,b); ==>
  1038. ***** bad number of indices for (eps) tensor
  1039. eps(a,b,c); ==>
  1040. a b c
  1041. eps
  1042. eps(a,b,b); ==> 0
  1043. \end{verbatim}
  1044. When the signature\index{signature} is equal to 1, it is known that
  1045. there exists
  1046. two {\em conventions} which are linked to the chosen value 1 or -1 of
  1047. the $(0,1,\ldots,n)$ component. So, the sytem does evaluate all components
  1048. in terms of the $(0,1,\ldots,n)$ upper index component. It is left to the user
  1049. to assign it to 1 or -1\index{GLOBAL\_SIGN}.
  1050. \begin{verbatim}
  1051. signature 1; ==> 1
  1052. eps(0,1,2); ==>
  1053. 0 1 2
  1054. eps
  1055. eps(-0,-1,-2); ==>
  1056. 0 1 2
  1057. eps
  1058. wholespace_dim 4; ==> 4
  1059. eps(0,1,2,3); ==>
  1060. 0 1 2 3
  1061. eps
  1062. eps(-0,-1,-2,-3); ==>
  1063. 0 1 2 3
  1064. - eps
  1065. % change of the global_sign convention:
  1066. global_sign(-1);
  1067. wholespace_dim 3; ==> 3
  1068. % compare with second input:
  1069. eps(-0,-1,-2); ==>
  1070. 0 1 2
  1071. - eps
  1072. \end{verbatim}
  1073. \subsubsection{ONESPACE is OFF}
  1074. \ttindex{onespace OFF}
  1075. As already said, several epsilon tensors may be defined. They {\em must}
  1076. be assigned to a well defined (sub-)space otherwise the simplifying
  1077. function \index{CANONICAL}CANONICAL will not properly work.
  1078. The set of epsilon tensors defined associated to their space-name
  1079. may be retrieved using the function
  1080. \index{SHOW\_EPSILONS}SHOW\_EPSILONS.
  1081. An important word of caution here. The output of this function does NOT
  1082. show the epsilon tensor one may have defined in the ON onespace context.
  1083. This is so because the default space has {\em NO} name.
  1084. Starting from a fresh environment, the following run illustrates
  1085. this point:
  1086. \begin{verbatim}
  1087. show_epsilons(); ==> {}
  1088. onespace ?; ==> yes
  1089. make_partic_tens(eps,epsilon); ==> t
  1090. show_epsilons(); ==> {}
  1091. \end{verbatim}
  1092. To make the {\tt epsilon} tensor defined in the single space environment
  1093. visible in the multi-space environment, one needs to associate it to
  1094. a space.
  1095. For example:
  1096. \begin{verbatim}
  1097. off onespace;
  1098. define_spaces wholespace={7,signature=1}; ==> t
  1099. show_epsilons(); ==> {} % still invisible
  1100. make_tensor_belong_space(eps,wholespace); ==>
  1101. wholespace
  1102. show_epsilons(); ==> {{eps,wholespace}}
  1103. \end{verbatim}
  1104. Next, let us define an {\em additional} {\tt epsilon}-type tensor:
  1105. \begin{verbatim}
  1106. define_spaces eucl={3,euclidian}; ==> t
  1107. make_partic_tens(ep,epsilon); ==>
  1108. *** Warning: ep MUST belong to a space
  1109. t
  1110. make_tensor_belong_space(ep,eucl); ==> eucl
  1111. show_epsilons(); ==> {{ep,eucl},{eps,wholespace}}
  1112. % We show that it is indeed working inside eucl:
  1113. ep(-1,-2,-3); ==> 1
  1114. ep(1,2,3); ==> 1
  1115. ep(a,b,c,d); ==>
  1116. ***** bad number of indices for (ep) tensor
  1117. ep(1,2,4); ==>
  1118. ***** numeric indices out of range
  1119. \end{verbatim}
  1120. As previously, the discrimation between symbolic indices
  1121. \index{symbolic indices}may be introduced
  1122. by assigning them to one or another space\index{spaces}:
  1123. \begin{verbatim}
  1124. rem_spaces wholespace;
  1125. define_spaces wholespace={dim,signature=1}; ==> t
  1126. mk_ids_belong_space({e1,e2,e3},eucl); ==> t
  1127. mk_ids_belong_space({a,b,c},wholespace); ==> t
  1128. ep(e1,e2,e3); ==>
  1129. e1 e2 e3
  1130. ep % accepted
  1131. ep(e1,e2,z); ==>
  1132. e1 e2 z
  1133. ep % accepted because z
  1134. % not attached to a space.
  1135. ep(e1,e2,a);==>
  1136. ***** some indices are not in the space of ep
  1137. eps(a,b,c); ==>
  1138. a b c
  1139. eps % accepted because *symbolic*
  1140. % space dimension.
  1141. \end{verbatim}
  1142. {\tt epsilon}-like tensors can also be defined on disjoint spaces.
  1143. The subsequent sample run starts from the environment of the previous one.
  1144. It suppresses the space {\tt wholespace}\ttindex{wholespace} as well as the
  1145. space-assignment of the indices {\tt a,b,c}. It defines the new space
  1146. {\tt mink}. Next, the previously defined {\tt eps} tensor is attached
  1147. to this space. {\tt ep} remains unchanged and {\tt e1,e2,e3} still
  1148. belong to the space {\tt eucl}.
  1149. \index{SHOW\_SPACES}\index{SHOW\_EPSILONS}
  1150. \begin{verbatim}
  1151. rem_spaces wholespace; ==> t
  1152. make_tensor_belong_anyspace eps; ==> t
  1153. show_epsilons(); ==> {{ep,eucl}}
  1154. show_spaces(); ==> {{eucl,3,signature=0}}
  1155. mk_ids_belong_anyspace a,b,c; ==> t
  1156. define_spaces mink={4,signature=1}; ==> t
  1157. show_spaces(); ==>
  1158. {{eucl,3,signature=0},
  1159. {mink,4,signature=1}}
  1160. make_tensor_belong_space(eps,mink); ==> mink
  1161. show_epsilons(); ==> {{eps,mink},{ep,eucl}}
  1162. eps(a,b,c,d); ==>
  1163. a b c d
  1164. eps
  1165. eps(e1,b,c,d); ==>
  1166. ***** some indices are not in the space of eps
  1167. ep(e1,b,c,d); ==>
  1168. ***** bad number of indices for (ep) tensor
  1169. ep(e1,b,c); ==>
  1170. b c e1
  1171. ep
  1172. ep(e1,e2,e3); ==>
  1173. e1 e2 e3
  1174. ep
  1175. \end{verbatim}
  1176. \subsection{{\tt DEL} generalized delta tensor}
  1177. \ttindex{del}
  1178. The generalized delta function comes from the contraction of two epsilons.
  1179. It is totally antisymmetric. Suppose its name has been chosen to be $gd$,
  1180. that the space to which it is
  1181. attached has dimension n while the name of the chosen delta tensor
  1182. is $\delta$, then
  1183. one can define it as follows:
  1184. $$
  1185. gd^{a_1,a_2,\ldots,\a_n}_{b_1,b_2,\ldots, b_n}=
  1186. \left|\begin{array}{cccc}
  1187. \delta^{a_1}_{b_1} & \delta^{a_1}_{b_2} & \ldots & \delta^{a_1}_{b_n} \\
  1188. \delta^{a_2}_{b_1} & \delta^{a_2}_{b_2} & \ldots & \delta^{a_2}_{b_n} \\
  1189. \vdots & \vdots & \ddots & \vdots \\
  1190. \delta^{a_n}_{b_1} & \delta^{a_n}_{b_1} & \ldots & \delta^{a_n}_{b_1}
  1191. \end{array}
  1192. \right|
  1193. $$
  1194. It is, in general uneconomical to explicitly write that determinant except
  1195. for particular {\em numeric} values of the indices
  1196. \index{numeric indices} or when almost all
  1197. upper and lower indices are recognized as dummy indices.
  1198. In the sample run below, {\tt gd} is defined as the generalized delta function
  1199. in the default space. The main automatic evaluations are illustrated.
  1200. The indices which are summed over are always simplified:
  1201. \begin{verbatim}
  1202. onespace ? ==> yes
  1203. make_partic_tens(delta,delta); ==> t
  1204. make_partic_tens(gd,del); ==> t
  1205. % immediate simplifications:
  1206. gd(1,2,-3,-4); ==> 0
  1207. gd(1,2,-1,-2); ==> 1
  1208. gd(1,2,-2,-1); ==> -1 % antisymmetric
  1209. gd(a,b,-a,-b);
  1210. ==> dim*(dim - 1) % summed over dummy indices
  1211. gd(a,b,c,-a,-d,-e); ==>
  1212. b c
  1213. gd *(dim - 2)
  1214. d e
  1215. gd(a,b,c,-a,-d,-c); ==>
  1216. b 2
  1217. delta *(dim - 3*dim + 2)
  1218. d
  1219. % no simplification:
  1220. gd(a,b,c,-d,-e,-f); ==>
  1221. a b c
  1222. gd
  1223. d e f
  1224. \end{verbatim}
  1225. One can force evaluation in terms of the determinant in all cases.
  1226. To this end, the switch \index{EXDELT}EXDELT is provided. It is initially
  1227. OFF. Switching it On will most often give inconveniently large outputs:
  1228. \begin{verbatim}
  1229. on exdelt;
  1230. gd(a,b,c,-d,-e,-f); ==>
  1231. a b c a b c
  1232. delta *delta *delta - delta *delta *delta
  1233. d e f d f e
  1234. a b c a b c
  1235. - delta *delta *delta + delta *delta *delta
  1236. e d f e f d
  1237. a b c a b c
  1238. + delta *delta *delta - delta *delta *delta
  1239. f d e f e d
  1240. \end{verbatim}
  1241. In a multi-space environment, it is never necessary to define several
  1242. such tensor. The reason is that \index{CANONICAL}CANONICAL uses it
  1243. always from the contraction of a pair of {\tt epsilon}-like tensors.
  1244. Therefore the control of indices is already done, the space-dimension
  1245. in which {\tt del} is working is also well defined.
  1246. \subsection{{\tt METRIC} tensors}
  1247. \ttindex{metric}
  1248. Very often, one has to define a specific metric. The {\tt metric}-type
  1249. of tensors include all generic properties. The first one is their symmetry,
  1250. the second one is their equality to the {\tt delta} \ttindex{delta} tensor
  1251. when they get mixed indices, the third one is their optional bloc-diagonality.
  1252. So, a metric (generic) tensor is generated by the declaration
  1253. \index{MAKE\_PARTIC\_TENS}
  1254. \begin{verbatim}
  1255. make_partic_tens(<tensor-name>,metric);
  1256. \end{verbatim}
  1257. By default, when one is working in a multi-space environment, it is
  1258. defined in {\tt wholespace}{\ttindex{wholespace}
  1259. One uses the usual means of \REDUCE\ to give it specific values.
  1260. In particular, the metric 'delta' tensor of the euclidian space
  1261. can be defined that way.
  1262. Implicit or explicit dependences on variables are allowed.
  1263. Here is an illustration in the single space environment:
  1264. \begin{verbatim}
  1265. make_partic_tens(g,metric); ==> t
  1266. make_partic_tens(delt,delta); ==> t
  1267. onespace ?; ==> yes
  1268. g(a,b); ==>
  1269. a b
  1270. g
  1271. g(b,a); ==>
  1272. a b
  1273. g
  1274. g(a,b,c); ==>
  1275. ***** bad choice of indices for a METRIC tensor
  1276. g(a,b,{x,y}); ==>
  1277. a b
  1278. g (x,y)
  1279. g(a,-b,{x,z}); ==>
  1280. a
  1281. delt
  1282. b
  1283. let g({x,y},1,1)=1/2(x+y);
  1284. g({x,y},1,1); ==>
  1285. x + y
  1286. -------
  1287. 2
  1288. rem_value_tens g({x,y},1,1);
  1289. g({x,y},1,1); ==>
  1290. 1 1
  1291. g (x,y)
  1292. \end{verbatim}
  1293. \section{The simplification function CANONICAL}
  1294. \index{CANONICAL}
  1295. \subsection{Tensor expressions}
  1296. \index{tensor polynomial}
  1297. Up to now, we have described the behaviour of individual
  1298. tensors and how they simplify themselves whenever possible.
  1299. However, this is far from being sufficient. In general, one is
  1300. to deal with objects which involve several tensors together
  1301. with various dummy summations between them.
  1302. We define a tensor expression as an arbitrary multivariate
  1303. polynomial. The indeterminates of such a polynomial may be
  1304. either an indexed object, an operator, a variable or a rational number.
  1305. A tensor-type indeterminate cannot appear to a degree larger
  1306. than one except if it is a trace\index{trace}.
  1307. The following is a tensor expression:
  1308. \begin{verbatim}
  1309. aa:= delt({x - y})*delt(a, - g)*delt(d, - g)*delt(g, -r)
  1310. *eps( - d, - e, - f)*eps(a,b,c)*op(x,y) + 1; ==>
  1311. a d g
  1312. aa := delt(x - y)*delt *delt *delt *eps
  1313. g g r d e f
  1314. a b c
  1315. *eps *op(x,y) + 1
  1316. \end{verbatim}
  1317. In the above expression, {\tt delt} and {\tt eps} are, respectively, the
  1318. {\tt delta}\ttindex{delta} and the {\tt epsilon}\ttindex{epsilon} tensors,
  1319. {\tt op} is an operator\index{operator}.
  1320. and {\tt delt(x-y)} is the Dirac delta function.\ttindex{delta function}
  1321. Notice that the above expression is not coh\'erent since the first term
  1322. has a variance while the second term is a scalar. Moreover, the
  1323. dummy index {\tt g} appears {\em three} times in the first term.
  1324. In fact, on input, each factor is simplified and each
  1325. factor is checked for coherence not more.
  1326. Therefore, if a dummy summation appears inside one factor, it will
  1327. be done whenever possible. Hereunder {\tt delt(a,-a)} is
  1328. summed over:
  1329. \index{SUB}
  1330. \begin{verbatim}
  1331. sub(g=a,aa); ==>
  1332. a d a b c
  1333. delt(x - y)*delt *delt *eps *eps
  1334. r a d e f
  1335. *op(x,y)*dim + 1
  1336. \end{verbatim}
  1337. \subsection{The use of CANONICAL}
  1338. \index{CANONICAL}CANONICAL is an offspring of the function
  1339. with the same name of the package {\tt DUMMY}
  1340. \ttindex{DUMMY}. It applies to tensor expressions as defined above.
  1341. When it acts, this functions has several features which are
  1342. worth to realise:
  1343. \begin{enumerate}
  1344. \item It tracks the free indices in each term and checks their
  1345. identity. It identifies and verify the coherence
  1346. of the various dummy index summations\index{dummy indices}.
  1347. \item Dummy indices summations are done on tensor products whenever
  1348. possible since it recognises the particular tensors
  1349. defined above or defined by the user.
  1350. \item It seeks a canonical form for the
  1351. various simplified terms, makes the comparison between them.
  1352. In that way it maximises simplifications and generates a canonical form
  1353. for the output polynomial.
  1354. \end{enumerate}
  1355. Its capabilities have been extended in four directions:
  1356. \begin{itemize}
  1357. \item It is able to work within {\em several} spaces\index{spaces}.
  1358. \item It manages correctly expressions where
  1359. formal tensor {\em derivatives} are present%
  1360. \footnote{In {\tt DUMMY}\ttindex{DUMMY} it does not take them into account}.
  1361. \item It takes into account all symmetries even if partial.
  1362. \item As its parent function, it can deal with non-commutative
  1363. and anticommutative indexed objects\index{anticommutative}.
  1364. So, Indexed objects may be spinors\index{spinor} or quantum fields.
  1365. \end{itemize}
  1366. We describe most of these features in the rest of this
  1367. documentation.
  1368. \subsection{Check of tensor indices}
  1369. \index{indices}
  1370. Dummy indices for individual tensors are kept in the memory of
  1371. the system. If they are badly distributed over several tensors,
  1372. it is CANONICAL\ which gives an error message:
  1373. \begin{verbatim}
  1374. tensor te,tf; ==> t
  1375. bb:=te(a,b,b)*te(-b); ==>
  1376. a b b
  1377. bb := te *te
  1378. b
  1379. canonical bb; ==>
  1380. ***** ((b)(a b b)) are inconsistent lists of indices
  1381. aa:=te(b,-c)*tf(b,-c); ==>
  1382. b b
  1383. aa := te *tf % b and c are free.
  1384. c c
  1385. canonical aa; ==>
  1386. b b
  1387. te *tf
  1388. c c
  1389. bb:=te(a,c,b)*te(-b)*tf(a)$
  1390. canonical bb; ==>
  1391. a c b a
  1392. te *te *tf
  1393. b
  1394. delt(a,-a); ==> dim % a is now a dummy index
  1395. canonical bb; ==>
  1396. ***** wrong use of indices (a)
  1397. \end{verbatim}
  1398. The message of canonical is clear, the first sublist contains the
  1399. list of all lower indices, and the second one the list of all upper
  1400. indices. The index {\tt b} is repeated {\em three} times.
  1401. In the second example, {\tt b} and {\tt c} are considered as free
  1402. indices, so they may be repeated.
  1403. The last example shows the interference between the check on
  1404. individual tensors and the one of canonical. The use of {\tt a}
  1405. as dummy index inside {\tt delt} does no longer allow {\tt a}
  1406. to be used as a free index in expression {\tt bb}.
  1407. To be usable, one must explicitly remove it as dummy index
  1408. using REM\_DUMMY\_INDICES \index{REM\_DUMMY\_INDICES}.
  1409. Dans le quatri\`eme cas, il n'y a pas de probl\`eme puisque {\tt b} et
  1410. {\tt c} sont tous les deux des indices {\em libres}.
  1411. CANONICAL\index{CANONICAL} checks that in a tensor polynomial
  1412. all do possess the {\em same} variance:
  1413. \begin{verbatim}
  1414. aa:=te(a,c)+x^2; ==>
  1415. a c 2
  1416. aa := te + x
  1417. canonical aa; ==>
  1418. ***** scalar added with tensor(s)
  1419. aa:=te(a,b)+tf(a,c); ==>
  1420. a b a c
  1421. aa := te + tf
  1422. canonical aa; ==>
  1423. ***** mismatch in free indices : ((a c) (a b))
  1424. \end{verbatim}
  1425. In the message the first two lists of incompatible indices are
  1426. explicitly indicated. So, it is not an exhaustive message and a more
  1427. complete correction may be needed.
  1428. Of course, no message of that kind appears if the indices are inside
  1429. ordinary operators%
  1430. \footnote{This is the case inside the {\tt DUMMY}\ttindex{DUMMY}\ package.}
  1431. \begin{verbatim}
  1432. dummy_names b; ==> t
  1433. cc:=op(b)*op(a,b,b); ==> cc := op(a,b,b)*op(b)
  1434. canonical cc; ==> op(a,b,b)*op(b)
  1435. clear_dummy_names; ==> t
  1436. \end{verbatim}
  1437. \subsection{Position and renaming of dummy indices}
  1438. \index{dummy indices}
  1439. For a specific tensor, contravariant dummy indices are place
  1440. in front of covariant ones. This already leads to some useful
  1441. simplifications. For instance:
  1442. \begin{verbatim}
  1443. pp:=te(a,-a)+te(-a,a)+1; ==>
  1444. a a
  1445. pp := te + te + 1
  1446. a a
  1447. canonical pp; ==>
  1448. a
  1449. 2*te + 1
  1450. a
  1451. pp:=te(a,-a)+te(-b,b); ==>
  1452. b a
  1453. pp := te + te
  1454. b a
  1455. canonical pp; ==>
  1456. a
  1457. 2*te
  1458. a
  1459. pp:=te(r,a,c,d,-a,f)+te(r,-b,c,d,b,f); ==>
  1460. r c d b f r a c d f
  1461. pp := te + te
  1462. b a
  1463. canonical pp; ==>
  1464. r a c d f
  1465. 2*te
  1466. a
  1467. \end{verbatim}
  1468. In the second and third example, there is also a renaming of the
  1469. dummy variable {\tt b} whih becomes {\tt a}.
  1470. There is a loophole at this point. For some expressions one will
  1471. never reach a stable expression.
  1472. This is the case for the following very simple monom:
  1473. \begin{verbatim}
  1474. tensor nt; ==> t
  1475. a1:=nt(-a,d)*nt(-c,a); ==>
  1476. d a
  1477. nt *nt
  1478. a c
  1479. canonical a1; ==>
  1480. a d
  1481. nt *nt
  1482. c a
  1483. a12:=a1-canonical a1; ==>
  1484. d a a d
  1485. a12 := nt *nt - nt *nt
  1486. a c c a
  1487. canonical a12; ==>
  1488. d a a d
  1489. - nt *nt + nt *nt % changes sign.
  1490. a c c a
  1491. \end{verbatim}
  1492. In the above example, no canonical form can be reached. When applied twice
  1493. on the tensor monom {\tt a1} it gives back {\tt a1}!
  1494. No change of dummy index position is allowed if a tensor belongs
  1495. to an {\tt AFFINE}\ttindex{affine} space.
  1496. With the tensor polynomial {\tt pp} introduced above one has:
  1497. \ttindex{onespace OFF}
  1498. \begin{verbatim}
  1499. off onespace;
  1500. define_spaces aff={dd,affine}; ==> t
  1501. make_tensor_belong_space(te,aff); ==> aff
  1502. mk_ids_belong_space({a,b},aff); ==> t
  1503. canonical pp; ==>
  1504. r c d a f r a c d f
  1505. te + te
  1506. a a
  1507. \end{verbatim}
  1508. The renaming of {\tt b} has been made however.
  1509. \subsection{Contractions and summations with particular tensors}
  1510. \index{tensor contractions}
  1511. This is a central part of the extension of CANONICAL.
  1512. The required contractions and summations can be done in a
  1513. multi-space environment as well in a single space environment.
  1514. \begin{center}
  1515. The case of {\tt DELTA}\ttindex{delta}
  1516. \end{center}
  1517. Dummy indices are recognized contracted and summed over whenever possible:
  1518. \begin{verbatim}
  1519. aa:=delt(a,-b)*delt(b,-c)*delt(c,-a) + 1; ==>
  1520. a b c
  1521. aa := delt *delt *delt + 1
  1522. b c a
  1523. canonical aa; ==> dim + 1
  1524. aa:=delt(a,-b)*delt(b,-c)*delt(c,-d)*te(d,e)$
  1525. canonical aa; ==>
  1526. a e
  1527. te
  1528. \end{verbatim}
  1529. CANONICAL will not attempt to make contraction with
  1530. dummy indices included inside ordinary operators:
  1531. \index{OPERATOR}
  1532. \begin{verbatim}
  1533. operator op;
  1534. aa:=delt(a,-b)*op(b,b)$
  1535. canonical aa; ==>
  1536. a
  1537. delt *op(b,b)
  1538. b
  1539. dummy_names b; ==> t
  1540. canonical aa; ==>
  1541. a
  1542. delta *op(b,b)
  1543. b
  1544. \end{verbatim}
  1545. \begin{center}
  1546. The case of {\tt ETA}\ttindex{eta}
  1547. \end{center}
  1548. First, we introduce {\tt ETA}:
  1549. \begin{verbatim}
  1550. make_partic_tens(eta,eta); ==> t
  1551. signature 1; ==> 1 % necessary
  1552. aa:=delta(a,-b)*eta(b,c); ==>
  1553. a b c
  1554. aa := delt *eta
  1555. b
  1556. canonical aa; ==>
  1557. a c
  1558. eta
  1559. canonical(eta(a,b)*eta(-b,c)); ==>
  1560. a c
  1561. eta
  1562. canonical(eta(a,b)*eta(-b,-c)); ==>
  1563. a
  1564. delt
  1565. c
  1566. canonical(eta(a,b)*eta(-b,-a)); ==> dim
  1567. canonical (eta(-a,-b)*te(d,-e,f,b)); ==>
  1568. d f
  1569. te
  1570. e a
  1571. aa:=eta(a,b)*eta(-b,-c)*te(-a,c)+1; ==>
  1572. a b c
  1573. aa := eta *eta *te + 1
  1574. b c a
  1575. canonical aa; ==>
  1576. a
  1577. te + 1
  1578. a
  1579. aa:=eta(a,b)*eta(-b,-c)*delta(-a,c)+
  1580. 1+eta(a,b)*eta(-b,-c)*te(-a,c)$
  1581. canonical aa; ==>
  1582. a
  1583. te + dim + 1
  1584. a
  1585. \end{verbatim}
  1586. Let us add a generic metric \index{metric tensor} tensor:
  1587. \begin{verbatim}
  1588. aa:=g(a,b)*g(-b,-d); ==>
  1589. a b
  1590. aa := g *g
  1591. b d
  1592. canonical aa; ==>
  1593. a
  1594. delt
  1595. d
  1596. aa:=g(a,b)*g(c,d)*eta(-c,-e)*eta(e,f)*te(-f,g); ==>
  1597. e f a b c d g
  1598. aa := eta *eta *g *g *te
  1599. c e f
  1600. canonical aa; ==>
  1601. a b d g
  1602. g *te
  1603. \end{verbatim}
  1604. \begin{center}
  1605. The case of {\tt EPSILON}\ttindex{epsilon}\ttindex{del}
  1606. \end{center}
  1607. The epsilon tensor plays an important role in many contexts.
  1608. CANONICAL\ realises the contraction of two epsilons if and only if
  1609. they belong to the same space. The proper use of CANONICAL\ on expressions
  1610. which contains it requires a preliminary definition of the tensor {\tt DEL}.
  1611. When the signature\ttindex{signature} is 0; the contraction of
  1612. two epsilons gives a {\tt DEL}-like tensor. When the
  1613. signature is equal to 1, it is equal to {\em minus} a {\tt DEL}-like tensor.
  1614. Here we choose 1 for the signature\index{signature} and we work in a
  1615. single space\index{spaces}.
  1616. \ttindex{onespace ON}
  1617. We define the {\tt DEL} tensor:
  1618. \begin{verbatim}
  1619. on onespace;
  1620. wholespace_dim dim; ==> dim
  1621. make_partic_tens(gd,del); ==> t
  1622. signature 1; ==> 1
  1623. \end{verbatim}
  1624. We define the {\tt EPSILON} tensor and show how CANONICAl\ contracts
  1625. expression containing {\em two}%
  1626. \footnote{No contractions are done on expressions containing
  1627. three or more epsilons which sit in the {\em same} space.
  1628. We are not sure whether it is useful
  1629. to be more general than we are presently.}
  1630. of them:
  1631. \begin{verbatim}
  1632. aa:=eps(a,b)*eps(-c,-d); ==>
  1633. a b
  1634. aa := eps *eps
  1635. c d
  1636. canonical aa; ==>
  1637. a b
  1638. - gd
  1639. c d
  1640. aa:=eps(a,b)*eps(-a,-b); ==>
  1641. a b
  1642. aa := eps *eps
  1643. a b
  1644. canonical aa; ==> dim*( - dim + 1)
  1645. on exdelt;
  1646. gd(-a,-b,a,b); ==> dim*(dim - 1)
  1647. aa:=eps(a,b,c)*eps(-b,-d,-e)$
  1648. canonical aa; ==>
  1649. a c a c
  1650. delt *delt *dim - 2*delt *delt -
  1651. d e d e
  1652. a c a c
  1653. - delt *delt *dim + 2*delt * delt
  1654. e d e d
  1655. \end{verbatim}
  1656. Several expressions which contain the epsilon tensor together
  1657. with other special tensors are given below as examples to treat
  1658. with CANONICAL:
  1659. \begin{verbatim}
  1660. aa:=eps( - b, - c)*eta(a,b)*eta(a,c); ==>
  1661. a b a c
  1662. eps *eta *eta
  1663. b c
  1664. canonical aa; ==> 0
  1665. aa:=eps(a,b,c)*te(-a)*te(-b); ==> % te is generic.
  1666. a b c
  1667. aa := eps *te *te
  1668. a b
  1669. canonical aa; ==> 0
  1670. tensor tf,tg;
  1671. aa:=eps(a,b,c)*te(-a)*tf(-b)*tg(-c)
  1672. + eps(d,e,f)*te(-d)*tf(-e)*tg(-f); ==>
  1673. canonical aa; ==>
  1674. a b c
  1675. 2*eps *te *tf *tg
  1676. a b c
  1677. aa:=eps(a,b,c)*te(-a)*tf(-c)*tg(-b)
  1678. + eps(d,e,f)*te(-d)*tf(-e)*tg(-f)$
  1679. canonical aa; ==> 0
  1680. \end{verbatim}
  1681. Since \index{CANONICAL}CANONICAL is able to work inside several
  1682. spaces, we can introduce also several epsilons and make the relevant
  1683. simplifications on each (sub)-spaces. This is the goal of the
  1684. next illustration.
  1685. \ttindex{onespace OFF}\index{SHOW\_EPSILONS}
  1686. \begin{verbatim}
  1687. off onespace;
  1688. define_spaces wholespace=
  1689. {dim,signature=1}; ==> t
  1690. define_spaces subspace=
  1691. {3,signature=0}; ==> t
  1692. show_spaces(); ==>
  1693. {{wholespace,dim,signature=1},
  1694. {subspace,3,signature=0}}
  1695. make_partic_tens(eps,epsilon); ==> t
  1696. make_partic_tens(kap,epsilon); ==> t
  1697. make_tensor_belong_space(eps,wholespace);
  1698. ==> wholespace
  1699. make_tensor_belong_space(kap,subspace);
  1700. ==> subspace
  1701. show_epsilons(); ==>
  1702. {{eps,wholespace},{kap,subspace}}
  1703. off exdelt;
  1704. aa:=kap(a,b,c)*kap(-d,-e,-f)*eps(i,j)*eps(-k,-l)$
  1705. canonical aa; ==>
  1706. a b c i j
  1707. - gd *gd
  1708. d e f k l
  1709. \end{verbatim}
  1710. If there are no index summation, as in the expression above, one can
  1711. develop both terms into the delta tensor with EXDELT
  1712. \index{EXDELT} switched ON.
  1713. In fact, the previous calculation is correct {\em only if there are no
  1714. dummy index} inside the two {\tt gd}'s.
  1715. If some of the indices are
  1716. dummy, then
  1717. we must
  1718. take care of the respective spaces in which the two {\tt gd} tensors
  1719. are considered. Since, the tensor themselves do not belong
  1720. to a given space, the space identification can only be made through
  1721. the indices. This is enough since the {\tt DELTA}-like tensor
  1722. is bloc-diagonal. With {\tt aa} the result of the above illustration,
  1723. one gets, for example,:
  1724. \index{MK\_IDS\_BELONG\_SPACE}\index{indices}
  1725. \begin{verbatim}
  1726. mk_ids_belong_space({a,b,c,d,e,f},wholespace)$
  1727. mk_ids_belong_space({i,j,k,l},subspace)$
  1728. sub(d=a,e=b,k=i,aa); ==>
  1729. c j 2
  1730. 2*delt *delt *( - dim + 3*dim - 2)
  1731. f l
  1732. sub(k=i,l=j,aa); ==>
  1733. a b c
  1734. - 6*gd
  1735. d e f
  1736. \end{verbatim}
  1737. \subsection{CANONICAL\ and symmetries}
  1738. \index{symmetries}
  1739. Most of the time, indexed objects have some symmetry property.
  1740. When this property is either full symmetry or antisymmetry, there
  1741. is no difficulty to implement it using the declarations
  1742. SYMMETRIC\ \index{SYMMETRIC} or \index{ANTISYMMETRIC}ANTISYMMETRIC
  1743. of \REDUCE. However, most often, indexed objects are neither
  1744. fully symmetric nor fully antisymmetric: they have {\em partial}
  1745. or {\em mixed} symmetries\index{partial symmetry}\index{mixed symmetry}.
  1746. In the {\tt DUMMY}\ttindex{DUMMY}\ package, the declaration
  1747. \index{SYMTREE}SYMTREE\ allows to impose such type of symmetries
  1748. on operators. This command has been improved and extended to
  1749. apply to tensors.
  1750. In order to illustrate it, we shall take the example of the
  1751. wellknown Riemann \index{Rieman tensor}tensor in general relativity.
  1752. Let us remind the reader
  1753. that this tensor has four indices. It is separately {\em antisymmetric} with
  1754. respect to the interchange of the first two indices and with respect to the
  1755. interchange of the last two indices. It is {\em symmetric} with respect to
  1756. the interchange of the first two and the last two indices.
  1757. In the illustration below, we show how to express this and how
  1758. CANONICAL\ is able to recognize mixed symmetries:
  1759. \begin{verbatim}
  1760. tensor r; ==> t
  1761. symtree(r,{!+,{!-,1,2},{!-,3,4}});
  1762. rem_dummy_indices a,b,c,d; % free indices
  1763. ra:=r(b,a,c,d); ==>
  1764. b a c d
  1765. ra := r
  1766. canonical ra; ==>
  1767. a b c d
  1768. - r
  1769. ra:=r(c,d,a,b); ==>
  1770. c d a b
  1771. ra := r
  1772. canonical ra; ==>
  1773. a b c d
  1774. r
  1775. canonical r(-c,-d,a,b); ==>
  1776. a b
  1777. r
  1778. c d
  1779. r(-c,-c,a,b); ==> 0
  1780. ra:=r(-c,-d,c,b); ==>
  1781. c b
  1782. ra := r
  1783. c d
  1784. canonical ra; ==>
  1785. b c
  1786. - r
  1787. c d
  1788. \end{verbatim}
  1789. In the last illustration, contravariant indices are placed in front
  1790. of covariant indices and the contravariant indices are transposed.
  1791. The superposition of the two partial symmetries gives a minus sign.
  1792. There exists an important (though natural) restriction on the use of
  1793. SYMTREE\ which is linked to the algorithm itself: Integer used to localize
  1794. indices must start from 1, be {\em contiguous} and monotoneously increasing.
  1795. For instance, one is not allow to introduce
  1796. \begin{verbatim}
  1797. symtree(r,{!*,{!+,1,3},{!*,2,4}});
  1798. symtree(r,{!*,{!+,1,2},{!*,4,5}};
  1799. symtree(r,{!*,{!-,1,3},{!*,2}});
  1800. \end{verbatim}
  1801. but the subsequent declarations are allowed:
  1802. \begin{verbatim}
  1803. symtree(r,{!*,{!+,1,2},{!*,3,4}});
  1804. symtree(r,{!*,{!+,1,2},{!*,3,4,5}});
  1805. symtree(r,{!*,{!-,1,2},{!*,3}});
  1806. \end{verbatim}
  1807. The first declaration endows {\tt r} with a {\em partial} symmetry
  1808. with respect to the first two indices.
  1809. A side effect of SYMTREE\ is to restrict the number of indices of
  1810. a generic tensor. For instance, the second declaration in the above
  1811. illustrations makes {\tt r} depend on 5 indices as illustrated below:
  1812. \begin{verbatim}
  1813. symtree(r,{!*,{!+,1,2},{!*,3,4,5}});
  1814. canonical r(-b,-a,d,c); ==>
  1815. ***** Index `5' out of range for
  1816. ((minus b) (minus a) d c) in nth
  1817. canonical r(-b,-a,d,c,e); ==>
  1818. d c e
  1819. r % correct
  1820. a b
  1821. canonical r(-b,-a,d,c,e,g); ==>
  1822. d c e
  1823. r % The sixth index is forgotten!
  1824. a b
  1825. \end{verbatim}
  1826. Finally, the function REMSYM\index{REMSYM}\ applied on any tensor
  1827. identifier removes all symmetry properties.
  1828. Another related question is the frequent need to symmetrize
  1829. a tensor polynomial.
  1830. To fulfill it, the function \index{SYMMETRIZE}SYMMETRIZE
  1831. of the package {\tt ASSIST} \ttindex{ASSIST} has been improved and
  1832. generalised. For any kernel\index{kernel} ( which may be either
  1833. an operator or a tensor) that function generates
  1834. \begin{itemize}
  1835. \item[-] the sum over the cyclic permutations of indices,
  1836. \item[-] the symetric or antisymetric sums over all permutations
  1837. of the indices.
  1838. \end{itemize}
  1839. Moreover, if it is given a list of indices, it generates a new list
  1840. which contains sublists wich contain the relevant permutations of
  1841. these indices
  1842. \begin{verbatim}
  1843. symmetrize(te(x,y,z,{v}),te,cyclicpermlist); ==>
  1844. x y z y z x z x y
  1845. te (v) + te (v) + te (v)
  1846. symmetrize(te(x,y),te,permutations); ==>
  1847. x y y x
  1848. te + te
  1849. symmetrize(te(x,y),te,permutations,perm_sign); ==>
  1850. x y y x
  1851. te - te
  1852. symmetrize(te(y,x),te,permutations,perm_sign); ==>
  1853. x y y x
  1854. - te + te
  1855. \end{verbatim}
  1856. If one wants to symmetrise an expression which is not a kernel, one
  1857. can also use SYMMETRIZE\ to obtain the desired result as the next
  1858. example shows:
  1859. \begin{verbatim}
  1860. ex:=te(a,-b,c)*te1(-a,-d,-e); ==>
  1861. a c
  1862. ex := te *te1
  1863. b a d e
  1864. ll:=list(b,c,d,e)$ % the chosen relevant indices
  1865. lls:=symmetrize(ll,list,cyclicpermlist); ==>
  1866. lls := {{b,c,d,e},{c,d,e,b},{d,e,b,c},{e,b,c,d}}
  1867. % The sum over the cyclic permutations is:
  1868. excyc:=for each i in lls sum
  1869. sub(b=i.1,c=i.2,d=i.3,e=i.4,ex); ==>
  1870. a c a d
  1871. excyc := te *te1 + te *te1
  1872. b a d e c a e b
  1873. a e a b
  1874. + te *te1 + te *te1
  1875. d a b c e a c d
  1876. \end{verbatim}
  1877. \subsection{CANONICAL and tensor derivatives}
  1878. \index{tensor derivatives}
  1879. Only ordinary (partial) derivatives are fully correctly handled
  1880. by CANONICAL. This is enough, to explicitly construct covariant
  1881. derivatives. We recognize here that extensions should still be made.
  1882. The subsequent illustrations show how CANONICAL\ does indeed
  1883. manage to find the canonical form and simplify expressions
  1884. which contain derivatives. Notice, the use of
  1885. the (modified) \index{DEPEND}DEPEND\ declaration.
  1886. \ttindex{onespace ON}
  1887. \begin{verbatim}
  1888. on onespace;
  1889. tensor te,x; ==> t
  1890. depend te,x;
  1891. aa:=df(te(a,-b),x(-b))-df(te(a,-c),x(-c))$
  1892. canonical aa; ==> 0
  1893. make_partic_tens(eta,eta); ==> t
  1894. signature 1;
  1895. aa:=df(te(a,-b),x(-b))$
  1896. aa:=aa*eta(-a,-d);
  1897. a
  1898. aa := df(te ,x )*eta
  1899. b b a d
  1900. canonical aa; ==>
  1901. a a
  1902. df(te ,x )
  1903. d
  1904. \end{verbatim}
  1905. In the last example, after contraction, the covariant dummy index {\tt b}
  1906. has been changed into the contravariant dummy index {\tt a}. This is allowed
  1907. since the space is metric.
  1908. \newpage
  1909. \printindex
  1910. \end{document}