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.
15 if get('itensor,'version)=false then load(itensor);
19 ("We need to declare some properties of the Levi-Civita symbol")$
20 declare(nounify(levi_civita),constant);
21 decsym(nounify(levi_civita),4,0,[anti(all)],[]);
22 decsym(nounify(levi_civita),0,4,[],[anti(all)]);*/
23 decsym(g,2,0,[sym(all)],[]);
24 decsym(g,0,2,[],[sym(all)]);
25 ("The EM field tensor is the exterior derivative of a vector field")$
27 components(F([i,j],[]),extdiff(A([i],[]),j));
28 components(F([],[i,j]),F([k,l],[])*g([],[i,k])*g([],[j,l]));
29 showcomps(F([i,j],[]));
30 ("Two of Maxwell's equations reduce to simple geometric identities")$
31 ishow('extdiff('F([i,j],[]),k)=extdiff(F([i,j],[]),k))$
32 ("The other two Maxwell equations define the 4-current")$
34 components(J([],[i]),idiff(F([],[i,j]),j));
35 ("We limit ourselves to the constant metric of special relativity...")$
37 ("Here, the 4-current satisfies a conservation equation")$
44 ("The EM field tensor is invariant under a gauge transformation.")$
45 ("We can add the gradient of an arbitrary scalar function to A:")$
46 extdiff(A([i],[])+f([],[],i),j)-F([i,j],[]);
47 ("The dual of the EM field tensor shall be denoted xF here:")$
49 components(xF([a,b],[]),'levi_civita([a,b,c,d],[])*F([],[c,d]));
50 ("We also define mixed-index components")$
51 components(F([a],[b]),F([a,c],[])*g([],[b,c]));
52 components(xF([a],[b]),xF([a,c],[])*g([],[b,c]));
53 ("This is what we need to define the energy-momentum tensor")$
55 components(T([a,b],[]),(F([a,c],[])*F([b],[c])+xF([a,c],[])*xF([b],[c]))/8/%pi);
56 components(T([a],[b]),T([a,c],[])*g([],[b,c]));
57 components(T([],[a,b]),T([c],[b])*g([],[a,c]));
58 ("T satisfies the equation T_[a,b;c] = 0")$
59 covdiff(canform(T([a,b],[])),c)-
60 covdiff(canform(T([b,a],[])),c)+
61 covdiff(canform(T([b,c],[])),a)-
62 covdiff(canform(T([c,b],[])),a)+
63 covdiff(canform(T([c,a],[])),b)-
64 covdiff(canform(T([a,c],[])),b)$
69 ("The energy-momentum tensor is symmetric in its indices")$
71 T([a,b],[])-T([b,a],[])$
74 canform(rename(contract(expand(%))));
75 ("Let us examine the 4-current again")$
81 ("In empty space, the 4-current is identically zero.")$
82 ("This can only happen if A([a],[],b,c)-A([b],[],a,c)=0.")$
83 ("In this case, the energy-momentum tensor should be conserved")$
84 covdiff(T([a],[b]),b)$
91 ishow(canform(rename(contract(expand(%)))))$
92 ("Let us apply what we learned about the 4-current:")$
93 subst(A([%2],[],a,%1),A([a],[],%1,%2),%th(2))$
96 ("and apply it again, resolving subexpressions 'by hand'")$
97 ratsubst(A([],[%3],%2,a)*g([],[%1,%2]),A([],[%1],%2,a)*g([],[%2,%3]),%th(2))$
98 ishow(canform(contract(expand(%))))$
99 ratsubst(A([],[%3],%2,%3)*g([],[%1,%2]),A([],[%1],%2,%3)*g([],[%2,%3]),%)$
100 ishow(canform(contract(expand(%))))$
101 subst(A([%2],[],%1,a),A([%1],[],%2,a),%)$
102 subst(A([%2],[],%1,%3),A([%1],[],%2,%3),%)$
103 ("and we find that energy is, indeed, conserved for a free EM field:")$
104 canform(contract(%th(2)));
106 /* End of demo -- comment line needed by MAXIMA to resume demo menu */