7.3. Canonicalization with a metric

In the presence of a metric new symmetries can be added to the process of canonicalization. The command ToCanonical has an option UseMetricOnVBundle that specifies on which vbundles the metric (if there is one) must be used during canonicalization. Possible values are All (default), None or a list of (maybe one) vbundles.

Tensors S and T have no symmetries and therefore their canonicalization without metric is trivial:

In[568]:=

ToCanonical[S[c, a] T[-a, -b, b], UseMetricOnVBundle→None]

Out[568]=

S_  ^ca T_ab ^(  b)

However with metric the canonical form is different because pairs of dummies are sorted such that the up-index comes first:

In[569]:=

ToCanonical[S[c, a] T[-a, -b, b]]

Out[569]=

S_ ( a)^c  T_ (  b)^ab

When derivatives are present canonicalization with a metric is harder, unless the only derivative is its Levi-Civita associated operator. In other cases, ToCanonical shows a warning message and changes to a different algorithm rather than using the default algorithm which just moves indices around and that could get easily confused. The new algorithm is based on a temporary internal change of the offending derivatives to the Levi-Civita connection of the metric of the corresponding vbundle. This new algorithm is much slower; compare the following timings:

We use the same tensors S and T:

In[570]:=

ToCanonical[S[c, a] CD[-d][T[-a, -b, b]], UseMetricOnVBundle→None]//AbsoluteTiming

Out[570]=

{0.004705 Second, S_  ^ca (▽_d^ T_ab ^(  b))}

In[571]:=

ToCanonical[S[c, a] CD[-d][T[-a, -b, b]]]//AbsoluteTiming

Out[571]=

{0.005225 Second, S_ ( a)^c  (▽_d^ T_ (  b)^ab )}

But now if we use PD instead:

In[572]:=

ToCanonical[S[c, a] PD[-d][T[-a, -b, b]], UseMetricOnVBundle→None]//AbsoluteTiming

Out[572]=

{0.005743 Second, S_  ^ca ∂_d^ T_ab ^(  b)}

In[573]:=

ToCanonical[S[c, a] PD[-d][T[-a, -b, b]]]//AbsoluteTiming

ToCanonical :: cmods : Changing derivatives to canonicalize.

Out[573]=

This form of canonicalization leaves lots of Christoffel hanging around. You can get rid of them in three steps: first use ChristoffelToGradMetric; then use ContractMetric,

In[574]:=

Last[%]//ChristoffelToGradMetric//ContractMetric

Out[574]=

Finally, canonicalize again, but this time without moving indices, to avoid bringing back the Christoffels:

In[575]:=

ToCanonical[%, UseMetricOnVBundle→None]

Out[575]=

S_  ^ce T_ (  b)^ab  ∂_d^ g_ae^   + S_ ( a)^c  ∂_d^ T_ (  b)^ab

The whole process is automatic with the option ExpandChristoffel:

In[576]:=

ToCanonical[S[c, a] PD[-d][T[-a, -b, b]], ExpandChristoffel→True]//AbsoluteTiming

ToCanonical :: cmods : Changing derivatives to canonicalize.

Out[576]=

{0.071727 Second, S_  ^ce T_ (  b)^ab  ∂_d^ g_ae^   + S_ ( a)^c  ∂_d^ T_ (  b)^ab }

This is another, somehow harder, example. Partial derivatives do not commute when having upper indices:

In[577]:=

PD[-b] @ PD[a] @ v[-a] - PD[a] @ PD[-b] @ v[-a]//Simplification

ToCanonical :: cmods : Changing derivatives to canonicalize.

ToCanonical :: cmods : Changing derivatives to canonicalize.

ToCanonical :: cmods : Changing derivatives to canonicalize.

General :: stop : Further output of ToCanonical :: cmods will be suppressed during this calculation. More…

Out[577]=

Now we can drop the two second derivatives, and remove the Christoffels:

In[578]:=

%//SortCovDs

Out[578]=

In[579]:=

Simplification[%//ChristoffelToGradMetric//ContractMetric, UseMetricOnVBundle→None]//AbsoluteTiming

Out[579]=

{0.645404 Second, -∂_b^ g_ac^   ∂ \( \( \) c\) v_ ^a - g_  ^cd g_  ^ef v_ ^a ∂_b^ g_ce^   ∂_f^ g_ad^  }

General recommendations:
    1. The simplest situation is having just one tangent bundle, with one metric and its Levi-Civita connection. In that case the metric can be always contracted, and we recommend to do it, just to decrease the number of indices.
    2. If there are several tangent bundles, each one having one metric with its Levi-Civita connection, then the metrics can be freely contracted, and the only additional problem is that you decide whether to use CheckZeroDerivative at some intermediate steps of the calculation, or else automate that point.
    3. If there is one vbundle, one metric with its Levi-Civita connection and an additional derivative (ordinary or not, that is irrelevant) then the canonicalizer must change to the slower algorithm. I recommend not to change the character of the slots of the tensors. To do that set UseMetricOnVBundle->False in ToCanonical and never use ContractMetric. The metric factors will be always explicit, and the number of indices in the expressions will be larger, but overall the canonicalizations will be faster.
    4. If there are several vbundles with several derivatives, combine comments 2 and 3.
    5. If furthermore there are several metrics on the vbundles, each with its own Levi-Civita connection, then before start crying, see next subsection.

The canonicalizer also takes into account whether indices can be moved up and down or not. This is done internally using the concept of metric-state for indices. Study next example carefully:

This expression is clearly antisymmetric under the exchange of derivatives:

In[580]:=

U[a, b, c] PD[-a][v[d]] PD[-b][v[e]] metricg[-d, -e]

Out[580]=

g_de^   U_   ^abc ∂_a^ v_ ^d ∂_b^ v_ ^e

and it is thus zero:

In[581]:=

ToCanonical[%]

Out[581]=

0

We contract the metric through a derivative. The expression however is now different and not zero:

In[582]:=

U[a, b, c] PD[-a][v[-d]] PD[-b][v[e]] metricg[d, -e]

Out[582]=

U_   ^abc ∂_a^ v_d^  ∂_b^ v_ ^d

but the system detects it and change to the alternative algorithm:

In[583]:=

ToCanonical[%]

ToCanonical :: cmods : Changing derivatives to canonicalize.

Out[583]=

Another example:

In[584]:=

ToCanonical[T[a, -b, c] PD[-d][v[-a]] PD[-e][v[b]] metricg[d, e]]

ToCanonical :: cmods : Changing derivatives to canonicalize.

ToCanonical :: cmods : Changing derivatives to canonicalize.

ToCanonical :: cmods : Changing derivatives to canonicalize.

General :: stop : Further output of ToCanonical :: cmods will be suppressed during this calculation. More…

Out[584]=

In[585]:=

ToCanonical[T[a, -b, c] PD[-d][v[-a]] PD[-e][v[b]] metricg[d, e], ExpandChristoffel→True]

ToCanonical :: cmods : Changing derivatives to canonicalize.

ToCanonical :: cmods : Changing derivatives to canonicalize.

ToCanonical :: cmods : Changing derivatives to canonicalize.

General :: stop : Further output of ToCanonical :: cmods will be suppressed during this calculation. More…

Out[585]=

T_   ^abc ∂_d^ v_b^  ∂ \( \( \) d\) v_a^ - T_   ^abc v_ ^d ∂_e^ g_bd^   ∂ \( \( \) e\) v_a^


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!