Rules for tensor components

436 views
Skip to first unread message

Albin Nilsson

unread,
Sep 29, 2017, 9:44:48 AM9/29/17
to xAct Tensor Computer Algebra
I am trying to set up a tensor t in this way:

DefTensor[t[a, b, c, d], M4, {Antisymmetric[{a, b}], Antisymmetric[{c, d}]}]

I know that all the components of the tensor t are constant with respect to the ordinary partial derivative PD. I am trying to write rules for this.
Best bet seems to be to write:
t /: PD[_][t[___ _]] := 0

But it is unclear to be whether this actually works, since when I try to check:
PD[a][t[b, c, d, e]]
the expression is not evaluated to 0, but is rather output in Traditional Form.


What is the best way to implement this rule?
Thanks in advance


pedram karimi

unread,
Sep 29, 2017, 12:15:42 PM9/29/17
to xAct Tensor Computer Algebra
Hi, Albin
You can use AutomaticRules to implement the rule. in your case:

AutomaticRules[t,MakeRule[{PD[e][t[a,b,c,d]],0}]]

Best,
Pedram

Leo Stein

unread,
Sep 29, 2017, 12:37:29 PM9/29/17
to Albin Nilsson, xAct Tensor Computer Algebra
Hi Albin,

You should examine your rule more closely to understand why it does something unexpected. In particular, if you use InputForm, you will see:
In[]:= PD[_][t[___ _]] // InputForm
Out[]//InputForm= PD[_][t[_*___]]
The expression that's inside the innermost square brackets is a product of a single underscore (Blank[]) and a triple underscore (BlankNullSequence[]). It's a product because you wrote "___ _" with a space.

You probably just want the triple underscore. That will capture any number (including zero) indices given to t[...]. So, if you write
PD[_][t[___]] ^:= 0
then you will see that all of these expressions vanish:
PD[a][t[]]
PD[a][t[b]]
PD[a][t[b, c, d, e, f]]
If you use MakeRule, as Pedram suggested, the rule will (i) probably be "safer", because MakeRule will include PatternTest's to guarantee that the indices are in the appropriate bundles; and (ii) only apply to exactly 4 indices.

Best
Leo

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Albin Nilsson

unread,
Oct 3, 2017, 10:16:12 AM10/3/17
to xAct Tensor Computer Algebra
Hi guys, thanks for the replies. I finally got around to implementing this, and it works like a charm.

Thanks for the help!

Albin Nilsson

unread,
Oct 12, 2017, 6:11:45 AM10/12/17
to xAct Tensor Computer Algebra
I realised I have a follow-up question about this, I hope it's okay to post it in the same thread. 

If I want to define a 4-tensor which is antisymmetric in the first and second pair of indices, I would write:
DefTensor[t[a, b, c, d], M4, {Antisymmetric[{a, b}], Antisymmetric[{c, d}]}]

Now, if the tensor is also symmetric in the first and second pair of indices (like the Riemann tensor), i.e. t[a,b,c,d]=t[c,d,a,b], how would I write that?
I have tried making a rule this way:
AutomaticRules[t, MakeRule[{t[a, b, c, d], t[c, d, a, b]}]];

This, however, seems to throw Mathematica off, and I get iteration depth errors. 
Any ideas?

Thanks in advance






On Friday, 29 September 2017 15:44:48 UTC+2, Albin Nilsson wrote:

Thomas Bäckdahl

unread,
Oct 12, 2017, 6:24:14 AM10/12/17
to xa...@googlegroups.com

Hi!

There is a predefined group for this called RiemannSymmetric.

DefTensor[T[a, b, c, d], M4, RiemannSymmetric[{a, b, c, d}]]

In general you can define any mono-term symmetry group you like. You just have to specify the permutation cycles that generate your index permutation group. This is done by GenSet.

You can not get the first Bianchi relation in this way because it is a multi-term symmetry. To handle that one need more advanced methods. Some of them are discussed in older posts.

I also realized that you sent this message twice because it did not appear immediately. This e-mail list is moderated, so we have to approve all messages. That is the reason for the delay.

Regards
Thomas
--
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.
Reply all
Reply to author
Forward
0 new messages