Skip to content

Linear Algebra and Tensor Computation

Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

Scrollable table. Use Left and Right arrow keys to reveal additional columns.

Scrollable figure. Use Left and Right arrow keys to inspect hidden content.

Linear algebra becomes reliable in a gravity calculation only when the geometric object is kept separate from its component array. This page is a compact map from vectors, tensors, decompositions, and eigenproblems to the data and checks that make a calculation meaningful. For a guided diagnostic and repair treatment, use Calculus and Linear Algebra for Relativity.

Let (ei)(e_i) be an ordered basis and let the columns of PP be a new basis expressed in the old one, so ei′=ejPjie'_i=e_jP^j{}_i. Then

[v]old=P[v]new,[v]new=P−1[v]old.[v]_{\mathrm{old}}=P[v]_{\mathrm{new}}, \qquad [v]_{\mathrm{new}}=P^{-1}[v]_{\mathrm{old}}.

The same geometric map and covariant bilinear form consequently have matrices

Anew=P−1AoldP,gnew=PTgoldP.A_{\mathrm{new}}=P^{-1}A_{\mathrm{old}}P, \qquad g_{\mathrm{new}}=P^{\mathsf T}g_{\mathrm{old}}P.

For a Hermitian form, replace the transpose by the conjugate transpose. Upper and lower tensor slots acquire the corresponding inverse and direct factors. Tong gives the index and contraction rules in Tong 2019, § 2.3, printed pp. 67–75. Wendl develops the pseudo-Riemannian metrics and isometries that make the distinction between components and geometry explicit in Wendl 2021–2022, §§ 22–24, printed pp. 184–211.

Object or operationData that must be declaredFast independent check
Vector or covectorvector space, field, basis, and dual pairingreconstruct the same object after a basis change
Bilinear or Hermitian formsignature, symmetry type, and whether the second slot is conjugatedcompare a fully contracted scalar
Tensor contractionvariance and type of every index, metric if used, and dimensioncheck free indices and evaluate in a second basis or frame
Linear mapdomain, codomain, bases, and any inner productverify rank, trace, determinant, or a defining action when applicable

A component identity is not automatically a tensor identity. Conversely, a full contraction is basis independent only when every object in it is transformed consistently.

Choose a decomposition by the question it answers, not by a familiar command.

ProblemUseful formEssential hypotheses and interpretation
Stable orthogonal basis or least squaresA=QRA=QRorthogonality refers to a declared positive-definite inner product
Rank, null spaces, and amplificationA=UΣV†A=U\Sigma V^\daggersingular values use the chosen domain and codomain inner products
Invariant subspaces of one endomorphismAv=λvAv=\lambda veigenvectors can be nonunique at degeneracy and badly conditioned for a nonnormal map
Coupled operator or discretized boundary problemAv=λBvAv=\lambda Bvretain the pencil A−λBA-\lambda B; state whether BB is singular, invertible, or positive definite

Higham defines the relevant induced norms and singular values in Higham 2002, Ch. 6, §§ 6.1–6.4, printed pp. 105–115. In an indefinite spacetime metric, “self-adjoint,” “orthogonal,” and “norm” require extra care: the Lorentzian metric is a nondegenerate bilinear form, not a positive-definite norm.

For resonance pencils and nonnormal discretizations, continue to Generalized Eigenvalue and Resonance Problems. A small matrix residual does not by itself establish a continuum mode.

Residual, backward error, and conditioning

Section titled “Residual, backward error, and conditioning”

Suppose AA is invertible, Ax=bAx=b, yy is an approximation, and r=b−Ayr=b-Ay. For a consistent induced norm and nonzero bb,

∥x−y∥∥x∥≤κ(A)∥r∥∥b∥,κ(A)=∥A∥ ∥A−1∥.\frac{\lVert x-y\rVert}{\lVert x\rVert} \le \kappa(A)\frac{\lVert r\rVert}{\lVert b\rVert}, \qquad \kappa(A)=\lVert A\rVert\,\lVert A^{-1}\rVert.

The residual measures failure of the computed vector to satisfy the displayed system. A normwise backward error asks for the smallest relative perturbation of the data that makes the computed vector exact. Conditioning measures how strongly the exact answer responds to such perturbations. Their separation, including the scaled residual formula and forward-sensitivity bound, is given in Higham 2002, Ch. 7, printed pp. 119–137, especially Thms. 7.1–7.2 and Eqs. (7.1)–(7.3). Thus a tiny residual or backward error can coexist with a large forward error when κ(A)\kappa(A) is large.

Always name the norm and scaling used to quote a condition number. For eigenproblems, also inspect left and right invariant subspaces, degeneracy, and stability under resolution or precision changes. Conditioning, Residuals, and Convergence develops those computational distinctions.

Before accepting a symbolic result:

  • declare each index type, metric, symmetry, and dimension-dependent identity;
  • distinguish free indices from dummy indices and verify that every contraction is legal;
  • canonicalize dummy names and declared permutations without treating canonical form as a proof of equality;
  • test a simple component realization, a symmetry, or a fully contracted invariant; and
  • compare any numerical evaluation against a basis or frame change.

The permutation-group treatment of tensor symmetries and dummy-index canonicalization is described in Martín-García 2008, §§ 2–5. It automates equivalence under declared symmetries; it does not infer missing assumptions or dimension-specific identities. For geometric definitions, use Tensor Fields and Natural Operations; for computer-algebra practice, use Symbolic Tensor and Algebraic Computation.

  • Higham, Nicholas J. Accuracy and Stability of Numerical Algorithms. 2nd ed. Philadelphia: Society for Industrial and Applied Mathematics, 2002. DOI.
  • Martín-García, José M. “xPerm: Fast Index Canonicalization for Tensor Computer Algebra.” Computer Physics Communications 179 (2008): 597–603. Open preprint.
  • Tong, David. General Relativity. Cambridge Part III lecture notes, 2019. Official PDF.
  • Wendl, Chris. Differential Geometry I and II. Humboldt-Universität zu Berlin lecture notes, 2021–2022. Open PDF.