The notation for metric tensor used in Redberry is ordinary `g_ab`

and similarly for other index types (`g_AB`

, `g_\\alpha\\beta`

etc.). Metric tensors are automatically symmetric:

println 'g_ab - g_ba'.t

> 0

println 'g^AB + g^BA'.t

> 2*g^AB

Raising and lowering of metric tensor indices may involve Kronecker delta:

println ('{_a -> ^a}'.mapping >> 'g_ab'.t)

> d^{a}_{b}

The transformation that simplifies contractions with metric tensor is EliminateMetrics:

println EliminateMetrics >> 'g_am*F^ab*g_bn'.t

> F_mn

println EliminateMetrics >> 'g_am*g^an'.t

> d^n_m

In addition to `g_ab`

notation Redberry also uses `d_ab`

, which is the notation for Kronecker delta with raised or lowered indices.

By default, metric tensor defined only for metric index types. So, if one will enter tensor with name `g`

and non-metric indices (e.g. `Matrix1`

), one will cause exception:

''' g_{a' b'} '''.t

> ParserException: Metric is not specified for non metric index type.

One can specify different name for metric tensor by putting the following line in the beginning of the code:

//change default metric name CC.current().setMetricName('f') println EliminateMetrics >> 'f_am*F^ab*f_bn'.t

> F_mn

- Related guides: Types of indices and metric