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.

Once you have OpenQASM code in the editor, you submit it to the remote quantum simulator by clicking Run. The simulator executes the circuit and returns the resulting quantum states, which appear in the right panel. This page explains the full lifecycle — from clicking Run through reading results and handling errors.

The Run button

The Run button is in the top-right area of the editor panel. It has a blue background and white label. Clicking it sends your code to /api/simulate as a JSON POST request and waits for the response. The button is disabled while a simulation is in progress to prevent duplicate submissions.
1

Write or load your circuit

Enter OpenQASM code in the editor, or select an example from the Examples menu.
2

Click Run

Click the blue Run button. The button label disappears and a spinning loader icon takes its place while the simulation is running.
3

Wait for results

The right panel shows “Waiting for remote server…” during execution. This indicates that the request has been sent and the simulator is processing your circuit.
4

Read the results

When the simulation completes, quantum state cards appear in the right panel. Each card shows the basis state, probability, probability bar, and complex amplitude.

Loading state

While a simulation is running, the right panel displays a centered message:
Waiting for remote server…
The Run button also shows an animated spinner in place of its label. Both indicators clear as soon as the simulator responds, whether with results or an error.

Error handling

If the simulator returns a non-2xx HTTP response or a network error occurs, an error panel appears in the right panel instead of quantum states. The error panel contains:
  • An Error Details heading
  • A preformatted block with the full error message, including the HTTP status code and any message returned by the server
A red Copy button appears in the results toolbar when an error is active. Clicking it copies the error text to your clipboard so you can share it or file a bug report.
Submitting an empty editor produces no request — the simulator call is skipped entirely if the code field is blank or only whitespace.

Results panel toolbar

The results panel has two buttons that are always visible:
ButtonBehavior
SortToggles between index order (default) and probability-descending order
CopyCopies all results as a formatted JSON string to your clipboard (or the error text when an error is shown)

Sort mode

Clicking Sort cycles through two modes:
  • Index order (default): states appear in the order returned by the simulator
  • Probability descending: states are sorted from highest to lowest probability
The sort state applies to both the right-panel cards and the full-screen table dialog.

Copying results

When results are loaded without error, the Copy button serializes the full result object to JSON with two-space indentation and writes it to your clipboard. The output looks like:
{
  "states": [
    {
      "binaryString": ["00"],
      "int": [0],
      "probability": 0.500000,
      "amplitude": {
        "real": 0.707107,
        "imag": 0.0
      }
    }
  ]
}

Full-screen results table

Clicking the Quantum States heading in the results panel opens a full-screen dialog with a tabular view of all states. The dialog is only clickable when results are loaded and no error is present — the heading appears as a hover link in that state. The table has four columns: Basis, Amplitude, Probability, and a visual Probability bar. The basis column is sticky so it remains visible as you scroll horizontally for circuits with wide state vectors. Click anywhere outside the dialog, or click the Close button in the dialog header, to dismiss it.
Use the full-screen table when your circuit produces many states and the card layout in the side panel becomes hard to scan. The tabular format fits more states on screen at once.

Build docs developers (and LLMs) love