04. Linear Solvers
Archived I/O limitedHHL exponential core negated by O(N) state prep and O(N) readout. Archived per Troyer framework.
Resource Estimation (Azure Quantum RE)
Resource Breakdown
Noise Resilience (Depolarizing Simulation)
Ideal outcome: [Zero] (97% probability)
Cross-Platform Emulator Results (100 shots)
Troyer Utility-Scale Classification
HHL offers exponential speedup but with critical caveats: (1) requires efficient state preparation, (2) only provides quantum state output (readout bottleneck), (3) condition number κ must be polylog(N). Practical utility requires all three conditions simultaneously.
Multi-Model Resource Comparison
Physical qubit requirements across 6 qubit technologies × 2 QEC schemes (inspired by Troyer Architecture Series, Part 3).
| Qubit Model | QEC | Physical Qubits | Logical Qubits |
|---|---|---|---|
| Majorana (ns, 1e-6) | surface_code | 4,140 | 18 |
| Superconducting (ns, 1e-4) | surface_code | 14,900 | 18 |
| Trapped Ion (μs, 1e-4) | surface_code | 14,900 | 18 |
| Majorana (ns, 1e-6) (Floquet) | floquet_code | 18,616 | 18 |
| Trapped Ion (μs, 1e-3) | surface_code | 72,116 | 18 |
| Superconducting (ns, 1e-3) | surface_code | 139,876 | 18 |
| Majorana (ns, 1e-4) (Floquet) | floquet_code | 375,672 | 18 |
| Majorana (ns, 1e-4) | surface_code | 382,356 | 18 |
Problem Documentation
04. Quantum Linear Solvers
This challenge sets up the scaffolding needed to explore quantum linear system algorithms such as HHL and modern block-encoding refinements. The immediate goal is to provide deterministic classical baselines, representative instance data, and a Q# entry point that compiles cleanly while we design a genuine quantum kernel.
Roadmap
- [x] Scaffold directory structure and helper scripts
- [x] Provide classical solver baseline with condition-number diagnostics
- [x] Supply representative Poisson-style benchmark instances (small/medium/large)
- [x] Add analysis notebooks for quick visual checks
- [x] Implement Q# analytical baseline matching the classical small instance
- [x] **Implement complete HHL algorithm with QPE and eigenvalue inversion**
- [x] **Run Azure Quantum Resource Estimator (18.7k qubits, 52ms runtime)**
- [ ] Scale to 4×4 and 8×8 systems with higher precision
- [ ] Implement amplitude amplification for success probability boost
- [ ] Connect advanced resource estimator profiles for multiple precision targets
Quickstart
cd problems/04_linear_solvers
make classical # Solve each YAML instance with dense linear algebra
make analyze # Generate plots of condition numbers and residuals
make build # Build the Q# project (uses modern QDK qsharp Python package)
make run # Execute the Q# analytical baseline for the small instance
make estimate # (Placeholder) Run resource estimation once quantum kernel lands
Outputs
- `estimates/classical_baseline.json` – Solutions, condition numbers, and residuals for each YAML instance
- `plots/condition_numbers.png` – Visual comparison of condition numbers across instances
- `plots/residual_vs_precision.png` – Residual norms versus target precision requirements
- `qsharp/src/Main.qs` – Q# analytical baseline, compiled on-the-fly by the modern QDK
- `STAGE_D_ADVANTAGE_EVIDENCE.md` – Stage D claim-boundary and evidence-tracking scaffold for expansion-queue onboarding
✅ Complete HHL Implementation
Status: Fully operational quantum linear solver with resource-estimated performance metrics.
The implementation includes:
- **State Preparation**: Ry rotation encoding of RHS vector |b⟩
- **Block Encoding**: Pauli decomposition for 2×2 symmetric matrices (A = c_I·I + c_Z·Z + c_X·X)
- **Quantum Phase Estimation**: 4-qubit precision register extracting eigenvalue phases via controlled time evolution U^(2^k)
- **Inverse QFT**: Standard Fourier transform with controlled rotations and SWAP gates
- **Eigenvalue Inversion**: Controlled Ry rotations encoding amplitudes ∝ 1/λ
- **Post-Selection**: Ancilla measurement for success/failure indication
Resource Requirements (Azure Quantum Resource Estimator)
Optimal Configuration: qubit_gate_ns_e3 (gate-based, 10⁻³ error rate)
Physical qubits: 18,680
Runtime: 52 milliseconds
Logical qubits: 6 (1 system + 4 precision + 1 ancilla)
T-gates: 903 (18 explicit + 885 from 59 rotations)
Success prob: ~26.6% (1/κ² for κ≈1.94)
Performance vs VQE: 62% fewer qubits (18.7k vs 48.5k-110k), demonstrates near-term feasibility for small-scale quantum advantage exploration.
See HHL_IMPLEMENTATION_SUMMARY.md for complete algorithm details, resource breakdowns, and scaling analysis.
Next milestone: Scale to 4×4 systems (2 system qubits), implement amplitude amplification to boost success probability, and benchmark against classical iterative solvers for sparse matrices.
Objective Maturity Gate
- **Current gate**: **Stage B complete** (classical baseline and Q# scaffold/build path are in place).
- **Next gate target**: **Stage C** (hardware-aware validation with uncertainty-bounded comparisons).
Stage C exit criteria for this problem:
- Execute at least one non-placeholder quantum workflow path tied to the problem objective.
- Report uncertainty-bounded comparisons between classical and quantum outputs on `small` and `medium` instances.
- Document transpilation/connectivity and backend assumptions used for reported quantum runs.
- Add calibration/noise-sensitivity evidence for the reported quantum metrics.
DiVincenzo Readiness (Stage C/D Overlay)
| Criterion | Status | Evidence / Notes |
|---|---|---|
| Scalable qubit system | partial | Estimator-backed 2x2 HHL resources are reported (18.7k physical qubits); scaling evidence for larger systems is still in progress. |
| Initialization | partial | RHS-vector state preparation is implemented for the current HHL path; robust loading for larger instances remains open. |
| Coherence vs gate time | partial | Runtime/T-gate estimates are available, but backend-calibrated coherence margin evidence is pending Stage C hardening. |
| Universal gate set | met | QPE, inverse QFT, controlled evolutions, and inversion rotations are implemented in the Q# HHL workflow. |
| Qubit-specific measurement | partial | Success-probability and post-selection behavior are documented; hardware readout uncertainty characterization is pending. |
Advantage Claim Contract
- **Claim category (current)**: `theoretical`.
- **Problem class and regime**: Problem-specific challenge instances defined in this directory.
- **Fair baseline**: Problem-local classical baseline in `python/` outputs.
- **Quantum resource scaling claim**: Expected asymptotic advantage depends on algorithm family and implementation assumptions; no hardware-demonstrated speedup claim yet.
- **Data-loading and I/O assumptions**: Must be documented alongside future advantage claims.
- **Noise/error model assumptions**: Backend-specific model and calibration assumptions to be added at Stage C.
- **Confidence/uncertainty method**: To be reported using shot-based confidence intervals or equivalent statistical bounds.
- **Residual risks**: Oracle/state-preparation/transpilation overhead may dominate for near-term instance sizes.
Reproduce It
cd problems/04_linear_solvers
make classical # Run classical baseline
make analyze # Generate plots
make build # Validate Q# compilation
make run # Run Q# entry pointKey Files
qsharp/src/Main.qsQuantum algorithm implementationqsharp/HardwareKernel.qsAzure-submittable QIR kernelpython/classical_baseline.pyClassical reference implementationestimates/classical_baseline.jsonBaseline metrics