Householder Transformation Calculator

Build precise reflectors for stable linear algebra tasks. Transform vectors or matrices with confidence today. Export results, review steps, and verify orthogonality easily here.

Calculator

Choose 2–10 to keep tables readable.
Classic mode zeros all but the first entry.
Provide n rows if enabled.
Use commas or spaces. Example: 4, 3, 0
Same length as x. Norm must match.
Useful when y is a direction vector.
Each row on a new line. Use spaces or commas. Example is 3×2.
Reset

Example data table

This example uses classic mode with n=3 and x = [4, 3, 0].

Step Input Output
Norm x = (4, 3, 0) ||x|| = 5
v build v = x + sign(x1)||x||e1 v = (9, 3, 0)
β β = 2/(vᵀv) β = 2/90 = 0.022222…
Reflect H = I − βvvᵀ Hx ≈ (−5, 0, 0)

Formula used

  • H = I − β v vᵀ, where β = 2/(vᵀv).
  • Classic mode chooses v = x + sign(x1)||x||e1 to make Hx align with e1.
  • Map mode uses v = x − y (with ||x||=||y||) so that Hx = y.
  • Orthogonality check: compute HᵀH and compare it to I.

How to use this calculator

  1. Set vector size n, then enter vector x with n values.
  2. Select a mode: classic to zero the tail, or map to target y.
  3. If mapping, enter y and optionally enable scaling.
  4. To transform a matrix, paste an n×m matrix into A.
  5. Click Compute. Results appear above the form under the header.
  6. Use the buttons to download a CSV or a PDF report.

Why reflections are useful

Householder transformations provide a fast, exact way to reflect vectors across a hyperplane. In practice, they are the workhorse behind QR factorization, least squares fitting, eigenvalue routines, and orthogonalization. This calculator constructs the reflector matrix H and shows how H reshapes an input vector x into a simpler form, often concentrating energy into the first component while keeping the overall length unchanged.

Stable construction of the reflector

For the classic reflector, the key is choosing v = x + sign(x1)||x||e1. This choice avoids catastrophic cancellation when x1 is negative and reduces rounding error. The scalar β = 2/(vᵀv) controls the rank‑one update H = I − βvvᵀ. Because only v and β are needed, implementations store them instead of the full matrix. The tables here let you inspect v and β directly.

Mapping one vector to another

When you want Hx = y, the reflector can be built from v = x − y, but only if the two vectors have the same Euclidean norm. That constraint is not arbitrary: any orthogonal reflector preserves lengths and angles. The optional scaling switch lets you normalize y to ||x|| so you can supply directions without manually rescaling. When x and y are already aligned, v becomes zero and the identity is returned.

Applying H to a matrix

Left-multiplying a matrix A by H performs the same reflection on every column of A, producing HA. This is exactly how QR algorithms eliminate subdiagonal entries column by column, turning dense columns into sparse ones. The calculator accepts any n×m matrix and prints both A and HA, so you can verify how one reflection modifies an entire linear system, measurement matrix, or feature set before further processing.

Quality checks and interpretation

An ideal Householder matrix is orthogonal, meaning HᵀH = I and Hᵀ = H. The calculator computes HᵀH and reports max|HᵀH−I| as a quick diagnostic. Values close to zero indicate numerical consistency. If the deviation grows, revisit input formatting, dimension choices, or extremely large magnitudes that may stress floating‑point arithmetic. For reproducible work, export the CSV or PDF and attach it to your calculation notes for audits and peer review.

FAQs

Q1. What does the Householder matrix do?
It reflects vectors across a hyperplane defined by v. The transformation is orthogonal, so it preserves lengths and dot products while changing direction to simplify later computations.

Q2. Why must ||x|| equal ||y|| in map mode?
Any orthogonal reflector preserves Euclidean norm. If x and y have different norms, no pure reflector can map one to the other exactly, so scaling y to ||x|| is offered.

Q3. Why does classic mode use sign(x1)?
The sign choice reduces cancellation in v = x + sign(x1)||x||e1. That improves numerical stability and avoids constructing a tiny v when x1 is negative and close to −||x||.

Q4. What does β represent?
β equals 2/(vᵀv) and sets the strength of the rank‑one update. Using β with v forms H = I − βvvᵀ efficiently without explicitly computing a plane normal.

Q5. How is HA used in practice?
In QR factorization, each reflector left-multiplies the remaining submatrix to introduce zeros below a pivot. Repeating this yields an upper‑triangular R and an orthogonal Q built from the reflectors.

Q6. How should I interpret max|HᵀH−I|?
It measures how close the computed matrix is to perfectly orthogonal under floating‑point arithmetic. Values near zero are expected; larger values can indicate extreme scaling, data entry mistakes, or unusually ill‑conditioned inputs.

Related Calculators

Row Reduction RREF CalculatorDiagonalization Checker CalculatorLU Decomposition Steps CalculatorQR Decomposition Steps Calculatormatrix calculator with variablesGauss-Jordan inverse calculatorPolynomial linear independence calculatorLinear independence of matrix calculatorComplex matrix inverse calculatorQR decomposition least squares

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.