Skip to content

quatica.optiq_visualization

quatica.optiq_visualization

OptiQ-specific visualization helpers.

This module is intentionally additive and does not modify QuatIca's core visualization.py. It provides a couple of convenience functions used by the OptiQ regression scripts.

All functions accept dense numpy-quaternion matrices (dtype=quaternion).

save_quaternion_abs_comparison(A_left, A_right, labels=('X_star', 'X(mu)'), title='Quaternion matrix magnitude comparison', save_path=None)

Save a 1×3 figure: |A_left|, |A_right|, and |A_left-A_right|.

save_quaternion_block_comparison(A_left, A_right, block=5, labels=('X_star', 'X(mu)'), title='Top-left block comparison (quaternion components)', save_path=None, annotate=True)

Save a side-by-side comparison of the top-left (block×block) entries.

Produces a 4×2 grid (components Re/i/j/k × {left,right}). Each subplot is a heatmap of the selected component; optionally annotates each entry.

Parameters

A_left, A_right: Dense quaternion matrices. block: Size of the top-left block to visualize. labels: Labels for left/right matrices. title: Figure title. save_path: If provided, saves to this path (PNG recommended). annotate: If True, write numeric values in each cell (recommended for block <= 6).