Mathematica 9 is now available

Wolfram Library Archive

All Collections Articles Books Conference Proceedings
Courseware Demos MathSource Technical Notes
Title Downloads

Riemannian Geometry & Tensor Calculus

Sotirios Bonanos
Old MathSource #

Revision date


This package introduces definitions for tensor calculations in Riemannian Geometry. To begin a calculation the user must specify a Riemannian space by giving:
  1. a list of symbols (= coordinates),
  2. a symmetric matrix of functions of the coordinates (= metric tensor) and
  3. a list of simplification rules (optional).

The main routine in the package -- RGtensors[metric_, coordinates_] -- then computes explicit expressions for all common Riemannian Geometry tensors (Riemann, Ricci, Einstein, Weyl) and tests if the space belongs to any of the following categories: Flat, Conformally Flat, Ricci Flat, Einstein Space or Space of Constant Curvature. Each tensor is stored as a nested list (of its components) under an appropriate global name.

The following functions for operating on these tensors are defined: Raise/Lower indices, Contract (multiple) indices, Covariant and Lie Differentiation and Covariant Divergence. These functions, together with the built- in functions Outer (giving tensor products) and Transpose (index rearrangement) provide the necessary tools for performing all common tensor operations on the computer. Several examples of the use of these functions on tensors computed using different metrics are given.

Tensor components can be calculated with respect to an arbitrary frame, and approximate calculations (series expansions) can be carried out.

In addition to the code and the examples, the notebook RGTC351.nb contains Instructions and Usage Tips. The notebooks OperatorPLT.nb and NPsymbolPLT.nb are palettes for entering the operators/symbols used.

*Mathematics > Calculus and Analysis > Differential Geometry

Riemann tensor, Ricci tensor, Einstein tensor, General Relativity, covariant derivative
Downloads Download Wolfram CDF Player

NPsymbolPLT.nb (4.9 KB) - Mathematica Notebook
OperatorPLT.nb (5.5 KB) - Mathematica Notebook
RGTC351.nb (616.2 KB) - Mathematica Notebook