Tutorial

Qly tutorial: app modes & editor modes

The Compute page has two top-level modes — Circuit and Notebook — switchable from the banner at the top. Each is built for a different kind of quantum work. This guide covers what each does, the editor modes inside them, and a runnable example for each.

Overview

Circuit
A focused editor for one circuit. Write Qiskit or OpenQASM, pick a device, Run.
Running a circuit on hardware
Notebook
Jupyter-style cells with a real Python kernel wired to quantum backends.
Full Python workflows & analysis

Across both, Qpilot, the AI copilot, sits on the right and is aware of which mode you're in.

Circuit mode

QiskitOpenQASM

The classic single-circuit editor. You write one circuit, choose a device in the left panel, and the Run button submits it. Only the circuit assigned to qc is submitted — Qly converts it to OpenQASM and transpiles to the device's native gates. Two editor modes share the same circuit, toggled by the Qiskit / OpenQASM switch.

Circuit mode with the Qiskit editor

Qiskit editor

Write standard Qiskit. Qly parses it, shows a live derived OpenQASM view, and transpiles on submit.

circuit.py · Qiskit
from qiskit import QuantumCircuit # Bell state: maximal entanglement on 2 qubits qc = QuantumCircuit(2) qc.h(0) # superposition qc.cx(0, 1) # entangle qc.measure_all()

Pick SV1 (a free AWS simulator) and hit Run — you'll get ~50% |00⟩ and ~50% |11⟩, the signature of a Bell pair.

OpenQASM editor

Flip to OpenQASM to see (and edit) the exact circuit that gets submitted. The QASM is what hardware receives, so this is the source of truth when you care about the precise gate list.

Circuit mode with the OpenQASM editor
circuit.qasm · OpenQASM 2.0
OPENQASM 2.0; include "qelib1.inc"; qreg q[2]; creg meas[2]; h q[0]; cx q[0], q[1]; measure q[0] -> meas[0]; measure q[1] -> meas[1];

Notebook mode

Python kernelbackend.run.ipynb

A Jupyter-style notebook with a real Python kernel running server-side. Cells share state, so variables, imports, and results persist between them. Unlike Circuit mode, this runs full Python: loops, NumPy, matplotlib, print(), and a predefined backend bound to the device you picked.

Notebook mode with cells

Example: run a Bell pair on real hardware and score the fidelity

backend.run(qc) submits a real job through Qly's pipeline; plot_histogram renders inline.

notebook.ipynb · Python
from qiskit import QuantumCircuit from qiskit.visualization import plot_histogram qc = QuantumCircuit(2, 2) qc.h(0); qc.cx(0, 1) qc.measure([0, 1], [0, 1]) job = backend.run(qc, shots=1000) # real submission to the selected device counts = job.result().get_counts() print("Job:", job.job_id()) plot_histogram(counts) # renders below the cell

Ask Qpilot for a follow-up cell — “add a cell that computes the Bell-state fidelity from my counts” — and it appends one that reads counts from the kernel. Save the notebook as a real .ipynb with code and results.

Bonus: structural resource scoring

qly.score(qc) counts Toffoli gates and qubit width without simulating, so it scales to huge reversible circuits.

notebook.ipynb · Python
qly.score(qc, label="my-adder") # → Toffoli, qubits, score = Toffoli × qubits, with the delta vs your last run

Qpilot, the AI copilot

Qpilot is on the right in every mode and adapts to it. In Circuit it generates and replaces Qiskit/QASM circuits; in Notebook it appends runnable cells that use your kernel state. It has context on your open code, recent jobs, and the selected device.

Tutorial: preview the transpilation before you submit

Real hardware has a native gate set and limited connectivity, so the circuit that runs is not the one you wrote — it's transpiled, and routing can add expensive two-qubit gates. In Circuit mode, click Preview on <device> under the Run button to see, before spending any credits:

  • Depth and 1q / 2q gate counts after translating to the device's native gates.
  • Routing overhead — extra two-qubit gates inserted to satisfy the device's connectivity (superconducting only; trapped-ion machines are all-to-all, so there's none).
Transpile preview for a device

Try the same circuit against an IBM device and an IonQ device: the trapped-ion IonQ needs no routing, while the superconducting IBM device adds SWAP overhead for any non-local two-qubit gate. That difference is exactly why connectivity matters.

Tutorial: read a device's calibration

Click the next to any device to open its detail drawer: topology, native gates, price, and live calibration: T1/T2 coherence times and one- and two-qubit gate fidelities, where the maker publishes them (most superconducting and trapped-ion QPUs today). A live badge means the numbers came straight from the provider; spec means topology and specs only.

Device calibration drawer

Use it to choose between similar devices — higher two-qubit fidelity and longer T2 generally mean cleaner results for deeper circuits — and pair it with the transpile preview to weigh connectivity against fidelity.

Tutorial: compare two runs

On the Jobs page, click Compare, then pick two completed jobs (they get an A and B tag). Qly overlays their outcome distributions and reports two numbers:

  • Total variation distance — 0 means identical, 1 means disjoint.
  • Overlap (Bhattacharyya fidelity) — 1 means identical.
Comparing two runs

This is the fastest way to answer “did my change help?” — compare the same circuit on a simulator vs. real hardware to see the noise, or two devices against each other, or a run before and after an optimization. Per-outcome deltas show exactly which bitstrings moved.

Which mode should I use?

I want to run one circuit on a QPUCircuit
I want loops, sweeps, plots, or post-processingNotebook
I want counts back as Python objects to analyzeNotebook
I want to see the exact gates sent to hardwareCircuit → OpenQASM
Open Compute →