Quantum Circuit Lab / conceptual bridge
Lesson 03 · conceptual bridge

The Quantum Execution Lifecycle

A software engineer’s tour of circuit construction, transpilation, execution, and measurement on a quantum backend.

Beginner12–15 min readsoftware engineering · quantum computing

1. Build: describe intent

You begin with a circuit object: registers, gates, parameters, and measurements. Think of it as an abstract syntax tree. It is readable and portable, but does not yet reflect the topology or native gate set of a particular device.

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

2. Transpile: compile for a target

Real processors have connectivity constraints and a limited native gate set. A transpiler maps virtual qubits, decomposes gates, schedules operations, and optimises while preserving the intended behaviour. The circuit you draw and the circuit executed by hardware can have different depths and gate counts.

3. Execute: simulate or submit

A state-vector simulator applies ideal operations to a full vector. A shot-based simulator samples the circuit repeatedly. Hardware adds calibration, queueing, noise, and readout error. These are distinct execution modes even when the source circuit is identical.

4. Measure: cross the boundary

Measurement turns the state into classical records. With 1,024 shots, a 50% outcome should appear roughly half the time—not exactly half on every run.

Lifecycle checklist: print the source circuit, inspect the transpiled circuit, record the backend and shot count, then report the distribution.

The gates doing the work are covered in the logic-gate translation guide. For a runnable version, use the state-vector lab.