The 10 Commandments of Index Expressions and Tensor Calculus

Common Topics: index, expression, indices, shall, summation

Having more than 10 years of experience in teaching vector and tensor calculus and special and general relativity, I have noted that many people have the same problems when trying to manipulate index expressions. The problem often lies in being familiar with the very basic ideas, such as repeated indices implying a sum (the summation convention), but not understanding the implications for the manipulations. If you are having trouble getting those pesky indices right, this Insight is intended for you. It will take the form of listing a number of commandments that I have seen students break time and time again, resulting in errors, headaches, and general loss of sanity. If you follow these commandments, you should find your index manipulation skills improve to be at least workable without risking glaring mistakes. I hope you find them useful. After the list, I will try to expand a bit on how they appear and how you can deal with them once you found that you broke them.

I have tried to order the commandments from being more basic to being more advanced.

The Commandments

1. You shall not despair.
2. You shall use clean and readable handwriting so that you do not confuse indices.
3. You shall not have different free indices on opposite sides of equality or in different terms of the same expression.
4. You shall not equate a vector expression to a scalar expression.
5. You shall not have more than two of any one index in an index expression.
6. You shall not sum over two covariant indices. Nor shall you sum over two contravariant indices.
7. When there are two occurrences of an index in your expression, you shall not rename them to something that already exists in your expression.
8. You shall not differentiate with respect to an already existing index unless that index is a free contravariant index and you are taking the divergence.
9. You shall be free to compute scalar expressions in any coordinate system.
10. You shall not confuse tensorial and non-tensorial quantities.

I have put the fifth commandment in bold because it is very common, easy to avoid, and some of the others are essentially corollaries of it.

Explanations and Countermeasures

1. You shall not despair

Easy to say, but harder to follow. I have encountered many students who seemingly have a direct aversion to manipulating index expressions and panic whenever they are asked to do so to the point of getting lost simply because they expect themselves to get lost. Sometimes this even leads to students not even making the attempt based on the assumption that they will fail. Take a deep breath and follow the remaining commandments and you will be fine.

2. You shall use clean and readable handwriting so that you do not confuse indices

This one also seems trivial, but it can be a real problem for some students with less than clear handwriting. Even if you normally have clean handwriting, you might be in risk of breaking this commandment during exams when your time becomes limited and your writing hurried. All of a sudden that ##i## might look like a ##j## and your expression no longer makes sense as it breaks one or more of the remaining commandments. If you feel that your handwriting when stressed is in risk of having two particular indices confused, do not use both of them in the same expression.

3. You shall not have different free indices on opposite sides of equality or in different terms of the same expression

Equality of index expressions means that it should hold regardless of what value the free indices take. As such, the free indices on each side of the expression need to match, when you put the free index ##i = 1## on the left-hand side, you should put it to one also on the right-hand side and you can only do that if the index appears on both sides. We have already mentioned one way of ending up with different free indices, misidentifying indices in your handwriting you could end up with something like ##v^i = T^{jk} w_k##, which, in accordance to this commandment, is nonsense. If you do find yourself with an expression like this, backtrack to the last point where it was not the case to identify your error.

4. You shall not equate a vector expression to a scalar expression

A typical example of this error is to write
$$\vec v \times \vec w = \epsilon_{ijk} v^j w^k.$$
While the left-hand side is a vector, the right-hand side is the component of the same vector (also note how the index ##i## appears on one side but not the other, also violating the previous commandment). While you can often recover from an error like this when you go back to a vector expression, it is an error that can be confusing and that is easily avoidable, either by taking the ##i##th component of the left-hand side or multiplying the right-hand side by the basis vector, i.e.,
$$(\vec v \times \vec w)^i = \epsilon_{ijk} v^j w^k \quad \mbox{or} \quad \vec v \times \vec w = \vec e_i \epsilon_{ijk} v^j w^k.$$
(Note that this expression breaks the 6th commandment if taken literally! It is intended to hold only in Cartesian coordinates. See the caveat.)

5.  You shall not have more than two of any one index in an index expression

If I had to give one commandment only, this would be it. It is by far the most common source of avoidable errors. If you end up with more than two of the same index in your expression, then the meaning of the expression is not clear. As an example of how this typically happens, let us look at the expression ##k^2 V^2##, where ##k## and ##V## are vectors. Here you know that for any vector ##U##, it holds that ##U^2 = U_\mu U^\mu## so you happily go about using this relation for both ##k## and ##V##, leading you to
$$k^2 V^2 = k_\mu k^\mu V_\mu V^\mu$$
and all of a sudden you do not know from looking at your expression which indices are contracted with each other. Note that you might get the same expression from applying similar logic to ##(k\cdot V)^2##, which is clearly not the same as ##k^2 V^2##. So what went wrong? With the summation convention, repeated indices imply a sum and in the above expression you have two of them, one for ##k^2## and another for ##V^2##. However, you used the same summation variable and without parentheses or summation signs, there is no longer any way to tell the different sums apart. If you are having problems with this, the way to avoid this is to insert one of the sums at a time, noting that you cannot insert an expression with a summation index that is the same as one of the indices already in your expression. In our particular example, we can start with inserting ##V^2 = V_\mu V^\mu## and obtaining
$$k^2 V^2 = k^2 V_\mu V^\mu.$$
So far so good, but since our expression already contains ##\mu##, we cannot insert ##k^2 = k_\mu k^\mu## without first changing the name of the summation index. Luckily, it does not matter what the summation index is called as
$$k_\mu k^\mu = \sum_\mu k_\mu k^\mu = k_1 k^1 + \ldots + k_N k^N = \sum_\nu k_\nu k^\nu = k_\nu k^\nu,$$
where we have written out the sums explicitly in the middle steps and assumed we are working in ##N## dimensions. Since there is no ##\nu## index in our expression above, we can happily go about replacing ##k^2## by ##k_\nu k^\nu## and obtain
$$k^2 V^2 = k_\nu k^\nu V_\mu V^\mu,$$
which cannot be mistaken for ##k_\mu k^\nu V^\mu V_\nu = (k\cdot V)^2##. If you end up with an expression where an index appears more than twice, trace your steps back to the last point where this did not happen and examine how this error appeared. Once found, make sure that you are not using the same summation index for different sums or using the same letter for a summation index as for one of your free indices.

6. You shall not sum over two covariant indices. Nor shall you sum over two contravariant indices.

Yes, index placement matters! At least if you care about your expressions is independent of the coordinate system you are using. When you change coordinate systems, the contraction between a covariant and a contravariant index leads to a simple contraction between a covariant and a contravariant index in the new coordinate system as well, just based on the chain rule for derivatives. For example,
$$V_\mu U^\mu = V_{\mu’} \frac{\partial x’^{\mu’}}{\partial x^\mu} U^{\nu’} \frac{\partial x^\mu}{\partial x’^{\nu’}}$$
(note how we needed to introduce two different primed indices to avoid four ##\mu’##), where the chain rule gives us
$$\frac{\partial x’^{\mu’}}{\partial x^\mu}\frac{\partial x^\mu}{\partial x’^{\nu’}} = \delta^{\mu’}_{\nu’}$$
and therefore
$$V_\mu U^\mu = V_{\mu’} U^{\nu’} \delta^{\mu’}_{\nu’} = V_{\mu’} U^{\mu’}.$$
If you had two covariant indices, you would instead end up with
$$V_\mu U_\mu = V_{\mu’} \frac{\partial x’^{\mu’}}{\partial x^\mu} U_{\nu’} \frac{\partial x’^{\nu’}}{\partial x^\mu}$$
with no possibility to apply the chain rule to get rid of the partial derivatives. The same holds for cases where you have two contravariant indices.

There are a few caveats and exceptions to this commandment. In particular, if you are working exclusively in Cartesian coordinates then covariant and contravariant components transform in exactly the same way and you can happily go about forgetting this rule. In fact, it is common to not care about index placement at all in that situation, but it can be good practice to do so anyway. Furthermore, some authors of advanced texts (such as Matthew Schwartz’s quantum field theory book) assume that you are familiar with this and that it goes without saying that one index should be covariant and the other contravariant in a contraction (and that it does not matter which of the pair is up or down) and go on to write all indices down. I do not recommend doing this until you are comfortable enough with index expressions to do so safely.

7. When there are two occurrences of an index in your expression, you shall not rename them to something that already exists in your expression

This is really a corollary to the idea of not having more than two of any index in your expressions but deserves some attention on its own. It is fine to rename summation indices to your heart’s content, as long as you do not rename them to something that already exists in your expression. Consider the expression ##V_\mu U^\nu W_\nu##. You might think that, since ##\nu## is a summation index, you could rename it to ##\mu## and obtain ##V_\mu U^\mu W_\mu##, but clearly, you then run into the problem of having more than two ##\mu## and not knowing which of the covariant indices should be contracted with the contravariant one.

There is an important caveat to this commandment: You are free to switch the names of two sets of summation indices. For example, in the expression ##F_{\mu\nu} F^{\mu\nu}##, it is perfectly fine to do the exchange ##\mu \leftrightarrow \nu## to obtain
$$F_{\mu\nu} F^{\mu\nu} = F_{\nu\mu} F^{\nu\mu}$$
as the sums remain the same and you do not end up with more than two of the same index. If you feel uncomfortable with this, you can do it in three steps using a temporary index name ##\sigma## according to
$$F_{\mu\nu} F^{\mu\nu} = F_{\sigma\nu} F^{\sigma\nu} = F_{\sigma\mu} F^{\sigma\mu} = F_{\nu\mu} F^{\nu\mu}.$$
The first step replaces ##\mu## by ##\sigma## (allowed since there is no other ##\sigma## in the previous expression), the second replaces ##\nu## by ##\mu## (allowed since there no longer is a ##\mu##), and the third replaces ##\sigma## by ##\nu## (allowed since there was no longer a ##\nu##). I suggest that you do it this way until you feel comfortable with just switching the indices around.

8. You shall not differentiate with respect to an already existing index unless that index is a free contravariant index and you are taking the divergence

This is also something of a corollary of the no-more-than-two-of-the-same-index commandment but also deserves its own mention as it is a common occurrence. If you are taking a derivative with respect to ##x^\mu##, then you cannot have other ##\mu##s in your expression, with the only exception being when you are computing a divergence. In particular, it is common to see errors in the form
$$\partial_\mu(U\cdot V) = \partial_\mu (U_\mu V^\mu),$$
which again is nonsensical. The solution is the same as before, use a different summation index when writing down ##U\cdot V## on component form, for example
$$\partial_\mu (U\cdot V) = \partial_\mu (U_\nu V^\nu).$$
As usual, go back to the last point where you had no more than two of each index and correct the mistake there.

9. You shall be free to compute scalar expressions in any coordinate system

This is one of the wonderful things about vector and tensor calculus. Scalars are invariant and will have the same value in any coordinate system. This is true even when you are adding different scalar expressions. Unfortunately, this point is often not appreciated enough by students who insist on computing all their scalars in the same coordinate system, which can make computations significantly more difficult. A typical example would be the computation of the center-of-mass energy of a two-particle system where the particles have 4-momenta ##p## and ##k##, respectively. We would find that
$$E_{\rm CoM}^2 = (p+k)^2 = p_\mu p^\mu + 2p_\mu k^\mu + k_\mu k^\mu.$$
Each of the terms in this expression can be computed individually and each is independent of the coordinate system used. Do not hesitate, compute each term in the frame where it is most convenient to do so.

10. You shall not confuse tensorial and non-tensorial quantities

The components of tensors follow very particular transformation rules that lead to tensor equations being covariant, i.e., taking the same form in all coordinate systems. However, remember that everything with indices is not a tensor. This includes both coordinates and their partial derivatives with respect to other coordinates. In particular, while tensor components inherently belong to one basis, the partial derivatives that appear in the transformation rules give you the relation between two different bases. Unfortunately, you sometimes see students mixing these things up and writing down transformation rules for the coordinates as if they were the components of a tensor and so on, i.e., I have seen things like
$$x’^{\alpha’} = \frac{\partial x’^{\alpha’}}{\partial x^\beta} x^\beta.$$
This is only true if the coordinate transformation is linear, i.e., if
$$x’^{\alpha’} = \Lambda^{\alpha’}_{\beta} x^\beta$$
for some fixed non-degenerate ##\Lambda^{\alpha’}_\beta##. As a counter example, consider polar coordinates ##r## and ##\phi## in the plane for which
$$x = r \cos(\phi) \quad \mbox{and} \quad y = r \sin(\phi)$$
but the relation above would give
$$x = \frac{\partial x}{\partial r} r + \frac{\partial x}{\partial \phi} \phi = r \cos(\phi) – r \phi \sin(\phi)$$
and similarly for ##y##.

Parting Words

Manipulating index expressions is a headache for many students, even if you are struggling you should know that you are not alone. I have seen each and every one of the above mistakes and misconceptions countless times with different students. However, if you are aware of and follow these commandments (especially the fifth!), your ability to confront difficulties should get at least a small boost. If you work systematically and patiently, thinking about the meaning of each step if you need to, you will get it right in the end.

16 replies
1. nuuskur says:

"You shall not have more than two of any one index in an index expression.

2. Will Flannery says:

I never had to use tensors at work (engineer – GPS, inertial nav, control systems, aerospace sims, etc.) but I considered myself a stone cold expert on coordinate transformations, quaternions, matrices, geometry, and every now and again I'd get it into my head to learn about tensors, and every time I got bounced back, and never really got anywhere. Until a couple of years ago when I decided I'd really make a run at it for part of a video series I was working on for my own amusement. And I did manage to struggle through to a base line understanding, and I made a video about it. Now, the vid isn't perfect and I need to redo it, but still, it does give an alternative approach, and one of the things that is different is that I decided the indexing conventions, the 'Einstein notation', the pre and post multiplication of matrices, that is, the usual notation for tensors, had to go. Also a rank 1 covariant tensor is a covector tensor and a rank 1 contravariant tensor is a vector tensor. No more use of covariant and contravaiant. …… Sounds a little silly, but for me it was absolutely necessary. … The vid ….

3. Orodruin says:
George Jones

I think by "next-to-next commandment", @Orodruin means Commandment 6. In the example you quoted, two "downstairs" indices are summed over, instead of one "downstairs" index and one "upstairs" index.This is correct. However, it does not hurt to be specific so I will update the text when I get around to it.

4. George Jones says:
Stephen Tashi

My question concerns the remarks before Commandment 5 and the examples before Commandment 5.I think by "next-to-next commandment", @Orodruin means Commandment 6. In the example you quoted, two "downstairs" indices are summed over, instead of one "downstairs" index and one "upstairs" index.

5. Stephen Tashi says:
George Jones

Have you looked at the example given in the explanation of Commandment 5?My question concerns the remarks before Commandment 5 and the examples before Commandment 5.

The examples after Commandment 5 are clear.

6. George Jones says:
Stephen Tashi

Which expression is considered to have more than two instances of an index?Have you looked at the example given in the explanation of Commandment 5?

7. Stephen Tashi says:

## (vec{v}timesvec{w})^i = epsilon_{ijk}v^jw^k ## ## vec{v}timesvec{w} = vec{e}_iepsilon_{ijk}v^jw^k ##
(Note that this expression breaks the next-to-next commandment if taken literally! It is intended to hold only in Cartesian coordinates. See the caveat.)

5. You shall not have more than two of any one index in an index expressionReference https://www.physicsforums.com/insights/the-10-commandments-of-index-expressions-and-tensor-calculus/

Which expression is considered to have more than two instances of an index?

8. vanhees71 says:
robphy

One would probably use different sets of indices, e.g.
$$A_a B_mu {v_1}^a {v_2}^mu$$Yes, if you define
$$A_a=A^{*a}, quad B_{mu} = B^{* mu}.$$

9. Orodruin says:
robphy

One thing that wasn't mentioned in the Insight is
the distinction between

In my experience, students have enough problems with the first of these to delve into the abstract index notation early on and most of the time they do not need it (and the students that are interested enough to delve into it really do not need to be told anything).

10. robphy says:

One thing that wasn't mentioned in the Insight is
the distinction between

11. robphy says:
vanhees71

$$langle AB|v_1 v_2 rangle=langle A|v_1 rangle langle B |v_2 rangle.$$
It doesn't make any sense to swap ##A## and ##B## in this expression, since ##langle A|v_2rangle## doesn't make any sense, because you cannot take a vector product of a vector with a vector belonging to a different vector space (e.g., think about ##V_1## being a spin-1 vector space (3D vector space) and ##V_2## a spin-2 vector space (5D vector space).One would probably use different sets of indices, e.g.
$$A_a B_mu {v_1}^a {v_2}^mu$$

12. stevendaryl says:

And as I said, partial contractions are really ugly. If you want to have ##langle C|## act on the second component of ##|Arangle |Brangle##, you can't write it as:

##langle C|Arangle |Brangle##

You could express it with Einstein indices, though:

##C_mu A^nu B^mu##

13. stevendaryl says:
vanhees71

…$$langle AB|v_1 v_2 rangle=langle A|v_1 rangle langle B |v_2 rangle.$$.But if you're writing ##langle A| langle B|## contracted with ## |Crangle |D rangle##, it looks like

##langle A| langle B | |Crangle |Drangle = langle A| (langle B|Crangle) |Drangle##, rather than what's supposed to be, ##langle A|Brangle langle C|Drangle##. Of course, you can disambiguate it, but the notation is pretty ugly.

14. vanhees71 says:

Well, in this case it's easy to answer, if you consider ##|A rangle## to belong to a completely different vector space than ##|B rangle##. Then, what physicists mean is a Kronecker product of vectors ##|AB rangle=|A rangle |B rangle = |A rangle otimes B rangle##. Then it's clear that the hermitean conjugate form of this, acting on ##V_1 otimes V_2## can only be ##|AB rangle^{dagger}=langle AB | = langle A |otimes langle B|##, because you can apply it only on a vector ##|v_1 v_2 rangle in V_1 otimes V_2## but not on a vector ##|v_2 v_1 rangle in V_2 otimes V_1##, i.e., a correct expression is
$$langle AB|v_1 v_2 rangle=langle A|v_1 rangle langle B |v_2 rangle.$$
It doesn't make any sense to swap ##A## and ##B## in this expression, since ##langle A|v_2rangle## doesn't make any sense, because you cannot take a vector product of a vector with a vector belonging to a different vector space (e.g., think about ##V_1## being a spin-1 vector space (3D vector space) and ##V_2## a spin-2 vector space (5D vector space).

15. stevendaryl says:
fresh_42

As made for me and my aversion against indices. Can I order another one for the bra – ket – "covariant" – "contravariant" – world? I mean their physical use, not their mathematical meaning.I've decided that the bra-ket notation is pretty wonderful if you're dealing with single systems, but gets messy and confusing if you have product states.

For example, should ##(|Arangle |Brangle)^dagger## be written as ##langle A| langle B|## or ##langle B| langle A|##? Also, how do you write a "partial" contraction on just one component of a product state?

Has someone tried using Einstein's notation for quantum states? So you would write ##|Arangle## as just ##A^mu##, and you would write ##langle A|## as ##A_mu##? Then the corresponding "metric" would be ##g(A,B) = langle A|Brangle##.

16. fresh_42 says:

As made for me and my aversion against indices. Can I order another one for the bra – ket – "covariant" – "contravariant" – world? I mean their physical use, not their mathematical meaning.