Interactive experiment · matrix multiplication
Can we multiply matrices faster?
Start with your own two matrices. Carry them through an experiment about doing the same computation with fewer multiplications.
Multiply two matrices.
Choose any cell of the answer. See which row and column are multiplied.
A 2 × 2 matrix has four output cells. Can we reuse intermediate results to do fewer than eight multiplications?
Eight multiplications become seven.
Instead of computing each cell separately, multiply carefully chosen sums.
One saved multiplication seems small. Apply the same pattern to blocks of matrices, and it changes the power of n.
Why a smaller exponent matters.
Increase the matrix size. Watch the multiplication counts diverge.
Try an actual timing experiment
Run both exact JavaScript implementations on the same small matrices. Arithmetic counts are exact; timings depend on this browser and implementation.
The 2.25 curve is an idealized comparison. The newer proofs use large constructions; our prototype is nowhere near that cost curve.
Do several products together.
A polynomial coefficient can encode a matrix dot product. Now combine five requested products into three longer products.
That trade-off is the starting point of Pass's proof. The extra symbol ε lets us separate mixed contributions and recover the desired coefficients exactly.
Why is ε needed?
It is a formal parameter, not a tiny floating-point number. The engine keeps exact powers of ε. Decoding cancels unwanted negative powers; the constant term is the answer.
What if every row has a different A?
The previous trick shared one left input. Try a smaller scalar version with a different left value in each row. Edit the selected factors and run the packed calculation.
The next construction combines three copies of this circuit with their input/output roles rearranged. This turns the independent scalar products into independent matrix products.
Multiply many matrices in one circuit.
Choose a batch size, run the research circuit, and inspect any matrix pair. Every entry is checked against ordinary multiplication.
How the three circuit copies connect this term
It verifies the algebraic ingredients. The exponent improvement requires the complete recursive compression construction, which has not yet been implemented.
What would it take to reach 2.25?
The small exact circuit is not faster. The mathematical proof uses repeated compression to make matrix dimensions grow faster relative to the product count. Explore that growth without allocating the matrices.
What do these parameters mean?
- c · Packing width
- How many source blocks the construction packs in a direction.
- d · Tensor pairs
- How many copies are combined to make balanced block groups.
- k · Compression rounds
- How often the theoretical construction enlarges the matrix while controlling the rank bound.
Try the other route: Shpilka’s seed
Shpilka starts from a different polynomial convolution tensor. We have implemented its initial restriction to matrix multiplication, not the improved recursive extraction.