Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

Gram-Schmidt orthogonalization

Gram-Schmidt constructs an orthonormal set spanning the same subspace as a linearly independent list of vectors.

Also called orthonormalization

Edition released Coverage: Overview · Technical · Research
On this page

Definition and method

Given independent vectors v_1,...,v_k, normalize v_1 to obtain e_1. For each later vector subtract its projections onto previously obtained e_j, then normalize the remaining component. In complex spaces the projection coefficient is <e_j|v>, including conjugation in the bra. The method builds coordinates for a subspace without changing that subspace.

Fully solved complex example

Take v_1=(1,i) and v_2=(1,0). Normalize e_1=(1,i)/sqrt(2). The overlap <e_1|v_2>=1/sqrt(2). Subtracting gives w_2=v_2-e_1/sqrt(2)=(1/2,-i/2). Its norm is 1/sqrt(2), so e_2=(1,-i)/sqrt(2). The inner product <e_1|e_2>=[1+(-i)(-i)]/2=0.

The resulting basis is the pair of Y eigenstates. If conjugation were omitted, the subtraction would not correctly enforce orthogonality for general complex inputs.

Numerical limits

When input vectors are nearly dependent, subtracting almost equal quantities can lose numerical precision. Modified Gram-Schmidt, reorthogonalization, Householder methods, or SVD may be more stable depending on the task. A residual near zero should trigger a rank decision with an explicit tolerance, not division by a tiny number without explanation.

The procedure is a classical mathematical construction. Presenting its formulas in a quantum reference does not imply that an unknown physical quantum state can be read out and orthogonalized freely. Physical state transformations are constrained by channels and available information.

Relationships

Orthonormal bases support spectral calculations, variational subspaces and numerical simulations. SVD provides another route to rank detection and orthogonal subspace bases.

A complex three-vector orthogonalization gives a complete QR factorization

Start with v₁ = (1,i,0), v₂ = (1,0,1), and v₃ = (0,1,−i). The first normalized vector is q₁ = (1,i,0)/√2. Its overlap with v₂ is 1/√2, so subtracting that component leaves w₂ = (1,−i,2)/2. This residual has norm √6/2, yielding q₂ = (1,−i,2)/√6.

For the third vector, the overlaps are ⟨q₁|v₃⟩ = −i/√2 and ⟨q₂|v₃⟩ = −i/√6. Subtracting both components gives w₃ = 2(i,1,−i)/3. Its norm is 2/√3, so q₃ = (i,1,−i)/√3. Conjugation of the first slot is essential for every one of these overlaps.

The three q vectors have unit norm and pairwise zero inner products. If V collects the original columns and Q collects the q columns, then V = QR with upper-triangular R = [[√2,1/√2,−i/√2],[0,√6/2,−i/√6],[0,0,2/√3]]. Multiplying Q by each column of R reconstructs the corresponding original vector, giving a complete factorization rather than only an orthogonality check.

The diagonal entries record the successive residual norms. Their product is two, so |det V| = two because Q is unitary. This connects the residual construction to volume scaling: each new column contributes only its component outside the span already established by earlier columns.

A zero residual diagnoses dependence rather than a missing normalization trick

Replace the third input by v₃′ = (0,1,i). It satisfies v₃′ = i(v₂−v₁), so it already lies in the span of the first two vectors. After subtracting its q₁ and q₂ components, the residual is exactly zero. There is no unit vector obtained by normalizing this residual, because division by its norm would divide by zero.

The appropriate mathematical conclusion is that these three inputs span only a two-dimensional subspace. A basis for the full ambient space could be completed with an additional independent vector, but that vector would be extra information not supplied by the dependent list. The procedure cannot manufacture a third independent direction from two-dimensional data.

Changing the order of independent input vectors usually changes the resulting orthonormal basis, while preserving their span. In an exactly degenerate physical eigenspace, these different orthonormal bases can describe the same projector. Orthogonalization chooses convenient coordinates within a subspace; it does not identify a unique physically preferred basis without further structure.

Near dependence makes the normalization sensitive

Consider real vectors a₁ = (1,1,1) and a₂ = (1,1+ε,1−ε). After projecting a₂ onto q₁ = a₁/√3, the exact residual is (0,ε,−ε), with norm √2|ε|. Its normalized direction depends on quantities of order ε obtained by subtracting quantities of order one.

An absolute arithmetic error of size u in the subtraction can therefore produce a relative directional error of order u/|ε|. This estimate explains the source of sensitivity without claiming that every calculation achieves that worst case. When ε is comparable to the numerical error scale, deciding whether the residual represents a real independent direction becomes a question about data accuracy as well as arithmetic.

Classical Gram–Schmidt computes projections against the original current column before subtracting their sum. Modified Gram–Schmidt updates a residual after each subtraction and uses that updated residual for subsequent projections. In exact arithmetic they agree; with rounding, their intermediate vectors differ and their preservation of orthogonality can differ. Reorthogonalization can reduce accumulated overlap but cannot recover information absent from imprecise input data.

Householder QR instead constructs unitary reflections that eliminate selected components. It provides a numerically robust route to the same factorization objective. The distinction concerns how a classical matrix calculation is organized, not a new postulate of quantum state evolution. A complete implementation would still choose tolerances and pivoting according to the data and intended rank decision.

The factorization also preserves a least-squares residual

With orthonormal Q columns, any residual b−QRx splits into a component in their span and an orthogonal component. Its squared norm is ‖Q†b−Rx‖²+‖(I−QQ†)b‖². The second term cannot be changed by x. Solving the triangular equation Rx = Q†b therefore minimizes the residual whenever R is invertible. This is the concrete connection between orthogonalization and a least-squares solution.

Phase conventions and physical interpretation

If Q is replaced by QD for a diagonal unitary D, the same V is obtained by replacing R with D†R. Taking each nonzero diagonal element of R to be positive real fixes this phase freedom in the full-column-rank case. Other conventions are valid, but comparisons of factors should account for them.

The orthonormal vectors constructed from known coordinates are not the outputs of a universal device that turns arbitrary unknown nonorthogonal quantum inputs into distinct orthogonal states while preserving their labels. A unitary preserves inner products. Classical orthogonalization changes linear combinations using a description of the vectors, so it addresses a different task from physically transforming unknown states one by one.

The solved complex example fixes phases by choosing three positive diagonal values of R. Exact dependence gives zero residual, while near dependence can leave a small nonzero residual. Exact rank, numerical rank, and phase convention are separate choices or properties.

Sources

  • John Watrous · · Textbook material · cs.uwaterloo.ca
    Verification scope

    The Theory of Quantum Information, Chapter 1: Mathematical preliminaries
    John Watrous · · Textbook material · cs.uwaterloo.ca

    Citation identity checked ·

    Background reference; this record does not claim a full independent peer review of the encyclopedia. Original exposition and newly constructed calculations are not copied from the source.

    The Theory of Quantum Information: Chapter 1, Mathematical preliminaries
    John Watrous · · Manuscript · Author manuscript · cs.uwaterloo.ca

    Selected text checked ·

    Chapter introduction, finite-dimensional linear-algebra definitions and Caratheodory theorem were inspected. The author explicitly describes the chapter as review material, not a primary source for all mathematical results.

    Selected passages and metadata were checked; this does not certify every sentence in the encyclopedia, constitute comprehensive literature review, or establish external peer review. Original worked examples are separately recomputed.

  • David Bindel · · Lecture or course notes · cs.cornell.edu
    Verification scope

    Selected text checked ·

    Official dated lecture inspected for QR, Gram–Schmidt residuals, cancellation and loss of orthogonality, Householder reflectors, and Givens rotations.

    Source mainly writes real transposes; encyclopedia complex examples consistently use adjoints and are recomputed separately. No source code or exercise is reproduced.