2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License as
4
* published by the Free Software Foundation; either version 2 of
5
* the License, or (at your option) any later version.
7
* This program is distributed in the hope that it will be
8
* useful, but WITHOUT ANY WARRANTY; without even the implied
9
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10
* PURPOSE. See the GNU General Public License for more details.
12
* Demonstrating special tensors
14
if get('itensor,'version)=false then load(itensor);
15
("the Kronecker delta is defined the usual way")$
16
ishow(kdelta([i],[j]))$
17
ishow(kdelta([i,j],[n,m]))$
18
ishow(kdelta([i,j,k],[l,n,m]))$
20
("A symmetricized version is also defined, useful in many calculations:")$
21
ishow(kdels([i],[l]))$
22
ishow(kdels([i,j],[l,k]))$
23
ishow(kdels([i,j,k],[l,m,n]))$
24
ishow(ev(kdels([],[]),kdelta))$
26
("Contraction of such kdels and kdelta gives zero. Look at the huge sum")$
27
ishow(expand(kdels([i,j,k],[l,m,n])*kdelta([l,m,n],[i1,i2,i3])))$
31
("take the symmetrization of A_ijk")$
32
ishow(contract(expand(a([i1,j1,k1],[])*kdels([i,j,k],[i1,j1,k1]))))$
34
("The Levi-Civita symbol accepts numeric and symbolic arguments:")$
37
levi_civita([i,j,j],[]);
39
("The lc2kdt function simplifies the unevaluated Levi-Civita symbol")$
40
ishow('levi_civita([i,j,k],[])*a([],[j])*
41
'levi_civita([],[k,l,n])*b([l],[])*c([n],[]))$
42
ishow(contract(expand(lc2kdt(%))))$
44
ishow('levi_civita([i,j,k],[])*a([],[j])*b([],[k])*'levi_civita([],[i,l,n])*c([l],[])*u([n],[]))$
45
ishow(contract(expand(lc2kdt(%))))$
47
("Two simplification rules process Levi-Civita index patterns")$
48
ishow('levi_civita([i,j,k],[])*a([],[j])*a([],[k])+'levi_civita([],[i,j,k])*a([j])*b([k]))$
50
ishow(factor(canform(contract(expand(%)))))$
52
("Finally look for the dualization of the antisymmetric tensor B")$
53
decsym(B,2,0,[anti(all)],[]);
55
("Compute the dualization")$
56
rank:length(covi(B([i,j],[])))$
57
dual:ishow('levi_civita([],[l,i,j])*B([i,j],[])/rank!)$
58
("Return to the original")$
59
ishow('levi_civita([i2,j2,l],[])*dual)$
60
ishow(canform(contract(expand(lc2kdt(%)))))$
62
/* End of demo -- comment line needed by MAXIMA to resume demo menu */