﻿ Hessenberg – Algosim documentation
Algosim documentation: Hessenberg

Hessenberg

Performs a Hessenberg decomposition of a matrix.

Syntax

• `[H, Q ≔ ]Hessenberg(A)`

• `A` is a matrix

Description

If `A` is a matrix, then `Hessenberg(A)` performs a Hessenberg decomposition of `A`, that is, it finds a similar Hessenberg matrix `H` and a unitary matrix `Q` such that `A = Q⋅H⋅Q*`.

The result of `Hessenberg(A)` is an assignment list of length 2, containing `H` and `Q`.

Examples

`A ≔ ❨❨6, 2, 4, 5, 1❩, ❨2, 8, −3, 1, 2❩, ❨6, 3, 3, −1, 1❩, ❨7, 5, −2, 6, 9❩, ❨4, 5, 2, 1, 3❩❩`
```⎛ 6   2   4   5   1⎞
⎜ 2   8  −3   1   2⎟
⎜ 6   3   3  −1   1⎟
⎜ 7   5  −2   6   9⎟
⎝ 4   5   2   1   3⎠
```
`(H, Q) ≔ Hessenberg(A)`
```⎛                    6         −6.53853048876        −0.289489513914          1.73510386979        −0.391445309069⎞
⎜        −10.246950766          8.07619047619         −3.10726843673        −0.135912197927         −9.30010937136⎟
⎜−3.76620873764⋅10^−19         −3.40642317114          5.63166766609         −1.43813721491           2.0718580141⎟
⎜−2.13956670128⋅10^−19   7.08790648724⋅10^−20           4.4791285155         0.924051521064          2.76729575219⎟
⎝−4.23935425962⋅10^−19   1.20379404785⋅10^−19  −1.62630325873⋅10^−19          3.81293940331          5.36809033666⎠

⎛               1                 0                 0                 0                 0⎞
⎜               0    −0.19518001459   −0.090311997272    0.579441392757    0.786127329008⎟
⎜               0   −0.585540043769    −0.78661476778  −0.0734174438009   −0.181631338703⎟
⎜               0   −0.683130051064    0.557697046598    0.322918581587   −0.343556294099⎟
⎝               0   −0.390360029179    0.249108318759   −0.744702048454    0.480606858225⎠
```
`IsUpperHessenberg(H) ∧ IsOrthogonal(Q)`
`true`
`Q⋅H⋅Q*`
```⎛ 6   2   4   5   1⎞
⎜ 2   8  −3   1   2⎟
⎜ 6   3   3  −1   1⎟
⎜ 7   5  −2   6   9⎟
⎝ 4   5   2   1   3⎠
```