Epoch I — The Dictionary That Became a Matrix¶
Date: 2026-11-29 (Chronicle of v0.1.0–v0.4.0, January – July 2026)
Author: Eran Rivlis & The Grand Council
Context: Retroactive architectural chronicle of AlgebraX's genesis—from its January 12, 2026 spin-out from mappingtools.algebra through MonoidAlgebraSemiring (v0.3.0) and sparse tensor einsum (v0.4.0).
1. The Genesis Bet: Refusing the Wrapper Tax¶
Every mathematical library begins with a choice of representation, and most choices quietly carry a tax. The conventional path in Python is to wrap numbers and indices inside opaque object hierarchies (Vector, Matrix, Node, Element) or surrender Python's flexibility entirely to flat C-contiguous index buffers.
algebrax was born on January 12, 2026 (v0.1.0) out of a deliberately contrary premise, spun out directly from mappingtools.algebra (and formally christened AlgebraX in v0.1.1 on April 9, 2026). That genesis commit contained just 14 source modules—anchored by a 937-line semiring.py, matrix/core.py, trie.py, transforms.py, automata.py, lattice.py, and probability.py—all orbiting a single Shannon-minimal realization:
A Python
dict[K, V]is already an unboxed sparse algebraic vector over arbitrary hashable basis keysK, and a nesteddict[K, dict[K, V]]is already a sparse matrix.
The moment you omit every zero entry and keep keys arbitrary—strings, tuples, graph nodes, grammar symbols, or exponent vectors—two traditional walls collapse at once:
- Zero weighs nothing. Absence from the mapping is the additive identity
0. You never allocate space for what does not happen. - Indices carry meaning. You never maintain an external bijection table translating
"Paris"or(2, 1, 0)into integer row47and back again.
2. The Structural Mechanics: One Contraction, Many Worlds¶
The second half of Epoch I's insight was separating sparse traversal (the mechanism) from scalar algebra (the policy).
In v0.1.1, the Semiring protocol was refined with TypeVar generics and instance-method dispatch, allowing any sparse matrix multiplication \(C_{ik} = \bigoplus_j A_{ij} \otimes B_{jk}\) to accept a swappable algebraic carrier. Suddenly, the exact same nested dictionary contraction executed wildly different algorithms without changing a line of control flow:
flowchart LR
DICT["Unboxed Sparse Mapping\ndict[K, dict[K, V]]"] --> ENGINE["Single Contraction Kernel\nC[i][k] = ⊕_j (A[i][j] ⊗ B[j][k])"]
ENGINE -->|"Standard (+, ×)"| LIN["Linear Algebra & Markov Chains"]
ENGINE -->|"Tropical (min, +)"| PATH["All-Pairs Shortest Paths"]
ENGINE -->|"Viterbi (max, ×)"| PROB["Most-Likely Paths & Inference"]
ENGINE -->|"Boolean (∨, ∧)"| REACH["Transitive Closure & Reachability"]
ENGINE -->|"MonoidAlgebra (v0.3.0)"| CONV["Convolution, Z-Transforms & CYK"]
Between June and July 2026, that single unification proved astonishingly fertile:
v0.2.0(June 20, 2026): Replaced heavy optimal-transport Ollivier–Ricci curvature with local, purely combinatorial Forman–Ricci graph curvature, and generalized the Fenchel–Legendre transform across multiple semirings.v0.3.0(July 26, 2026): IntroducedMonoidAlgebraSemiring, revealing that discrete convolution, Z-transforms, and polynomial multiplication were all special cases of multiplying sparse maps indexed by an additive monoid.v0.4.0(July 31, 2026): Lifted 2D nested dictionaries into arbitrary-rank sparse tries viatensor(einsum,outer,tensordot) and unveiled the first interactive DearPyGui lab and recipe compendium (Catalan numbers, CYK parsing, Walsh–Hadamard transforms, control theory, sensor reliability).
3. The Ontological Lesson¶
Epoch I proved something easy to overlook in an era obsessed with GPU kernels: representation clarity is a form of mathematical discovery.
By refusing to box scalars or force basis elements into integer arrays, AlgebraX inherited what later became its permanent Constitutional Pillar (EP-0004 — Unboxed Storage & Sparse Carrier Invariance). Any pure-Python value—an int, a Fraction, a complex, or another nested dict—could pass straight through the same sparse loops.
At the close of v0.4.0, however, an unspoken question hung over the codebase: if a sparse dictionary parameterized by a semiring could compute shortest paths, convolutions, and tensor contractions, how far across mathematics could this single carrier reach?
Epoch II was about to find out.