Metrics

A database of metrics for use with Mathematica.

The Metrics package supplies a database of exact solutions for Einstein’s equations for use with Mathematica. It is designed to be compatible with xTensor, Kranc and NRMMA, but can be used in any situation (with or without Mathemtaica) where exact solutions are needed.

Basic usage

For basic usage, we just load the Metrics package which supplies an interface to the database:

<<Metrics`

??Metrics`*

The metrics are stored in files, one file per metric. These files may be in any directory listed in $MetricPath.

$MetricPath

So far there are some simple example metrics included:

ListMetrics[]//TableForm

We can get a detailed report of a specific metric

MetricInfo["Schwarzschild"]

Metric definitions

A metric definition consists of a list of rules specifying the poroperties of the metric. The required elements in this list are:
“Name”: A unique name for this metric.
“Description”: A brief description of the metric.
“Coordinates”: A list of the coordinates.
“Metric”: An array of components of the metric.

There are also many optional properties, including:
“SignDet”: Sign of the determinant of the metric. Defaults to -1.
“AInds”: List of abstract indices (for use with xTensor). Defaults to a, ..., z.
“BInds”: List of basis indices (for use with xTensor). Defaults to 1, ..., ndim.

GetMetric["Schwarzschild"]

We allow a lot of flexibility in metric definitions. All we require is an expression which returns a list of rules including the required rules above. This allows us to programattically define a metric. As an example, we can define the Kerr-Schild metric using the following:

FilePrint[FileNameJoin[{$MetricPath[[1]],"KerrSchild.m"}]]

Usage with xTensor

<<Metrics`LoadMetric`

$DefInfoQ=False;
$CVVerbose=False;
$UndefInfoQ=False;
$PrePrint=ScreenDollarIndices;

LoadMetric["Minkowski"]

MetricInfo[$CurrentMetric]

UnloadMetric[]

LoadMetric["Schwarzschild"]

MetricInfo[$CurrentMetric]

MetricCompute[g,Schwarzschild, All]

TensorValues[KretschmannCD[]]

expr=RiemannCD[-a,-b,c,d]RiemannCD[-c,-e,a,b]

ComponentArray[TraceBasisDummy[ToBasis[Schwarzschild][expr]]]/.TensorValues[RiemannCD]