The file curvature.m contains Mathematica functions to calculate connections and curvature for metrics that are of of the form \sum e_i exp(2f_i) (dx_i)^2. The indices start with 1 rather than 0 as in the course since Mathematica labels the components of array, A, A[[1]],A[[2]],.... Also the exterior calculus (d, \wedge, etc) is only done up to degree 2. Read the comments in the file curvature.m for an explanation of the functions. The best way to use the functions is to paste them in order into Mathematica. If you place the file curvature.m in directory (folder) then you can put all the functions in simultaneously using << \curvature.m The << is the command to insert. Here are the main examples all in n=4 dimensions (* conformally flat constant positive curvature *) e = {1,1,1,1}; f = -Log[1+Sum[x[i]^2,{i,1,4}]]; (* Lorentzian *) e = {1,-1,-1,-1}; (* Pull back of metric on U(2) used in class *) f=-Log[1+ 2 Sum[x[i]^2,{i,1,4}]+Sum[e[[i]]x[i]^2,{i,1,4}]^2]/2; (* Normalized Schwarzschild *) f = {Log[1- 1/Sum[x[i]^2,{i,2,4}]^(1/2)]-Log[1+ 1/Sum[x[i]^2,{i,2,4}]^(1/2)], 2 Log[1+ 1/Sum[x[i]^2,{i,2,4}]^(1/2)],2 Log[1+ 1/Sum[x[i]^2,{i,2,4}]^(1/2)], 2 Log[1+ 1/Sum[x[i]^2,{i,2,4}]^(1/2]}