The metric tensor is the rule that turns coordinates into lengths and angles. In Cartesian coordinates you never see it, because Pythagoras does the job. As soon as the axes are skewed, curved or mixed with time, you need it to measure anything. I'll start with the problem it solves, and then build it from the basis vectors. After that we'll work out the metric for polar and spherical coordinates, see how it raises and lowers indices, and finish with the metric of spacetime.
- What problem does the metric tensor solve ?
- How is the metric tensor built from the basis vectors ?
- What is the metric in polar and spherical coordinates ?
- How does the metric raise and lower indices ?
- What is the metric of spacetime ?
- YouTube
What problem does the metric tensor solve ?
A coordinate is only a label. A change of 0.1 in a coordinate can be a change of 0.1 m, or a change of 0.1 rad, which covers a different distance at each radius. So we need a rule that says how far apart two nearby points really are, given the change in their coordinates.
In Cartesian coordinates the rule is Pythagoras: ds2 = dx2 + dy2 + dz2. Let's try the same rule in polar coordinates. At r = 2, move by dr = 0.1 and dθ = 0.05 rad. The naive rule gives √(0.12 + 0.052) = 0.112, which adds a length to an angle. The correct distance is √(0.12 + (2 x 0.05)2) = 0.141, because an angle step dθ moves the point by r dθ.
The metric tensor packs this rule into a table of numbers gij. In any coordinate system, the squared length of a small step is ds2 = gij dxi dxj. Here the sum runs over every i and every j. This is the Einstein summation convention: an index that appears once up and once down is summed. For Cartesian coordinates gij is the identity matrix, and the formula becomes Pythagoras again.
Coordinates are not distances : the metric converts a change in coordinates into a real length.The metric is a matrix at each point : for n coordinates, gij is an n x n matrix. In general its values change from point to point.The metric is symmetric : gij = gji, because the step dxi dxj is the same as dxj dxi.The superscripts are indices, not powers : dxi means component i of the step. Only ds2 and dx2 in Pythagoras are squares.
How is the metric tensor built from the basis vectors ?
Where do the numbers gij come from? They come from the basis vectors of the coordinate system. A small example with two skewed basis vectors shows the whole idea, and the arithmetic stays small enough to check by hand.
Every vector is a sum of basis vectors, v = v1e1 + v2e2. Its squared length is the dot product v ⋅ v = vivj (ei ⋅ ej). So the metric is just the table of dot products between the basis vectors, gij = ei ⋅ ej. It is the Gram matrix of the basis vectors, built from the inner product. The same dot product with two different vectors gives the inner product u ⋅ v = gij uivj, so the metric also measures angles.
Now take e1 = (1, 0) and e2 = (1, 1). The dot products are e1 ⋅ e1 = 1, e1 ⋅ e2 = 1 and e2 ⋅ e2 = 2. So the metric is g = [[1, 1], [1, 2]]. Take the vector with components v1 = 2 and v2 = 1. The metric gives its squared length as [2 1] g [2 1]T = 10. Let's check it directly. The vector is 2e1 + e2 = (3, 1) in Cartesian terms, and 32 + 12 = 10. Plain Pythagoras on the components would give 22 + 12 = 5, which is wrong.
Diagonal entries are squared lengths of the basis vectors : g22 = 2 says that e2 has length √2.Off-diagonal entries measure how skewed the axes are : the angle between e1 and e2 is arccos(g12 / √(g11g22)) = arccos(1/√2) = 45 deg.An orthonormal basis gives the identity : when the basis vectors have length 1 and are orthogonal, gij is the identity and the metric is invisible.In matrix form, g = ETE : E is the matrix whose columns are the basis vectors. This form makes the symmetry of g obvious.
What is the metric in polar and spherical coordinates ?
Polar and spherical coordinates are the most common curved coordinates in engineering. An antenna pattern is drawn in spherical coordinates, and a rotating phasor is described in polar ones. Their basis vectors change direction and length from point to point, so their metric depends on the position.
The basis vectors of a curved system are the derivatives of the position with respect to each coordinate. For polar coordinates, x = r cos θ and y = r sin θ. Then e1 = ∂(x, y)/∂r = (cos θ, sin θ), which has length 1. e2 = ∂(x, y)/∂θ = (-r sin θ, r cos θ), which has length r. The two vectors are orthogonal. So the metric is g = diag(1, r2) and ds2 = dr2 + r2 dθ2. That is the rule used in the first section.
The same steps in spherical coordinates, with polar angle θ and azimuth φ, give g = diag(1, r2, r2 sin2θ). So ds2 = dr2 + r2 dθ2 + r2 sin2θ dφ2. As a check, go back to the polar metric and walk once around a circle of radius r. Only θ changes, so ds = r dθ, and the length is the integral of r dθ from 0 to 2π, which is 2πr.
The metric can depend on position : gθθ = r2 grows with r, because the same angle covers a longer arc far from the origin.A diagonal metric means orthogonal coordinate lines : polar and spherical coordinates both have diagonal metrics, so their coordinate lines cross at right angles.The metric gives area and volume too : the volume element is √det(g) times the product of the coordinate steps. For spherical coordinates this is r2 sin θ dr dθ dφ.g = JTJ : J is the Jacobian of the Cartesian position with respect to the curved coordinates. This is the curved version of g = ETE.
How does the metric raise and lower indices ?
Tensor formulas write some indices up and some down, and the metric is the tool that converts one kind into the other. This matters because a formula is only valid when each summed index appears once up and once down. The skewed basis from the second section gives a concrete example.
The components vi with an upper index are the contravariant components. They are the coefficients of the basis vectors. The metric turns them into covariant components with a lower index, vi = gij vj. The inverse matrix gij turns them back, vi = gijvj. For g = [[1, 1], [1, 2]] and vi = (2, 1), the lower components are vi = (3, 4). The inverse metric is gij = [[2, -1], [-1, 1]], and it maps (3, 4) back to (2, 1).
With one upper and one lower index, the squared length needs no metric at all: vivi = 3 x 2 + 4 x 1 = 10. This is the same 10 as before. The covariant components have a direct meaning too. Each vi is the dot product v ⋅ ei, so v1 = (3, 1) ⋅ (1, 0) = 3 and v2 = (3, 1) ⋅ (1, 1) = 4.
Lowering uses gij, raising uses gij : the two matrices are inverses of each other, so lowering and then raising gives back the original components.In Cartesian coordinates the two kinds are equal : g is the identity, so vi = vi. That is why ordinary vector algebra never needs the distinction.A contraction of an upper and a lower index is invariant : vivi gives the same number in every coordinate system.
What is the metric of spacetime ?
The two lectures in the YouTube section use the metric tensor in general relativity. There the coordinates include time, and the metric is no longer positive. Let's see what changes when time joins the three space coordinates.
Special relativity uses the Minkowski metric η = diag(-1, 1, 1, 1) for the coordinates (ct, x, y, z). So ds2 = -c2dt2 + dx2 + dy2 + dz2. Some books use the opposite sign convention, diag(1, -1, -1, -1). Both describe the same physics, so check the convention before you compare formulas. This ds2 is the spacetime interval, and every inertial observer measures the same value for it. For a light signal, dx = c dt, so ds2 = 0.
General relativity lets the metric gμν change from point to point, and that variation is gravity. Outside a spherical mass M, the Schwarzschild metric has gtt = -(1 - rs/r), with rs = 2GM/c2. For the Earth rs is only about 8.9 mm, so the correction is small. It is still large enough that GPS satellite clocks must be corrected for it.
A metric does not have to be positive : the Minkowski metric gives a negative ds2 for a step that is mostly in time, and zero for a light path.Greek indices mark spacetime : μ and ν run over 0 to 3, with 0 for time. Latin indices such as i and j run over space only.Gravity is a metric that varies : in general relativity, gμν is found by solving the Einstein field equations for a given mass distribution.
YouTube
The two lectures below explain the metric tensor in the setting of general relativity. They build on the same ideas as the sections above: basis vectors, dot products and a metric that changes from point to point.
- Demystifying The Metric Tensor in General Relativity
- The Maths of General Relativity (4/8) - Metric tensor