Einstein notation

In mathematics, especially in applications of linear algebra to physics, the **Einstein notation** or **Einstein summation convention** is a notational convention that implies summation over a set of indexed terms in a formula, thus achieving notational brevity. As part of mathematics it is a notational subset of Ricci calculus; however, it is often used in applications in physics that do not distinguish between tangent and cotangent spaces. It was introduced to physics by Albert Einstein in 1916.

## Introduction

### Statement of convention

According to this convention, when an index variable appears twice in a single term and is not otherwise defined (see free and bound variables), it implies summation of that term over all the values of the index. So where the indices can range over the set {1, 2, 3},

# i
1

3

c
i

x
i

=

c
1

x
1

c
2

x
2

c
3

x
3

{\displaystyle y = \sum\_{i = 1}^3 c\_i x^i = c\_1 x^1 + c\_2 x^2 + c\_3 x^3}

is simplified by the convention to:

# y

c
i

x
i

.

{\displaystyle y = c\_i x^i.}

The upper indices are not exponents but are indices of coordinates, coefficients or basis vectors. That is, in this context *x*2 should be understood as the second component of **x** rather than the square of **x** (this can occasionally lead to ambiguity). The upper index position in *x**i* is because, typically, an index occurs once in an upper (superscript) and once in a lower (subscript) position in a term (see *#Application* below). Typically, (*x*1 *x*2 *x*3) would be equivalent to the traditional (*x* *y* *z*).

In general relativity, a common convention is that

* the Greek alphabet is used for space and time components, where indices take on values 0, 1, 2, or 3 (frequently used letters are *μ*, *ν*, ...),
* the Latin alphabet is used for spatial components only, where indices take on values 1, 2, or 3 (frequently used letters are *i*, *j*, ...),

In general, indices can range over any indexing set, including an infinite set. This should not be confused with a typographically similar convention used to distinguish between tensor index notation and the closely related but distinct basis-independent abstract index notation.

An index that is summed over is a *summation index*, in this case "*i*". It is also called a dummy index since any symbol can replace "*i*" without changing the meaning of the expression provided that it does not collide with index symbols in the same term.

An index that is not summed over is a *free index* and should appear only once per term. If such an index does appear, it usually also appears in terms belonging to the same sum, with the exception of special values such as zero.

### Application

Einstein notation can be applied in slightly different ways. Typically, each index occurs once in an upper (superscript) and once in a lower (subscript) position in a term; however, the convention can be applied more generally to any repeated indices within a term. When dealing with covariant and contravariant vectors, where the position of an index also indicates the type of vector, the first case usually applies; a covariant vector can only be contracted with a contravariant vector, corresponding to summation of the products of coefficients. On the other hand, when there is a fixed coordinate basis (or when not considering coordinate vectors), one may choose to use only subscripts; see *#Superscripts and subscripts versus only subscripts* below.

## Vector representations

### Superscripts and subscripts versus only subscripts

In terms of covariance and contravariance of vectors,

* upper indices represent components of contravariant vectors (vectors),
* lower indices represent components of covariant vectors (covectors).

They transform contravariantly or covariantly, respectively, with respect to change of basis.

In recognition of this fact, the following notation uses the same symbol both for a vector or covector and its *components*, as in:

# v

v
i

e
i

=

[

e
1

e
2

⋯

e
n

]

[

v
1

v
2

⋮

v
n

]

# w

w
i

e
i

=

[

w
1

w
2

⋯

w
n

]

[

e
1

e
2

⋮

e
n

]

{\displaystyle v = v^i e\_i = \begin{bmatrix}e\_1 & e\_2 & \cdots & e\_n\end{bmatrix} \begin{bmatrix}v^1 \\ v^2 \\ \vdots \\ v^n\end{bmatrix} \qquad w = w\_i e^i = \begin{bmatrix}w\_1 & w\_2 & \cdots & w\_n\end{bmatrix} \begin{bmatrix}e^1 \\ e^2 \\ \vdots \\ e^n\end{bmatrix}}

where *v* is the vector and *vi* are its components (not the *i*th covector *v*), *w* is the covector and *wi* are its components. The basis vector elements

e
i

{\displaystyle e\_i}

 are each column vectors, and the covector basis elements

e
i

{\displaystyle e^i }

 are each row covectors. (See also Abstract Description; duality, below and the examples)

In the presence of a non-degenerate form (an isomorphism *V* → *V*∗, for instance a Riemannian metric or Minkowski metric), one can raise and lower indices.

A basis gives such a form (via the dual basis), hence when working on ℝ*n* with a Euclidean metric and a fixed orthonormal basis, one has the option to work with only subscripts.

However, if one changes coordinates, the way that coefficients change depends on the variance of the object, and one cannot ignore the distinction; see covariance and contravariance of vectors.

### Mnemonics

In the above example, vectors are represented as *n* × 1 matrices (column vectors), while covectors are represented as 1 × *n* matrices (row covectors).

When using the column vector convention:

* "**Up**per indices go **up** to down; **l**ower indices go **l**eft to right."
* "**Co**variant tensors are **row** vectors that have indices that are **below** (**co-row-below**)."
* Covectors are row vectors:

[

w
1

⋯

w
k

]

.

{\displaystyle \begin{bmatrix}w\_1 & \cdots & w\_k\end{bmatrix}.}

Hence the lower index indicates which *column* you are in.
* Contravariant vectors are column vectors:

[

v
1

⋮

v
k

]

{\displaystyle \begin{bmatrix}v^1 \\ \vdots \\ v^k\end{bmatrix}}

Hence the upper index indicates which *row* you are in.

### Abstract description

The virtue of Einstein notation is that it represents the invariant quantities with a simple notation.

In physics, a scalar is invariant under transformations of basis. In particular, a Lorentz scalar is invariant under a Lorentz transformation. The individual terms in the sum are not. When the basis is changed, the *components* of a vector change by a linear transformation described by a matrix. This led Einstein to propose the convention that repeated indices imply the summation is to be done.

As for covectors, they change by the inverse matrix. This is designed to guarantee that the linear function associated with the covector, the sum above, is the same no matter what the basis is.

The value of the Einstein convention is that it applies to other vector spaces built from *V* using the tensor product and duality. For example, *V* ⊗ *V*, the tensor product of *V* with itself, has a basis consisting of tensors of the form **e***ij* = **e***i* ⊗ **e***j*. Any tensor **T** in *V* ⊗ *V* can be written as:

T

=

T

i
j

e

i
j

{\displaystyle \mathbf{T} = T^{ij}\mathbf{e}\_{ij}}

.
*V*\*, the dual of *V*, has a basis **e**1, **e**2, ..., **e***n* which obeys the rule

e

i

(

e

j

# )

δ
j
i

.

{\displaystyle \mathbf{e}^i (\mathbf{e}\_j) = \delta^i\_j.}

where *δ* is the Kronecker delta. As

Hom
⁡
(
V
,
W
# )

V
∗

⊗
W

{\displaystyle \operatorname{Hom}(V,W) = V^\* \otimes W}

the row/column coordinates on a matrix correspond to the upper/lower indices on the tensor product.

## Common operations in this notation

In Einstein notation, the usual element reference *Amn* for the *m*th row and *n*th column of matrix **A** becomes *Amn*. We can then write the following operations in Einstein notation as follows.

### Inner product (hence also vector dot product)

Using an orthogonal basis, the inner product is the sum of corresponding components multiplied together:

u

⋅

v

=

u
j

v
j

{\displaystyle \mathbf{u} \cdot \mathbf{v} = u\_j v^j }

This can also be calculated by multiplying the covector on the vector.

### Vector cross product

Again using an orthogonal basis (in 3 dimensions) the cross product intrinsically involves summations over permutations of components:

u

×

v

=

ε
i

j
k

u
j

v
k

e

i

{\displaystyle \mathbf{u} \times \mathbf{v}= \varepsilon^i{}\_{jk}u^j v^k \mathbf{e}\_i }

where

ε
i

j
k

=

δ

i
l

ε

l
j
k

{\displaystyle \varepsilon^i{}\_{jk}=\delta^{il}\varepsilon\_{ljk}}

*εijk* is the Levi-Civita symbol, and *δil* is the generalized Kronecker delta. Based on this definition of *ε*, there is no difference between *εijk* and *εijk* but the position of indices.

### Matrix-vector multiplication

The product of a matrix *Aij* with a column vector *vj* is :

u

i

=
(

A

v

)

i

=

∑

# j
1

N

A

i
j

v

j

{\displaystyle \mathbf{u}\_{i} = (\mathbf{A} \mathbf{v})\_{i} =\sum\_{j=1}^N A\_{ij} v\_{j}}

equivalent to

u
i

=

A
i

j

v
j

{\displaystyle u^i = A^i{}\_j v^j }

This is a special case of matrix multiplication.

### Matrix multiplication

The matrix product of two matrices *Aij* and *Bjk* is:

C

i
k

=
(

A

B

)

i
k

=

∑

# j
1

N

A

i
j

B

j
k

{\displaystyle \mathbf{C}\_{ik} = (\mathbf{A} \mathbf{B})\_{ik} =\sum\_{j=1}^N A\_{ij} B\_{jk}}

equivalent to

C
i

k

=

A
i

j

B
j

k

{\displaystyle C^i{}\_k = A^i{}\_j B^j{}\_k }

### Trace

For a square matrix *Aij*, the trace is the sum of the diagonal elements, hence the sum over a common index *Aii*.

### Outer product

The outer product of the column vector *ui* by the row vector *vj* yields an *m* × *n* matrix **A**:

A
i

j

=

u
i

v
j

=
(
u
v

)
i

j

{\displaystyle A^i{}\_j = u^i v\_j = (u v)^i{}\_j}

Since *i* and *j* represent two *different* indices, there is no summation and the indices are not eliminated by the multiplication.

### Raising and lowering indices

Given a tensor, one can raise an index or lower an index by contracting the tensor with the metric tensor, *gμν*. For example, take the tensor *Tαβ*, one can raise an index:

T

μ
α

=

g

μ
σ

T

σ

α

{\displaystyle T^{\mu\alpha} = g^{\mu\sigma} T\_{\sigma}{}^{\alpha}}

Or one can lower an index:

T

μ
β

=

g

μ
σ

T

σ

β

{\displaystyle T\_{\mu\beta} = g\_{\mu\sigma} T^{\sigma}{}\_{\beta}}

## Notes

1. This applies only for numerical indices. The situation is the opposite for abstract indices. Then, vectors themselves carry upper abstract indices and covectors carry lower abstract indices, as per the example in the introduction of this article. Elements of a basis of vectors may carry a lower *numerical* index and an upper *abstract* index.