The playground runs your OpenQASM programs on a statevector simulator. The simulator tracks the full quantum state, which grows exponentially with qubit count. To keep simulation fast and deterministic in the browser, the playground caps the total number of qubits at 12.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/itsubaki/qasm-playground/llms.txt
Use this file to discover all available pages before exploring further.
Maximum qubit count
You can declare up to 12 qubits across all registers in a single program. Registers are counted by their declared size, soqubit[4] r and qubit[4] s and qubit a together use 9 qubits.
Bit string ordering
Measurement results are displayed as bit strings in declaration order, which is MSB-first. The first qubit you declare corresponds to the leftmost (most significant) bit in the output. For example, in the Bell state program:00 and 11, where the left digit represents q[0] and the right digit represents q[1].
When registers are declared separately, the declaration order determines the concatenation order in the output. In Shor’s algorithm:
q followed by 4 bits from a.
How qubit count affects simulation cost
The statevector forn qubits requires 2^n complex amplitudes. Each additional qubit doubles memory usage and computation time:
| Qubits | State vector size |
|---|---|
| 1 | 2 amplitudes |
| 4 | 16 amplitudes |
| 8 | 256 amplitudes |
| 10 | 1,024 amplitudes |
| 12 | 4,096 amplitudes |
Additional limitations
Beyond the qubit count, the underlying itsubaki/qasm simulator has known constraints and open issues that may affect certain programs. For an up-to-date list of limitations, edge cases, and known bugs, check the GitHub issues for the simulator.If your program runs within the 12-qubit limit but still produces unexpected results or an error, the cause may be a known simulator issue. Check the GitHub issues before reporting a new bug.
Tips for working within the limit
Split large algorithms into smaller sub-circuits. If you are exploring a 16-qubit algorithm, isolate one sub-routine (for example, just the QFT block) and verify it separately with fewer qubits. Reuse qubits with reset. Ancilla qubits can be reset after use and repurposed for a subsequent part of the circuit. Thereset instruction reinitializes a qubit to |0⟩ without adding a new qubit to the count.