EP-0133: Jupyter Rich Display & CLI Inspector¶
| Field | Value |
|---|---|
| EP | 0133 |
| Title | Jupyter Rich Display & CLI Inspector |
| Author | Eran Rivlis & Antigravity |
| Status | Draft |
| Type | Standards Track |
| Created | 2026-08-02 |
| Updated | 2026-08-02 |
Abstract¶
This proposal adds two integration surfaces that reduce friction for users exploring algebrax:
- Jupyter
_repr_html_(): Rich HTML rendering of sparse matrices, semirings, and algebraic structures directly in Jupyter notebooks with color-coded heatmaps and formatted LaTeX. - CLI Inspector: A
python -m algebrax inspectcommand that loads a JSON graph/matrix, applies a semiring power operation, and prints the result.
Motivation¶
The Steward (Harmony): "Move forward with the least friction." Users currently must write boilerplate to visualize
results. Jupyter's _repr_html_() protocol and a CLI tool eliminate this friction.
Specification¶
1. _repr_html_() Protocol¶
Add _repr_html_() methods to:
SparseMatrixwrapper class (or a display helper functionalgebrax.display.matrix_html())Semiringbase class (showing the semiring name, zero, one, and operator symbols)SimplicialComplex(showing simplex counts and Betti numbers)AlgebraicTrie(showing a tree structure)
2. CLI Inspector¶
# Apply tropical matrix power and display result
python -m algebrax inspect graph.json --semiring tropical --power 5
# Show semiring catalog
python -m algebrax catalog
# Verify algebraic laws for a semiring
python -m algebrax verify --semiring viterbi
3. Display Helper Module: algebrax.display¶
def matrix_html(matrix: SparseMatrix, title: str = '') -> str:
"""Generate an HTML table with heatmap coloring for a sparse matrix."""
def semiring_card(semiring: Semiring) -> str:
"""Generate an HTML card summarizing a semiring's properties."""
Backwards Compatibility¶
Purely additive. No existing behavior changes.
Change Log¶
- 2026-08-02: Initial Draft.