Skip to content

quatica.decomp.hessenberg

quatica.decomp.hessenberg

Quaternion Matrix Hessenberg Reduction Module

This module implements reduction of a general quaternion matrix to upper Hessenberg form using Householder similarity transformations.

Key properties: - For a square matrix A, there exists a unitary P such that H = P * A * P^H is upper Hessenberg (all entries strictly below the first subdiagonal are 0).

Notes: - We reuse the quaternion Householder machinery already implemented for Hermitian tridiagonalization. Here, we adapt it to the general (non-Hermitian) Hessenberg case by zeroing elements below the first subdiagonal column-by-column.

Constraints: - Per project rules, this module is added without modifying existing core functions. It only depends on utilities and existing Householder helpers.

check_hessenberg(H, atol=1e-12)

Clean tiny entries below first subdiagonal to exact zeros (for readability).

Parameters: - H: quaternion matrix suspected to be upper Hessenberg - atol: tolerance below which entries are zeroed

hessenbergize(A)

Reduce a general square quaternion matrix A to upper Hessenberg form.

Returns (P, H) such that H = P * A * P^H and H is upper Hessenberg.

Parameters: - A: (n x n) quaternion numpy array

Returns: - P: unitary quaternion matrix accumulating the similarity transforms - H: upper Hessenberg quaternion matrix

is_hessenberg(H, atol=1e-12)

Return True if quaternion matrix H is upper Hessenberg within tolerance.

Upper Hessenberg means H[i, j] == 0 for all i > j + 1.