Gram-Schmidt operates uniformly across many settings — ℝⁿ with the standard dot product, polynomial spaces with integral inner products, function spaces in Fourier analysis, and abstract inner product spaces in general. The table below collects the main contexts in which the process is applied, alongside the input, the inner product used, and what the algorithm produces in each case.
| Input |
Inner product / setting |
Output of Gram–Schmidt |
What is obtained |
| Independent vectors v1, …, vk in ℝⁿ |
standard dot product u · v |
orthogonal set {u1, …, uk} with same span at every step |
orthogonal basis for Span{v1, …, vk} |
| Same input, plus normalization step qj = uj / ‖uj‖ |
standard dot product |
orthonormal set {q1, …, qk} with qi · qj = δij |
orthonormal basis for the same subspace |
| Columns of a full-column-rank matrix A (m × n) |
standard dot product on column vectors |
Q (m × n, orthonormal columns) and R (n × n, upper triangular, positive diagonal) |
thin QR decomposition A = Q R |
| {1, x, x²} in 𝒫2 |
⟨p, q⟩ = ∫−11 p(x) q(x) dx |
P0(x) = 1, P1(x) = x, P2(x) = ½(3x² − 1) (up to normalization) |
the first three Legendre polynomials |
| Selected functions in C[0, 2π] |
⟨f, g⟩ = ∫02π f(x) g(x) dx |
sines and cosines remain orthogonal across the chosen frequencies |
orthogonal basis underlying Fourier analysis |
| Independent v1, …, vk in any inner product space V |
general ⟨·, ·⟩ |
orthonormal {q1, …, qk} with same span |
constructive proof that every finite-dimensional inner product space has an orthonormal basis |