~ubuntu-branches/debian/squeeze/maxima/squeeze

« back to all changes in this revision

Viewing changes to share/tensor/ex_calc.dem

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2006-10-18 14:52:42 UTC
  • mto: (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20061018145242-vzyrm5hmxr8kiosf
ImportĀ upstreamĀ versionĀ 5.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
("the anticommutative algebra's operations on indexed objects")$
2
 
("the operations are allowed only on the covariant tensors")$
3
 
load("ex_calc.mac");
4
 
dummyx:z;
5
 
("The exterior product is denoted by &. Take it on two 1-forms
6
 
  a([i])&b([j])")$
7
 
 
8
 
show(a([i])&b([j]))$
9
 
 
10
 
("The exterior product of the three  1-forms
11
 
  a([i])&b([j])&c([k])")$
12
 
 
13
 
show(a([i])&b([j])&c([k]))$
 
1
/* Copyright (C) 2003 Valerij Pipin <pip@iszf.irk.ru>
 
2
 *
 
3
 * This program is free software; you can redistribute it and/or
 
4
 * modify it under the terms of the GNU General Public License as
 
5
 * published by the Free Software Foundation; either version 2 of
 
6
 * the License, or (at your option) any later version.
 
7
 *
 
8
 * This program is distributed in the hope that it will be
 
9
 * useful, but WITHOUT ANY WARRANTY; without even the implied
 
10
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * Demonstrating exterior algebra operations
 
14
 *
 
15
*/
 
16
if get('itensor,'version)=false then load(itensor);
 
17
("Exterior algebra for fully antisymmetric covariant tensors")$
 
18
 
 
19
("The exterior product is denoted by ~. Apply it to two 1-forms")$
 
20
ishow(a([i])~b([j]))$
 
21
 
 
22
("The exterior product of the three  1-forms")$
 
23
ishow(a([i])~b([j])~c([k]))$
14
24
 
15
25
("Take a sum of two 3 forms")$
16
 
show( factor(a([i])&(bk*b([j]))&c([k]) +(ak*a([i]))&c([j])&b([k])))$
 
26
ishow( factor(a([i])~(bk*b([j]))~c([k]) +(ak*a([i]))~c([j])~b([k])))$
17
27
 
18
 
("declare 2-form (don't forget to put allsym:false) and take & with 1-form")$
19
 
allsym:false;
 
28
("declare a 2-form and compute its exterior product with a 1-form")$
20
29
decsym(p,2,0,[anti(all)],[]);
21
 
 
22
 
show(q([i])&p([j,k]))$
23
 
("the exterior (anticommutative) derivative
24
 
  is denoted by @ind, where ind denotes the component")$
25
 
 
26
 
("So actually d_k & form means in our notation form @ k, e.g.")$
27
 
 
28
 
show(p([j,k])@i)$
29
 
show((a([j])&b([k]))@i)$
30
 
show((a([j])&b([k]))@k)$
31
 
 
32
 
("the interior product is denoted by |_, say form |_ vector, where
33
 
  form is indexed tensor and vector is vector's name")$
34
 
show(a([i])|_a)$
35
 
 
36
 
show((a([i])&b([j]))|_a)$
37
 
("to avoid the mistake please use the literally sorted indices
38
 
  when you apply the |_ ")$
39
 
 
40
 
show(factor((a([i2])&b([i1]))|_a+ (a([i1])&b([i2]))|_a))$
41
 
 
42
 
("the Lie derivative is denoted by @L[vector,ind], (say form @L[vector,ind])
43
 
  where  vector is vector name and ind is the index of the component")$
44
 
("it is currently not applicable to functions.
45
 
  Also you have to use the literally sorted indices")$
46
 
 
47
 
show(a([i1])@L[v,i2])$
48
 
("tests the consequence of the
49
 
  Cartan identity for 1-forms.  The Lie derivative
50
 
  has to commute with the exterior one ")$
51
 
 
52
 
show((a([i1])@i2)@L[v,i3]-(a([i1])@L[v,i2])@i3)$
53
 
 
54
 
("where the (a([i1])@i2)@L[v,i3] is")$
55
 
show((a([i1])@i2)@L[v,i3])$
56
 
 
57
 
("the verifications of this consequence of the Cartan identity
58
 
  for the higher order forms are in car_iden.dem")$
 
30
ishow(q([i])~p([j,k]))$
 
31
 
 
32
("the exterior derivative by index k is denoted by extdiff(x,k)")$
 
33
ishow(extdiff(p([j,k]),i))$
 
34
("In other words, instead of 'd_k~f' we write extdiff(f,k)")$
 
35
ishow(extdiff((a([j])~b([k])),i))$
 
36
ishow(extdiff((a([j])~b([k])),k))$
 
37
 
 
38
("Contraction (interior product) with a vector v is denoted by f|v")$
 
39
ishow(a([i])|a)$
 
40
 
 
41
ishow((a([i])~b([j]))|a)$
 
42
 
 
43
("This operator always uses the first index in literal order")$
 
44
ishow(factor((a([i2])~b([i1]))|a+(a([i1])~b([i2]))|a))$
 
45
 
 
46
("The Lie derivative is liediff(v,x); v is a vector name, x a tensor")$
 
47
ishow(liediff(v,a([i1])))$
 
48
 
 
49
("The Lie-derivative works on all tensors (but not on functions)")$
 
50
ishow(liediff(v,a([i,j],[k,l],m)))$
 
51
 
 
52
("To see all these at work, we verify the Cartan identity for 1-forms")$
 
53
ishow(canform(liediff(v,extdiff(a([i1]),i2))-extdiff(liediff(v,a([i1])),i2)))$
 
54
 
 
55
("Where liediff(v,extdiff(a([i1]),i2)) evaluates to:")$
 
56
ishow(liediff(v,extdiff(a([i1]),i2)))$
 
57
 
 
58
("Cartan identities for higher-order forms are shown in car_iden.dem")$
 
59
 
 
60
/* End of demo -- comment line needed by MAXIMA to resume demo menu */