QuatIca: Advanced Numerical Linear Algebra and Optimization for Quaternionic Matrices in Python

Valentin Leplat, Salman Ahmadi-Asl, Junjun Pan, Henni Ouerdane, Michael NgarXiv 2026

TL;DR

QuatIca is the first comprehensive, open-source Python library dedicated to advanced numerical linear algebra and optimization for quaternion-valued matrices. By providing structure-preserving decompositions, iterative solvers, and a specialized semidefinite programming module, it bridges the gap between theoretical quaternion algebra and practical, reproducible scientific computing.

What Problem Does This Paper Address?

Multi-channel signals—such as RGB images, polarized radar data, 3D vector fields, and multi-detector time series—contain components that are strongly coupled. While traditional methods process these channels independently or flatten them into massive real matrices, quaternion-valued representations offer a elegant alternative that preserves cross-channel phase and coupling information.

However, working with quaternions introduces a major mathematical headache: non-commutativity ($ij \neq ji$). This makes standard linear algebra operations highly sensitive to left/right linearity conventions and prone to numerical drift. While numerical software for real and complex numbers is incredibly mature, tools for quaternions have remained fragmented, low-level, or locked behind proprietary platforms like MATLAB. QuatIca solves this by delivering a high-level, numerically sound, and extensible Python framework designed specifically for research and engineering workflows.

Methods

QuatIca follows a layered architecture built directly on top of the standard scientific Python stack (NumPy, SciPy, and Matplotlib), leveraging numpy-quaternion for basic arithmetic.

Figure 1: High-level architecture of QuatIca: the core quaternion matrix layer (utils) sup- ports decompositions and spectral reductions, iterative solvers and restoration modules, conic optimization (OptiQ), and rotation trajectories (qtraj), together with standardized diagnostics and plotting.

The library introduces several advanced algorithmic blocks:

  • Dense Decompositions & Reductions: Includes quaternion-native LU factorization (using modulus-based partial pivoting to handle non-commutativity), QR factorization, Cholesky decomposition, and Hessenberg/tridiagonal reductions.
  • Randomized Q-SVD: Implements randomized and pass-efficient Quaternion Singular Value Decompositions (Q-SVD) to drastically lower the data-movement and computational costs for large matrices.
  • Iterative Solvers: Features a component-wise Quaternion GMRES (Q-GMRES) solver equipped with a native left LU preconditioner, alongside higher-order Newton-Schulz schemes for computing Moore-Penrose pseudoinverses.
  • OptiQ Module: A specialized interior-point method solver for quaternion Hermitian semidefinite programs (SDPs) that uses log-det barrier functions, $\mu$-continuation, and a unique "hat-space" constraint whitening technique to ensure numerical stability.

Datasets

Because QuatIca is a foundational numerical library rather than a deep learning model, it is evaluated using synthetic benchmarks and classic signal processing problems:

  • Synthetic Matrix Families: Random dense, moderately ill-conditioned, and Hermitian positive definite (SPD) quaternion matrices generated with controlled spectral decay to stress-test solvers.
  • Kodak Image Dataset: Specifically, the standard kodim16 image is utilized to benchmark color image deblurring and denoising pipelines.
  • Lorenz Attractor Trajectories: Simulated chaotic 3D time-series data used to evaluate structured quaternion linear filtering algorithms.

Key Insights and Ideas

  • Strategic Real Embeddings: To exploit highly optimized, low-level BLAS/LAPACK routines, QuatIca selectively uses $4\times4$ real-block embeddings internally, but carefully contracts the outputs back to a quaternion-native interface to shield the user from complexity.
  • Modulus-Based Pivoting: In quaternion LU decomposition, rows are permuted by maximizing the quaternion modulus in the active column. This simple choice drastically improves numerical robustness in non-commutative settings.
  • Hat-Space Whitening: For semidefinite programming, OptiQ applies a linear change of coordinates based on the Gram matrix of the constraints. This "hat-space" formulation normalizes residuals, prevents feasibility drift, and tames ill-conditioned problems.
  • Preconditioning is Essential: Krylov subspace methods like GMRES struggle with quaternion non-commutativity. Introducing a native left LU preconditioner acts as a massive accelerator, collapsing iteration counts.

Key Results

The authors validated QuatIca across several demanding benchmarks:

  • Q-GMRES Acceleration: Across dense and ill-conditioned synthetic systems, the built-in left LU preconditioner reduced the number of iterations required to converge by 87% to 98%, achieving a maximum wall-clock speedup factor of 13.2× on larger matrix sizes.
  • Low-Rank Approximations: The randomized and pass-efficient Q-SVD variants successfully recovered exact low-rank matrices to near machine precision while scaling significantly better than full deterministic Q-SVD as matrix dimensions grew.
  • End-to-End Applications: The library demonstrated robust performance in practical workflows, including completing an RGB image with 70% missing pixels via cross-approximation (CUR), filtering noisy chaotic Lorenz signals, and performing high-fidelity image deblurring using an FFT-based Tikhonov restoration scheme.

Limitations and Future Work

While QuatIca is a major step forward, the authors note several areas for expansion:

  • Conic Optimization Scalability: OptiQ currently factors dense Schur complements, which limits its scalability for massive SDPs. Future updates will explore matrix-free Schur operators and Alternating Direction Method of Multipliers (ADMM) variants.
  • Exploiting Sparsity: The library does not yet systematically support sparse quaternion formats or structured linear algebra matrices (like Toeplitz, circulant, or block-Hankel forms).
  • Tensor Decompositions: Tools for higher-order quaternion tensors (e.g., Tucker, Tensor-Train) are currently experimental and slated for full integration.
  • Hardware & Algebraic Extensions: Long-term goals include robust GPU acceleration and extending the library's mathematical coverage from quaternions to octonions.

Summary updated

BibTeX
@misc{leplat2026quatica,
  author = {Valentin Leplat and Salman Ahmadi-Asl and Junjun Pan and Henni Ouerdane and Michael Ng},
  title = {{QuatIca: Advanced Numerical Linear Algebra and Optimization for Quaternionic Matrices in Python}},
  year = {2026},
  eprint = {2603.24074},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.24074},
}
Figure