Quantum Circuit Benchmarking in Rust
- How We Found a Silent Bug That Quantum Volume Misses
- About This Book
- Contents
About the Author
Chapter 1: The Problem with Quantum Software Testing
- 1.1 The Promise and the Fragmentation
- 1.2 The Illusion of Correctness
- 1.3 What Quantum Volume Does Not Measure
- 1.4 The OpenQASM Standard and Why It Matters
- 1.5 What We Built
- 1.6 What This Book Covers
- Summary
Chapter 2: The Bug We Found
- 2.1 The Setup: Four Simulators, One Circuit
- 2.2 The QAOA Circuit
- 2.3 The Sign Convention
- 2.4 Why Orthogonal?
- 2.5 The Invisible Nature of the Bug
- 2.6 Reproducing the Bug
- 2.7 The Fix
- 2.8 What This Means in Practice
- Summary
Chapter 3: The Architecture of CleitonForge
- 3.1 The Design Goal
- 3.2 The Workspace
- 3.3 The Canonical IR:
cforge-core - 3.4 The Plugin Trait:
SimulationBackend - 3.5 The Native Backend
- 3.6 The QuantRS2 Backend
- 3.7 Adding a New Backend
- 3.8 Why Rust?
- Summary
Chapter 4: The OpenQASM Parser
- 4.1 Why Build a Parser?
- 4.2 OpenQASM 2 vs OpenQASM 3
- 4.3 The Two-Pass Parser for QASM 2
- 4.4 Whole-Register Broadcasting
- 4.5 User-Defined Gates
- 4.6 Gate Aliases
- 4.7 Parameter Evaluation
- 4.8 The QASM 3 Parser
- 4.9 The Full Parse Pipeline
- 4.10 Parsing in Python
- Summary
Chapter 5: Metrics — Fidelity, Memory, and Time
- 5.1 What Should a Quantum Benchmark Measure?
- 5.2 Statevector Fidelity
- 5.3 The Inner Product in Practice
- 5.4 Circuit Statistics
- 5.5 Timing
- 5.6 Memory Measurement
- 5.7 The
measureFunction - 5.8 JSON Output for CI/CD
- Summary
Chapter 6: How to Use CleitonForge in Your Project
- 6.1 Three Ways to Use CleitonForge
- 6.2 Installation
- 6.3 The CLI:
cforge run - 6.4 The CLI:
cforge validate - 6.5 Python:
pip install cleitonforge - 6.6 Integrating with Qiskit
- 6.7 GitHub Actions: Fidelity Checks in CI/CD
- 6.8 PyPI Package Details
- 6.9 Noisy Simulation
- Summary
Chapter 7: What Comes Next
- 7.1 Where We Are
- 7.2 Hardware Backends
- 7.3 Noise Modeling
- 7.4 More Rust Backends
- 7.5 Cross-Backend Fidelity as a Standard
- 7.6 The Book You Are Reading as a Data Point
- 7.7 How to Contribute
- 7.8 Final Words
- Summary
Appendix A: Supported Gate Reference
- Single-Qubit Gates — No Parameters
- Single-Qubit Gates — With Parameters
- Two-Qubit Gates — No Parameters
- Two-Qubit Gates — With Parameters
- Three-Qubit Gates
- Qubit Limits
- Gate Coverage by Backend
Appendix B: CLI Reference
- Installation
- Global Options
cforge runcforge validate- Default Seed
- Supported QASM Features