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:
Programs near the 12-qubit limit will noticeably slower to simulate than programs using 4–6 qubits.
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.