Best
Leo
> thanks for the prompt reply. I should have stated that that was the
> first thing I tried (without the ?TangentS`pmQ, which is helpful).
> When I use that rule, like this
>
> PD[-a][T[b, c]] //.LambdaRule
>
> I get the following:
>
> ReplaceRepeated::rrlim: Exiting after PD[-a][T[b,c]] scanned 65536
> times.
>
> PD[-a][T[b, c]]/\[Lambda]^65536
>
> I don't know what to make of that.
>
what you are using here is "ReplaceRepeated" which keeps applying a rule
until an expression no longer changes. Your rule will never produce an
expression which remains unchanged and that's why ReplaceRepeated quits
after applying your rule 65536 times. What you need here is "ReplaceAll"
whose syntax is
PD[-a][T[b, c]] /.LambdaRule
(you just write the forward-slash once). For more information you can
check the on-line help of "ReplaceAll" and "ReplaceRepeated" in
Mathematica.
Best regards,
Alfonso.
I can give one piece of advice: build the tracefree rules by hand,
rather than using MakeRule. If you have an auxiliary tensor with many
indices which are all symmetric, then MakeRule is going to generate
very many rules, one for each pair of indices which are being
contracted. For example, if you have (0,4) tensor T[-a,-b,-c,-d] which
is completely symmetric, and you want to make rules for killing its
trace, then you would write:
MakeRule[{T[-a, a, -c, -d], 0}]
MakeRule[{met[a, b] T[-a, -b, -c, -d], 0}, MetricOn -> All]
The above generates a total of 108 rules. You really do not need that many:
T /: T[___, a_, ___, -a_, ___] := 0;
T /: T[___, -a_, ___, a_, ___] := 0;
T /: (T[___, -a_, ___, -b_, ___] met[a,b]) := 0;
T /: (T[___, -b_, ___, -a_, ___] met[a,b]) := 0;
T /: (T[___, a_, ___, b_, ___] met[-a,-b]) := 0;
T /: (T[___, b_, ___, a_, ___] met[-a,-b]) := 0;
T /: (T[___, a_, ___, -b_, ___] delta[-a,b]) := 0;
T /: (T[___, -b_, ___, -a_, ___] delta[-a,b]) := 0;
The above rules work any tensor T which is STF. I wrote them above as
automatic rules, but you could make a function returning a list of
rules, e.g. STFRules[T] which would give a list of the above as rules.
Best,
Leo