# USING A GENERALIZED BASIS IN CALCULATING THE CURVATURE TENSOR
# ---------------------------------------------------------------
# This program was developed in 1986 for the Grad Student Rational
# Calculator program of F. J. Ernst.  Here we rewrite the program
# for Maple.  Reference: J. Math. Phys. 12, 2395 (1971).
# ---------------------------------------------------------------
# We shall employ a generic procedure to calculated the Ricci
# rotation matrix of differential forms, given the differentials
# of the basic 1-forms e[a], and the metric g[a,b] with respect to
# that generalized basis.
# read `RRsolve.m`;
with(share): readshare(RRsolve,fjeforms);
# Employ the FJE ENTERPRISES revision of difforms package:
# read `fjeforms.m`: with(fjeforms):
readshare(fjeforms,fjeforms): with(fjeforms);
# Select a block form for the metric
g := array(symmetric,0..3,0..3):
g[0,0] := -1:
for a from 1 to 3 do g[0,a] := 0 od:
# Specify how to display partial derivatives:
dcomps := [d(x[0]),`d[0]`],[d(x[1]),`d[1]`],
           [d(x[2]),`d[2]`],[d(x[3]),`d[3]`];
# Compute and print out the differential of metric:
for a from 0 to 3 do
     for b from 0 to 3 do
         dg[a,b] := d(g[a,b],dcomps);
         print( evaln(dg[a,b]) = dg[a,b] );
     od;
 od;
# Next we specify the choice of tetrad.
e[0] := sqrt(F)*(d(x[0])-W[1]*d(x[1])-W[2]*d(x[2])-W[3]*d(x[3]));
for a from 1 to 3 do e[a] := d(x[a])/sqrt(F) od;
# The differentials of these basic 1-forms are given by:
for a from 0 to 3 do de[a] := d(e[a],dcomps) od;
# Now we can express de[a] and dg[a,b] in terms of e[a]:
for a from 0 to 3 do e[a] := evaln(e[a]); od:
defform(e[0]=1,e[1]=1,e[2]=1,e[3]=1):
for a from 1 to 3 do d(x[a]) := sqrt(F)*e[a]; od;
d(x[0]) := W[1]*d(x[1])+W[2]*d(x[2])+W[3]*d(x[3])+e[0]/sqrt(F);
for a from 0 to 3 do de[a] := simpform(expand(de[a])) od;
for a from 0 to 3 do
     for b from 0 to 3 do
         dg[a,b] := simpform(expand(dg[a,b]));
         print( evaln(dg[a,b]) = dg[a,b] );
     od
 od;
# Call RRsolve, which computes the skew-symmetric Ricci rotation
# matrix Omega[a,b].
RRsolve(de,g,dg);
# Print out Ricci rotation matrix Omega[a,b]:
for a from 0 to 3 do
    for b from 0 to 3 do
         print( evaln(Omega[a,b]) = Omega[a,b])
    od
od;
quit
