physop.tex 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. \documentstyle[11pt,reduce,makeidx]{article}
  2. \makeindex
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. % The following definitions should be commented out by those
  5. % wishing to use MakeIndeX
  6. \def\indexentry#1#2{{\tt #1} \dotfill\ #2\newline}
  7. \renewcommand{\printindex}{\noindent \@input{\jobname.idx}}
  8. %%%%%%% end of definitions %%%%%%%%%%%%%%%%%%%%%
  9. \title{PHYSOP \\ A Package for Operator Calculus in Quantum Theory}
  10. \author{User's Manual \\ Version 1.5 \\ January 1992}
  11. \date{Mathias Warns \\
  12. Physikalisches Institut der Universit\"at Bonn \\
  13. Endenicher Allee 11--13 \\
  14. D--5300 BONN 1 \\
  15. Germany \\*[2\parskip]
  16. Tel: (++49) 228 733724 \\
  17. Fax: (++49) 228 737869 \\
  18. e--mail: UNP008@DBNRHRZ1.bitnet}
  19. \begin{document}
  20. \maketitle
  21. \section{Introduction}
  22. The package PHYSOP has been designed to meet the requirements of
  23. theoretical physicists looking for a
  24. computer algebra tool to perform complicated calculations
  25. in quantum theory
  26. with expressions containing operators. These operations
  27. consist mainly in the calculation of commutators between operator
  28. expressions and in the evaluations of operator matrix elements
  29. in some abstract space. Since the capabilities
  30. of the current \REDUCE\ release to deal with complex
  31. expressions containing noncommutative operators are rather restricted,
  32. the first step was to enhance these possibilities in order to
  33. achieve a better usability of \REDUCE\ for these kind of calculations.
  34. This has led to the development of a first package called
  35. NONCOM2 which is described in section 2. For more complicated
  36. expressions involving both scalar quantities and operators
  37. the need for an additional data type has emerged in order to make a
  38. clear separation between the various objects present in the calculation.
  39. The implementation of this new \REDUCE\ data type is realized by the
  40. PHYSOP (for PHYSical OPerator) package described in section 3.
  41. \section{The NONCOM2 Package}
  42. The package NONCOM2 redefines some standard \REDUCE\ routines
  43. in order to modify the way noncommutative operators are handled by the
  44. system. In standard \REDUCE\ declaring an operator to be noncommutative
  45. using the \f{NONCOM} statement puts a global flag on the
  46. operator. This flag is checked when the system has to decide
  47. whether or not two operators commute during the manipulation of an
  48. expression.
  49. The NONCOM2 package redefines the \f{NONCOM} \index{NONCOM} statement in
  50. a way more suitable for calculations in physics. Operators have now to
  51. be declared noncommutative pairwise, i.e. coding: \\
  52. \begin{framedverbatim}
  53. NONCOM A,B;
  54. \end{framedverbatim}
  55. declares the operators \f{A} and \f{B} to be noncommutative but allows them
  56. to commute with any other (noncommutative or not) operator present in
  57. the expression. In a similar way if one wants e.g.\ \f{A(X)} and
  58. \f{A(Y)} not to commute, one has now to code: \\
  59. \begin{framedverbatim}
  60. NONCOM A,A;
  61. \end{framedverbatim}
  62. Each operator gets a new property list containing the
  63. operators with which it does not commute.
  64. A final example should make
  65. the use of the redefined \f{NONCOM} statement clear: \\
  66. \begin{framedverbatim}
  67. NONCOM A,B,C;
  68. \end{framedverbatim}
  69. declares \f{A} to be noncommutative with \f{B} and \f{C},
  70. \f{B} to be noncommutative
  71. with \f{A} and \f{C} and \f{C} to be noncommutative
  72. with \f{A} and \f{B}.
  73. Note that after these declaration
  74. e.g.\ \f{A(X)} and \f{A(Y)}
  75. are still commuting kernels.
  76. Finally to keep the compatibility with standard \REDUCE\, declaring a
  77. \underline{single} identifier using the \f{NONCOM} statement has the same
  78. effect as in
  79. standard \REDUCE\, i.e., the identifier is flagged with the \f{NONCOM} tag.
  80. From the user's point of view there are no other
  81. new commands implemented by the package. Commutation
  82. relations have to be declared in the standard way as described in
  83. the manual i.e.\ using
  84. \f{LET} statements. The package itself consists of several redefined
  85. standard
  86. \REDUCE\ routines to handle the new definition of noncommutativity in
  87. multiplications and pattern matching processes.
  88. {\bf CAVEAT: } Due to its nature, the package is highly version
  89. dependent. The current version has been designed for the 3.3 and 3.4
  90. releases
  91. of \REDUCE\ and may not work with previous versions. Some different
  92. (but still correct) results may occur by using this package in
  93. conjunction with
  94. LET statements since part of the pattern matching routines have been
  95. redesigned. The package has been designed to bridge a deficiency of the
  96. current \REDUCE\ version concerning the notion of noncommutativity
  97. and it is the author's hope that it will be made obsolete
  98. by a future release of \REDUCE.
  99. \section{The PHYSOP package}
  100. The package PHYSOP implements a new \REDUCE\ data type to perform
  101. calculations with physical operators. The noncommutativity of
  102. operators is
  103. implemented using the NONCOM2 package so this file should be loaded
  104. prior to the use of PHYSOP\footnote{To build a fast
  105. loading version of PHYSOP the NONCOM2
  106. source code should be read in prior to the PHYSOP
  107. code}.
  108. In the following the new commands implemented by the package
  109. are described. Beside these additional commands,
  110. the full set of standard \REDUCE\ instructions remains
  111. available for performing any other calculation.
  112. \subsection{Type declaration commands}
  113. The new \REDUCE\ data type PHYSOP implemented by the package allows the
  114. definition of a new kind of operators (i.e. kernels carrying
  115. an arbitrary
  116. number of arguments). Throughout this manual, the name
  117. ``operator''
  118. will refer, unless explicitly stated otherwise, to this new data type.
  119. This data type is in turn
  120. divided into 5 subtypes. For each of this subtype, a declaration command
  121. has been defined:
  122. \begin{description}
  123. \item[\f{SCALOP A;} ] \index{SCALOP} declares \f{A} to be a scalar
  124. operator. This operator may
  125. carry an arbitrary number of arguments i.e.\ after the
  126. declaration: \f{ SCALOP A; }
  127. all kernels of the form e.g.\
  128. \f{A(J), A(1,N), A(N,L,M)}
  129. are recognized by the system as being scalar operators.
  130. \item[\f{VECOP V;} ] \index{VECOP} declares \f{V} to be a vector operator.
  131. As for scalar operators, the vector operators may carry an arbitrary
  132. number of arguments. For example \f{V(3)} can be used to represent
  133. the vector operator $\vec{V}_{3}$. Note that the dimension of space
  134. in which this operator lives is \underline{arbitrary}.
  135. One can however address a specific component of the
  136. vector operator by using a special index declared as \f{PHYSINDEX} (see
  137. below). This index must then be the first in the argument list
  138. of the vector operator.
  139. \item[\f{TENSOP C(3);} ] \index{TENSOP}
  140. declares \f{C} to be a tensor operator of rank 3. Tensor operators
  141. of any fixed integer rank larger than 1 can be declared.
  142. Again this operator may carry an arbitrary number of arguments
  143. and the space dimension is not fixed.
  144. The tensor
  145. components can be addressed by using special \f{PHYSINDEX} indices
  146. (see below) which have to be placed in front of all other
  147. arguments in the argument list.
  148. \item[\f{STATE U;} ] \index{STATE} declares \f{U} to be a state, i.e.\ an
  149. object on
  150. which operators have a certain action. The state U can also carry an
  151. arbitrary number of arguments.
  152. \item[\f{PHYSINDEX X;} ] \index{PHYSINDEX} declares \f{X} to be a special
  153. index which will be used
  154. to address components of vector and tensor operators.
  155. \end{description}
  156. It is very important to understand precisely the way how the type
  157. declaration commands work in order to avoid type mismatch errors when
  158. using the PHYSOP package. The following examples should illustrate the
  159. way the program interprets type declarations.
  160. Assume that the declarations listed above have
  161. been typed in by the user, then:
  162. \begin{description}
  163. \item[$\bullet$] \f{A,A(1,N),A(N,M,K)} are SCALAR operators.
  164. \item[$\bullet$] \f{V,V(3),V(N,M)} are VECTOR operators.
  165. \item[$\bullet$] \f{C, C(5),C(Y,Z)} are TENSOR operators of
  166. rank 3.
  167. \item[$\bullet$] \f{U,U(P),U(N,L,M)} are STATES.
  168. \item[BUT:] \f{V(X),V(X,3),V(X,N,M)} are all \underline{scalar}
  169. operators
  170. since the \underline{special index} \f{X} addresses a
  171. specific component
  172. of the vector operator (which is a scalar operator). Accordingly,
  173. \f{C(X,X,X)} is also a \underline{scalar} operator because
  174. the diagonal component $C_{xxx}$
  175. of the tensor operator \f{C} is meant here
  176. (C has rank 3 so 3 special indices must be used for the components).
  177. \end{description}
  178. In view of these examples, every time the following text
  179. refers to \underline{scalar} operators,
  180. it should be understood that this means not only operators defined by
  181. the
  182. \f{SCALOP} statement but also components of vector and tensor operators.
  183. Depending on the situation, in some case when dealing only with the
  184. components of vector or tensor operators it may be preferable to use
  185. an operator declared with \f{SCALOP} rather than addressing the
  186. components using several special indices (throughout the
  187. manual,
  188. indices declared with the \f{PHYSINDEX} command are referred to as special
  189. indices).
  190. Another important feature of the system is that
  191. for each operator declared using the statements described above, the
  192. system generates 2 additional operators of the same type:
  193. the \underline{adjoint} and the \underline{inverse} operator.
  194. These operators are accessible to the user for subsequent calculations
  195. without any new declaration. The syntax is as following:
  196. If \f{A} has been declared to be an operator (scalar, vector or tensor)
  197. the \underline{adjoint} operator is denoted \f{A!+} and the
  198. \underline{inverse}
  199. operator is denoted \f{A!-1} (an inverse adjoint operator \f{A!+!-1}
  200. is also generated).
  201. The exclamation marks do not appear
  202. when these operators are printed out by \REDUCE\ (except when the switch
  203. \f{NAT} is set to off)
  204. but have to be typed in when these operators are used in an input
  205. expression.
  206. An adjoint (but \underline{no} inverse) state is also
  207. generated for every state defined by the user.
  208. One may consider these generated operators as ''placeholders'' which
  209. means that these operators are considered by default as
  210. being completely independent of the original operator.
  211. Especially if some value is assigned to the original operator,
  212. this value is \underline{not} automatically assigned to the
  213. generated operators. The user must code additional assignement
  214. statements in order to get the corresponding values.
  215. Exceptions from these rules are (i) that inverse operators are
  216. \underline{always} ordered at the same place as the original operators
  217. and (ii) that the expressions \f{A!-1*A}
  218. and \f{A*A!-1} are replaced\footnote{This may not always occur in
  219. intermediate steps of a calculation due to efficiency reasons.}
  220. by the unit operator \f{UNIT} \index{UNIT}.
  221. This operator is defined
  222. as a scalar operator during the initialization of the PHYSOP package.
  223. It should be used to indicate
  224. the type of an operator expression whenever no other PHYSOP
  225. occur in it. For example, the following sequence: \\
  226. \begin{framedverbatim}
  227. SCALOP A;
  228. A:= 5;
  229. \end{framedverbatim}
  230. leads to a type mismatch error and should be replaced by: \\
  231. \begin{framedverbatim}
  232. SCALOP A;
  233. A:=5*UNIT;
  234. \end{framedverbatim}
  235. The operator \f{UNIT} is a reserved variable of the system and should
  236. not be used for other purposes.
  237. All other kernels (including standard \REDUCE\ operators)
  238. occurring in expressions are treated as ordinary scalar variables
  239. without any PHYSOP type (referred to as \underline{scalars} in the
  240. following).
  241. Assignement statements are checked to ensure correct operator
  242. type assignement on both sides leading to an error if a type
  243. mismatch occurs. However an assignement statement of the form
  244. \f{A:= 0} or \f{LET A = 0} is \underline{always} valid regardless of the
  245. type of \f{A}.
  246. Finally a command \f{CLEARPHYSOP} \index{CLEARPHYSOP}
  247. has been defined to remove
  248. the PHYSOP type from an identifier in order to use it for subsequent
  249. calculations (e.g. as an ordinary \REDUCE\ operator). However it should be
  250. remembered that \underline{no}
  251. substitution rule is cleared by this function. It
  252. is therefore left to the user's responsibility to clear previously all
  253. substitution rules involving the identifier from which the PHYSOP type
  254. is removed.
  255. Users should be very careful when defining procedures or statements of
  256. the type \f{FOR ALL ... LET ...} that the PHYSOP type of all identifiers
  257. occurring in such expressions is unambigously fixed. The type analysing
  258. procedure is rather restrictive and will print out a ''PHYSOP type
  259. conflict'' error message if such ambiguities occur.
  260. \subsection{Ordering of operators in an expression}
  261. The ordering of kernels in an expression is performed according to
  262. the following rules: \\
  263. 1. \underline{Scalars} are always ordered ahead of
  264. PHYSOP \underline{operators} in an expression.
  265. The \REDUCE\ statement \f{KORDER} \index{KORDER} can be used to control the
  266. ordering of scalars but has \underline{no}
  267. effect on the ordering of operators.
  268. 2. The default ordering of \underline{operators} follows the
  269. order in which they have been declared (and \underline{not}
  270. the alphabetical one).
  271. This ordering scheme can be changed using the command \f{OPORDER}.
  272. \index{OPORDER}
  273. Its syntax is similar to the \f{KORDER} statement, i.e.\ coding:
  274. \f{OPORDER A,V,F;}
  275. means that all occurrences of the operator \f{A} are ordered ahead of
  276. those of \f{V} etc. It is also possible to include operators
  277. carrying
  278. indices (both normal and special ones) in the argument list of
  279. \f{OPORDER}. However including objects \underline{not}
  280. defined as operators (i.e. scalars or indices) in the argument list
  281. of the \f{OPORDER} command leads to an error.
  282. 3. Adjoint operators are placed by the declaration commands just
  283. after the original operators on the \f{OPORDER} list. Changing the
  284. place of an operator on this list means \underline{not} that the
  285. adjoint operator is moved accordingly. This adjoint operator can
  286. be moved freely by including it in the argument list of the
  287. \f{OPORDER} command.
  288. \subsection{Arithmetic operations on operators}
  289. The following arithmetic operations are possible with
  290. operator expressions: \\
  291. 1. Multiplication or division of an operator by a scalar.
  292. 2. Addition and subtraction of operators of the \underline{same} type.
  293. 3. Multiplication of operators is only defined between two
  294. \underline{scalar} operators.
  295. 4. The scalar product of two VECTOR operators is implemented with
  296. a new function \f{DOT} \index{DOT}. The system expands the product of
  297. two vector operators into an ordinary product of the components of these
  298. operators by inserting a special index generated by the program.
  299. To give an example, if one codes: \\
  300. \begin{framedverbatim}
  301. VECOP V,W;
  302. V DOT W;
  303. \end{framedverbatim}
  304. the system will transform the product into: \\
  305. \begin{framedverbatim}
  306. V(IDX1) * W(IDX1)
  307. \end{framedverbatim}
  308. where \f{IDX1} is a \f{PHYSINDEX} generated by the system (called a DUMMY
  309. INDEX in the following) to express the summation over the components.
  310. The identifiers \f{IDXn} (\f{n} is
  311. a nonzero integer) are
  312. reserved variables for this purpose and should not be used for other
  313. applications. The arithmetic operator
  314. \f{DOT} can be used both in infix and prefix form with two arguments.
  315. 5. Operators (but not states) can only be raised to an
  316. \underline{integer} power. The system expands this power
  317. expression into a product of the corresponding number of terms
  318. inserting dummy indices if necessary. The following examples explain
  319. the transformations occurring on power expressions (system output
  320. is indicated with an \f{-->}): \\
  321. \begin{framedverbatim}
  322. SCALOP A; A**2;
  323. - --> A*A
  324. VECOP V; V**4;
  325. - --> V(IDX1)*V(IDX1)*V(IDX2)*V(IDX2)
  326. TENSOP C(2); C**2;
  327. - --> C(IDX3,IDX4)*C(IDX3,IDX4)
  328. \end{framedverbatim}
  329. Note in particular the way how the system interprets powers of
  330. tensor operators which is different from the notation used in matrix
  331. algebra.
  332. 6. Quotients of operators are only defined between
  333. \underline{scalar} operator expressions.
  334. The system transforms the quotient of 2 scalar operators into the
  335. product of the first operator times the inverse of the second one.
  336. Example\footnote{This shows how inverse operators are printed out when
  337. the switch \f{NAT} is on}: \\
  338. \begin{framedverbatim}
  339. SCALOP A,B; A / B;
  340. -1
  341. --> (B )*A
  342. \end{framedverbatim}
  343. 7. Combining the last 2 rules explains the way how the system
  344. handles negative powers of operators: \\
  345. \noindent
  346. \begin{framedverbatim}
  347. SCALOP B;
  348. B**(-3);
  349. -1 -1 -1
  350. --> (B )*(B )*(B )
  351. \end{framedverbatim}
  352. The method of inserting dummy indices and expanding powers of
  353. operators has been chosen to facilitate the handling of
  354. complicated operator
  355. expressions and particularly their application on states
  356. (see section 3.4.3). However it may be useful to get rid of these
  357. dummy indices in order to enhance the readability of the
  358. system's final output.
  359. For this purpose the switch \f{CONTRACT} \index{CONTRACT} has to
  360. be turned on (\f{CONTRACT} is normally set to \f{OFF}).
  361. The system in this case contracts over dummy indices reinserting the
  362. \f{DOT} operator and reassembling the expanded powers. However due to
  363. the predefined operator ordering the system may not remove all the
  364. dummy indices introduced previously.
  365. \subsection{Special functions}
  366. \subsubsection{Commutation relations}
  367. If 2 PHYSOPs have been declared noncommutative using the (redefined)
  368. \f{NONCOM} statement, it is possible to introduce in the environment
  369. \underline{elementary} (anti-) commutation relations between them. For
  370. this purpose,
  371. 2 \underline{scalar} operators \f{COMM} \index{COMM} and
  372. \f{ANTICOMM} \index{ANTICOMM} are available.
  373. These operators are used in conjunction with \f{LET} statements.
  374. Example: \\
  375. \begin{framedverbatim}
  376. SCALOP A,B,C,D;
  377. LET COMM(A,B)=C;
  378. FOR ALL N,M LET ANTICOMM(A(N),B(M))=D;
  379. VECOP U,V,W; PHYSINDEX X,Y,Z;
  380. FOR ALL X,Y LET COMM(V(X),W(Y))=U(Z);
  381. \end{framedverbatim}
  382. Note that if special indices are used as dummy variables in
  383. \f{FOR ALL ... LET} constructs then these indices should have been
  384. declared previously using the \f{PHYSINDEX} command.
  385. Every time the system
  386. encounters a product term involving 2
  387. noncommutative operators which have to be reordered on account of the
  388. given operator ordering, the list of available (anti-) commutators is
  389. checked in the following way: First the system looks for a
  390. \underline{commutation} relation which matches the product term. If it
  391. fails then the defined \underline{anticommutation} relations are
  392. checked. If there is no successful match the product term
  393. \f{A*B} is replaced by: \\
  394. \begin{framedverbatim}
  395. A*B;
  396. --> COMM(A,B) + B*A
  397. \end{framedverbatim}
  398. so that the user may introduce the commutation relation later on.
  399. The user may want to force the system to look for
  400. \underline{anticommutators} only; for this purpose a switch \f{ANTICOM}
  401. \index{ANTICOM}
  402. is defined which has to be turned on ( \f{ANTICOM} is normally set to
  403. \f{OFF}). In this case, the above example is replaced by: \\
  404. \begin{framedverbatim}
  405. ON ANTICOM;
  406. A*B;
  407. --> ANTICOMM(A,B) - B*A
  408. \end{framedverbatim}
  409. Once the operator ordering has been fixed (in the example above \f{B}
  410. has to be ordered ahead of \f{A}),
  411. there is \underline{no way} to prevent the
  412. system from introducing (anti-)commutators every time it encounters
  413. a product whose terms are not in the right order. On the other hand,
  414. simply by changing the \f{OPORDER} statement and reevaluating the
  415. expression one can change the operator ordering
  416. \underline{without}
  417. the need to introduce new commutation relations.
  418. Consider the following example: \\
  419. \begin{framedverbatim}
  420. SCALOP A,B,C; NONCOM A,B; OPORDER B,A;
  421. LET COMM(A,B)=C;
  422. A*B;
  423. - --> B*A + C;
  424. OPORDER A,B;
  425. B*A;
  426. - --> A*B - C;
  427. \end{framedverbatim}
  428. The functions \f{COMM} and \f{ANTICOMM} should only be used to
  429. define
  430. elementary (anti-) commutation relations between single operators.
  431. For the calculation of (anti-) commutators between complex
  432. operator
  433. expressions, the functions \f{COMMUTE} \index{COMMUTE} and
  434. \f{ANTICOMMUTE} \index{ANTICOMMUTE} have been defined.
  435. Example (is included as example 1 in the test file): \\
  436. \begin{framedverbatim}
  437. VECOP P,A,K;
  438. PHYSINDEX X,Y;
  439. FOR ALL X,Y LET COMM(P(X),A(Y))=K(X)*A(Y);
  440. COMMUTE(P**2,P DOT A);
  441. \end{framedverbatim}
  442. \subsubsection{Adjoint expressions}
  443. As has been already mentioned, for each operator and state defined
  444. using the declaration commands quoted in section 3.1, the system
  445. generates automatically the corresponding adjoint operator. For the
  446. calculation of the adjoint representation of a complicated
  447. operator expression, a function \f{ADJ} \index{ADJ} has been defined.
  448. Example\footnote{This shows how adjoint operators are printed out
  449. when the switch \f{NAT} is on}: \\
  450. \begin{framedverbatim}
  451. SCALOP A,B;
  452. ADJ(A*B);
  453. + +
  454. --> (B )*(A )
  455. \end{framedverbatim}
  456. \subsubsection{Application of operators on states}
  457. For this purpose, a function \f{OPAPPLY} \index{OPAPPLY} has been
  458. defined.
  459. It has 2 arguments and is used in the following combinations: \\
  460. {\bf (i)} \f{LET OPAPPLY(}{\it operator, state}\f{) =} {\it state};
  461. This is to define a elementary
  462. action of an operator on a state in analogy to the way
  463. elementary commutation relations are introduced to the system.
  464. Example: \\
  465. \begin{framedverbatim}
  466. SCALOP A; STATE U;
  467. FOR ALL N,P LET OPAPPLY((A(N),U(P))= EXP(I*N*P)*U(P);
  468. \end{framedverbatim}
  469. {\bf (ii)} \f{LET OPAPPLY(}{\it state, state}\f{) =} {\it scalar exp.};
  470. This form is to define scalar products between states and normalization
  471. conditions.
  472. Example: \\
  473. \begin{framedverbatim}
  474. STATE U;
  475. FOR ALL N,M LET OPAPPLY(U(N),U(M)) = IF N=M THEN 1 ELSE 0;
  476. \end{framedverbatim}
  477. {\bf (iii)} {\it state} \f{:= OPAPPLY(}{\it operator expression, state});
  478. In this way, the action of an operator expression on a given state
  479. is calculated using elementary relations defined as explained in {\bf
  480. (i)}. The result may be assigned to a different state vector.
  481. {\bf (iv)} \f{OPAPPLY(}{\it state}\f{, OPAPPLY(}{\it operator expression,
  482. state}\f{))}; This is the way how to calculate matrix elements of
  483. operator
  484. expressions. The system proceeds in the following way: first the
  485. rightmost operator is applied on the right state, which means that the
  486. system tries
  487. to find an elementary relation which match the application of the
  488. operator on the state. If it fails
  489. the system tries to apply the leftmost operator of the expression on the
  490. left state using the adjoint representations. If this fails also,
  491. the system prints out a warning message and stops the evaluation.
  492. Otherwise the next operator occuring in the expression is
  493. taken and so on until the complete expression is applied. Then the
  494. system
  495. looks for a relation expressing the scalar product of the two
  496. resulting states and prints out the final result. An example of such
  497. a calculation is given in the test file.
  498. The infix version of the \f{OPAPPLY} function is the vertical bar $\mid$
  499. . It is \underline{right} associative and placed in the precedence
  500. list just above the minus ($-$) operator.
  501. Some of the \REDUCE\ implementation may not work with this character,
  502. the prefix form should then be used instead\footnote{The source code
  503. can also be modified to choose another special character for the
  504. function}.
  505. \section{Known problems in the current release of PHYSOP}
  506. \indent {\bf (i)} Some spurious negative powers of operators
  507. may appear
  508. in the result of a calculation using the PHYSOP package. This is a
  509. purely ''cosmetic'' effect which is due to an additional
  510. factorization of the expression in the output printing routines of
  511. \REDUCE. Setting off the \REDUCE\ switch \f{ALLFAC} (\f{ALLFAC} is normally
  512. on)
  513. should make these
  514. terms disappear and print out the correct result (see example 1
  515. in the test file).
  516. {\bf (ii)} The current release of the PHYSOP package is not optimized
  517. w.r.t. computation speed. Users should be aware that the evaluation
  518. of complicated expressions involving a lot of commutation relations
  519. requires a significant amount of CPU time \underline{and} memory.
  520. Therefore the use of PHYSOP on small machines is rather limited. A
  521. minimal hardware configuration should include at least 4 MB of
  522. memory and a reasonably fast CPU (type Intel 80386 or equiv.).
  523. {\bf (iii)} Slightly different ordering of operators (especially with
  524. multiple occurrences of the same operator with different indices)
  525. may appear in some calculations
  526. due to the internal ordering of atoms in the underlying LISP system
  527. (see last example in the test file). This cannot be entirely avoided
  528. by the package but does not affect the correctness of the results.
  529. \section{Compilation of the packages}
  530. To build a fast loading module of the NONCOM2 package, enter the
  531. following commands after starting the \REDUCE\ system: \\
  532. \begin{framedverbatim}
  533. faslout "noncom2";
  534. in "noncom2.red";
  535. faslend;
  536. \end{framedverbatim}
  537. To build a fast loading module of the PHYSOP package, enter the
  538. following commands after starting the \REDUCE\ system: \\
  539. \begin{framedverbatim}
  540. faslout "physop";
  541. in "noncom2.red";
  542. in "physop.red";
  543. faslend;
  544. \end{framedverbatim}
  545. Input and output file specifications may change according to the
  546. underlying operating system. \\
  547. On PSL--based systems, a spurious message: \\
  548. \begin{framedverbatim}
  549. *** unknown function PHYSOP!*SQ called from compiled code
  550. \end{framedverbatim}
  551. may appear during the compilation of the PHYSOP package. This warning
  552. has no effect on the functionality of the package.
  553. \section{Final remarks}
  554. The package PHYSOP has been presented by
  555. the author at the IV inter. Conference on Computer Algebra in Physical
  556. Research, Dubna (USSR) 1990 (see M. Warns, {\it
  557. Software Extensions of \REDUCE\ for Operator Calculus in Quantum Theory},
  558. Proc.\ of the IV inter.\ Conf.\ on Computer Algebra in Physical
  559. Research, Dubna 1990, to appear). It has been developed with the aim in
  560. mind to perform calculations of the type exemplified in the test file
  561. included in the distribution of this package.
  562. However it should
  563. also be useful in some other domains like e.g.\ the calculations of
  564. complicated Feynman diagrams in QCD which could not be performed using
  565. the HEPHYS package. The author is therefore grateful for any
  566. suggestion
  567. to improve or extend the usability of the package. Users should not
  568. hesitate to contact the author for additional help and explanations on
  569. how to use
  570. this package. Some bugs may also
  571. appear which have not been discovered during the tests performed
  572. prior to the release of this version. Please send in this case to the
  573. author a short
  574. input and output listing displaying the encountered problem.
  575. \section*{Acknowledgements}
  576. The main ideas for the implementation of a new data type in the \REDUCE\
  577. environnement have been taken from the VECTOR package developed by
  578. Dr.\ David Harper (D. Harper, Comp.\ Phys.\ Comm.\ {\bf 54} (1989)
  579. 295).
  580. Useful discussions with Dr.\ Eberhard Schr\"ufer and
  581. Prof.\ John Fitch are also gratefully acknowledged.
  582. \appendix
  583. \section{List of error and warning messages}
  584. In the following the error (E) and warning (W) messages specific to the
  585. PHYSOP package are listed.
  586. \begin{description}
  587. \item[\f{cannot declare} {\it x}\f{ as }{\it data type}] (W):
  588. An attempt has been made to declare an
  589. object {\it x} which cannot be used as a PHYSOP operator of the
  590. required type. The declaration command is ignored.
  591. \item [{\it x} \f{already defined as} {\it data type}] (W): The object
  592. {\it x} has already been declared using a \REDUCE\ type declaration
  593. command and can therefore not be used as a PHYSOP operator.
  594. The declaration command is ignored.
  595. \item [{\it x} \f{already declared as} {\it data type}] (W): The object
  596. \f{x} has already been declared with a PHYSOP declaration command.
  597. The declaration command is ignored.
  598. \item[{\it x} \f{is not a PHYSOP}] (E): An invalid argument has been
  599. included in an \f{OPORDER} command. Check the arguments.
  600. \item[\f{invalid argument(s) to }{\it function}] (E): A
  601. function implemented by the PHYSOP package has been called with an
  602. invalid argument. Check type of arguments.
  603. \item[\f{Type conflict in }{\it operation}] (E): A PHYSOP type conflict
  604. has occured during an arithmetic operation. Check the arguments.
  605. \item [\f{invalid call of }{\it function} \f{with args:} {\it arguments}]
  606. (E): A function
  607. of the PHYSOP package has been declared with invalid argument(s). Check
  608. the argument list.
  609. \item[\f{type mismatch in} {\it expression}] (E): A type mismatch has
  610. been detected in an expression. Check the corresponding expression.
  611. \item[\f{type mismatch in} {\it assignement}] (E): A type
  612. mismatch has been detected in an assignment or in a \f{LET}
  613. statement. Check the listed statement.
  614. \item[\f{PHYSOP type conflict in} {\it expr}] (E): A ambiguity has been
  615. detected during the type analysis of the expression. Check the
  616. expression.
  617. \item[\f{operators in exponent cannot be handled}] (E): An operator has
  618. occurred in the exponent of an expression.
  619. \item[\f{cannot raise a state to a power}] (E): states cannot be
  620. exponentiated by the system.
  621. \item[\f{invalid quotient}] (E): An invalid denominator has occurred in a
  622. quotient. Check the expression.
  623. \item[\f{physops of different types cannot be commuted}] (E): An invalid
  624. operator has occurred in a call of the \f{COMMUTE}/\f{ANTICOMMUTE} function.
  625. \item[\f{commutators only implemented between scalar operators}] (E):
  626. An invalid operator has occurred in the call of the
  627. \f{COMMUTE}/\f{ANTICOMMUTE} function.
  628. \item[\f{evaluation incomplete due to missing elementary relations}] (W):
  629. \\
  630. The system has not found all
  631. the elementary commutators or application relations necessary to
  632. calculate or reorder the input expression. The result may however be
  633. used for further calculations.
  634. \end{description}
  635. \section{List of available commands}
  636. \printindex
  637. \end{document}