You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A quantum circuit simulator written in C++20, capable of simulating up to 25 qubits. It runs OpenQASM 2.0 circuit files from the command line and includes hardware acceleration via OpenMP (CPU multithreading) and SYCL via Intel oneAPI.
Features
State vector simulation — contiguous std::complex<double> vector of size 2ⁿ, up to 25 qubits (512 MB)
Bitwise gate application — in-place 2×2 matrix transforms using bit-index masking; no full 2ⁿ×2ⁿ matrices
OpenQASM 2.0 parser — load and run .qasm circuit files with register declarations, parametric gates, and block comments
Hardware acceleration — OpenMP for CPU parallelism; SYCL kernel for Intel GPUs via oneAPI (optional)
Intel oneAPI Base Toolkit with icpx (SYCL build only)
Build
# Standard build (OpenMP)
make
# Clean rebuild
make re
# Build with Intel oneAPI SYCL (requires icpx)
make sycl
Usage
./qubby <circuit.qasm> <num_qubits> [OPTIONS]
./qubby --repl [num_qubits]
Arguments:
<circuit.qasm> Path to an OpenQASM 2.0 circuit file
<num_qubits> Number of qubits in the circuit
Options:
--repl Start the interactive OpenQASM REPL
--noise Enable noise simulation (density matrix, ≤12 qubits)
--noise-rate=<p> Per-gate depolarizing error rate in [0,1] (default: 0.01)
--ascii Draw an ASCII diagram of the circuit
--print Print the quantum state before measurement
--bloch=<qubit> Show Bloch sphere (ASCII) for the given qubit index
--bloch-svg=<qubit> Same, and save an SVG (requires --bloch-file)
--bloch-file=<path> Output path for the Bloch sphere SVG
--export-qiskit=<file> Export circuit as a Qiskit Python script
--export-cirq=<file> Export circuit as a Cirq Python script
-h, --help Show this help message and exit
Examples
Bell state — ASCII diagram + probability distribution
# Build and run unit + functional tests
make run_tests
# Unit tests only (153 tests via Criterion)
make unit_tests && ./tests/unit_tests
# Functional tests only (42 shell tests)
make functional_tests
# Generate HTML coverage report
make coverage
# Report available at coverage/html/index.html
Benchmarking
Measures wall-clock time for applyGate (OpenMP) vs applyGateSYCL (SYCL) across 20–25 qubit counts.
make benchmark
make benchmark_sycl # requires icpx
Simulate quantum circuits in C++20, from Bell states to Shor's algorithm — up to 25 qubits, hardware-accelerated, with noise simulation, Bloch sphere and interactive REPL.