2 * Introduction to atensor::
3 * Functions and Variables for atensor::
6 @node Introduction to atensor, Functions and Variables for atensor, Package atensor, Package atensor
7 @section Introduction to atensor
9 @code{atensor} is an algebraic tensor manipulation package. To use @code{atensor},
10 type @code{load("atensor")}, followed by a call to the @code{init_atensor}
13 The essence of @code{atensor} is a set of simplification rules for the
14 noncommutative (dot) product operator ("@code{.}"). @code{atensor} recognizes
15 several algebra types; the corresponding simplification rules are put
16 into effect when the @code{init_atensor} function is called.
18 The capabilities of @code{atensor} can be demonstrated by defining the
19 algebra of quaternions as a Clifford-algebra Cl(0,2) with two basis
20 vectors. The three quaternionic imaginary units are then the two
21 basis vectors and their product, i.e.:
28 Although the @code{atensor} package has a built-in definition for the
29 quaternion algebra, it is not used in this example, in which we
30 endeavour to build the quaternion multiplication table as a matrix:
34 @c init_atensor(clifford,0,0,2);
35 @c atensimp(v[1].v[1]);
36 @c atensimp((v[1].v[2]).(v[1].v[2]));
39 @c for i thru adim do q[1,i+1]:q[i+1,1]:v[i];
40 @c q[1,4]:q[4,1]:v[1].v[2];
41 @c for i from 2 thru 4 do for j from 2 thru 4 do
42 @c q[i,j]:atensimp(q[i,1].q[1,j]);
46 (%i1) load("atensor");
47 (%o1) /share/tensor/atensor.mac
48 (%i2) init_atensor(clifford,0,0,2);
50 (%i3) atensimp(v[1].v[1]);
52 (%i4) atensimp((v[1].v[2]).(v[1].v[2]));
54 (%i5) q:zeromatrix(4,4);
64 (%i7) for i thru adim do q[1,i+1]:q[i+1,1]:v[i];
66 (%i8) q[1,4]:q[4,1]:v[1].v[2];
69 (%i9) for i from 2 thru 4 do for j from 2 thru 4 do
70 q[i,j]:atensimp(q[i,1].q[1,j]);
88 @code{atensor} recognizes as base vectors indexed symbols, where the symbol
89 is that stored in @code{asymbol} and the index runs between 1 and @code{adim}.
90 For indexed symbols, and indexed symbols only, the bilinear forms
91 @code{sf}, @code{af}, and @code{av} are evaluated. The evaluation
92 substitutes the value of @code{aform[i,j]} in place of @code{fun(v[i],v[j])}
93 where @code{v} represents the value of @code{asymbol} and @code{fun} is
94 either @code{af} or @code{sf}; or, it substitutes @code{v[aform[i,j]]}
95 in place of @code{av(v[i],v[j])}.
97 Needless to say, the functions @code{sf}, @code{af} and @code{av}
100 When the @code{atensor} package is loaded, the following flags are set:
108 If you wish to experiment with a nonassociative algebra, you may also
109 consider setting @code{dotassoc} to @code{false}. In this case, however,
110 @code{atensimp} will not always be able to obtain the desired
113 @opencatbox{Categories:}
115 @category{Share packages}
116 @category{Package atensor}
119 @c end concepts atensor
120 @node Functions and Variables for atensor, , Introduction to atensor, Package atensor
122 @section Functions and Variables for atensor
124 @anchor{init_atensor}
125 @deffn {Function} init_atensor @
126 @fname{init_atensor} (@var{alg_type}, @var{opt_dims}) @
127 @fname{init_atensor} (@var{alg_type})
129 Initializes the @code{atensor} package with the specified algebra type. @var{alg_type}
130 can be one of the following:
132 @code{universal}: The universal algebra has no commutation rules.
134 @code{grassmann}: The Grassman algebra is defined by the commutation
135 relation @code{u.v+v.u=0}.
137 @code{clifford}: The Clifford algebra is defined by the commutation
138 relation @code{u.v+v.u=-2*sf(u,v)} where @code{sf} is a symmetric
139 scalar-valued function. For this algebra, @var{opt_dims} can be up
140 to three nonnegative integers, representing the number of positive,
141 degenerate, and negative dimensions of the algebra, respectively. If
142 any @var{opt_dims} values are supplied, @code{atensor} will configure the
143 values of @code{adim} and @code{aform} appropriately. Otherwise,
144 @code{adim} will default to 0 and @code{aform} will not be defined.
146 @code{symmetric}: The symmetric algebra is defined by the commutation
147 relation @code{u.v-v.u=0}.
149 @code{symplectic}: The symplectic algebra is defined by the commutation
150 relation @code{u.v-v.u=2*af(u,v)} where @code{af} is an antisymmetric
151 scalar-valued function. For the symplectic algebra, @var{opt_dims} can
152 be up to two nonnegative integers, representing the nondegenerate and
153 degenerate dimensions, respectively. If any @var{opt_dims} values are
154 supplied, @code{atensor} will configure the values of @code{adim} and @code{aform}
155 appropriately. Otherwise, @code{adim} will default to 0 and @code{aform}
158 @code{lie_envelop}: The algebra of the Lie envelope is defined by the
159 commutation relation @code{u.v-v.u=2*av(u,v)} where @code{av} is
160 an antisymmetric function.
162 The @code{init_atensor} function also recognizes several predefined
165 @code{complex} implements the algebra of complex numbers as the
166 Clifford algebra Cl(0,1). The call @code{init_atensor(complex)} is
167 equivalent to @code{init_atensor(clifford,0,0,1)}.
169 @code{quaternion} implements the algebra of quaternions. The call
170 @code{init_atensor (quaternion)} is equivalent to
171 @code{init_atensor (clifford,0,0,2)}.
173 @code{pauli} implements the algebra of Pauli-spinors as the Clifford-algebra
174 Cl(3,0). A call to @code{init_atensor(pauli)} is equivalent to
175 @code{init_atensor(clifford,3)}.
177 @code{dirac} implements the algebra of Dirac-spinors as the Clifford-algebra
178 Cl(3,1). A call to @code{init_atensor(dirac)} is equivalent to
179 @code{init_atensor(clifford,3,0,1)}.
181 @opencatbox{Categories:}
182 @category{Package atensor}
188 @deffn {Function} atensimp (@var{expr})
190 Simplifies an algebraic tensor expression @var{expr} according to the rules
191 configured by a call to @code{init_atensor}. Simplification includes
192 recursive application of commutation relations and resolving calls
193 to @code{sf}, @code{af}, and @code{av} where applicable. A
194 safeguard is used to ensure that the function always terminates, even
195 for complex expressions.
197 @opencatbox{Categories:}
198 @category{Package atensor}
199 @category{Simplification functions}
205 @deffn {Function} alg_type
206 The algebra type. Valid values are @code{universal}, @code{grassmann},
207 @code{clifford}, @code{symmetric}, @code{symplectic} and @code{lie_envelop}.
209 @opencatbox{Categories:}
210 @category{Package atensor}
216 @defvr {Variable} adim
219 The dimensionality of the algebra. @code{atensor} uses the value of @code{adim}
220 to determine if an indexed object is a valid base vector. See @code{abasep}.
222 @opencatbox{Categories:}
223 @category{Package atensor}
224 @category{Global variables}
230 @defvr {Variable} aform
231 Default value: @code{ident(3)}
233 Default values for the bilinear forms @code{sf}, @code{af}, and
234 @code{av}. The default is the identity matrix @code{ident(3)}.
236 @opencatbox{Categories:}
237 @category{Package atensor}
238 @category{Global variables}
244 @defvr {Variable} asymbol
245 Default value: @code{v}
247 The symbol for base vectors.
249 @opencatbox{Categories:}
250 @category{Package atensor}
251 @category{Global variables}
257 @deffn {Function} sf (@var{u}, @var{v})
259 A symmetric scalar function that is used in commutation relations.
260 The default implementation checks if both arguments are base vectors
261 using @code{abasep} and if that is the case, substitutes the
262 corresponding value from the matrix @code{aform}.
264 @opencatbox{Categories:}
265 @category{Package atensor}
271 @deffn {Function} af (@var{u}, @var{v})
273 An antisymmetric scalar function that is used in commutation relations.
274 The default implementation checks if both arguments are base vectors
275 using @code{abasep} and if that is the case, substitutes the
276 corresponding value from the matrix @code{aform}.
278 @opencatbox{Categories:}
279 @category{Package atensor}
285 @deffn {Function} av (@var{u}, @var{v})
287 An antisymmetric function that is used in commutation relations.
288 The default implementation checks if both arguments are base vectors
289 using @code{abasep} and if that is the case, substitutes the
290 corresponding value from the matrix @code{aform}.
297 @c aform:matrix([0,3,-2],[-3,0,1],[2,-1,0]);
302 (%i1) load("atensor");
303 (%o1) /share/tensor/atensor.mac
306 (%i3) aform:matrix([0,3,-2],[-3,0,1],[2,-1,0]);
319 @opencatbox{Categories:}
320 @category{Package atensor}
327 @deffn {Function} abasep (@var{v})
329 Checks if its argument is an @code{atensor} base vector. That is, if it is
330 an indexed symbol, with the symbol being the same as the value of
331 @code{asymbol}, and the index having a numeric value between 1
334 @opencatbox{Categories:}
335 @category{Package atensor}
336 @category{Predicate functions}