Skip to main content

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.

OpenQASM Playground runs entirely in your browser. There is no CLI to install, no account to create, and no local simulator to configure. This guide walks you through running your first quantum circuit — a Bell state — and explains what the output means.
1

Open the playground

Navigate to the OpenQASM Playground in your browser. The editor loads with a Bell state circuit by default, so you can see the format immediately. If the editor is empty, select Bell State from the Examples menu.
2

Enter the Bell state circuit

The Bell state prepares two qubits in a maximally entangled superposition: (|00⟩ + |11⟩) / √2. Paste or confirm the following code in the editor:
// Bell State
//
// Prepares two qubits in the entangled state.
// The final state is (|00> + |11>)/sqrt(2).

OPENQASM 3.0;

gate h q { U(pi/2.0, 0, pi) q; }
gate cx c, t { ctrl @ U(pi, 0, pi) c, t; }

qubit[2] q;
reset q;

h q[0];
cx q[0], q[1];
This circuit defines two standard gates — h (Hadamard) and cx (CNOT) — in terms of the built-in U gate, allocates two qubits, and applies them in sequence.
3

Run the circuit

Click the Run button. The playground sends your code to the remote simulator via POST /api/simulate. Results appear in the output panel within a second or two.
4

Read the output

For the Bell state, you will see two entries in the results table:
Basis stringProbabilityAmplitude (real)Amplitude (imag)
000.50.707…0
110.50.707…0
Each row represents one basis state of the output:
  • Basis string — the binary representation of the qubit register, displayed in declaration order (MSB-first). 00 means both qubits measured as 0; 11 means both measured as 1.
  • Probability — the squared magnitude of the amplitude. A probability of 0.5 means the state would be observed 50% of the time in repeated measurements.
  • Amplitude — the complex coefficient for the basis state in the state vector. The real and imaginary parts are shown separately. Here, both states have amplitude 1/√2 ≈ 0.707 with no imaginary component.
The two equal-probability states confirm the circuit produced the expected entangled superposition: measuring either qubit collapses both to the same value.
States with zero probability are not shown. Only the states with non-zero amplitude appear in the output table.
5

Try another example

Open the Examples menu to choose from additional built-in circuits: quantum teleportation, Deutsch-Jozsa (constant and balanced), quantum phase estimation, Grover’s algorithm, Shor’s algorithm (N=15), and quantum signal processing. Each example includes inline comments explaining the circuit logic and expected output.

Next steps

Using the editor

Learn keyboard shortcuts, tab indentation, and how to navigate the editor.

Understanding quantum states

A deeper explanation of basis strings, probabilities, and complex amplitudes.

Sharing your circuit

Save your circuit to a permanent URL and share it with others.

Deploy your own instance

Run your own playground and simulator using Vercel and Google Cloud Run.

Build docs developers (and LLMs) love