COOLJAPAN
← All posts

QuantRS2 0.2.0 Released — Surface-Code QEC, 3D State Visualization, and Simulated-Bifurcation Sampling

QuantRS2 0.2.0, the pure-Rust quantum framework — production surface-code QEC (rotated codes d=3/5/7, MWPM & union-find decoders, Pauli-frame tracking), 3D state visualization (Bloch/Q-sphere/Wigner/Husimi), new Tytan samplers (Tabu, Simulated Bifurcation, population annealing), and a PennyLane device backend.

release quantrs2 quantum-computing rust error-correction surface-codes quantum-annealing pennylane pure-rust

Fault-tolerant quantum computing is no longer a C++/CUDA-only game — production surface-code QEC, 3D state visualization, and Toshiba Simulated Bifurcation now live in pure Rust.

Today we released QuantRS2 0.2.0 — the biggest release so far, leading with a production-grade surface-code error-correction stack (rotated codes at d = 3/5/7 with MWPM and union-find decoders), 3D quantum-state visualization, a trio of new native-Rust Tytan samplers including Toshiba Simulated Bifurcation, and a PennyLane device backend.

No C. No Fortran. No CUDA toolkit. No Python runtime. QuantRS2 is a comprehensive, modular, pure-Rust quantum computing framework — a Rust-native alternative to Qiskit, Cirq, and PennyLane, and to the C++/CUDA simulators (Stim, cuQuantum) that have owned QEC and large-scale simulation until now. SymEngine’s C++ symbolic core is replaced by the 100%-Rust quantrs2-symengine-pure; OpenBLAS is replaced by the pure-Rust OxiBLAS backend. Default features are 100% Pure Rust (CUDA and MKL are optional and feature-gated), and the whole framework compiles to Linux, macOS, Windows, and WASM — shipping as a single static binary with no shared-library hunt at deploy time.

Why QuantRS2 0.2.0 is a game changer

For years, the moment you needed real quantum error correction or serious sampling you were pushed out of Rust and into a C++/CUDA stack: Stim for QEC decoding, cuQuantum for big state vectors, vendor SDKs for annealing. QuantRS2 0.2.0 closes that gap with native Rust capability:

This lands on a mature base: 5,237 tests passing (0 failures, 74 skipped), 804,894 lines of Rust across 2,744 files, organized as a Cargo workspace of 11 crates.

Technical Deep Dive

(a) The QEC stack — core/src/error_correction/. RotatedSurfaceCode lays out a d×d rotated planar code (data / X-ancilla / Z-ancilla qubits) with a full stabilizer schedule and logical-operator extraction for d = 3/5/7. MwpmSurfaceDecoder is a bitmask-DP minimum-weight perfect matcher — optimal for ≤ 24 defects (i.e. d ≤ 7) — using Dijkstra over the rotated lattice to weight syndrome-graph edges. UnionFindDecoder implements the Delfosse–Nickerson weighted union-find algorithm with peeling for near-linear decoding. PauliFrame tracks Pauli frames by Clifford conjugation with H/S/CNOT propagation rules. All four are exposed to Python via py::qec (PyRotatedSurfaceCode, PyMwpmSurfaceDecoder, PyUnionFindDecoder, PyPauliFrame).

(b) Visualization — core/src/state_visualization_3d/. Five Plotly-JSON renderers, rendered with plotters: a multi-qubit Bloch-sphere array (per-qubit reduced density matrix via partial_trace), a Qiskit-style Q-sphere (latitude ∝ Hamming weight, phase-colored markers), a discrete Wigner function (Wootters 1987, n = 1, 2; explicit error for n ≥ 3), a Husimi-Q distribution (spin-coherent projection on a 64×64 grid), and a density-matrix 3D bar plot (Re/Im side by side). Python bindings ship via PyQuantumState3DVisualizer with {bloch_array,qsphere,wigner,husimi,density_bars}_html().

(c) The Tytan optimization engine — tytan/src/sampler/. The new energy.rs module provides shared, allocation-free QUBO/PUBO energy primitives: QUBO kernels energy_full / energy_delta / compute_influence / update_influence give O(1) incremental ΔE via a maintained influence vector, each with an autovectorized _simd companion (opt-level=3 autovectorization — no nightly std::simd). HOBO/PUBO kernels include specialized 3-body and 4-body paths, and hobo_to_qubo performs Rosenberg-polynomial quadratization. Three new samplers implement the canonical Sampler trait (run_qubo, run_hobo): TabuSampler (FIFO-ring tabu search, aspiration criterion, restart-from-best), SBSampler (Toshiba Simulated Bifurcation, Goto–Tatsumura–Dixon 2019, ballistic bSB and discrete dSB via symplectic Euler dynamics), and PopulationAnnealingSampler (Hukushima–Iba, importance-weighted resampling, log-sum-exp ESS threshold). HOBO parallelization runs through rayon (scirs2_core::parallel_ops) above size thresholds, and the CIM and photonic samplers now support run_hobo (previously NotImplemented) by quadratizing through hobo_to_qubo.

(d) Interop and numerical foundation. The PennyLane device backend (sim/src/pennylane/) exposes QuantRS2Device, executing PennyLane circuits against the state-vector simulator over a JSON protocol (execute / execute_json), with PennyLaneCircuit / Operation / Observable / Result payload types and a WireMap / WireId translation layer. Underneath, the whole stack rides SciRS2 0.5.0 (arrays / linalg / FFT-via-OxiFFT / optimize), the pure-Rust OxiBLAS backend, and OxiFFT — a C/C++/Fortran-free numerical core.

Getting Started

cargo add quantrs2-core quantrs2-circuit quantrs2-sim
use quantrs2_circuit::builder::Circuit;
use quantrs2_sim::statevector::StateVectorSimulator;

fn main() {
    let mut circuit = Circuit::<2>::new();
    circuit.h(0).unwrap()
           .cnot(0, 1).unwrap();
    let simulator = StateVectorSimulator::new();
    let result = circuit.run(simulator).unwrap();
    for (i, prob) in result.probabilities().iter().enumerate() {
        let bits = format!("{:02b}", i);
        println!("|{}⟩: {:.6}", bits, prob);
    }
}

The Circuit::<2> const-generic parameter makes qubit counts part of the type — out-of-range qubit indices are a compile error, not a runtime panic.

What’s New in 0.2.0

Added

Changed

Fixed

Tips

This is the foundation

QuantRS2 0.2.0 doesn’t stand alone — it stands on the COOLJAPAN ecosystem as of June 2026. It builds on SciRS2 0.5.0 (arrays, linalg, FFT-via-OxiFFT, optimize), the pure-Rust OxiBLAS backend that replaces OpenBLAS, NumRS2 0.4.0 and PandRS 0.4.0 for data, OptiRS for VQE/QAOA optimization, and Oxicode 0.2.4 plus OxiARC (oxiarc-deflate / oxiarc-lz4) for pure-Rust serialization and compression. The result is an end-to-end, C/C++/Fortran-free quantum stack — from circuit construction through simulation, error correction, and optimization, all the way down to the BLAS calls.

Repository: https://github.com/cool-japan/quantrs

Star the repo if a pure-Rust path to fault-tolerant quantum computing is something you want to see grow — and tell us what you build with surface codes and Simulated Bifurcation.

Pure Rust quantum computing is here — fast, safe, and sovereign.

KitaSan at COOLJAPAN OÜ June 6, 2026

↑ Back to all posts