Python / Qiskit projects

Standard Python and Qiskit, running in your browser with a backend already created for you.

Build a Python / Qiskit project for standard quantum work. You write ordinary Python with Qiskit in main.py, and it runs in the browser with nothing to install. For interactive, visual projects, use JS / Qiskit instead.

The environment

The runtime is Python 3.14 with Qiskit 2.x, plus most of the standard library and extras like NumPy 2.x. main.py can import your other Python files, and requirements.txt adds packages. The runtime environment covers both, along with data files and the input form a main() function gets. A new Python project opens on a runnable Bell-state starter; the Code Playground lesson walks through running it.

A minimal example

Build a circuit the way you would anywhere else, then run it against backend:

bell_state.py Python · Playground version
from qiskit import QuantumCircuit

circuit = QuantumCircuit(2, 2)
circuit.h(0)
circuit.cx(0, 1)
circuit.measure([0, 1], [0, 1])

# `backend` is pre-created; just run against it
job = backend.run(circuit, shots=100)
print(job.result().get_counts())

The circuit half is ordinary Qiskit and would run unchanged on your own machine. The last two lines are the part that is specific to Qollab.

The pre-created backend

backend is pre-created for you. Locally you would build a provider, hand it an API key, and ask it for a backend. On Qollab backend exists when your code starts, and there is no key to manage.

The machine it points at is chosen in the Select QPU dialog when you press Run; nothing in the code sets it. The same script therefore runs on the built-in simulator, on one of IonQ's free remote simulators, or on real hardware without a line changing. Compute backends lists every option with its qubit ceiling and what it costs.

Shots are set in code: shots goes in the run call. A shots: int parameter on main() becomes a Shots field under Run settings in the Select QPU dialog; pass that parameter to the run call. Omit shots and you get the backend's default of 1024. The shot count drives accuracy, and usually how long the run takes; Ideal vs. noise-model simulators explains when it does not.

backend is also a real backend object from the provider you selected, not a Qollab wrapper around one. Picking a built-in run hands you Qiskit's BasicSimulator, an IBM noise model hands you that device's Fake backend, and an IonQ choice hands you IonQProvider's. On the local simulators (the built-in one, the AWS Braket local simulator and the IBM noise models), anything that provider's run() accepts works here, including a list of circuits. IonQ jobs pass through Qollab, which accepts one job per run holding one circuit; see One job per run on IonQ.

The result is whatever that provider returns, so print each value you care about; the console shows what your code prints.

What happens to your circuit

IonQ compiles the circuit into its native gate set before it executes, which can change the gate count enough to matter. See How your circuit is compiled.

Visualizations

Graphical circuit drawings, such as circuit.draw("mpl"), need Qiskit Visualizations, which you turn on in the Libraries list. Text drawings from print(circuit) work without it. Leave it off for text-only runs to keep the environment light.

Learning Qiskit

The gates the Circuit panel draws each have a page in the Gate reference, with the call in Python and JS; Transpilation and Primitives cover the two layers around backend.run. To run the same SDK on your own machine, with your own IonQ key, follow the Quantum computing with Python and Qiskit course.

Stay in the loop.

Get the latest tutorials, demos, and project showcases straight to your inbox. No noise, just the good stuff.