Open Quantum Workbench · FAST University

Write quantum circuits in the framework you already know.

Qiskit, Cirq or PennyLane in. OpenQASM 3.0, a circuit diagram and measurement counts out, in one browser tab.

QiskitCirqPennyLaneOpenQASM 3.03 simulatorscounts
from qiskit import QuantumCircuit qc = QuantumCircuit(2, 2)qc.h(0)qc.cx(0, 1)qc.measure([0, 1], [0, 1])

Circuit

q0|0⟩q1|0⟩H

OpenQASM 3.0

Counts

1,024 shots

  • |00⟩0
  • |01⟩0
  • |10⟩0
  • |11⟩0
A Bell-state program in Qiskit, Cirq or PennyLane, the OpenQASM 3.0 it compiles to, and the measurement counts from 1,024 shots: about half 00 and half 11.

Run it, then read the noise.

Step through a circuit one moment at a time. The bars show the exact probabilities so far; at the end, compare them with what 1,024 real shots on the QCanvas simulator returned.

time →123q0|0⟩q1|0⟩H
moment 3 / 3

Two qubits, one Hadamard and one CNOT.

StateExactMeasured
  • |00⟩50%522
  • |01⟩0%0
  • |10⟩0%0
  • |11⟩50%502

Ideal is 50% each for |00⟩ and |11⟩. The run returned 522 and 502: that gap is shot noise, not an error. |01⟩ and |10⟩ never appear because the qubits are entangled.

Measured: one 1,024-shot run on the QCanvas simulator (Qiskit backend). Bit order q0 first.

One circuit, three frameworks

Same circuit. Same gates.

Each framework compiles to OpenQASM 3.0, so you can switch syntax without relearning the circuit.

Trace
Qiskitpython
from qiskit import QuantumCircuit qc = QuantumCircuit(2, 2)qc.h(0)qc.cx(0, 1)qc.measure([0, 1], [0, 1])
Cirqpython
import cirq q0, q1 = cirq.LineQubit.range(2)circuit = cirq.Circuit(    cirq.H(q0),    cirq.CNOT(q0, q1),    cirq.measure(q0, q1),)
PennyLanepython
import pennylane as qml dev = qml.device("default.qubit", wires=2) @qml.qnode(dev)def bell():    qml.Hadamard(wires=0)    qml.CNOT(wires=[0, 1])    return qml.counts()
OpenQASM 3.0
Output from
OPENQASM 3.0;include "stdgates.inc"; // Quantum and classical registersqubit[2] q;bit[2] c; // Circuit operationsh q[0];cx q[0], q[1];measure q[0] -> c[0];measure q[1] -> c[1];

Qiskit and Cirq produce identical QASM.

QASM shown is the output of the QCanvas converter, not hand-written.

A path through the workshop

Six real templates, ordered from a single entangled pair to a parameterised circuit. Each one opens in the editor, ready to run.

  1. 01BeginnerQiskit

    Bell state

    A Hadamard and a CNOT entangle two qubits. The histogram shows only 00 and 11, in roughly equal parts.

    q0|0⟩q1|0⟩H
  2. 02IntermediateQiskit

    Deutsch-Jozsa

    A balanced oracle on three input qubits and one ancilla. One query later, the inputs always read 111.

    q0|0⟩q1|0⟩q2|0⟩q3|0⟩XHHHHHHH
  3. 03IntermediateQiskit

    Quantum teleportation

    A Bell pair is shared between q1 and q2, then q0 and q1 are Bell-measured and all three qubits are read out.

    q0|0⟩q1|0⟩q2|0⟩HHH
  4. 04IntermediateQiskit

    Grover's search

    A two-qubit search that marks |11> with a CZ oracle, then amplifies it with a diffuser. The result is 11.

    q0|0⟩q1|0⟩HHZHHXXZXXHH
  5. 05AdvancedQiskit

    Quantum Fourier transform

    Three qubits, Hadamards and controlled-phase rotations, then a swap to reverse the qubit order.

    q0|0⟩q1|0⟩q2|0⟩XHPπ/2Pπ/4HPπ/2H
  6. 06AdvancedPennyLane

    Variational circuit

    A two-qubit ansatz: RY on each qubit, a CNOT, then RZ on each, with the angles held in a params array.

    q0|0⟩q1|0⟩RY0.3RY-0.7RZ0.2RZ1.1

Inside the workbench

Write, convert, simulate and inspect a circuit without leaving the page.

A real code editor

Monaco with completions for Qiskit, Cirq and PennyLane. Files and projects are saved to your account.

The QCanvas editor with a Qiskit program open

Three simulators

The same OpenQASM program runs on the Cirq, Qiskit and PennyLane backends. Every shipped example passes on all three.

  • Qiskit
  • Cirq
  • PennyLane
q0|0⟩q1|0⟩H

Circuit diagrams in 2D and 3D

Switch to a 3D view, hover a gate for its details, and export the diagram as SVG.

OpenQASM 3.0 export

OPENQASM 3.0;include "stdgates.inc";qubit[2] q;bit[2] c;h q[0];cx q[0], q[1];measure q[0] -> c[0];measure q[1] -> c[1];

Copy it or download it as a .qasm file.

No account needed

Try it without an account

Guests get a private workspace of their own. It is deleted when you log out or after 3 days.

Open the editor and run your first circuit.

Built at FAST University as part of Open Quantum Workbench. Free for coursework, workshops and your own experiments.

Read the docs