Quantum computing in Rust, with no Python runtime and no C++ build chain — just cargo add.
Today we released QuantRS2 0.1.0 — a comprehensive, modular, pure-Rust quantum computing framework spanning simulation, algorithm development, and real hardware interaction. This is the first stable release: early, but solid, and already useful end to end.
QuantRS2 (pronounced /kwɒntərz tu:/) is a deliberate alternative to the way quantum software is usually built today. The mainstream stack is Python at the front (Qiskit, Cirq, PennyLane) glued onto C++/CUDA at the back (Stim, cuQuantum). That works, but it brings fragile environments, version-pinned wheels, and a build chain you fight before you ever simulate a qubit. QuantRS2 takes the other path. No C. No Fortran. No CUDA toolkit. No Python runtime. It compiles to a single static binary — or to WASM — and runs the same on Linux, macOS (including Apple Silicon), and Windows. Even the symbolic mathematics is sovereign: quantrs2-symengine-pure is a from-scratch, 100% Rust symbolic engine that replaces SymEngine’s C++ bindings outright.
Why QuantRS2 0.1.0 matters
The incumbent’s pain is well known: a quantum program is rarely just a quantum program. It is Python glue over a C++/CUDA core, an environment that breaks when a transitive dependency moves, and a deployment story that assumes a full scientific Python install is present. Reproducing a result a year later can be harder than writing it.
QuantRS2 trades that for a compiled, type-checked, self-contained framework. A few concrete wins from the 0.1.0 benchmarks, measured on Apple Silicon:
- Fast core gates. At 4 qubits, a Hadamard runs in 57 ns and a CNOT in 100 ns. At 8 qubits, 339 ns and 847 ns. At 12 qubits, 3.88 µs and 9.34 µs.
- Common patterns are cheap. A Bell state builds and runs in 12.2 µs, a 5-qubit GHZ state in 13.1 µs, and a 5-qubit QFT in 14.3 µs.
- Specialized simulation is dramatic. For an 8-qubit, 20-gate circuit, switching from the base path to a specialized simulator takes runtime from 2434 ms down to 0.6 ms — roughly a 4000x speedup.
- It scales by method. State-vector simulation reaches 30+ qubits; the stabilizer simulator handles 50+ qubits, and tensor-network simulation can push past 50 qubits on the right circuits.
- SIMD pays off. Vectorization delivers a 2–4x speedup on supported platforms, on top of multi-threaded parallel execution.
Technical Deep Dive: Inside QuantRS2
QuantRS2 is organized as a Cargo workspace, with each layer in its own crate.
Type-safe circuits (quantrs2-core, quantrs2-circuit). The core crate defines the types, traits, and abstractions; the circuit crate provides a circuit DSL and gate library on top. The signature feature here is the use of Rust const generics for compile-time verification of qubit counts. A Circuit::<2> is a two-qubit circuit, statically — so an out-of-range qubit index is a type error, not a runtime panic.
The simulator family (quantrs2-sim). A single crate ships four complementary engines. The state-vector simulator is the general workhorse (30+ qubits). The stabilizer simulator uses the O(n²) tableau formalism to reach 50+ qubits — ideal for Clifford circuits and quantum error correction. The tensor-network simulator targets low-entanglement circuits (50+ qubits, circuit-dependent) and includes specialized contraction-path optimization for QFT and QAOA. The density-matrix simulator handles mixed states and open systems, and a quantum reservoir computing engine rounds out the set.
Hardware and annealing (quantrs2-device, quantrs2-anneal, quantrs2-tytan). The device crate connects circuits to real quantum hardware: IBM Quantum (Qiskit-compatible auth, transpilation, job submission, and result processing), Azure Quantum, and AWS Braket. On the annealing side, quantrs2-anneal integrates with D-Wave, and quantrs2-tytan is a high-level annealing library on top.
The numerical foundation and symbolic engine. Underneath everything sits SciRS2, the scientific-computing core this release is built directly on. And as noted above, quantrs2-symengine-pure provides symbolic mathematics in pure Rust — no C++ dependency anywhere in the default build.
Getting Started
Add the three crates from the README’s own quickstart:
cargo add quantrs2-core quantrs2-circuit quantrs2-sim
Then build and simulate a Bell state:
use quantrs2_circuit::builder::Circuit;
use quantrs2_sim::statevector::StateVectorSimulator;
fn main() {
// Create a circuit with 2 qubits
let mut circuit = Circuit::<2>::new();
// Build a Bell state circuit: H(0) followed by CNOT(0, 1)
circuit.h(0).unwrap()
.cnot(0, 1).unwrap();
// Run the circuit on the state vector simulator
let simulator = StateVectorSimulator::new();
let result = circuit.run(simulator).unwrap();
// Print the resulting probabilities
for (i, prob) in result.probabilities().iter().enumerate() {
let bits = format!("{:02b}", i);
println!("|{}⟩: {:.6}", bits, prob);
}
}
Prefer Python? The bindings (built with PyO3 via quantrs2-py) are available as a package: pip install quantrs2.
What’s inside
This is 0.1.0, so here is what ships in the box:
- A modular crate family:
quantrs2-core,quantrs2-circuit,quantrs2-sim,quantrs2-device,quantrs2-ml,quantrs2-anneal,quantrs2-tytan,quantrs2-symengine-pure, andquantrs2-py. A unified meta-crate,quantrs2, ties them together behind feature flags (circuit,sim,anneal,device,ml,tytan,symengine,full). - Four simulators: state-vector, stabilizer, tensor-network, and density-matrix — plus quantum reservoir computing.
- Built-in algorithms: Grover’s search, QFT, VQE, QAOA, QPE, and a simplified Shor’s algorithm.
- Quantum machine learning: QNNs, QGANs, quantum reservoirs, and HEP classifiers (
quantrs2-ml). - Realistic noise models: bit flip, phase flip, depolarizing, amplitude/phase damping, and IBM device-specific T1/T2 relaxation.
- Quantum error correction codes: the bit-flip code, phase-flip code, Shor code, and the 5-qubit perfect code.
- Hardware and annealing backends: IBM Quantum, Azure Quantum, AWS Braket, and the D-Wave annealer.
- Framework compatibility targets: Stim 99%+, TorchQuantum 99%+, cuQuantum 95%+, IBM Qiskit 90%+, Google Cirq 90%+, and PennyLane 85%+.
- Broad platform support: Linux (x86_64, aarch64), macOS (x86_64 and Apple Silicon), Windows (x86_64), and WebAssembly (wasm32). Optional C/C++ dependencies (CUDA, MKL) are feature-gated only; the default build is 100% pure Rust.
Tips
- Match the simulator to the circuit. For Clifford-heavy and QEC circuits, reach for the stabilizer simulator — its O(n²) tableau formalism scales to 50+ qubits where a state vector would not fit in memory.
- Use tensor networks for low entanglement. When a circuit stays weakly entangled, the tensor-network simulator can push well past the state-vector memory wall, and its contraction-path optimization is tuned for QFT and QAOA.
- Let the type system catch mistakes. Declaring
Circuit::<N>means an out-of-range qubit index fails at compile time rather than during a run — lean on it. - Turn on the GPU for big circuits. Opt into the WGPU-backed GPU feature for a 10–100x speedup on large circuits, while keeping the default build pure Rust.
- Pull in only what you need. The
quantrs2meta-crate’s feature flags (sim,anneal,device,ml,tytan) let you compile a lean dependency surface — no need to take the whole framework for a state-vector experiment.
Built on SciRS2
QuantRS2 does not stand alone — it sits on the SciRS2 scientific-computing ecosystem (v0.1.2). Array operations come from scirs2-core::ndarray, randomness from scirs2-core::random, Complex64/Complex32 from scirs2_core, SIMD from scirs2-core::simd_ops, parallelism from scirs2-core::parallel_ops, and GPU from scirs2-core::gpu. This release also depends on optirs-core (the optimization layer behind VQE/QAOA), numrs2, pandrs, and oxicode.
That places QuantRS2 squarely in the young, sovereign, pure-Rust COOLJAPAN stack — alongside SciRS2 at the center, with NumRS2 for numerics, OptiRS for ML/optimization, Oxicode in place of bincode, OxiZ in place of Z3, and OxiFFT in place of rustfft. The ecosystem is early, but it is real, and QuantRS2 is built on it from the ground up.
Repository: https://github.com/cool-japan/quantrs
Star the repo if a pure-Rust quantum framework is something you want to see grow — this is the first stable release, and there is a long road ahead.
Pure Rust quantum computing is here — fast, safe, and sovereign.
— KitaSan at COOLJAPAN OÜ January 21, 2026