← All projectsProject 09 / 12 · software

MettleQ / Apple Silicon / Quantum simulation

Your circuits.
Your Mac.
Your GPU.

Local quantum-circuit simulation on Apple Silicon, with Qiskit and PennyLane integrations and reproducible CPU/GPU benchmarks.

QISKIT + PENNYLANEMettleQMetal · MLXApple M3 Pro · 18 GPU cores
1.16×vs. Qiskit Aer CPU
8.37×vs. PennyLane Lightning CPU

20 qubits · depth 3
Full-state SDK calls, accuracy checked

Performance, with context

Where the GPU pulls ahead.

Benchmark record ↗
Full-state SDK crossover · final run on Apple M3 Pro

Full-state SDK crossover · final run on Apple M3 Pro

The crossover plot compares complete SDK calls. Read ratios together with width and numerical error: a faster call is useful only when the returned state also satisfies the accuracy check.

The crossover matters.

The GPU crossed Aer at 20 qubits and Lightning at 16 qubits in this measured workload. Smaller circuits can favor the CPU.

MettleQ brings quantum simulation to the Apple GPU through familiar Qiskit and PennyLane interfaces. It combines exact statevectors, bounded matrix-product states, MLX, and custom Metal kernels, with memory checks before execution.

Apple M3 Pro · depth 3 · CPU time / GPU time; a ratio above 1 means GPU was faster
QubitsAer / MettleQLightning / MettleQ
160.234×1.453×
180.801×3.488×
201.162×8.371×

Memory, contractions & other hardware

Beyond a single speedup.

Apple CPU/GPU · MPS contraction and residency

Apple CPU/GPU · MPS contraction and residency

This microbenchmark compares CPU contraction, GPU-resident contraction, GPU readback, and CPU SVD across bond dimensions. At these sizes NumPy contraction is faster; SVD becomes the dominant cost. It is distinct from the full-state SDK benchmark above.

Apple M3 Pro vs CUDA-Q on RTX 3070 · matched widths

Apple M3 Pro vs CUDA-Q on RTX 3070 · matched widths

Both systems use the same six circuit families at 15–28 qubits with synchronized complex64 full-state output. MettleQ wins all six comparisons at 15 and 20 qubits; CUDA-Q is faster on all six at 28 qubits. This is a cross-machine comparison, not a claim about equivalent hardware.

Apple Metal and Windows CPU/GPU backends · matched widths

Apple Metal and Windows CPU/GPU backends · matched widths

The all-backend view includes CUDA-Q, Lightning GPU, Aer CPU, and Lightning CPU on the Windows machine. Compare like-for-like circuit widths and full-state contracts. The results are frozen on the MettleQ development branch.

Full-state SDK timings

In the supplied final crossover run, the 20-qubit Qiskit full-state call took 32.95 ms on MettleQ GPU versus 38.28 ms on Aer CPU.

The PennyLane full-state call took 19.29 ms on MettleQ GPU versus 161.52 ms on Lightning CPU at 20 qubits.

Backend architecture & measurement protocol

An SDK-first simulator

The goal is to keep existing quantum workflows usable while changing the execution engine underneath them. A Qiskit BackendV2 and registered PennyLane devices expose the simulator through each library’s normal circuit and result interfaces. Adaptive devices can select a CPU or Apple-GPU path based on the circuit, precision, and available memory.

Choosing the right simulation contract

An exact statevector stores every amplitude, so its memory cost grows exponentially with qubit count. Matrix-product states offer a different tradeoff: their useful range depends on entanglement and the allowed bond dimension. Asking an MPS backend to materialize a complete dense state removes much of that advantage, which is why this benchmark states its full-state contract explicitly.

Apple and NVIDIA at matched circuit widths

The comparison record runs six circuit families at 15, 20, 24, 26, and 28 qubits on M3 Pro Metal and an RTX 3070 under Windows/WSL. Each uses one warm-up and three measured repetitions. The small-width results favor MettleQ, while CUDA-Q wins at 28 qubits; launch overhead and circuit structure affect the crossover. These are separate machines, and the full-state contract should be kept in view.

Implementation & checks

  1. Run the same depth-3 circuits on an Apple M3 Pro with 18 GPU cores and 36 GB RAM.
  2. Compare complete statevectors through each SDK adapter, with warm-up and repeated timing. Disable Aer circuit truncation to preserve agreement with independent references.
  3. Accept a row only after phase-aligned state error passes the 5×10⁻⁶ threshold. The accepted rows had errors below 4.1×10⁻⁷.