encyclopegia.org

Gram–Schmidt process

In mathematics, particularly linear algebra and numerical analysis, the Gram–Schmidt process or Gram-Schmidt algorithm is a way of finding a set of two or more vectors that are perpendicular to each other.[src] By technical definition, it is a method of constructing an orthonormal basis from a set of vectors in an inner product space, most commonly the Euclidean space \mathbb{R}^n equipped with the standard inner product.[src] The Gram–Schmidt process takes a finite, linearly independent set of vectors S = \{ \mathbf{v}_1, \ldots , \mathbf{v}_k \} for and generates an orthogonal set S' = \{ \mathbf{u}_1 , \ldots , \mathbf{u}_k \} that spans the same k -dimensional subspace of \mathbb{R}^n as S .[src] The method is named after Jørgen Pedersen Gram and Erhard Schmidt, but Pierre-Simon Laplace had been familiar with it before Gram and Schmidt.[src] In the theory of Lie group decompositions, it is generalized by the Iwasawa decomposition.[src] The application of the Gram–Schmidt process to the column vectors of a full column rank matrix yields the QR decomposition (it is decomposed into an orthogonal and a triangular matrix).[src]

In mathematics, particularly linear algebra and numerical analysis, the Gram–Schmidt process or Gram-Schmidt algorithm is a way of finding a set of two or more vectors that are perpendicular to each other.[src] By technical definition, it is a method of constructing an orthonormal basis from a set of vectors in an inner product space, most commonly the Euclidean space \mathbb{R}^n equipped with the standard inner product.[src] The Gram–Schmidt process takes a finite, linearly independent set of vectors S = \{ \mathbf{v}_1, \ldots , \mathbf{v}_k \} for and generates an orthogonal set S' = \{ \mathbf{u}_1 , \ldots , \mathbf{u}_k \} that spans the same k -dimensional subspace of \mathbb{R}^n as S .[src] The method is named after Jørgen Pedersen Gram and Erhard Schmidt, but Pierre-Simon Laplace had been familiar with it before Gram and Schmidt.[src] In the theory of Lie group decompositions, it is generalized by the Iwasawa decomposition.[src] The application of the Gram–Schmidt process to the column vectors of a full column rank matrix yields the QR decomposition (it is decomposed into an orthogonal and a triangular matrix).[src] \operatorname{proj}_{\mathbf u} (\mathbf{v}) = \frac{\langle \mathbf{v}, \mathbf{u}\rangle}{\langle \mathbf{u}, \mathbf{u}\rangle} \,\mathbf{u} , where \langle \mathbf{v}, \mathbf{u}\rangle denotes the dot product of the vectors \mathbf u and \mathbf v .[src] This means that \operatorname{proj}_{\mathbf u} (\mathbf{v}) is the orthogonal projection of \mathbf v onto the line spanned by \mathbf u .[src] If \mathbf u is the zero vector, then \operatorname{proj}_{\mathbf u} (\mathbf{v}) is defined as the zero vector.[src] Given k nonzero linearly-independent vectors \mathbf{v}_1, \ldots, \mathbf{v}_k the Gram–Schmidt process defines the vectors \mathbf{u}_1, \ldots, \mathbf{u}_k as follows: \begin{align} \mathbf{u}_1 & = \mathbf{v}_1, & \!\mathbf{e}_1 & = \frac{\mathbf{u}_1}{\|\mathbf{u}_1\|} \\ \mathbf{u}_2 & = \mathbf{v}_2-\operatorname{proj}_{\mathbf{u}_1} (\mathbf{v}_2), & \!\mathbf{e}_2 & = \frac{\mathbf{u}_2}{\|\mathbf{u}_2\|} \\ \mathbf{u}_3 & = \mathbf{v}_3-\operatorname{proj}_{\mathbf{u}_1} (\mathbf{v}_3) - \operatorname{proj}_{\mathbf{u}_2} (\mathbf{v}_3), & \!\mathbf{e}_3 & = \frac{\mathbf{u}_3 }{\|\mathbf{u}_3\|} \\ \mathbf{u}_4 & = \mathbf{v}_4-\operatorname{proj}_{\mathbf{u}_1} (\mathbf{v}_4)-\operatorname{proj}_{\mathbf{u}_2} (\mathbf{v}_4)-\operatorname{proj}_{\mathbf{u}_3} (\mathbf{v}_4), & \!\mathbf{e}_4 & = {\mathbf{u}_4 \over \|\mathbf{u}_4\|} \\ & {}\ \ \vdots & & {}\ \ \vdots \\ \mathbf{u}_k & = \mathbf{v}_k - \sum_{j=1}^{k-1}\operatorname{proj}_{\mathbf{u}_j} (\mathbf{v}_k), & \!\mathbf{e}_k & = \frac{\mathbf{u}_k}{\|\mathbf{u}_k\|}.[src] \end{align} The sequence \mathbf{u}_1, \ldots, \mathbf{u}_k is the required system of orthogonal vectors, and the normalized vectors \mathbf{e}_1, \ldots, \mathbf{e}_k form an orthonormal set.[src] The calculation of the sequence \mathbf{u}_1, \ldots, \mathbf{u}_k is known as Gram–Schmidt orthogonalization, and the calculation of the sequence \mathbf{e}_1, \ldots, \mathbf{e}_k is known as Gram–Schmidt orthonormalization.[src] To check that these formulas yield an orthogonal sequence, first compute \langle \mathbf{u}_1, \mathbf{u}_2 \rangle by substituting the above formula for \mathbf{u}_2 : we get zero.[src] Then use this to compute \langle \mathbf{u}_1, \mathbf{u}_3 \rangle again by substituting the formula for \mathbf{u}_3 : we get zero.[src] For arbitrary k the proof is accomplished by mathematical induction.[src] Geometrically, this method proceeds as follows: to compute \mathbf{u}_i , it projects \mathbf{v}_i orthogonally onto the subspace U generated by \mathbf{u}_1, \ldots, \mathbf{u}_{i-1} , which is the same as the subspace generated by \mathbf{v}_1, \ldots, \mathbf{v}_{i-1} .[src] The vector \mathbf{u}_i is then defined to be the difference between \mathbf{v}_i and this projection, guaranteed to be orthogonal to all of the vectors in the subspace U .[src] The Gram–Schmidt process also applies to a linearly independent countably infinite sequence .[src] The result is an orthogonal (or orthonormal) sequence such that for natural number : the algebraic span of \mathbf{v}_1, \ldots, \mathbf{v}_{n} is the same as that of \mathbf{u}_1, \ldots, \mathbf{u}_{n} .[src] If the Gram–Schmidt process is applied to a linearly dependent sequence, it outputs the vector on the i th step, assuming that \mathbf{v}_i is a linear combination of \mathbf{v}_1, \ldots, \mathbf{v}_{i-1} .[src] If an orthonormal basis is to be produced, then the algorithm should test for zero vectors in the output and discard them because no multiple of a zero vector can have a length of 1.[src] The number of vectors output by the algorithm will then be the dimension of the space spanned by the original inputs.[src] A variant of the Gram–Schmidt process using transfinite recursion applied to a (possibly uncountably) infinite sequence of vectors (v_\alpha)_{\alpha yields a set of orthonormal vectors (u_\alpha)_{\alpha with \kappa\leq\lambda such that for any \alpha\leq\lambda , the completion of the span of \{ u_\beta : \beta is the same as that of In particular, when applied to a (algebraic) basis of a Hilbert space (or, more generally, a basis of any dense subspace), it yields a (functional-analytic) orthonormal basis.[src] Note that in the general case often the strict inequality \kappa holds, even if the starting set was linearly independent, and the span of (u_\alpha)_{\alpha need not be a subspace of the span of (v_\alpha)_{\alpha (rather, it's a subspace of its completion).[src] ===Euclidean space=== Consider the following set of vectors in \mathbb{R}^2 (with the conventional inner product) S = \left\{\mathbf{v}_1=\begin{bmatrix} 3 \\ 1\end{bmatrix}, \mathbf{v}_2=\begin{bmatrix}2 \\2\end{bmatrix}\right\}.[src] Now, perform Gram–Schmidt, to obtain an orthogonal set of vectors: \mathbf{u}_1=\mathbf{v}_1=\begin{bmatrix}3\\1\end{bmatrix} \mathbf{u}_2 = \mathbf{v}_2 - \operatorname{proj}_{\mathbf{u}_1} (\mathbf{v}_2) = \begin{bmatrix}2\\2\end{bmatrix} - \operatorname{proj}_{\left[\begin{smallmatrix}3 \\ 1\end{smallmatrix}\right]} {\begin{bmatrix}2\\2\end{bmatrix}} = \begin{bmatrix}2\\2\end{bmatrix} - \frac{8}{10} \begin{bmatrix} 3 \\1 \end{bmatrix} = \begin{bmatrix} -2/5 \\6/5 \end{bmatrix}.[src] We check that the vectors \mathbf{u}_1 and \mathbf{u}_2 are indeed orthogonal: \langle\mathbf{u}_1,\mathbf{u}_2\rangle = \left\langle \begin{bmatrix}3\\1\end{bmatrix}, \begin{bmatrix} -2/5 \\ 6/5 \end{bmatrix} \right\rangle = -\frac{6}{5} + \frac{6}{5} = 0, noting that if the dot product of two vectors is 0 then they are orthogonal.[src] For non-zero vectors, we can then normalize the vectors by dividing out their sizes as shown above: \mathbf{e}_1 = \frac{1}{\sqrt {10}}\begin{bmatrix}3\\1\end{bmatrix} \mathbf{e}_2 = \frac{1}{\sqrt{40 \over 25}} \begin{bmatrix}-2/5\\6/5\end{bmatrix} = \frac{1}{\sqrt{10}} \begin{bmatrix}-1\\3\end{bmatrix}.[src] It is orientation preserving in the sense that \operatorname{or}(\mathbf{v}_1,\dots,\mathbf{v}_k) = \operatorname{or}(\operatorname{GS}(\mathbf{v}_1,\dots,\mathbf{v}_k)) .[src] It commutes with orthogonal maps: Let g \colon \R^n \to \R^n be orthogonal (with respect to the given inner product).[src] Then we have \operatorname{GS}(g(\mathbf{v}_1),\dots,g(\mathbf{v}_k)) = \left( g(\operatorname{GS}(\mathbf{v}_1,\dots,\mathbf{v}_k)_1),\dots,g(\operatorname{GS}(\mathbf{v}_1,\dots,\mathbf{v}_k)_k) \right) Further, a parametrized version of the Gram–Schmidt process yields a (strong) deformation retraction of the general linear group \mathrm{GL}(\R^n) onto the orthogonal group O(\R^n) .[src] \mathbf{u}_k = \mathbf{v}_k - \operatorname{proj}_{\mathbf{u}_1} (\mathbf{v}_k) - \operatorname{proj}_{\mathbf{u}_2} (\mathbf{v}_k) - \cdots - \operatorname{proj}_{\mathbf{u}_{k-1}} (\mathbf{v}_k), it is computed as \begin{align} \mathbf{u}_k^{(1)} &= \mathbf{v}_k - \operatorname{proj}_{\mathbf{u}_1} (\mathbf{v}_k), \\ \mathbf{u}_k^{(2)} &= \mathbf{u}_k^{(1)} - \operatorname{proj}_{\mathbf{u}_2} \left(\mathbf{u}_k^{(1)}\right), \\ & \;\; \vdots \\ \mathbf{u}_k^{(k-2)} &= \mathbf{u}_k^{(k-3)} - \operatorname{proj}_{\mathbf{u}_{k-2}} \left(\mathbf{u}_k^{(k-3)}\right), \\ \mathbf{u}_k^{(k-1)} &= \mathbf{u}_k^{(k-2)} - \operatorname{proj}_{\mathbf{u}_{k-1}} \left(\mathbf{u}_k^{(k-2)}\right), \\ \mathbf{e}_k &= \frac{\mathbf{u}_k^{(k-1)}}{\left\|\mathbf{u}_k^{(k-1)}\right\|} \end{align} This method is used in the previous animation, when the intermediate \mathbf{v}'_3 vector is used when orthogonalizing the blue vector \mathbf{v}_3 .[src] Here is another description of the modified algorithm.[src] Given the vectors \mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_n , in our first step we produce vectors \mathbf{v}_1, \mathbf{v}_2^{(1)}, \dots, \mathbf{v}_n^{(1)} by removing components along the direction of \mathbf{v}_1 .[src] In formulas, \mathbf{v}_k^{(1)} := \mathbf{v}_k - \frac{\langle \mathbf{v}_k, \mathbf{v}_1 \rangle}{\langle \mathbf{v}_1, \mathbf{v}_1 \rangle} \mathbf{v}_1 .[src] After this step we already have two of our desired orthogonal vectors \mathbf{u}_1, \dots, \mathbf{u}_n , namely \mathbf{u}_1 = \mathbf{v}_1, \mathbf{u}_2 = \mathbf{v}_2^{(1)} , but we also made \mathbf{v}_3^{(1)}, \dots, \mathbf{v}_n^{(1)} already orthogonal to \mathbf{u}_1 .[src] Next, we orthogonalize those remaining vectors against \mathbf{u}_2 = \mathbf{v}_2^{(1)} .[src] This means we compute \mathbf{v}_3^{(2)}, \mathbf{v}_4^{(2)}, \dots, \mathbf{v}_n^{(2)} by subtraction \mathbf{v}_k^{(2)} := \mathbf{v}_k^{(1)} - \frac{\langle \mathbf{v}_k^{(1)}, \mathbf{u}_2 \rangle}{\langle \mathbf{u}_2, \mathbf{u}_2 \rangle} \mathbf{u}_2 .[src] Now we have stored the vectors \mathbf{v}_1, \mathbf{v}_2^{(1)}, \mathbf{v}_3^{(2)}, \mathbf{v}_4^{(2)}, \dots, \mathbf{v}_n^{(2)} where the first three vectors are already \mathbf{u}_1, \mathbf{u}_2, \mathbf{u}_3 and the remaining vectors are already orthogonal to \mathbf{u}_1, \mathbf{u}_2 .[src] As should be clear now, the next step orthogonalizes \mathbf{v}_4^{(2)}, \dots, \mathbf{v}_n^{(2)} against \mathbf{u}_3 = \mathbf{v}_3^{(2)} .[src] Proceeding in this manner we find the full set of orthogonal vectors \mathbf{u}_1, \dots, \mathbf{u}_n .[src] If orthonormal vectors are desired, then we normalize as we go, so that the denominators in the subtraction formulas turn into ones.[src] function U = gramschmidt(V) [n, k] = size(V); U = zeros(n,k); U(:,1) = V(:,1) / norm(V(:,1)); for i = 2:k U(:,i) = V(:,i); for j = 1:i-1 U(:,i) = U(:,i) - (U(:,j)'*U(:,i)) * U(:,j); end U(:,i) = U(:,i) / norm(U(:,i)); end end The cost of this algorithm is asymptotically floating point operations, where is the dimensionality of the vectors.[src] If the rows are written as a matrix A , then applying Gaussian elimination to the augmented matrix \left[A A^\mathsf{T} | A \right] will produce the orthogonalized vectors in place of A .[src] However the matrix A A^\mathsf{T} must be brought to row echelon form, using only the row operation of adding a scalar multiple of one row to another.[src] For example, taking \mathbf{v}_1 = \begin{bmatrix} 3 & 1\end{bmatrix}, \mathbf{v}_2=\begin{bmatrix}2 & 2\end{bmatrix} as above, we have \left[A A^\mathsf{T} | A \right] = \left[\begin{array}{rr|rr} 10 & 8 & 3 & 1 \\ 8 & 8 & 2 & 2\end{array}\right] And reducing this to row echelon form produces \left[\begin{array}{rr|rr} 1 & .8 & .3 & .1 \\ 0 & 1 & -.25 & .75\end{array}\right] The normalized vectors are then \mathbf{e}_1 = \frac{1}{\sqrt {.3^2+.1^2}}\begin{bmatrix}.3 & .1\end{bmatrix} = \frac{1}{\sqrt{10}} \begin{bmatrix}3 & 1\end{bmatrix} \mathbf{e}_2 = \frac{1}{\sqrt{.25^2+.75^2}} \begin{bmatrix}-.25 & .75\end{bmatrix} = \frac{1}{\sqrt{10}} \begin{bmatrix}-1 & 3\end{bmatrix}, as in the example above.[src] \mathbf{e}_j = \frac{1}{\sqrt{D_{j-1} D_j}} \begin{vmatrix} \langle \mathbf{v}_1, \mathbf{v}_1 \rangle & \langle \mathbf{v}_2, \mathbf{v}_1 \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_1 \rangle \\ \langle \mathbf{v}_1, \mathbf{v}_2 \rangle & \langle \mathbf{v}_2, \mathbf{v}_2 \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_2 \rangle \\ \vdots & \vdots & \ddots & \vdots \\ \langle \mathbf{v}_1, \mathbf{v}_{j-1} \rangle & \langle \mathbf{v}_2, \mathbf{v}_{j-1} \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_{j-1} \rangle \\ \mathbf{v}_1 & \mathbf{v}_2 & \cdots & \mathbf{v}_j \end{vmatrix} \mathbf{u}_j = \frac{1}{D_{j-1} } \begin{vmatrix} \langle \mathbf{v}_1, \mathbf{v}_1 \rangle & \langle \mathbf{v}_2, \mathbf{v}_1 \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_1 \rangle \\ \langle \mathbf{v}_1, \mathbf{v}_2 \rangle & \langle \mathbf{v}_2, \mathbf{v}_2 \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_2 \rangle \\ \vdots & \vdots & \ddots & \vdots \\ \langle \mathbf{v}_1, \mathbf{v}_{j-1} \rangle & \langle \mathbf{v}_2, \mathbf{v}_{j-1} \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_{j-1} \rangle \\ \mathbf{v}_1 & \mathbf{v}_2 & \cdots & \mathbf{v}_j \end{vmatrix} where D_0 = 1 and, for j \ge 1 , D_j is the Gram determinant D_j = \begin{vmatrix} \langle \mathbf{v}_1, \mathbf{v}_1 \rangle & \langle \mathbf{v}_2, \mathbf{v}_1 \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_1 \rangle \\ \langle \mathbf{v}_1, \mathbf{v}_2 \rangle & \langle \mathbf{v}_2, \mathbf{v}_2 \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_2 \rangle \\ \vdots & \vdots & \ddots & \vdots \\ \langle \mathbf{v}_1, \mathbf{v}_j \rangle & \langle \mathbf{v}_2, \mathbf{v}_j \rangle & \cdots & \langle \mathbf{v}_j, \mathbf{v}_j \rangle \end{vmatrix}.[src] Note that the expression for \mathbf{u}_k is a "formal" determinant, i.e.[src] the matrix contains both scalars and vectors; the meaning of this expression is defined to be the result of a cofactor expansion along the row of vectors.[src] The determinant formula for the Gram-Schmidt is computationally (exponentially) slower than the recursive algorithms described above; it is mainly of theoretical interest.[src] \mathbf{u}_k = \mathbf{v}_k - \sum_{j=1}^{k-1} (\mathbf{v}_k \cdot \mathbf{u}_j)\mathbf{u}_j^{-1}\ , which is equivalent to the expression using the \operatorname{proj} operator defined above.[src] The results can equivalently be expressed as \mathbf{u}_k = \mathbf{v}_{k}\wedge\mathbf{v}_{k-1}\wedge\cdot\cdot\cdot\wedge\mathbf{v}_{1}(\mathbf{v}_{k-1}\wedge\cdot\cdot\cdot\wedge\mathbf{v}_{1})^{-1}, which is closely related to the expression using determinants above.[src] Yet another alternative is motivated by the use of Cholesky decomposition for inverting the matrix of the normal equations in linear least squares.[src] Let V be a full column rank matrix, whose columns need to be orthogonalized.[src] The matrix V^* V is Hermitian and positive definite, so it can be written as V^* V = L L^*, using the Cholesky decomposition.[src] The lower triangular matrix L with strictly positive diagonal entries is invertible.[src] Then columns of the matrix U = V\left(L^{-1}\right)^* are orthonormal and span the same subspace as the columns of the original matrix V .[src] The explicit use of the product V^* V makes the algorithm unstable, especially if the product's condition number is large.[src] Nevertheless, this algorithm is used in practice and implemented in some software packages because of its high efficiency and simplicity.[src] In quantum mechanics there are several orthogonalization schemes with characteristics better suited for certain applications than original Gram–Schmidt.[src] Nevertheless, it remains a popular and effective algorithm for even the largest electronic structure calculations.[src] ==See also== Linear algebra Recursion Orthogonality (mathematics)[src]

68 sentences · 68 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Gram–Schmidt process." encyclopegia.org, 2026, https://encyclopegia.org/wiki/gram-schmidt-process. Accessed 29 November 2026.

Chicago

"Gram–Schmidt process." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/gram-schmidt-process.

APA

encyclopegia.org. (2026). Gram–Schmidt process. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/gram-schmidt-process

Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Hans Schmidt

stub · references available

Schmidt

stub · references available

centimeter–gram–second system of units

stub · references available

Hans-Thilo Schmidt

stub · references available

Frithjof Schmidt

stub · references available

Erich Schmidt

stub · references available

Paul Felix Schmidt

stub · references available

Edzard Schmidt-Jortzig

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1375494788 · 0.5 · snapshot enwiki-001375494788

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.