in a computation involving xCoba, I'm encountering problems with
products of epsilon tensors:
Needs["xAct`xCoba`"]
DefManifold[M, 3, IndexRange[{a, h}]]
DefMetric[-1, \[Eta][-a, -b], CD]
DefBasis[B, TangentM, {0, 1, 2}]
epsilon\[Eta][{1, -B}, {a, B}, {0, B}] epsilon\[Eta][{b,
B}, {2, -B}, {0, B}]
The last line throws an error about an unknown index B. I think this is
because expandGdelta recurses into the basis indices, so a fix would be
to tell Outer[] not to do this:
expandGdelta[metric_][indices___]:=Module[{semil=Length[{indices}]/2},
If[!IntegerQ[semil],
Throw@Message[Gdelta::error,
"Found Gdelta with odd number of indices."]];
Det@Outer[
metric,{indices}[[Range[semil]]],{indices}[[Range[semil+1,
2semil]]],1]];
(Patch against xTensor.m attached. [1])
But even with this fixed, the above line still results in an error:
"Recursion depth of 256 exceeded." Stack trace:
epsilon\[Eta][xAct`xTensor`Private`inds1$__]*
epsilon\[Eta][xAct`xTensor`Private`inds2$__]
SignDetOfMetric[\[Eta]]*ExpandGdelta[Gdelta[{1, -B}, {a, B}, {0, B},
{b, B}, {2, -B}, {0, B}]]
ExpandGdelta[Gdelta[{1, -B}, {a, B}, {0, B}, {b, B}, {2, -B},
{0, B}]]
ExpandGdelta[expr_]
Gdelta[{1, -B}, {a, B}, {0, B}, {b, B}, {2, -B}, {0, B}] /.
Gdelta[xAct`xTensor`Private`inds__] :> expandGdelta[delta][inds]
expandGdelta[delta][{1, -B}, {a, B}, {0, B}, {b, B}, {2, -B},
{0, B}]
expandGdelta[metric_][indices___]
...
Det[Outer[delta, {{1, -B}, {a, B}, {0, B}, {b, B}, {2, -B},
{0, B}}[[Range[semil$4003]]],
{{1, -B}, {a, B}, {0, B}, {b, B}, {2, -B}, {0, B}}[[
Range[semil$4003 + 1, 2*semil$4003]]], 1]]
Outer[delta, {{1, -B}, {a, B}, {0, B}, {b, B}, {2, -B}, {0, B}}[[
Range[semil$4003]]], {{1, -B}, {a, B}, {0, B}, {b, B},
{2, -B}, {0, B}}[[Range[semil$4003 + 1, 2*semil$4003]]], 1]
Outer[delta, {{1, -B}, {a, B}, {0, B}},
{{b, B}, {2, -B}, {0, B}}, 1]
{{delta[{1, -B}, {b, B}], delta[{1, -B}, {2, -B}],
delta[{1, -B}, {0, B}]}, {delta[{a, B}, {b, B}],
delta[{a, B}, {2, -B}], delta[{a, B}, {0, B}]},
{delta[{0, B}, {b, B}], delta[{0, B}, {2, -B}],
delta[{0, B}, {0, B}]}}
{delta[{a, B}, {b, B}], delta[{a, B}, {2, -B}],
delta[{a, B}, {0, B}]}
delta[{a, B}, {b, B}]
delta[xAct`xTensor`Private`a_, xAct`xTensor`Private`b :
{_, _Symbol}]
Basis[{a, B}, {b, B}]
Basis[xAct`xCoba`Private`a : {_, _Symbol}, xAct`xCoba`Private`b_]
SymmetryOfIndex[{a, B}]*Basis[{b, B}, {a, B}]
Basis[{b, B}, {a, B}]
Basis[xAct`xCoba`Private`a : {_, _Symbol}, xAct`xCoba`Private`b_]
And at this point it goes into an endless loop, swapping the indices of
Basis[{a, B}, {b, B}] again and again. You can see the same behavior
with just this:
Basis[a, b]
Does anyone know a way to fix this or get around it?
-Torsten
[1] By the way, how do you guys develop xAct? It seems that you modify
the .nb files which then causes the .m file to be regenerated. But when
I do this, the formatting of the .m file changes completely (maybe due
to version differences), so that's not useful for sending patches.
And the .nb files are not really human-readable, so version-controlling
them is not easily possible, right?
And when you modify an .nb (or .m) file, how do you cause a running
session to use the modified definitions? The only I came up with is to
restart the kernel, but that's very inconvenient.
Ah, I see. This does indeed seem to solve the problem. Thanks for this
fix, and for confirming the other one!