Gram-Schmidt's orthogonalization method

from Wikipedia, the free encyclopedia

The Gram-Schmidt orthogonalization method is an algorithm from the mathematical branch of linear algebra . For every system of linearly independent vectors, he creates an orthogonal system from a Prähilbert space (a vector space with a scalar product ) , which creates the same sub-vector space . The Gram-Schmidt orthonormalization method is an extension : Instead of an orthogonal system, it calculates an orthonormal system . If a system of basis vectors is used as input for the algorithms, they compute an orthogonal or orthonormal basis .

The two processes are named after Jørgen Pedersen Gram and Erhard Schmidt . However, they were used earlier in the works of Pierre-Simon Laplace and Augustin-Louis Cauchy .

The Gram-Schmidt methods are poorly suited for numerical calculation by a computer with floating point arithmetic . Due to accumulated rounding errors , the calculated vectors are no longer orthogonal. However, there are modifications of the method that do not have this disadvantage. Other orthogonalization methods are based on household transformations or Givens rotations .

Preliminary remark

In the following, elements of the vector space under consideration (vectors) are designated with simple Latin letters such as and , if necessary with indices such as and . Both overlay arrows and bold type are dispensed with. The dot product is represented by angle brackets: . In the complex case, the convention is used that the scalar product is semilinear in the first argument and linear in the second argument, that is

for all vectors , and all . In the complex case, the order of the factors in the scalar product is important in the formulas shown below, but not in the real case.

In addition, denotes the norm of the vector .

Algorithm of the orthogonalization process

Illustration of the Gram-Schmidt method using an example with three vectors

The following algorithm calculates an orthogonal system of pairwise orthogonal vectors for the linearly independent vectors, which generates the same subspace.

The individual vectors of the orthogonal system are calculated as follows:

In other words, the for are recursively through

Are defined.


In provided with the standard scalar two linearly independent vectors are determined that provide an subspace:

Two orthogonal vectors and are now calculated, which generate the same subspace:

Algorithm of the orthonormalization process

The following algorithm calculates an orthonormal system of normalized, pairwise orthogonal vectors for the linearly independent vectors, which generates the same sub-vector space. It is identical to a normalization of the orthogonal vectors which were determined by the above algorithm.

The individual vectors of the orthonormal system are obtained by first calculating an orthogonal vector and then normalizing it:

(Normalize the first vector )
(Orthogonalizing the second vector )
(Normalize the vector )
(Orthogonalizing the third vector )
(Normalize the vector )
(Orthogonalizing the -th vector )
(Normalize the vector )

In other words, the and for are recursively through

and defined.

In general, this method does not give a particularly excellent system. Im must z. B. only be followed by a rearrangement step in order to obtain a right or left system.


In equipped with the standard scalar two basis vectors may be given:

Two vectors and are now calculated, which form an orthonormal basis of .


A special property of both methods is that after each intermediate step the vectors calculated up to now generate the same vector space as the vectors . The vectors thus form an orthogonal or orthonormal basis of the corresponding sub-vector spaces. In other words, the transformation matrix that expresses the coordinates of one system in the other is a triangular matrix on the upper right. This also has a positive determinant, so the resulting orthogonal or orthonormal basis has the same orientation as the starting basis. If the orthonormal vectors are summarized as columns of a matrix Q , as well as the vectors of the initial system to form a matrix A , there is a triangular matrix R with A = QR , so a QR decomposition is determined. Accordingly, the result of the Gram-Schmidt orthonormalization can also be determined with other methods for QR decomposition that work with Givens rotations or Householder reflections .

If you calculate an orthogonal system by hand, it is often easier to first calculate an orthogonal system and then to normalize the individual vectors. This saves you having to standardize twice and you can often count on simpler values. It may be worthwhile to carry out the Gaussian elimination method before creating the orthogonal system / orthonormal system .

Principle of the procedure

If the orthogonal vectors are already determined, we try to subtract a suitable linear combination of the vectors from, so that the difference vector

becomes orthogonal to all vectors . This is equivalent to saying that the scalar product results in the value 0 for all of them . Such a linear combination results if for each the expression

is chosen. A control calculation shows that by all scalar products with assume the value 0:

Orthonormalization of infinite systems of vectors

In any Hilbert space , the method can also be applied to infinite systems of independent vectors, whereby the independence is to be understood in the sense that no element lies in the closure of the linear envelope of the other vectors. The case of a countable system (i.e. is a separable Hilbert space ) can be traced back directly to the finite case presented above: Given an independent sequence , a corresponding orthonormal sequence is obtained by applying and obtaining the above procedure for each . More generally, every independent system can be viewed according to the well-ordered theorem as a sequence for a cardinal number and ordinal numbers (in the case of a dense linear envelope of the independent system, the dimension of is precisely ). Now designate the orthogonal projection onto a closed subspace , which always exists due to the completeness of the space, designate the normalization . So an orthonormal system results from


Using transfinite induction it can then be shown that , even for . The procedure can be written more explicitly using transfinite recursion as follows:

Here, the sum is well-defined due to Bessel's inequality (in particular, there are only countably many summands that are not equal to zero).


  • Andrzej Kielbasiński, Hubert Schwetlick: Numerical linear algebra. A computer-oriented introduction . Deutscher Verlag der Wissenschaften, Berlin 1988, ISBN 3-326-00194-0 .