File: itensor4.dem

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (62 lines) | stat: -rw-r--r-- 2,328 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * Demonstrating special tensors
 */
if get('itensor,'version)=false then load(itensor);
("the Kronecker delta is defined the usual way")$
ishow(kdelta([i],[j]))$
ishow(kdelta([i,j],[n,m]))$
ishow(kdelta([i,j,k],[l,n,m]))$

("A symmetricized version is also defined, useful in many calculations:")$
ishow(kdels([i],[l]))$
ishow(kdels([i,j],[l,k]))$
ishow(kdels([i,j,k],[l,m,n]))$
ishow(ev(kdels([],[]),kdelta))$

("Contraction of such kdels and kdelta gives zero.  Look at the huge sum")$
ishow(expand(kdels([i,j,k],[l,m,n])*kdelta([l,m,n],[i1,i2,i3])))$
ishow(contract(%))$

("Another example")$
("take the symmetrization of A_ijk")$
ishow(contract(expand(a([i1,j1,k1],[])*kdels([i,j,k],[i1,j1,k1]))))$

("The Levi-Civita symbol accepts numeric and symbolic arguments:")$
dim:3;
levi_civita([1,2,3]);
levi_civita([i,j,j],[]);
%,kdelta;
("The lc2kdt function simplifies the unevaluated Levi-Civita symbol")$
ishow('levi_civita([i,j,k],[])*a([],[j])*
      'levi_civita([],[k,l,n])*b([l],[])*c([n],[]))$
ishow(contract(expand(lc2kdt(%))))$

ishow('levi_civita([i,j,k],[])*a([],[j])*b([],[k])*'levi_civita([],[i,l,n])*c([l],[])*u([n],[]))$
ishow(contract(expand(lc2kdt(%))))$

("Two simplification rules process Levi-Civita index patterns")$
ishow('levi_civita([i,j,k],[])*a([],[j])*a([],[k])+'levi_civita([],[i,j,k])*a([j])*b([k]))$
applyb1(%,lc_l,lc_u)$
ishow(factor(canform(contract(expand(%)))))$

("Finally look for the dualization of the antisymmetric tensor B")$
decsym(B,2,0,[anti(all)],[]);
ishow(B([i,j],[]))$
("Compute the dualization")$
rank:length(covi(B([i,j],[])))$
dual:ishow('levi_civita([],[l,i,j])*B([i,j],[])/rank!)$
("Return to the original")$
ishow('levi_civita([i2,j2,l],[])*dual)$
ishow(canform(contract(expand(lc2kdt(%)))))$

/* End of demo -- comment line needed by MAXIMA to resume demo menu */