Chapter 2: Tensor Analysis

Tensors are the natural mathematical objects that transform properly under coordinate changes. They form the language of general relativity, expressing physical laws in coordinate-independent form.

What is a Tensor?

A tensor of type (r, s) is a multilinear map that takes r covectors and s vectors as inputs and produces a real number. In component form:

\(T^{\mu_1...\mu_r}_{\;\;\;\;\;\;\;\nu_1...\nu_s}\)

r contravariant indices (upper), s covariant indices (lower)

Transformation Law

Under coordinate transformation xμ → xμ', tensor components transform as:

\(T'^{\mu'}_{\;\;\nu'} = \frac{\partial x^{\mu'}}{\partial x^\mu} \frac{\partial x^\nu}{\partial x^{\nu'}} T^{\mu}_{\;\;\nu}\)

Tensor Transformation: Same Vector, Different ComponentsCoordinates xμV'¹V'²x'¹x'²Coordinates x'μ∂x'μ/∂xνSame geometric vector — different component representations

Important Tensor Types

Scalars (0,0)

Invariant quantities: proper time τ, rest mass m, spacetime interval ds²

Vectors (1,0) and Covectors (0,1)

\(Vectors: V^\mu = (V^0, V^1, V^2, V^3) — tangent to curves\)

\(Covectors: \omega_\mu = (\omega_0, \omega_1, \omega_2, \omega_3) — gradients of functions\)

The Metric Tensor (0,2)

\(g_{\mu\nu} — defines distances, angles, and raises/lowers indices\)

The Riemann Tensor (1,3)

\(R^\rho_{\;\sigma\mu\nu} — encodes spacetime curvature\)

Tensor Operations

Addition

\((A + B)^{\mu\nu} = A^{\mu\nu} + B^{\mu\nu}\)

Same type tensors only

Tensor Product

\((A \otimes B)^{\mu\nu} = A^\mu B^\nu\)

Creates higher-rank tensor

Contraction

\(A^\mu_{\;\mu} = \sum_\mu A^\mu_{\;\mu}\)

Reduces rank by 2

Index Raising/Lowering

\(V_\mu = g_{\mu\nu}V^\nu\)

Uses metric tensor

Python: Tensor Transformations

Python
tensor_transform.py70 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server

Fortran: Tensor Contraction

Fortran + Python: Tensor Operations

Python

Compiles Fortran tensor code and visualizes components as heatmaps

tensor_plot.py123 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server

Einstein Summation Convention

Repeated indices (one up, one down) are implicitly summed over:

\(A^\mu B_\mu \equiv \sum_{\mu=0}^{3} A^\mu B_\mu = A^0 B_0 + A^1 B_1 + A^2 B_2 + A^3 B_3\)

This convention eliminates cumbersome summation symbols and makes equations more readable. Free indices must match on both sides of an equation.

Practice Problems

Problem 1:Contract the tensor $T^{\mu\nu}$ with the Minkowski metric $\eta_{\mu\nu} = \text{diag}(1, -1, -1, -1)$ to find the trace $T = \eta_{\mu\nu}T^{\mu\nu}$ for the electromagnetic stress-energy tensor, which is traceless.

Solution:

Step 1: The trace is $T = \eta_{\mu\nu}T^{\mu\nu} = T^{00} - T^{11} - T^{22} - T^{33}$.

Step 2: For the EM field, $T^{00} = \frac{1}{2}(E^2 + B^2)$ (energy density) and $T^{ii} = \frac{1}{2}(E^2 + B^2)\delta^{ii} - E_iE_i - B_iB_i$ (Maxwell stress).

Step 3: Sum the spatial diagonal: $T^{11} + T^{22} + T^{33} = \frac{3}{2}(E^2 + B^2) - E^2 - B^2 = \frac{1}{2}(E^2 + B^2)$.

Step 4: Therefore $T = \frac{1}{2}(E^2 + B^2) - \frac{1}{2}(E^2 + B^2) = 0$.

Answer: $T = \eta_{\mu\nu}T^{\mu\nu} = 0$. The EM stress-energy tensor is traceless, reflecting the conformal invariance of Maxwell's equations in 4D.

Problem 2:Given a 4-velocity $u^\mu = (\gamma, \gamma v, 0, 0)$ in Minkowski space, lower the index to find $u_\mu$ and verify $u_\mu u^\mu = 1$.

Solution:

Step 1: Lower with the metric: $u_\mu = \eta_{\mu\nu}u^\nu$. With signature $(+,-,-,-)$:

$u_0 = \eta_{00}u^0 = \gamma, \quad u_1 = \eta_{11}u^1 = -\gamma v, \quad u_2 = 0, \quad u_3 = 0$

Step 2: So $u_\mu = (\gamma, -\gamma v, 0, 0)$.

Step 3: Compute the invariant: $u_\mu u^\mu = \gamma \cdot \gamma + (-\gamma v)(\gamma v) + 0 + 0 = \gamma^2(1 - v^2)$.

Step 4: Since $\gamma = 1/\sqrt{1-v^2}$: $u_\mu u^\mu = \frac{1-v^2}{1-v^2} = 1$.

Answer: $u_\mu = (\gamma, -\gamma v, 0, 0)$ and $u_\mu u^\mu = 1$. ✓

Problem 3:Compute the Christoffel symbol $\Gamma^r_{tt}$ for the Schwarzschild metric $ds^2 = (1-2M/r)\,dt^2 - (1-2M/r)^{-1}dr^2 - r^2 d\Omega^2$.

Solution:

Step 1: The Christoffel symbol formula is $\Gamma^\rho_{\mu\nu} = \frac{1}{2}g^{\rho\sigma}(\partial_\mu g_{\nu\sigma} + \partial_\nu g_{\mu\sigma} - \partial_\sigma g_{\mu\nu})$.

Step 2: For $\Gamma^r_{tt}$: $\Gamma^r_{tt} = \frac{1}{2}g^{rr}(\partial_t g_{tr} + \partial_t g_{tr} - \partial_r g_{tt})$. Since the metric is static, $\partial_t g_{\mu\nu} = 0$.

Step 3: This reduces to $\Gamma^r_{tt} = -\frac{1}{2}g^{rr}\partial_r g_{tt}$.

Step 4: With $g_{tt} = 1 - 2M/r$ and $g^{rr} = -(1 - 2M/r)$: $\partial_r g_{tt} = 2M/r^2$.

Step 5: Therefore $\Gamma^r_{tt} = -\frac{1}{2}\left(-(1-2M/r)\right)\frac{2M}{r^2} = \frac{M}{r^2}(1-2M/r)$.

Answer: $\Gamma^r_{tt} = \frac{M}{r^2}\left(1 - \frac{2M}{r}\right)$. This reduces to $M/r^2$ for $r \gg 2M$, recovering Newtonian gravity.

Problem 4:Prove that the covariant derivative of the metric tensor vanishes: $\nabla_\rho g_{\mu\nu} = 0$ (metric compatibility).

Solution:

Step 1: Write out the covariant derivative: $\nabla_\rho g_{\mu\nu} = \partial_\rho g_{\mu\nu} - \Gamma^\sigma_{\rho\mu}g_{\sigma\nu} - \Gamma^\sigma_{\rho\nu}g_{\mu\sigma}$.

Step 2: Lower the Christoffel symbols using $\Gamma_{\sigma\rho\mu} = g_{\sigma\lambda}\Gamma^\lambda_{\rho\mu} = \frac{1}{2}(\partial_\rho g_{\mu\sigma} + \partial_\mu g_{\rho\sigma} - \partial_\sigma g_{\rho\mu})$.

Step 3: The two Christoffel terms become: $\Gamma_{\nu\rho\mu} + \Gamma_{\mu\rho\nu} = \frac{1}{2}(\partial_\rho g_{\mu\nu} + \partial_\mu g_{\rho\nu} - \partial_\nu g_{\rho\mu}) + \frac{1}{2}(\partial_\rho g_{\nu\mu} + \partial_\nu g_{\rho\mu} - \partial_\mu g_{\rho\nu})$.

Step 4: The $\partial_\mu g_{\rho\nu}$ and $\partial_\nu g_{\rho\mu}$ terms cancel pairwise, leaving $\partial_\rho g_{\mu\nu}$.

Answer: $\nabla_\rho g_{\mu\nu} = \partial_\rho g_{\mu\nu} - \partial_\rho g_{\mu\nu} = 0$. This is guaranteed by the definition of the Levi-Civita connection.

Problem 5:Given $A_\mu = (3, -1, 4, 0)$ and $B^\mu = (2, 1, 0, -1)$ in Minkowski space, compute the scalar $A_\mu B^\mu$ and raise $A_\mu$ to get $A^\mu$.

Solution:

Step 1: The contraction is $A_\mu B^\mu = A_0 B^0 + A_1 B^1 + A_2 B^2 + A_3 B^3$.

Step 2: Evaluate: $A_\mu B^\mu = (3)(2) + (-1)(1) + (4)(0) + (0)(-1) = 6 - 1 + 0 + 0 = 5$.

Step 3: To raise $A_\mu$: $A^\mu = \eta^{\mu\nu}A_\nu$. With $\eta^{\mu\nu} = \text{diag}(1,-1,-1,-1)$:

$A^0 = A_0 = 3, \quad A^1 = -A_1 = 1, \quad A^2 = -A_2 = -4, \quad A^3 = -A_3 = 0$

Answer: $A_\mu B^\mu = 5$ and $A^\mu = (3, 1, -4, 0)$.

Rate this chapter: