atensor
is an algebraic tensor manipulation package
the essence of atensor
is a set of simplification rules for the noncommutative product operator .
to use atensor
, type load(atensor)
, followed by a call to the init_atensor()
function
atensor
recognizes several algebra types; the corresponding simplification rules are put into effect when the init_atensor
function is called:
-------------------------------------------------------- algebra commutator -------------------------------------------------- universal no commutation rules symmetric u · v − v · u = 0 symplectic u · v − v · u = 2 af (u , v) lie_envelop u · v − v · u = 2 av (u , v) grassmann u · v + v · u = 0 clifford u · v + v · u = 2 sf (u , v) --------------------------------------------------------here,
sf
- symmetric scalar valued function sf (u, v) = sf (v, u)af
- an antisymmetric scalar valued function af (u, v) = − af (v, u) av
- an antisymmetric vector valued function
the init_atensor
function also recognizes several predefined algebra types:
complex
implements the algebra of complex numbers quaternion
implements the algebra of quaternions pauli
implements the algebra of Pauli-spinors dirac
implements the algebra of Dirac-spinors alg_type
can be one of the following: atensor
recognizes as base vectors indexed symbols, where the symbol is that stored in asymbol
and the index runs between 1 and adim
for indexed symbols only, the bilinear forms sf
, af
and av
are evaluated. the evaluation substitutes the value of aform[i,j]
in place of fun(v[i],v[j])
where
asymbol
andaf
or sf
or av
kill(all)$ load(atensor)$ init_atensor(complex)$ aform; adim; t : 1 + 2 * v[1] ; s : 2 - 2 * v[1] ; atensimp (t . s) ; atensimp (s . t) ; /* compare with */ a : 1 + 2 * %i ; b : 2 - 2 * %i ; c : a * b ; realpart (c) ; imagpart (c) ;
(%i3) init_atensor (grassmann,3) (%o3) done (%i4) adim (%o4) 3 (%i5) aform [ 1 0 0 ] [ ] (%o5) [ 0 1 0 ] [ ] [ 0 0 1 ] (%i6) abasep (v[1]) (%o6) true (%i7) abasep (v[2]) (%o7) true (%i8) abasep (v[3]) (%o8) true (%i9) s : 4*v[1] - 2*v[2] (%o9) 4 v - 2 v 1 2 (%i10) t : (-3)*v[2] + 7*v[3] (%o10) 7 v - 3 v 3 2 (%i13) r1 : atensimp(s . t); (%o13) 4 (7 (v . v ) - 3 (v . v )) - 14 (v . v ) 1 3 1 2 2 3 (%i14) ev(r1, v[1]=1, v[2]=1, v[3]=1) ; (%o14) 2 (%i15) r2 : atensimp(t . s) ; (%o15) 7 (2 (v . v ) - 4 (v . v )) + 12 (v . v ) 2 3 1 3 1 2 (%i16) ev(r2, v[1]=1, v[2]=1, v[3]=1) ; (%o16) - 2
we will build the quaternion multiplication table as a matrix by defining the algebra of quaternions as a Clifford-algebra Cl(0,2) with two basis vectors v[1] and v[2]
the three quaternionic imaginary units are then the two basis vectors and their product:
i = v[1] j = v[2] k = v[1] . v[2]
let us produce Cayley table for quaternions:
load (atensor) $ init_atensor (clifford,0,0,2) $ q : zeromatrix (4, 4) $ q[1,1] : 1 $ /* just symbol of multiplication, nothing more */ for i thru adim do q[1,i+1] : q[i+1,1] : v[i] $ q[1,4] : q[4,1] : v[1] . v[2] $ for i from 2 thru 4 do for j from 2 thru 4 do q[i,j] : atensimp (q[i, 1] . q[1, j]) $ q ;
output :
[ 1 v v v . v ] [ 1 2 1 2 ] [ ] [ v - 1 v . v - v ] [ 1 1 2 2 ] [ ] [ v - v . v - 1 v ] [ 2 1 2 1 ] [ ] [ v . v v - v - 1 ] [ 1 2 2 1 ]