Strange behaviour of SeparateMetric

52 views
Skip to first unread message

Markus B. Fröb

unread,
Mar 16, 2018, 2:08:04 PM3/16/18
to xAct Tensor Computer Algebra
Hi all,

I ran into an infinite recursion in xPert (latest version) under Mathematica 11.1, when using ExpandPerturbation on a perturbed metric with contravariant indices: ExpandPerturbation[Perturbation[g[a,b],1]] (without having used DefMetricPerturbation before).

The issue seems to be that SeparateMetric[][g[a,b]] returns g[b,a], which seems quite strange.

I think that SeparateMetric when called without an explicit index to separate should leave any explicit metric tensors untouched. Would you agree?
The fix in this case is simple: replace in section "14.2.5. SeparateMetric. New code" the function

SeparateMetric[metric_, basis_][expr_, Automatic] := 
  With[{tensors = FindAllOfType[expr, Tensor], covds = FindAllOfType[expr, CovD]}, 
   SeparateMetric[metric, basis][expr, Flatten@Apply[IndexList, movedindices /@ Join[tensors, covds]]]
  ];

by

SeparateMetric[metric_, basis_][expr_, Automatic] := 
  With[{tensors = FindAllOfType[expr, Tensor], covds = FindAllOfType[expr, CovD]},
   Module[{tensors2},
    If[metric === Automatic, tensors2 = DeleteCases[tensors, _?(MetricQ[Head[#]] &)], tensors2 = DeleteCases[tensors, _metric]];
    SeparateMetric[metric, basis][expr, Flatten@Apply[IndexList, movedindices /@ Join[tensors2, covds]]]
   ]
  ];

Best, Markus

Jose

unread,
Mar 24, 2018, 4:29:45 PM3/24/18
to xAct Tensor Computer Algebra
Thanks for reporting this Markus.

You are very right that SeparateMetric should not try to separate metric factors from the first-metric itself (independently of whether that metric was specified in the first pair of brackets or not). Instead of the code you included in your email, I prefer to add this explicit case before the general definition of SeparateMetric2:

SeparateMetric2[AIndex, metric_][metric_[i1_, i2_], index_] := metric[i1, i2];

Cheers,
Jose.

Markus B. Fröb

unread,
May 18, 2018, 1:12:24 PM5/18/18
to xAct Tensor Computer Algebra
Hi Jose,

that one works as well. Thanks!
(Sorry for not answering earlier - I didn't get any notification from your reply, and in the meantime was busy.)

I have another strange behaviour to report, with the xPert package.
Defining a metric g and perturbation h, ToCanonical[ h[LI[1], -a, -b] Perturbation[ g[c,b] ] ] returns 0.
It seems that this is due to ToCanonical reordering the indices to h[LI[1], -a, b] Perturbation[ g[c,-b] ], and then Perturbation[ g[c,-b] ] = Perturbation[ delta[c,-b] ] = 0.
I haven't come up with a fix for this one, though, and for the moment just make sure to ExpandPerturbation[] everywhere.

Best, Markus
Reply all
Reply to author
Forward
0 new messages