After you run an OpenQASM circuit, the simulator returns a list of quantum states — one for each basis vector that has a non-zero amplitude in the final superposition. These results appear in the right panel as state cards. This page explains what each field means, how the display is organized, and how to explore results in the full-screen table.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.
What quantum states represent
When a quantum circuit finishes executing, the qubits exist in a superposition described by a state vector. Each component of that vector corresponds to a classical bit string (a basis state) and carries a complex-valued amplitude. The probability of measuring that basis state is the squared magnitude of its amplitude. The playground surfaces three values per basis state:- Basis string — the classical bit pattern in ket notation
- Probability — the likelihood of measuring that basis state
- Amplitude — the complex number whose squared magnitude equals the probability
State cards
Each state in the results panel is rendered as a card with the following layout.Basis (ket notation)
The top of each card shows the basis state in ket notation. For example, a two-qubit state with bits0 and 1 is displayed as |01⟩.
Bit strings are displayed in declaration order — the order in which qubits are declared in your OpenQASM program. The first declared qubit occupies the most significant bit position (leftmost character) in the string.
If your circuit uses multiple qubit registers, each register produces its own ket label and they are concatenated: for example, |01⟩|10⟩.
Probability
The probability is shown as a six-decimal-place value, for example0.500000. Below it, a horizontal bar visualizes the probability relative to 1.0. The bar is always at least 6 px wide so that low-probability states remain visible.
Amplitude
The complex amplitude is shown in rectangular form:For a state with probability
p, the amplitude a + bi satisfies a² + b² = p. A pure basis state (probability 1.0) has amplitude 1.000000 + 0.000000i. An equal superposition of two states each has amplitude approximately 0.707107 + 0.000000i.Sort modes
The Sort button in the results toolbar cycles through two ordering modes:| Mode | Description |
|---|---|
| Index order (default) | States appear in the order returned by the simulator, which corresponds to ascending integer value of the basis bit string |
| Probability descending | States are re-ordered from highest to lowest probability, making it easy to identify the most likely outcomes at a glance |
Full-screen results table
Clicking the Quantum States heading in the results panel opens a full-screen dialog with a tabular layout. This is useful when a circuit produces many states and the card layout becomes hard to read. The table has four columns:| Column | Contents |
|---|---|
| Basis | Basis state in ket notation, sticky-scrolls horizontally |
| Amplitude | Complex amplitude in ±real ± imagi format |
| Probability | Numerical probability to six decimal places |
| (bar) | Visual probability bar |
The Quantum States heading is only clickable when results are loaded and there is no active error. When no results are available, the heading is non-interactive.
Copying results as JSON
The Copy button in the results toolbar serializes all current results to JSON and writes them to your clipboard. The JSON follows this structure:binaryString is an array of strings — one per qubit register — giving the bit pattern for that register. int is the integer value of each bit string. amplitude.real and amplitude.imag are both optional fields; if a component is zero, it may be omitted from the response.