In linear algebra, the **Gram-Schmidt process** is method of *orthogonalizing* a set of vectors in an inner product space, most commonly the Euclidean space **R**^{n}. Orthogonalization in this context means the following: we start with vectors *v*_{1},...,*v*_{k} which are linearly independent and we want to find mutually orthogonal vectors *u*_{1},...,*u*_{k} which generate the same subspace as the vectors *v*_{1},...,*v*_{k}.

We denote the inner (dot) product of the two vectors *u* and *v* by (*u* **.** *v*). The Gram-Schmidt process works as follows:

*u*_{1}=*v*_{1}*u*_{2}=*v*_{2}- [(*v*_{2}**.***u*_{1})/(*u*_{1}**.***u*_{1})]*u*_{1}*u*_{3}=*v*_{3}- [(*v*_{3}**.***u*_{1})/(*u*_{1}**.***u*_{1})]*u*_{1}- [(*v*_{3}**.***u*_{2})/(*u*_{2}**.***u*_{2})]*u*_{2}- ...
*u*=_{k}*v*- [(_{k}*v*_{k}**.***u*_{1})/(*u*_{1}**.***u*_{1})]*u*_{1}- [(*v*_{k}**.***u*_{2})/(*u*_{2}**.***u*_{2})]*u*_{2}- ... - [(*v*_{k}**.***u*_{k-1})/(*u*_{k-1}**.***u*_{k-1})]*u*_{k-1}

*u*

_{1}

**.**

*u*

_{2}) by substituting the above formula for

*u*

_{2}: you will get zero. Then use this to compute (

*u*

_{1}

**.**

*u*

_{3}) again by substituting the formula for

*u*

_{3}: you will get zero. The general proof proceeds by mathematical induction.

Geometrically, this method proceeds as follows: to compute *u*_{i}, it projects *v*_{i} orthogonally onto the subspace *U* generated by *u*_{1},...,*u*_{i-1}, which is the same as the subspace generated by *v*_{1},...,*v*_{i-1}. *u*_{i} is then defined to be the difference between *v*_{i} and this projection, guaranteed to be orthogonal to all of the vectors in the subspace *U*.

If one is interested in an *orthonormal* system *u*_{1},...,*u*_{k} (i.e. the vectors are mutually orthogonal and all have norm 1), then one can divide *u*_{i} by its norm (*u*_{i} **.** *u*_{i}).

When performing orthogonalization on a computer, the Householder transformation is usually preferred over the Gram-Schmidt process since it is more numerically stable, i.e. rounding errors tend to have less serious effects.