Gram-Schmidt orthogonalization

Any set of linearly independentMathworldPlanetmath vectors v1,,vn can be converted into a set of orthogonal vectorsMathworldPlanetmath q1,,qn by the Gram-Schmidt processMathworldPlanetmath. In three dimensionsMathworldPlanetmathPlanetmath, v1 determines a line; the vectors v1 and v2 determine a plane. The vector q1 is the unit vectorMathworldPlanetmath in the direction v1. The (unit) vector q2 lies in the plane of v1,v2, and is normal to v1 (on the same side as v2. The (unit) vector q3 is normal to the plane of v1,v2, on the same side as v3, etc.

In general, first set u1=v1, and then each ui is made orthogonalMathworldPlanetmath to the preceding u1,ui-1 by subtraction of the projections of vi in the directions of u1,,ui-1 :


The i vectors ui span the same subspaceMathworldPlanetmathPlanetmath as the vi. The vectors qi=ui/||ui|| are orthonormal. This leads to the following theorem:


Any m×n matrix A with linearly independent columns can be factorized into a product, A=QR. The columns of Q are orthonormal and R is upper triangular and invertiblePlanetmathPlanetmath.

This “classical” Gram-Schmidt method is often numerically unstable, see [Golub89] for a “modified” Gram-Schmidt method.

  • Originally from The Data Analysis Briefbook (

  • Golub89

    Gene H. Golub and Charles F. van Loan: Matrix Computations, 2nd edn., The John Hopkins University Press, 1989.

Title Gram-Schmidt orthogonalization
Canonical name GramSchmidtOrthogonalization
Date of creation 2013-03-22 12:06:14
Last modified on 2013-03-22 12:06:14
Owner akrowne (2)
Last modified by akrowne (2)
Numerical id 9
Author akrowne (2)
Entry type Algorithm
Classification msc 65F25
Synonym Gram-Schmidt decomposition
Synonym Gram-Schmidt orthonormalization
Synonym Gram-Schmidt process
Related topic HouseholderTransformation
Related topic GivensRotation
Related topic QRDecomposition
Related topic AnExampleForSchurDecomposition