1 /* Copyright (C) 2003 Valerij Pipin <pip@iszf.irk.ru>
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.
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.
13 * Demonstrating exterior algebra operations
16 if get('itensor,'version)=false then load(itensor);
17 ("Exterior algebra for fully antisymmetric covariant tensors")$
19 ("The exterior product is denoted by ~. Apply it to two 1-forms")$
22 ("The exterior product of the three 1-forms")$
23 ishow(a([i])~b([j])~c([k]))$
25 ("Take a sum of two 3 forms")$
26 ishow( factor(a([i])~(bk*b([j]))~c([k]) +(ak*a([i]))~c([j])~b([k])))$
28 ("declare a 2-form and compute its exterior product with a 1-form")$
29 decsym(p,2,0,[anti(all)],[]);
30 ishow(q([i])~p([j,k]))$
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))$
38 ("Contraction (interior product) with a vector v is denoted by f|v")$
41 ishow((a([i])~b([j]))|a)$
43 ("This operator always uses the first index in literal order")$
44 ishow(factor((a([i2])~b([i1]))|a+(a([i1])~b([i2]))|a))$
46 ("The Lie derivative is liediff(v,x); v is a vector name, x a tensor")$
47 ishow(liediff(v,a([i1])))$
49 ("The Lie-derivative works on all tensors (but not on functions)")$
50 ishow(liediff(v,a([i,j],[k,l],m)))$
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)))$
55 ("Where liediff(v,extdiff(a([i1]),i2)) evaluates to:")$
56 ishow(liediff(v,extdiff(a([i1]),i2)))$
58 ("Cartan identities for higher-order forms are shown in car_iden.dem")$
60 /* End of demo -- comment line needed by MAXIMA to resume demo menu */