solana-qsim

Status: On devnet · open source · Group: Quantum infrastructure

Quantum circuits, simulated inside a Solana program.

A Solana program can't trust a quantum computer's result: a relayer just posts some numbers. solana-qsim lets the program run the same small circuit itself, exactly, and score the QPU's result against it.

Qubits in one transactionQubits across transactionsScore a real GHZ-5 result
112026k CU

What it is: a deterministic simulator built for Solana

  • Fixed-point state vector. no_std, no floats, deterministic. Amplitudes are Q1.30 complex numbers, 8 bytes each; rounding is about 2⁻³⁰, far below QPU noise.
  • The common OpenQASM gates. H, X, Y, Z, S, S†, T, T†, √X, RX, RY, RZ, phase and U; CX, CZ, SWAP, controlled phase and Toffoli. Angles are exact fractions of a turn.
  • Scores QPU counts. Hellinger fidelity (what Qiskit reports), total variation distance and linear cross-entropy (XEB) against the ideal distribution.
  • Bound to the receipt. simulate_receipt first checks that the circuit hash and the counts hash equal the bb84 proof receipt's, then scores them.

Real QPU: Rigetti GHZ-5, scored on-chain

A five-qubit GHZ circuit, 1,024 shots on Rigetti Cepheus-1-108Q through Amazon Braket. The bb84 proof receipt was recorded, then simulate_receipt checked and scored the counts on devnet. Forged "better" counts were rejected on-chain (ResultMismatch).

CountsFidelityXEB
Ideal GHZ-51.0015.0
Rigetti Cepheus-1-108Q0.7010.2
Noisy local simulation (2% bit flips)0.8913.3
Random noise posing as a result0.070.1

Measured: one transaction, state on the heap

CircuitQubitsCompute (CU)
Bell pair + score25,226
GHZ823,228
GHZ11151,162
Random layers, 92 gates8818,445

Larger circuits keep the state in an account and spread gates over many transactions, with every gate hash-chained on-chain. Scoring a 20-qubit state takes 4,882 CU.

Why it matters

  • Catch bad results. For small circuits a program can reject a result that doesn't fit: a lazy oracle, a simulator labelled "QPU", or a broken device.
  • Powers the Gateway. The Quantum Gateway releases payment only when qsim's checks pass.
  • Next experiments. Noise fingerprints per vendor, Solana-challenged random circuits, Bell and GHZ games, and a CPI helper for other programs.

Honest limits: what it does and doesn't prove

  • A classical simulator is classical: anything Solana can simulate, a laptop can too. qsim checks small QPU results; it doesn't prove quantum advantage.
  • Cost grows as 2ⁿ: about 11 qubits fit in one transaction, and 20 qubits across transactions with the state in an account.
  • It proves the counts belong to the circuit and the receipt, not that they came from quantum hardware.

qsim is a classical check of quantum results. It is not quantum computing on Solana.

Program

ProgramInstructionsDevnet addressMainnet address
qsimsimulate, simulate_receipt, init_state, apply, apply_range, score6sHufVFfaMwxPuDKxBuV8qZqNot8bJNgtFKhZKXHdhSw{{MAINNET_QSIM_ADDRESS}}

Source: https://github.com/bb84sh/solana-qsim

Related

Quantum Gateway · bb84 RNG · All products


Did this page help you?