Some moderately interesting Maxima examples.
First, this is how we can prove that the covariant derivative of the metric vanishes (but only if the metric is symmetric!)
load(itensor);
imetric(g);
ishow(covdiff(g([],[i,j]),k))$
%,ichr2$
ishow(contract(canform(contract(canform(rename(expand(%)))))))$
ishow(covdiff(g([i,j],[]),k))$
%,ichr2$
ishow(canform(contract(rename(expand(%)))))$
decsym(g,2,0,[sym(all)],[]);
decsym(g,0,2,[],[sym(all)]);
ishow(covdiff(g([],[i,j]),k))$
%,ichr2$
ishow(contract(canform(contract(canform(rename(expand(%)))))))$
ishow(covdiff(g([i,j],[]),k))$
%,ichr2$
ishow(canform(contract(rename(expand(%)))))$
Next, the equation of motion for a perfect fluid:
load(itensor);
imetric(g);
decsym(g,2,0,[sym(all)],[]);
decsym(g,0,2,[],[sym(all)]);
defcon(v,v,u);
components(u([],[]),1);
components(T([],[i,j]),(rho([],[])+p([],[]))*v([],[i])*v([],[j])
-p([],[])*g([],[i,j]));
ishow(covdiff(T([],[i,j]),i))$
ishow(canform(%))$
ishow(canform(rename(contract(expand(%)))))$
%,ichr2$
canform(%)$
ishow(canform(rename(contract(expand(%)))))$
Finally, the equation of motion in the spherically symmetric, static case:
load(ctensor);
load(itensor);
K:J([i],[])=covdiff(T([i],[j]),j);
E:ic_convert(K);
ct_coords:[t,r,u,v];
lg:ident(4);
lg[1,1]:B;
lg[2,2]:-A;
lg[3,3]:-r^2;
lg[4,4]:-r^2*sin(u)^2;
depends([A,B,T,rho,p],[r]);
derivabbrev:true;
cmetric();
christof(mcs);
J:[0,0,0,0];
ev(E);
T:ident(4);
T[1,1]:rho;
T[2,2]:T[3,3]:T[4,4]:p;
J,ev;
These examples are probably not profound enough to include with Maxima, but are useful to remember.