Solvers and Visualizations
8. The Builds: Every Artifact, in Order
All source files referenced here are in /source. This is the build history —
what each one does and why the next one replaced or extended it.
1. xyzt-lattice.jsx — first 3D visualization (n=2)
A Three.js scene plotting all 16 real n=2 boolean functions by their Walsh
coefficients (X=c1, Y=c12, Z=c2), alongside a Math.random() “quantum
measurement” stand-in cloud for comparison. Established the visual language reused
by every later 3D view: dark scene, teal for exact/deterministic data, pink for
the pseudo-random stand-in, drag-to-rotate, hover for exact coefficients.
2. boolean-solver.jsx — first interactive solver (n=2)
Combines three real, live computations on a clickable 2×2 truth table: the Walsh-Hadamard vector, the Shannon cofactor split (with automatic copy/invert/independent relation detection), and a breadth-first NAND-synthesis search that finds the minimum-depth NAND circuit for whatever table is built, starting from just x1 and x2.
3. xyzt-lattice-n3.jsx — the n=3 capstone visualization
Same visual language, extended to all 256 real n=3 functions. X/Y/Z became the three single-variable influence coefficients (one axis per variable, matching the “three reversible axes” idea from Document 4); T became the count of relevant variables (0–3), shown as color and pulse rate, with a slider to filter by minimum T.
4. ultimate-solver.jsx — the solver extended to n=3
The same three real solvers from boolean-solver.jsx, generalized: the Fast
Walsh-Hadamard Transform replaces the naive per-coefficient loop, the Shannon
split now reduces an n=3 function to two named n=2 functions (reusing the
16-gate name list), and NAND synthesis searches the full 256-function space. Ends
with an explicit, honest scope note: this only covers combinational functions
(one output bit) — a true “quantum solver” needs reversible gates, a structurally
different object.
5. quantum-composer.jsx — the reversible half
A real 3-qubit quantum circuit simulator: an 8-dimensional complex amplitude vector, starting at |000⟩, with genuine unitary matrices for X, H, Z, S, CNOT, and Toffoli applied via actual complex arithmetic. Includes a separability check (marginal-independence test) that flags entanglement — verified live by building the Bell-state circuit (H on q1, then CNOT control-q1-target-q2) and watching the flag flip.
6. unified-app.jsx — everything merged, then generalized further
The final, most complete artifact. Combines every prior piece into one app with a single top-level control bar:
- Solver page — generalized to n=0,1,2,3, including the trivial cases (n=0 and n=1 are computed for real, not faked, with explicit “not applicable” messages where a concept genuinely doesn’t apply, e.g. Shannon split at n=0).
- 3D View page — same generalization, X/Y/Z/T convention held constant across all four sizes, with a gold-ringed marker highlighting whichever function is currently open on the Solver page, plus the restored min-T filter slider and color legend.
- Quantum page — the composer, generalized from a fixed 3 qubits to n=0..3
qubits (gate availability now correctly depends on n: CNOT needs n≥2,
Toffoli needs n≥3), sharing the same top-level n selector as the other two
pages. Includes a second 3D panel (
QuantumLattice3D) reusing the same cube and rotation style as the deterministic plot, but honestly re-purposed: fixed corner positions (the basis states themselves) with size=probability and color=phase angle, rather than continuously-variable coefficient positions. - Trajectories page — a restricted N-body simulation: every real function of the current n rendered as a fixed gravity well (the “dark matter” analogy), with pseudo-random points as moving test masses under Newtonian toy gravity (softened inverse-square, plus weaker mutual pull between the moving points, plus damping and a soft containment term for visual stability), with position trails.
Bugs found and fixed during the build (worth keeping on record)
- A genuine Rules-of-Hooks violation in the Quantum page: two
useMemocalls were declared after ann===0early return, meaning the component called a different number of hooks depending on n. Fixed by moving both hooks above the conditional return. - The min-T filter slider’s upper bound allowed selecting a value (
n=0, slider at 1) that could never match any point, silently hiding everything. Tightened tomax={n}. - A dead, unused constant (
QN = 8) left over from generalizing the composer from fixed-3-qubit to arbitrary n. Removed. - The min-T slider and its color legend were present in the standalone
xyzt-lattice-n3.jsxbuild but were dropped when that page was folded intounified-app.jsx. Restored, with the slider bound scaling correctly per n.