An example in using the Riemann package

I started a Mathematica package to performs computations of Riemannian geometry. As an exercise in using it, I present here the computation of the curvature of a 2-sphere embedded in the euclidean space. The package is in development and its content is not meant to be exhaustive. This suffices however to perform some of the most basic computations on (pseudo-)Riemannian real manifolds. The package is available in its own git repository.

For something more general, I recommend you take a look at the excellent SageManifolds.

let us start by defining a background 3-dimensional euclidean space by providing a set of coordinates and a metric in the form of a squared line-element:

One way to embed the 2-sphere in the 3-dimensional euclidean space is to impose that

where denotes the Radius of the sphere. One parametrisation satisfying this constraint is

with taking up the role of local ordinates on the 2-sphere which we will denote as .

The components of the one-form normal to are obtained as follows

Once it has been normalised, this turns out to be

The general expression of the projector onto is

Here this gives:

Finally, the extrinsic curvature is the Lie derivative of this tensor along the normal vector defined above:

Here this gives:

The mean curvature is given by the trace of this tensor. Here, it is found to be

All the above was done using only vectors (and one-forms) belonging to the (co-)tangent bundle of the surrounding euclidean space without any explicit reference to the local coordinates on . The extrinsic curvature also has a representation on .

From , one constructs the vielbein:

where denotes the coordinates on , and are the coordinates on , . In our case, this reads, in the matrix form :

The induced metric on can then be computed as

which here gives:

Applying a transformation similar to Eq. to the extrinsic curvature gives

and so we recover Eq. by taking the trace ().