Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:ref:metric_tensor [2015/11/21 12:33] (current)
Line 1: Line 1:
 +====== 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:
 +<sxh groovy; gutter: false>
 +println 'g_ab - g_ba'​.t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > 0
 +</​sxh>​
 +<sxh groovy; gutter: false>
 +println 'g^AB + g^BA'​.t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > 2*g^AB
 +</​sxh>​
 +
 +Raising and lowering of metric tensor indices may involve [[documentation:​ref:​kronecker_delta]]:​
 +<sxh groovy; gutter: false>
 +println ('{_a -> ^a}'​.mapping >> '​g_ab'​.t)
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > d^{a}_{b}
 +</​sxh>​
 +
 +The transformation that simplifies contractions with metric tensor is [[documentation:​ref:​eliminatemetrics]]:​
 +<sxh groovy; gutter: false>
 +println EliminateMetrics >> '​g_am*F^ab*g_bn'​.t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > F_mn
 +</​sxh>​
 +<sxh groovy; gutter: false>
 +println EliminateMetrics >> '​g_am*g^an'​.t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > d^n_m
 +</​sxh>​
 +
 +====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:
 +<sxh groovy; gutter: false>
 +'''​ g_{a' b'} '''​.t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > ParserException:​ Metric is not specified for non metric index type.
 +</​sxh>​
 +
 +One can specify different name for metric tensor by putting the following line in the beginning of the code:
 +<sxh groovy; gutter: false>
 +//change default metric name
 +CC.current().setMetricName('​f'​)
 +println EliminateMetrics >> '​f_am*F^ab*f_bn'​.t
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > F_mn
 +</​sxh>​
 +
 +=====See also=====
 +  * Related guides: [[documentation:​guide:​types_of_indices_and_metric]]
 +  * Reference material: [[documentation:​ref:​kronecker_delta]],​ [[documentation:​ref:​eliminatemetrics]],​ [[documentation:​ref:​indextype]] ​