# Tag Info

1

I have a few suggestions, but I'm not sure about their efficiency. I'm sure that if this is the only thing that you want to compute my suggestion is good enough. What I do when I have to compute something like this is to use a lot of replacement rules and a dot product. First, define P[k_,i_,j_]:=delta[i,j] - k[i] k[j]/k^2 For the P[p-k,i,j] term just use ...

4

You almost had it, with just two things going wrong. First, you had a higher-rank tensor than you wanted, which can be solved by peeling off a layer of curly braces, and the two $2 \times 2$ matrices are effectively transposed, suggesting we should reverse the order of multiplication. You want: {A, B}.{{{a, b}, {c, d}}, {{e, f}, {g, h}}} which gives ...

3

You definitely want to look up the functions Inner and Outer. Outer gives you a generalized outer product, and it is extremely useful. Inner gives you a generalized inner product. See this question and the answers below it for how to think about these functions. It can be tricky to use and figure out the syntax, so here's a start. For your problem, let's ...

1

My suggestion would be to use xPert to generate the expressions in abstract indices. Once you have those then use xCoba to establish your metric in a particular chart, then you can expand your perturbative expression in the chosen coordinate basis according to the operations under the xCoba documentation. I have a slide show on how to do this sort of thing ...

0

Since the question "Efficient tensor product followed by contraction" asking for an efficient solution to this problem has been marked as a duplicate, I find it appropriate to add here an encapsulated version of the answer to that question by @m_goldberg. Note that this works efficiently for the contraction of any number of index pairs. The notation follows ...

Top 50 recent answers are included