Possible bug with IndexCoefficient

56 views
Skip to first unread message

AH

unread,
Apr 7, 2016, 10:46:10 PM4/7/16
to xAct Tensor Computer Algebra
Hi there,

I've just noticed what I think is a bug in IndexCoefficient ... but I'm pretty new to xAct so I could be wrong.  Basically if I have v[_a;b] , IndexCoefficient works fine without the factor of a half, if I now have them in a bracket and divide by 2 (or any number that's not 1), IndexCoefficient gives 0.  I've attached a notebook so you can see, I can't see why it shouldn't work.  I've figured a work around for now - basically just use expand before IndexCoefficient.

Cheers,
Anna


IndexCoefficientBug.nb

AH

unread,
May 13, 2016, 10:30:42 PM5/13/16
to xAct Tensor Computer Algebra
Hi again,

I think I've found another bug in Index Coefficient ... it doesn't seem to recognise the scalar products. I've amended the previous attachment to show both bugs.  Not sure how to find a work around this one.  Any suggestions are welcome.

Cheers,
Anna
IndexCoefficientBug.nb

Leo Stein

unread,
May 14, 2016, 8:47:43 PM5/14/16
to AH, xAct Tensor Computer Algebra
Hi Anna,

These bugs are quite bad. Poking at it a bit more, there are other shortcomings, like the fact that it can't operate on tensors with label indices. Perhaps IndexCoefficient needs to be rewritten.

For now, here is a very ugly workaround (in the attached NB).

Firstly, IndexCoefficient[] operates differently than the builtin Coefficient[], because IndexCoefficient[] should satisfy the identity
  tensor * IndexCoefficient[expression, tensor] == expression.
However the above is not true with Coefficient: Coefficient[x^2, x] is 0, while IndexCoefficient[v[a]v[b], v[a]] is v[b].

IndexCoefficient falls through to Coefficient when the second argument is a scalar. Clearly that is not what we want!
So, that definition needs to be cleared out.

Now, since IndexCoefficient operates correctly on powers of indexed tensors, we can replace a scalar s[] with a temporary product Scalar[v[a]w[-a]] of a vector and 1-form; then extract the IndexCoefficient of v[a]w[-a], and then revert back to the original scalar. Please see the attached example.

This workaround is definitely very ugly, and maybe a sign that IndexCoefficient needs to be rewritten...

L

--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

IndexCoefficientBug (1).nb

AH

unread,
May 27, 2016, 3:37:37 PM5/27/16
to xAct Tensor Computer Algebra, annahef...@gmail.com
Hi Leo,

Thanks for taking the time to figure this one out - not the prettiest but it works! :)

Cheers,
Anna
Reply all
Reply to author
Forward
0 new messages