# HessenbergDecomposition

gives the Hessenberg decomposition of a numerical matrix m.

# Details and Options • The result is given in the form {p,h} where p is a unitary matrix such that p.h.ConjugateTranspose[p]==m.
• The matrix m must be square.

# Examples

open allclose all

## Basic Examples(1)

Find the Hessenberg decomposition of a 4×4 matrix:

The matrix is upper Hessenberg, meaning it has only zeros beneath the first subdiagonal:

Verify that is unitary and :

## Scope(9)

### Basic Uses (5)

Find the Hessenberg decomposition of a machine-precision matrix:

Format the result:

Hessenberg decomposition of a complex matrix:

Hessenberg decomposition for an arbitrary-precision matrix:

Exact matrices must be numericized to be used with HessenbergDecomposition: The Hessenberg decomposition of a large numerical matrix is computed efficiently:

### Special Matrices (4)

Find the Hessenberg decomposition for sparse matrices:

Hessenberg decompositions of structured matrices:

Hessenberg decomposition of an identity matrix consists of two identity matrices:

Hessenberg decomposition of HilbertMatrix:

## Applications(2)

The Hessenberg decomposition is particularly useful for Hermitian matrices because the resulting matrix is tridiagonal. Generate a random 6×6 Hermitian matrix:

Verify that the matrix is Hermitian:

Compute the Hessenberg decomposition:

If small numerical errors are ignored, the matrix is manifestly tridiagonal:

A matrix is tridiagonal if it is both upper and lower Hessenberg. The following shows that the small numbers discarded by Chop were in fact numerically insignificant:

A simple method for computing the Schur decomposition is the unshifted QR algorithm. Starting with , at each stage compute the QR decomposition of , then let . In the limit, converges to the desired matrix (for well-behaved input matrices). A modification to speed up this algorithm is to let be the matrix of Hessenberg decomposition. Because so many entries are already zero, each QR step is much faster. Explore this for a randomly generated 25×25 real symmetric matrix:

The matrix is real and symmetric:

Do 2000 iterations of the unshifted QR algorithm using QRDecomposition:

As the eigenvalues of are real, they make up the diagonal of up to small numerical error:

The modification where the Hessenberg decomposition is computed first is roughly twice as fast:

It also produces a smaller numerical error:

## Properties & Relations(7)

A random 4×4 matrix:

Compute its Hessenberg decomposition:

The matrix is unitary:

The matrix is upper Hessenberg:

The original matrix is given by p.h.ConjugateTranspose[p]:

For an upper Hessenberg matrix h, returns :

All 2×2 matrices are upper Hessenberg, so are returned unchanged by HessenbergDecomposition:

Det[m] equals the determinant of the matrix of :

Tr[m] equals the trace of the matrix of :

The Hessenberg decomposition of a Hermitian matrix is tridiagonal:

Both the Hessenberg and Schur decompositions reduce real matrices to a Hessenberg matrix:

HessenbergDecomposition is based on row operations and preserves the top-left corner:

SchurDecomposition is based on eigenvalues; entries below the diagonal indicate complex values:

## Possible Issues(1)

HessenbergDecomposition works only with matrices of approximate numerical values: Use JordanDecomposition for exact matrices: