# General Relativity/Metric tensor

Recall that a tensor is a linear function which can convert vectors into scalars. Recall also that a distance can be stated as a formula that converts vectors to a scalar. So can we express distance with tensors formulas? Yes, we can.

The first problem comes in, in that tensors are linear functions, but we have some squares in our distance formula. We can deal with this with a mathematical trick. Consider the formula for distance in normal three dimensional Euclidean space using cartesian coordinates:

We can rewrite this as:

Now is obviously a tensor. What type of tensor is it? Well it takes two contravariant vectors and turns them into a scalar . So it must be a covariant tensor of rank 2. is called the Kronecker delta tensor, which is 1 whenever and 0 otherwise. In general, instead of components , we have :

This leads us to a general metric tensor . As shown earlier, in Euclidean 3-space, is simply the Kronecker delta matrix.

And that is the equation of distances in Euclidean three space in tensor notation.

Now let's do special relativity using this notation:

where the Greek letters just remind us that we are summing over four dimensional space time. Now in the case of special relativity is zero for where and are different, +1 for the space indices 1,2,3 and for the time index. We can call this special matrix , giving us the formulas:

In general, however, will not be a constant. A simple example where we can see that is spherical coordinates, with the metric

Here, , , , , , , and .

Also, a metric may have off-diagonal terms, as in

It is easy to see that and .