physop.tex 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. \chapter[PHYSOP: Operator Calculus]%
  2. {PHYSOP: Operator calculus in quantum theory}
  3. \label{PHYSOP}
  4. \typeout{{PHYSOP: Operator calculus in quantum theory}}
  5. {\footnotesize
  6. \begin{center}
  7. Mathias Warns \\
  8. Physikalisches Institut der Universit\"at Bonn \\
  9. Endenicher Allee 11--13 \\
  10. D--5300 BONN 1, Germany \\[0.05in]
  11. e--mail: UNP008@DBNRHRZ1.bitnet
  12. \end{center}
  13. }
  14. \ttindex{PHYSOP}
  15. The package PHYSOP has been designed to meet the requirements of
  16. theoretical physicists looking for a
  17. computer algebra tool to perform complicated calculations
  18. in quantum theory
  19. with expressions containing operators. These operations
  20. consist mainly in the calculation of commutators between operator
  21. expressions and in the evaluations of operator matrix elements
  22. in some abstract space.
  23. \section{The NONCOM2 Package}
  24. The package NONCOM2 redefines some standard \REDUCE\ routines
  25. in order to modify the way noncommutative operators are handled by the
  26. system. It redefines the \f{NONCOM}\ttindex{NONCOM} statement in
  27. a way more suitable for calculations in physics. Operators have now to
  28. be declared noncommutative pairwise, {\em i.e.\ }coding: \\
  29. \begin{verbatim}
  30. NONCOM A,B;
  31. \end{verbatim}
  32. declares the operators \f{A} and \f{B} to be noncommutative but allows them
  33. to commute with any other (noncommutative or not) operator present in
  34. the expression. In a similar way if one wants {\em e.g.\ }\f{A(X)} and
  35. \f{A(Y)} not to commute, one has now to code:
  36. \begin{verbatim}
  37. NONCOM A,A;
  38. \end{verbatim}
  39. A final example should make
  40. the use of the redefined \f{NONCOM} statement clear:
  41. \begin{verbatim}
  42. NONCOM A,B,C;
  43. \end{verbatim}
  44. declares \f{A} to be noncommutative with \f{B} and \f{C},
  45. \f{B} to be noncommutative
  46. with \f{A} and \f{C} and \f{C} to be noncommutative
  47. with \f{A} and \f{B}.
  48. Note that after these declaration
  49. {\em e.g.\ }\f{A(X)} and \f{A(Y)}
  50. are still commuting kernels.
  51. Finally to keep the compatibility with standard \REDUCE\, declaring a
  52. \underline{single} identifier using the \f{NONCOM} statement has the same
  53. effect as in
  54. standard \REDUCE.
  55. From the user's point of view there are no other
  56. new commands implemented by the package.
  57. \section{The PHYSOP package}
  58. The package PHYSOP implements a new \REDUCE\ data type to perform
  59. calculations with physical operators. The noncommutativity of
  60. operators is
  61. implemented using the NONCOM2 package so this file should be loaded
  62. prior to the use of PHYSOP.
  63. \subsection{Type declaration commands}
  64. The new \REDUCE\ data type PHYSOP implemented by the package allows the
  65. definition of a new kind of operators ({\em i.e.\ }kernels carrying
  66. an arbitrary
  67. number of arguments). Throughout this manual, the name
  68. ``operator''
  69. will refer, unless explicitly stated otherwise, to this new data type.
  70. This data type is in turn
  71. divided into 5 subtypes. For each of this subtype, a declaration command
  72. has been defined:
  73. \begin{description}
  74. \item[\f{SCALOP A;} ]\ttindex{SCALOP} declares \f{A} to be a scalar
  75. operator. This operator may
  76. carry an arbitrary number of arguments; after the
  77. declaration: \f{ SCALOP A; }
  78. all kernels of the form
  79. \f{A(J), A(1,N), A(N,L,M)}
  80. are recognised by the system as being scalar operators.
  81. \item[\f{VECOP V;} ]\ttindex{VECOP} declares \f{V} to be a vector operator.
  82. As for scalar operators, the vector operators may carry an arbitrary
  83. number of arguments. For example \f{V(3)} can be used to represent
  84. the vector operator $\vec{V}_{3}$. Note that the dimension of space
  85. in which this operator lives is \underline{arbitrary}.
  86. One can however address a specific component of the
  87. vector operator by using a special index declared as \f{PHYSINDEX} (see
  88. below). This index must then be the first in the argument list
  89. of the vector operator.
  90. \item[\f{TENSOP C(3);} ] \ttindex{TENSOP}
  91. declares \f{C} to be a tensor operator of rank 3. Tensor operators
  92. of any fixed integer rank larger than 1 can be declared.
  93. Again this operator may carry an arbitrary number of arguments
  94. and the space dimension is not fixed.
  95. The tensor
  96. components can be addressed by using special \f{PHYSINDEX} indices
  97. (see below) which have to be placed in front of all other
  98. arguments in the argument list.
  99. \item[\f{STATE U;} ]\ttindex{STATE} declares \f{U} to be a state, {\em i.e.\ }an
  100. object on
  101. which operators have a certain action. The state U can also carry an
  102. arbitrary number of arguments.
  103. \item[\f{PHYSINDEX X;} ]\ttindex{PHYSINDEX} declares \f{X} to be a special
  104. index which will be used
  105. to address components of vector and tensor operators.
  106. \end{description}
  107. A command \f{CLEARPHYSOP}\ttindex{CLEARPHYSOP}
  108. removes
  109. the PHYSOP type from an identifier in order to use it for subsequent
  110. calculations. However it should be
  111. remembered that \underline{no}
  112. substitution rule is cleared by this function. It
  113. is therefore left to the user's responsibility to clear previously all
  114. substitution rules involving the identifier from which the PHYSOP type
  115. is removed.
  116. \subsection{Ordering of operators in an expression}
  117. The ordering of kernels in an expression is performed according to
  118. the following rules: \\
  119. 1. \underline{Scalars} are always ordered ahead of
  120. PHYSOP operators in an expression.
  121. The \REDUCE\ statement \f{KORDER}\ttindex{KORDER} can be used to control the
  122. ordering of scalars but has no
  123. effect on the ordering of operators.
  124. 2. The default ordering of operators follows the
  125. order in which they have been declared (not the alphabetical one).
  126. This ordering scheme can be changed using the command \f{OPORDER}.
  127. \ttindex{OPORDER}
  128. Its syntax is similar to the \f{KORDER} statement, {\em i.e.\ }coding:
  129. \f{OPORDER A,V,F;}
  130. means that all occurrences of the operator \f{A} are ordered ahead of
  131. those of \f{V} etc. It is also possible to include operators
  132. carrying
  133. indices (both normal and special ones) in the argument list of
  134. \f{OPORDER}. However including objects \underline{not}
  135. defined as operators ({\em i.e.\ }scalars or indices) in the argument list
  136. of the \f{OPORDER} command leads to an error.
  137. 3. Adjoint operators are placed by the declaration commands just
  138. after the original operators on the \f{OPORDER} list. Changing the
  139. place of an operator on this list means \underline{not} that the
  140. adjoint operator is moved accordingly. This adjoint operator can
  141. be moved freely by including it in the argument list of the
  142. \f{OPORDER} command.
  143. \subsection{Arithmetic operations on operators}
  144. The following arithmetic operations are possible with
  145. operator expressions: \\
  146. 1. Multiplication or division of an operator by a scalar.
  147. 2. Addition and subtraction of operators of the \underline{same}
  148. type.
  149. 3. Multiplication of operators is only defined between two
  150. \underline{scalar} operators.
  151. 4. The scalar product of two VECTOR operators is implemented
  152. with a new function \f{DOT}\ttindex{DOT}. The system expands
  153. the product of
  154. two vector operators into an ordinary product of the components of these
  155. operators by inserting a special index generated by the program.
  156. To give an example, if one codes:
  157. \begin{verbatim}
  158. VECOP V,W;
  159. V DOT W;
  160. \end{verbatim}
  161. the system will transform the product into:
  162. \begin{verbatim}
  163. V(IDX1) * W(IDX1)
  164. \end{verbatim}
  165. where \f{IDX1} is a \f{PHYSINDEX} generated by the system (called a
  166. DUMMY INDEX in the following) to express the summation over the
  167. components. The identifiers \f{IDXn} (\f{n} is a nonzero integer) are
  168. reserved variables for this purpose and should not be used for other
  169. applications. The arithmetic operator
  170. \f{DOT} can be used both in infix and prefix form with two arguments.
  171. 5. Operators (but not states) can only be raised to an
  172. \underline{integer} power. The system expands this power
  173. expression into a product of the corresponding number of terms
  174. inserting dummy indices if necessary. The following examples explain
  175. the transformations occurring on power expressions (system output
  176. is indicated with an \f{-->}):
  177. \begin{verbatim}
  178. SCALOP A; A**2;
  179. --> A*A
  180. VECOP V; V**4;
  181. --> V(IDX1)*V(IDX1)*V(IDX2)*V(IDX2)
  182. TENSOP C(2); C**2;
  183. --> C(IDX3,IDX4)*C(IDX3,IDX4)
  184. \end{verbatim}
  185. Note in particular the way how the system interprets powers of
  186. tensor operators which is different from the notation used in matrix
  187. algebra.
  188. 6. Quotients of operators are only defined between
  189. scalar operator expressions.
  190. The system transforms the quotient of 2 scalar operators into the
  191. product of the first operator times the inverse of the second one.
  192. \begin{verbatim}
  193. SCALOP A,B; A / B;
  194. -1
  195. A *( B )
  196. \end{verbatim}
  197. 7. Combining the last 2 rules explains the way how the system
  198. handles negative powers of operators:
  199. \noindent
  200. \begin{verbatim}
  201. SCALOP B;
  202. B**(-3);
  203. -1 -1 -1
  204. --> (B )*(B )*(B )
  205. \end{verbatim}
  206. The method of inserting dummy indices and expanding powers of
  207. operators has been chosen to facilitate the handling of
  208. complicated operator
  209. expressions and particularly their application on states.
  210. However it may be useful to get rid of these
  211. dummy indices in order to enhance the readability of the
  212. system's final output.
  213. For this purpose the switch \f{CONTRACT}\ttindex{CONTRACT} has to
  214. be turned on (\f{CONTRACT} is normally set to \f{OFF}).
  215. The system in this case contracts over dummy indices reinserting the
  216. \f{DOT} operator and reassembling the expanded powers. However due to
  217. the predefined operator ordering the system may not remove all the
  218. dummy indices introduced previously.
  219. %%file).
  220. \subsection{Special functions}
  221. \subsubsection{Commutation relations}
  222. If two PHYSOPs have been declared noncommutative using the (redefined)
  223. \f{NONCOM}\ttindex{NONCOM} statement, it is possible to introduce in the environment
  224. elementary (anti-) commutation relations between them. For
  225. this purpose,
  226. two scalar operators \f{COMM}\ttindex{COMM} and
  227. \f{ANTICOMM}\ttindex{ANTICOMM} are available.
  228. These operators are used in conjunction with \f{LET} statements.
  229. Example:
  230. \begin{verbatim}
  231. SCALOP A,B,C,D;
  232. LET COMM(A,B)=C;
  233. FOR ALL N,M LET ANTICOMM(A(N),B(M))=D;
  234. VECOP U,V,W; PHYSINDEX X,Y,Z;
  235. FOR ALL X,Y LET COMM(V(X),W(Y))=U(Z);
  236. \end{verbatim}
  237. Note that if special indices are used as dummy variables in
  238. \f{FOR ALL ... LET} constructs then these indices should have been
  239. declared previously using the \f{PHYSINDEX} command.\ttindex{PHYSINDEX}
  240. Every time the system
  241. encounters a product term involving two
  242. noncommutative operators which have to be reordered on account of the
  243. given operator ordering, the list of available (anti-) commutators is
  244. checked in the following way: First the system looks for a
  245. \underline{commutation} relation which matches the product term. If it
  246. fails then the defined \underline{anticommutation} relations are
  247. checked. If there is no successful match the product term
  248. \f{A*B} is replaced by: \\
  249. \begin{verbatim}
  250. A*B;
  251. --> COMM(A,B) + B*A
  252. \end{verbatim}
  253. so that the user may introduce the commutation relation later on.
  254. The user may want to force the system to look for
  255. \underline{anticommutators} only; for this purpose a switch \f{ANTICOM}
  256. \ttindex{ANTICOM}
  257. is defined which has to be turned on ( \f{ANTICOM} is normally set to
  258. \f{OFF}). In this case, the above example is replaced by:
  259. \begin{verbatim}
  260. ON ANTICOM;
  261. A*B;
  262. --> ANTICOMM(A,B) - B*A
  263. \end{verbatim}
  264. For the calculation of (anti-) commutators between complex
  265. operator
  266. expressions, the functions \f{COMMUTE}\ttindex{COMMUTE} and
  267. \f{ANTICOMMUTE}\ttindex{ANTICOMMUTE} have been defined.
  268. \begin{verbatim}
  269. VECOP P,A,K;
  270. PHYSINDEX X,Y;
  271. FOR ALL X,Y LET COMM(P(X),A(Y))=K(X)*A(Y);
  272. COMMUTE(P**2,P DOT A);
  273. \end{verbatim}
  274. \subsubsection{Adjoint expressions}
  275. As has been already mentioned, for each operator and state defined
  276. using the declaration commands, the system
  277. generates automatically the corresponding adjoint operator. For the
  278. calculation of the adjoint representation of a complicated
  279. operator expression, a function \f{ADJ}\ttindex{ADJ} has been defined.
  280. \begin{verbatim}
  281. SCALOP A,B;
  282. ADJ(A*B);
  283. + +
  284. --> (A )*(B )
  285. \end{verbatim}
  286. \subsubsection{Application of operators on states}
  287. A function \f{OPAPPLY}\ttindex{OPAPPLY} has been
  288. defined for the application of operators to states.
  289. It has two arguments and is used in the following combinations:
  290. {\bf (i)} \f{LET OPAPPLY(}{\it operator, state}\f{) =} {\it state};
  291. This is to define a elementary
  292. action of an operator on a state in analogy to the way
  293. elementary commutation relations are introduced to the system.
  294. \begin{verbatim}
  295. SCALOP A; STATE U;
  296. FOR ALL N,P LET OPAPPLY((A(N),U(P))= EXP(I*N*P)*U(P);
  297. \end{verbatim}
  298. {\bf (ii)} \f{LET OPAPPLY(}{\it state, state}\f{) =} {\it scalar exp.};
  299. This form is to define scalar products between states and normalisation
  300. conditions.
  301. \begin{verbatim}
  302. STATE U;
  303. FOR ALL N,M LET OPAPPLY(U(N),U(M)) = IF N=M THEN 1 ELSE 0;
  304. \end{verbatim}
  305. {\bf (iii)} {\it state} \f{:= OPAPPLY(}{\it operator expression, state});
  306. In this way, the action of an operator expression on a given state
  307. is calculated using elementary relations defined as explained in {\bf
  308. (i)}. The result may be assigned to a different state vector.
  309. {\bf (iv)} \f{OPAPPLY(}{\it state}\f{, OPAPPLY(}{\it operator expression,
  310. state}\f{))}; This is the way how to calculate matrix elements of
  311. operator
  312. expressions. The system proceeds in the following way: first the
  313. rightmost operator is applied on the right state, which means that the
  314. system tries
  315. to find an elementary relation which match the application of the
  316. operator on the state. If it fails
  317. the system tries to apply the leftmost operator of the expression on the
  318. left state using the adjoint representations. If this fails also,
  319. the system prints out a warning message and stops the evaluation.
  320. Otherwise the next operator occuring in the expression is
  321. taken and so on until the complete expression is applied. Then the
  322. system
  323. looks for a relation expressing the scalar product of the two
  324. resulting states and prints out the final result. An example of such
  325. a calculation is given in the test file.
  326. The infix version of the \f{OPAPPLY} function is the vertical bar
  327. $\mid$. It is \underline{right} associative and placed in the
  328. precedence
  329. list just above the minus ($-$) operator.