Add quantum execution intelligence engine with 5 core backends#161
Merged
Add quantum execution intelligence engine with 5 core backends#161
Conversation
Maps ruvector's quantum error correction (ruQu) capabilities to blockchain transaction forensics, identifying five novel contributions: - Subpolynomial dynamic min-cut for real-time transaction graph decomposition - QEC-inspired coherence gating for live transaction stream monitoring - Anytime-valid e-value testing for court-defensible attribution - Cryptographic witness chains for tamper-evident forensic audit trails - Quantum-classical hybrid pipeline (QAOA + GNN + vector similarity fusion) Includes comparative analysis against current SOTA (GNN-based, heuristic clustering, commercial platforms) and 20-week implementation roadmap. https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
…riment) Maps ruQu's implemented quantum primitives to known cryptanalytic attack surfaces: variational factoring via VQE, Grover's search on symmetric keys, QAOA for lattice problems, interference-based side channels, and a novel self-learning cryptanalytic framework using the three-filter pipeline. Key insight: the software stack for quantum cryptanalysis is closer to ready than the hardware. Defensive recommendations included for post-quantum migration planning. https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
Speculative but grounded projection of Shor's algorithm trajectory across five decades: NISQ-to-fault-tolerant transition (2026-2036), routine factoring era (2036-2046), post-cryptographic paradigm (2046-2056), and long-term legacy (2056-2076). Includes hardware scaling estimates, wildcard scenarios (lattice breaks, QEC breakthroughs, hardware walls), and how ruQu's architecture positions for each phase. Key thesis: the software stack (ruQu) is closer to ready than the hardware, and Shor's lasting legacy is the urgency it created for PQC migration, not the numbers it will eventually factor. https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
Scale the quantum simulator from 25 to 32+ qubits via 6 new modules: - simd.rs: AVX2 SIMD gate kernels + rayon parallel dispatch - stabilizer.rs: Aaronson-Gottesman tableau (millions of Clifford qubits) - tensor_network.rs: Matrix Product State with QR truncation (hundreds-thousands) - backend.rs: Circuit analysis + automatic backend routing - circuit_analyzer.rs: Gate classification, Clifford detection, bond dim estimation - mixed_precision.rs: f32 state vector for 2x memory savings (up to 33 qubits) Bumps MAX_QUBITS from 25 to 32 for dense state vector. 253 tests pass across all backends. https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
Transform ruqu-core from a simulator into a scientific instrument and QEC control plane. Adds ADR-QE-015 and 16 new modules across 4 layers: Scientific instrument layer: - qasm.rs: OpenQASM 3.0 export with ZYZ Euler decomposition - noise.rs: Kraus channel noise (depolarizing, T1/T2, readout, crosstalk) - mitigation.rs: ZNE via gate folding, measurement correction, CDR - hardware.rs: provider HAL (IBM/IonQ/Rigetti/Braket adapters) - transpiler.rs: basis gate decomposition + BFS qubit routing - replay.rs: deterministic replay via seeded ChaCha20 RNG - witness.rs: SHA-256 hash-chain tamper-evident witness logging - confidence.rs: Wilson score, Clopper-Pearson, chi-squared, TVD - verification.rs: automatic cross-backend comparison + certification SOTA differentiation layer: - planner.rs: cost-model circuit router (memory/runtime/fidelity) - clifford_t.rs: Clifford+T via low-rank stabilizer decomposition - decomposition.rs: hybrid circuit partitioning (interaction graph + min-cut) QEC control plane: - decoder.rs: union-find + partitioned surface code decoder (sublinear) - qec_scheduler.rs: feed-forward minimizing QEC scheduling engine Modified: stabilizer.rs (clone_with_seed for Clifford+T forking), lib.rs (16 module declarations across 4 layers). https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
subpoly_decoder.rs (1207 lines): - HierarchicalTiledDecoder: O(d^(2-epsilon)) expected-case complexity via recursive multi-scale tiling with boundary merging - RenormalizationDecoder: coarse-grain syndrome lattice at multiple scales - SlidingWindowDecoder: streaming O(w*d^2) per-round for real-time QEC - ComplexityAnalyzer: provable complexity certificates and threshold theorems - DefectGraphBuilder: spatial-hashed defect graph construction benchmark.rs (790 lines): - Proof 1: routing cost-model outperforms naive/heuristic selectors - Proof 2: entanglement budgeting as deterministic compiler constraint - Proof 3: real-time adaptive decoder with measurable latency gains - Proof 4: cross-backend approximation certification with bounded error https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
control_theory.rs: formalizes the QEC classical control loop as a discrete-time control system with provable stability conditions. - QecControlLoop: plant/controller/state model for syndrome→decode→correct - StabilityAnalyzer: derives convergence conditions (decode latency < syndrome period), critical error rates, stability margins - ResourceOptimizer: Pareto-optimal allocation of physical qubits vs code distance vs decode parallelism - LatencyBudgetPlanner: end-to-end timing model for QEC rounds - BacklogSimulator: dynamic simulation of error accumulation under varying decode throughput - ScalingLaws: classical overhead O(d^alpha) and logical error suppression p_L ~ (p/p_th)^(d/2) predictions Completes the 20-module quantum execution intelligence engine. https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
Tighten module documentation and reduce verbosity while preserving all public API surface and functionality. https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
- New title: "Quantum Execution Intelligence Engine" (was "Classical Nervous System for Quantum Machines") - Platform Overview: simulate, optimize, execute, correct, verify - Five-layer architecture diagram with all 30 modules - Complete module reference tables with line counts per layer: Layer 0 (Core Engine, 13 modules), Layer 1 (Scientific Instrument, 9), Layer 2 (SOTA Differentiation, 3), Layer 3 (QEC Control Plane, 2), Layer 4 (Theoretical Foundations, 2), Layer 5 (Proof Suite, 1) - Totals table: 30 modules, 24,676 lines, 5 backends, 4 hardware providers, 6 noise channels, 3 mitigation strategies, 5 decoders - Coherence gating section preserved with validated results - Honest limitations table with path forward for each gap - Updated roadmap: v0.3 (execution engine) marked Done, v0.4 next - Application domains table: healthcare, finance, QEC, cloud, hardware - Ecosystem table linking all ruQu crates - Trimmed tutorials to 5 (removed redundant ones) - Removed emoji prefixes from section headers https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
… routing, min-cut, fidelity Implements the four capabilities identified as missing in the README: 1. **pipeline.rs** (615 lines): End-to-end execution orchestration that chains plan -> decompose -> execute -> stitch -> verify. Includes PipelineConfig, PipelineResult, per-segment execution, and fidelity estimation. 8 tests. 2. **CliffordT backend routing**: Added BackendType::CliffordT variant to backend.rs. Integrated T-rank analysis into planner.rs cost model with memory prediction (2^t * n^2/4 bytes) and runtime prediction (2^t * n^2 * gates * 0.15ns). Routes circuits with >32 qubits and moderate T-count (<=40) to Bravyi-Gosset decomposition. 3. **Stoer-Wagner min-cut** (decomposition.rs): O(V^3) global minimum cut algorithm replacing greedy spatial partitioning. `spatial_decomposition_mincut` recursively bisects along min-cuts. 4 tests validating linear, triangle, and barbell graph topologies. 4. **Fidelity-aware stitching** (decomposition.rs): `stitch_with_fidelity` models Schmidt coefficient loss at partition boundaries. Each cut entangling gate contributes F_cut = 2^(-k/2) fidelity penalty. StitchFidelity struct tracks per-boundary and overall fidelity. 2 tests. Also updated classify_segment to route moderate T-count segments to CliffordT instead of TensorNetwork, with threshold at 40 T-gates. 803 tests pass (602 lib + 40+37+77+36 integration + 11 doc-tests). https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh
ruvnet
added a commit
that referenced
this pull request
Feb 20, 2026
Transforms ruqu from classical coherence monitor into full-stack quantum execution intelligence engine (~2K to ~24K lines). New: StateVector, Stabilizer, TensorNetwork, Clifford+T, and Hardware simulation backends. Cost-model planner, surface code decoder (union-find O(n*alpha(n))), QEC scheduler, noise models, OpenQASM 3.0 export, deterministic replay, and cross-backend verification. PR #161
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR transforms ruqu from a classical coherence monitor into a full-stack quantum execution intelligence engine -- a layered operating platform that decides how, where, and whether to run quantum workloads. The codebase expands from ~2K lines to ~24K lines of production Rust, adding five simulation backends, cost-model routing, error correction, and hardware abstraction.
Key Changes
New Simulation Backends
state.rs): Dense state-vector simulator for exact simulation up to ~32 qubitsstabilizer.rs): Aaronson-Gottesman tableau for Clifford-only circuits (millions of qubits)tensor_network.rs): Matrix Product State for low-depth, locally-connected circuitsclifford_t.rs): Stabilizer rank decomposition for moderate T-count circuitshardware.rs): Unified provider abstraction for IBM Quantum, IonQ, Rigetti, Amazon Braket, and local simulationCost-Model Execution Planning
planner.rs): Predicts memory, runtime, and selects optimal backend based on circuit structuredecomposition.rs): Partitions circuits into independent segments (temporal/spatial/hybrid strategies) for parallel executionbackend.rs,circuit_analyzer.rs): Structural circuit classification (gate count, T-count, entanglement, connectivity)Quantum Error Correction
decoder.rs): Ultra-fast surface code decoder with union-find clustering and partitioned MWPMqec_scheduler.rs): Minimizes feed-forward latency via deferred corrections and batch mergingcontrol_theory.rs): Models QEC feedback loop as discrete-time control systemError Mitigation & Noise
mitigation.rs): Zero-Noise Extrapolation, measurement error correction, Clifford Data Regressionnoise.rs): Kraus-operator channels (depolarizing, amplitude damping, thermal relaxation) with device calibrationExecution Infrastructure
pipeline.rs): End-to-end orchestration (plan → decompose → execute → stitch → verify)verification.rs): Cross-backend certification and statistical testingreplay.rs): Deterministic execution records for reproducibilityconfidence.rs): Statistical bounds, chi-squared tests, convergence monitoringbenchmark.rs): Comprehensive proof suite for routing, entanglement budgeting, adaptive decodingInteroperability
qasm.rs): Circuit export with ZYZ Euler decomposition for arbitrary unitariesmixed_precision.rs): Float32 state vectors for 2x memory savingsDocumentation
Implementation Highlights
QuantumSimulatortrait for pluggable executionTesting & Validation
https://claude.ai/code/session_01FppgvMQdPUKXrpHADLPxfh