Playground
The Playground is an interactive code editor at /run where you can write, test, and iterate on quantum circuits. It supports multiple quantum frameworks and offers two execution modes: Browser (client-side simulation) and Server (remote execution).
Execution modes
Browser mode (default)
Browser mode runs your quantum circuit entirely in your browser — no server round-trip, no cost. It accepts OpenQASM code only. If you write Python code (Qiskit, Cirq, PennyLane), the playground will prompt you to either:
- Run on Server — send the Python code to the remote worker for execution.
- Convert to QASM & Run in Browser — convert the Python circuit to OpenQASM server-side, then simulate the resulting QASM locally.
Server mode
Server mode sends your code to the Marqov worker for execution. It supports all frameworks: Qiskit, Cirq, PennyLane, OpenQASM, and Marqov. Use Server mode for Python-based circuits or when you need features beyond what the browser simulator provides.
Simulator engines
When running in Browser mode, you can choose between two simulation engines:
| Engine | Speed | Features | Notes |
|---|---|---|---|
| qulacs-wasm (default) | 26x—886x faster | Pure simulation, no diagram | Compiled C++ via WebAssembly. Requires SharedArrayBuffer. |
| quantum-circuit | Slower | Generates SVG circuit diagrams | Pure JavaScript. Works in all browsers. |
Select the engine from the dropdown next to the Browser/Server toggle in the toolbar.
Safari fallback
Safari does not support SharedArrayBuffer (required by qulacs-wasm). The playground automatically detects Safari and falls back to the quantum-circuit engine. A yellow banner appears:
Safari doesn’t support the fast WASM simulator. Using quantum-circuit engine instead. For best performance, use Chrome or Firefox.
The qulacs-wasm option is disabled in the engine picker when running in Safari.
Qubit limits for browser simulation
Browser simulation has memory and performance constraints:
| Qubit count | Behavior |
|---|---|
| 1—16 | Runs normally. |
| 17—20 | Warning displayed: “Simulating 17+ qubits in the browser may freeze the page for several seconds.” You can choose to run anyway or switch to Server mode. |
| 21+ | Blocked. The playground returns an error: “N-qubit circuits are too large for browser simulation (max 20). Switch to Server mode for larger circuits.” |
For circuits larger than 20 qubits, use Server mode or submit the circuit as a job.
Language auto-detection
The playground automatically detects which quantum framework your code uses based on import statements. The detected language appears in the bottom status bar. Supported frameworks:
- Qiskit — detected by
from qiskitorimport qiskit - Cirq — detected by
import cirq - PennyLane — detected by
import pennylane - OpenQASM — detected by
OPENQASMheader - Marqov — detected by
from marqovorimport marqov
You can override auto-detection by selecting a specific language from the Language dropdown. When set to “Auto”, the playground re-detects on every code change (debounced at 300ms).
For OpenQASM code, the status bar also shows live qubit and gate counts parsed from the circuit.
Shots
Set the number of measurement shots using the Shots input in the toolbar. Valid range: 1 to 100,000. Defaults to 1,000.
Save and load scripts
Saving a new script
Click the Save button in the toolbar (visible when editing unsaved code). A dialog prompts for a name and optional description. The script is saved to your team’s script library and the URL updates to /run?script_id=<uuid>.
Editing a saved script
When viewing a saved script (via URL parameter ?script_id=...), a header bar shows the script name and an “Unsaved changes” indicator. If you own the script, a Save button updates it in place. Save As… creates a copy under your account.
The editor warns you before navigating away from unsaved changes.
Dependencies tab
When editing a saved script, a Dependencies tab appears next to the Code tab. Enter pip package requirements in requirements.txt format (one per line, e.g. numpy==1.24.0). Dependencies are used when running the script as a job.
Run as Job
The Run button has a dropdown with a Run as Job… option. This submits your code for tracked execution on a specific backend (including cloud simulators and quantum hardware). The job dialog lets you configure:
- Backend — grouped by tier: Marqov Simulators (free), Quantum Brilliance, Cloud Simulators, Quantum Hardware
- Shots — 1 to 100,000
- Execution mode — Fast (Direct) or Durable (Temporal)
- Backend-specific options (noise model config, state vector extraction)
If your code has not been saved as a script, you will be prompted to save it first. After submission, you are redirected to the job status page.
Examples
The Examples dropdown in the toolbar provides sample circuits in various frameworks. Selecting an example replaces the current code and sets the appropriate language.
Python to QASM conversion
When you attempt to run Python code in Browser mode, the playground offers a Convert to QASM & Run in Browser option. This sends your Python code to the server (POST /api/playground/convert), which extracts the quantum circuit and returns equivalent OpenQASM. The QASM is then simulated locally in the browser. This conversion is lightweight — it builds the circuit but does not simulate it on the server.