A Givens rotation eliminates one component of a vector by rotating just two coordinates, preserving its Euclidean norm. For example,
The length remains five: elimination moves the component into the retained coordinate rather than discarding it. Applied to a matrix, the same operation mixes two rows; QR decomposition by Givens rotations uses these local operations to build an upper triangular matrix.
Figure 1.
A Givens rotation takes clockwise to while preserving the Euclidean norm
. Details.
For indices , the matrix is the identity matrix except for its block on coordinates :
This article uses left matrix multiplication on column vectors. If and , the block is a rotation matrix through angle : the minus sign belongs in the lower left. Its transpose reverses the rotation. Direct multiplication gives and determinant one, so it is an orthogonal matrix; consequently . Only two coordinates change, but this Euclidean norm identity holds for the entire vector.
For finite real numbers , a Givens rotation that annihilates is defined mathematically by
Here hypot means an evaluation of the Euclidean norm of designed to avoid unnecessary range failures in floating-point arithmetic. The zero case selects the identity matrix, avoiding division by zero. If , then ; if , then . Thus the retained component is nonnegative, including when . In exact arithmetic, and .
Computing the square root of a*a + b*b directly can fail even when the final norm is representable. In binary64 floating-point arithmetic, makes the squares overflow, whereas is finite. With the squares round to zero, although is representable. A range-safe hypot avoids these intermediate failures.
The simple divisions still need care when is a subnormal number: rounding can cause large relative errors. For the smallest positive binary64 subnormal number , taking rounds to ; dividing by that rounded value gives , which is not an orthogonal matrix. For nonzero finite inputs, compute the coefficients before rescaling the norm:
At least one scaled component has absolute value one, and . This construction keeps the coefficients meaningful even when rounding is severe. It cannot make an unrepresentably large finite, preserve an arbitrarily tiny against underflow, or repair inputs already rounded to zero. The row updates themselves can also overflow if their exact results exceed the available range.
LAPACK's DLARTG uses scaling for numerical stability but a different sign convention: for it chooses and ; for it returns . Its block still has the lower-left minus sign. Do not combine its returned coefficients with an assumed nonnegative .[ref]
Left matrix multiplication by a Givens rotation replaces rows of a matrix by
Both right-hand sides use the old entries. An in-place algorithm must save the first result temporarily, update the second entry, and only then overwrite the first. The reference BLAS DROT implementation follows this order with its temporary DTEMP.[ref]
For elimination in column , construct from . This sets the lower component to zero in exact arithmetic. In floating-point arithmetic the computed expression can leave a small remainder; after computing the other updated entries, explicitly store and . Previously eliminated columns stay zero if both participating rows are already zero there. This is why the ordering in QR decomposition by Givens rotations matters.
Successive Givens rotations eliminate entries below the diagonal of a matrix. For an matrix with , process columns ; within column , rotate rows for each whose entry needs elimination. Apply each Givens row-pair update to columns . Both rows are zero in earlier columns, so these operations preserve earlier eliminations. No assumption of full column rank is needed to perform the eliminations.
For a concrete example, take
First use , then :
The entry in position was already zero, so its elimination was skipped. The second Givens rotation combines the remaining pair in column two. This yields the full QR decomposition
The first two columns of and first two rows of give the reduced QR decomposition. Direct multiplication verifies both and . For these displayed factors evaluated in binary64 floating-point arithmetic, the Frobenius norms and are both below ; these measure reconstruction and loss of orthogonality separately.
Figure 1.
Two local Givens row-pair updates turn a matrix into the rectangular of a QR decomposition
. Details.
More generally, if the chronological rotations are , then
Each factor is an orthogonal matrix, so is too. For a rectangular matrix, has zeros below its diagonal; its leading block is an upper triangular matrix. With full column rank, retaining the first columns of gives orthonormal columns. To impose a positive diagonal when necessary, flip matching columns of and rows of , preserving their product.
For a linear least-squares problem, apply the same chronological Givens rotations to the right-hand side , obtaining , without explicitly constructing . Since the Euclidean norm is preserved, solve the leading upper triangular matrix system by back substitution when has full column rank; the remaining entries of give the minimum residual norm. In the example, gives , , and minimum residual Euclidean norm .
The locality is useful for a sparse matrix or an existing QR decomposition needing an extra row: only two rows change at each step, and the new row can be eliminated against the stored upper triangular matrix. For an factor, this extra-row procedure takes rotations and arithmetic operations. Locality does not guarantee preservation of sparsity: mixing rows can create nonzeros wherever either row had one. For a fully populated input, the straightforward elimination uses rotations, each touching columns, giving work. Storage layout, zero patterns and implementation affect speed; this count alone establishes no universal advantage over other QR decomposition algorithms.
The Euclidean norm preservation explains the appeal for numerical stability: exact rotations do not amplify a perturbation's length. Rounded coefficients and Givens row-pair updates still introduce roundoff error. Small reconstruction and orthogonality residuals check the computed factors, while the condition number of the original problem still controls how accurately a linear least-squares problem determines its solution.
Use determinant-one Givens rotations and choose every nonzero eliminated pair to leave a positive pivot. If the input square matrix is orthogonal, its resulting upper triangular factor is orthogonal too, and hence diagonal with entries of absolute value one. Positivity fixes the first entries to one, while determinant preservation fixes the last to . A negative last entry is unavoidable when the input reverses orientation.

Ancestors (5)

  1. Numerical analysis
  2. Analysis
  3. Area of mathematics
  4. Mathematics
  5. Home

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (1)

Givens rotation is a mathematical technique used in linear algebra for rotating vectors in two-dimensional space. It is particularly useful in the context of QR decomposition, a method for factorizing a matrix into the product of an orthogonal matrix (Q) and an upper triangular matrix (R). A Givens rotation is defined by a rotation matrix that can be constructed using two elements \( (a, b) \) of a vector or matrix.