a Bug with Gdelta

64 views
Skip to first unread message

ste...@web.de

unread,
May 13, 2016, 2:02:55 PM5/13/16
to xAct Tensor Computer Algebra
Hi everyone,

while doing some computations I came across a bug in xTensor using Gdelta. A minimal example would be:

****CODE-Begin****

In[1]:= << xAct`xTensor`
In[2]:= DefManifold[M, 4, Join[IndexRange[a, n], {q, w, r, s}]];

In[3]:= Gdelta[-a, -l, m, n]*Gdelta[a, b, -c, -d]]// ExpandGdelta // ToCanonical
Out[3]:= delta[b, -d] delta[-l, n] delta[m, -c] - delta[b, -c] delta[-l, n] delta[m, -d] -
             delta[b, -d] delta[-l, m] delta[n, -c] + delta[b, -c] delta[-l, m] delta[n, -d]

In[4]:= Gdelta[-a, -l, m, e]*Gdelta[a, b, -c, -d]]// ExpandGdelta // ToCanonical;
          ReplaceIndex[Evaluate@%, e -> n]
Out[5]:=
- delta[b, -d] delta[-l, n] delta[m, -c] + delta[b, -c] delta[-l, n] delta[m, -d] +
             delta[b, -d] delta[-l, m] delta[n, -c] - delta[b, -c] delta[-l, m] delta[n, -d]

****CODE-End****

Both expressions should agree, but in fact do differ by sign after evaluation. Unfortunately I don't know why this happens...

Does anybody have a solution?

Best,
Stefan

ste...@web.de

unread,
May 16, 2016, 10:15:28 AM5/16/16
to xAct Tensor Computer Algebra
Hi again,

I think I found the source of the Problem. It is in Line 4595 of xTensor.m. There it is only the "Signature" of "Join[#1,orest]" taken into account.
But that assumes, that "oinds" already is in canonical order, which does not have to be the case. So one has to add another Factor: "Signature[oinds]", which corrects for that.

I hope that someone can check that.

Best,
Stefan

ste...@web.de

unread,
May 17, 2016, 10:15:52 AM5/17/16
to xAct Tensor Computer Algebra
I found yet another Problem in Gdelta. Using the Setup from above (even with the fix I already posted) the following evaluates not correctly
Input 1:
(Gdelta[-a, -b, m, f]*Gdelta[-m, -f, c, d]) //ExpandGdelta //ToCanonical
Input 2:
ExpandGdelta[Gdelta[-a, -b, m, f]]*ExpandGdelta[Gdelta[-m, -f, c, d]] //ToCanonical

Therefore I now checked this part of the Code; and found the cause of this bug:

There is a second place where a specific Index structure is expected, namely in Line 4597 (where the contracted Indices are Replaced with the corresponding indices of Gdelta).
Hence, one has to make sure, that the "ictrs" indices are in the same order as they appear in Gdelta. So we go to Line 4565 where "ctr[[3]]" corresponds to the "ictrs" of Line 4597.
And append after Line 4597 the following command ("ctr[[1]]" are the indices of Gdelta, so we want to order "ctr[[3]]" according to "ctr[[1]]")
"ctr[[3]] = SortBy[ctr[[3]], Position[ctr[[1]], #][[1, 1]] &];"

This then correctly accounts for the Order of the Indices.

By the way this also solves this issue https://groups.google.com/forum/#!topic/xact/8t5gQIXtKrc

I still hope, that someone could check that, so this gets fixed in the next release of xAct.

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