====== Metric tensor ======
----
====Basics====
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 [[documentation:ref:kronecker_delta]]:
println ('{_a -> ^a}'.mapping >> 'g_ab'.t)
> d^{a}_{b}
The transformation that simplifies contractions with metric tensor is [[documentation:ref:eliminatemetrics]]:
println EliminateMetrics >> 'g_am*F^ab*g_bn'.t
> F_mn
println EliminateMetrics >> 'g_am*g^an'.t
> d^n_m
====Details====
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 [[IndexType|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
=====See also=====
* Related guides: [[documentation:guide:types_of_indices_and_metric]]
* Reference material: [[documentation:ref:kronecker_delta]], [[documentation:ref:eliminatemetrics]], [[documentation:ref:indextype]]