Open Source Project
A full quantum computing platform with a Rust core and native Metal GPU acceleration. Not just a simulator - a research toolkit spanning 14 quantum domains.
I wanted to explore quantum computing on my Mac. Every major quantum framework - Qiskit, Cirq, PennyLane - is locked to CUDA for GPU acceleration. If you're on Apple Silicon, you get CPU-only simulation. Slow. Frustrating.
Head-to-head against every major quantum computing framework. nQPU is the only one that combines native Mac GPU acceleration with a full-stack research platform.
| Feature | nQPU | Qiskit | Cirq | PennyLane | osxQuantum |
|---|---|---|---|---|---|
| Core Language | Rust | Python/C++ | Python/C++ | Python | C++ |
| GPU on Mac | ✓ Native Metal | ✗ | ✗ | ✗ | ✓ MLX JIT |
| Max Qubits (SV) | 30+ | 30+ | 30+ | 30+ | 25 |
| Tensor Networks | MPS/PEPS/MERA/TTN | Limited | ✗ | ✓ | ✗ |
| Stabilizer Sim | 1,000+ qubits | ✓ | ✗ | ✗ | ✗ |
| Error Correction | 37 modules | Basic | Basic | ✗ | ✗ |
| Drug Discovery | ✓ | ✗ | ✗ | ✗ | ✗ |
| Quantum ML | 16 modules | Limited | Limited | ✓ | ✗ |
| Quantum Trading | ✓ | ✗ | ✗ | ✗ | ✗ |
| CUDA + ROCm | ✓ | CUDA only | CUDA only | Both | ✗ |
| Real-time TUI | 3D Bloch sphere | ✗ | ✗ | ✗ | ✗ |
Key Advantage: nQPU writes raw Metal compute shaders for GPU acceleration. No MLX abstraction layer, no JIT compilation overhead. Direct GPU dispatch with zero-copy unified memory access.
nQPU isn't a single-purpose simulator. It's a modular research platform organized into 14 specialized domains. Each domain is a self-contained module with its own algorithms, data structures, and tests.
State vectors, density matrices, 50+ quantum gates, stabilizer simulation, quantum channels, mid-circuit measurement, continuous-variable quantum, decision diagrams.
MPS, PEPS, MERA, TTN, DMRG, TEBD. Simulate 100+ qubits for shallow circuits. Contraction optimization, fermionic networks, 3D lattice simulation.
Surface codes, floquet codes, QLDPC, bosonic codes, holographic codes. Neural decoders (transformer, Mamba). Magic state distillation. GPU-accelerated MWPM.
Device-specific noise models, Bayesian noise characterization, non-Markovian dynamics. ZNE, PEC, PNA, Pauli twirling, dynamical decoupling, Lindblad simulation.
VQE (+ ADAPT, GGA, Meta variants), QAOA, QPE, Shor's algorithm, QSP/QSVT, quantum annealing, Trotter decomposition, GPU Pauli propagation.
Quantum kernels, neural quantum states, quantum attention and transformers, natural gradient, reservoir computing, barren plateau analysis, JAX/PyTorch bridges.
Molecular Hamiltonians, double factorization, CAMPS-DMRG. Drug discovery pipeline: molecular fingerprints (ECFP4/6, MACCS), ADMET prediction, Lipinski filtering, QED scoring.
Native Metal compute shaders (multiple variants), CUDA, ROCm. Auto-backend selection, UMA zero-copy dispatch, thermal-aware scheduling, mixed precision, pulse control.
Circuit optimizer, gate fusion, AI transpiler, ZX calculus, circuit cutting. QASM 2.0/3.0 parser, QIR compiler, QASM language server, parametric circuits.
QKD protocols (BB84, E91), metro QKD network simulation, QRNG integration, entropy extraction, NIST randomness testing, post-quantum cryptography assessment.
Quantum walks, cellular automata, thermodynamics, quantum batteries, chaos theory, quantum Darwinism, topological quantum, Majorana fermions, quantum biology.
Quantum finance, logistics optimization, climate modeling, quantum NLP, quantum chess and poker, quantum art generation, cognitive modeling.
State tomography, classical shadows, quantum Fisher information, QCVV benchmarking, layer fidelity estimation, property testing, source certification.
SIMD-optimized operations, distributed MPI computing, Python FFI (PyO3), C FFI, WASM bindings, autodiff, benchmark suites, terminal UI with 3D Bloch sphere.
nQPU doesn't use MLX or any abstraction layer. It writes raw Metal compute shaders and dispatches directly to Apple Silicon's GPU. This gives maximum control over memory layout, threadgroup sizing, and kernel optimization.
CPU and GPU share the same memory on Apple Silicon. nQPU exploits this - single-qubit gates run on CPU, multi-qubit gates dispatch to GPU, with no memory copies.
Adaptive threadgroup sizing monitors execution time drift and scales down GPU work when thermal throttling is detected. Sustained performance without overheating.
Automatic backend selection analyzes circuit properties - Clifford fraction, magic level, qubit count - and routes to the fastest backend (state vector, MPS, stabilizer, or GPU).
The Rust core is wrapped in a Python SDK with optional domain-specific packages. Install only what you need.
Molecular fingerprints (ECFP4/6, MACCS, Atom Pair), ADMET prediction, drug-likeness scoring (Lipinski, QED), similarity search (Tanimoto, Dice).
Photosynthesis simulation, enzyme tunneling rate calculations, DNA/RNA quantum encoding, quantum coherence in biological systems.
Quantum volatility surfaces, regime detection, signal processing, quantum walk momentum, entropy-modulated Kelly criterion, walk-forward backtesting.
All domain packages plus the core quantum simulation engine with Metal GPU acceleration. One install, full research platform.
Measured on Apple Silicon. GPU benchmarks use native Metal compute shaders.
| Operation | CPU | GPU (Metal) | Speedup |
|---|---|---|---|
| 20-qubit random circuit | 1.2s | 12ms | 100x |
| 30-qubit QFT | 4.5s | 45ms | 100x |
| 1000-shot sampling | 0.8s | 8ms | 100x |
| Molecular fingerprint | 50ms | 0.5ms | 100x |
nQPU automatically selects the best backend for your circuit, but you can override manually.
| Backend | Max Qubits | Speed | Best For |
|---|---|---|---|
| State Vector (CPU) | ~28 | Fast | General circuits, exact amplitudes |
| State Vector (Metal GPU) | 30+ | Very Fast | Anything on Apple Silicon |
| Tensor Network (MPS) | 100+ | Fast | Shallow circuits, low entanglement |
| Stabilizer | 1,000+ | Ultra Fast | Clifford circuits, QEC simulation |
| CUDA | 30+ | Very Fast | NVIDIA GPU workstations |
| ROCm | 30+ | Fast | AMD GPU workstations |
Get started with a Bell state in three lines. GPU acceleration is automatic on Apple Silicon.
nQPU is released under the MIT License. Free to use, modify, and distribute.