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.

The playground’s code editor occupies the left panel and is where you write all your OpenQASM programs. It behaves like a minimal text editor tuned for quantum circuit code — with line numbers, monospace fonts, keyboard shortcuts, and an examples menu to get you started quickly.

Editor layout

The editor fills the full height of the left panel. On the left side of the editor area, a gutter displays line numbers so you can orient yourself in longer programs. The main editing surface sits to the right of the gutter and scrolls independently in both axes. When the editor is taller than the content, the line numbers stay synchronized as you scroll vertically. The editor renders all text in a monospace font stack — Monaco, Menlo, Ubuntu Mono, Consolas, and Courier New — in that priority order, depending on which is available in your operating system. Font size is set to 0.83 rem with a 1.4 line height, matching what most code editors use for comfortable reading.

Keyboard shortcuts

KeyAction
TabInsert four spaces at the cursor position
EscapeRemove focus from the editor (blur)
The Tab key inserts a literal four-space indent rather than a tab character. This matches the convention used in most OpenQASM examples and keeps indentation consistent when you copy code between environments.

Loading examples

The Examples dropdown in the editor toolbar lets you load any of the built-in circuit programs directly into the editor. Selecting an example immediately replaces the current editor content with that program’s code.
1

Open the Examples menu

Click the Examples dropdown in the top-right area of the editor toolbar. The menu lists all available built-in programs, including Bell state, quantum teleportation, Deutsch-Jozsa, and others.
2

Select an example

Click any example name. The editor content is replaced with the selected program’s OpenQASM code.
3

Run or modify the code

Click Run to simulate the example as-is, or edit the code first.
Loading an example overwrites whatever is currently in the editor. If you have unsaved work you want to keep, click Share first to save it as a permanent snippet before selecting a new example.
The Examples menu is hidden while a shared URL is displayed in the toolbar. If you have just shared your code and want to load a new example, reload the page to reset the toolbar.

Writing and pasting code

You can type OpenQASM directly into the editor or paste from an external source. The editor accepts plain text and renders it with syntax-appropriate font settings. A placeholder message — “Enter your OpenQASM code here…” — is shown when the editor is empty.
OPENQASM 3.0;
qubit[2] q;

h q[0];
cx q[0], q[1];
After typing or pasting your program, click Run to send it to the remote simulator.
Use Tab to indent gate argument lists and if blocks cleanly. The four-space indent makes nested structures easy to read.

Build docs developers (and LLMs) love