In short: Qiskit is IBM's open-source Python toolkit that lets you build quantum circuits, test them on classical simulators, and submit them to real quantum hardware through one workflow: build, transpile, run, analyse.
Why Qiskit is the default starting point
If you read our overview of quantum computing programming, you know that a quantum program is a sequence of gates applied to qubits, followed by measurement. Qiskit turns that idea into Python objects. A QuantumCircuit holds the gates, a backend represents either a simulator or a physical processor, and a primitive (Sampler or Estimator) executes circuits and returns results. Because the same circuit object can target a laptop simulator or a 100+ qubit IBM device, it is the shortest path from textbook to hardware.
The ecosystem splits into a few packages: qiskit (core circuits and the transpiler), qiskit-aer (high-performance simulators), and qiskit-ibm-runtime (cloud access to IBM systems). Install them with pip install qiskit qiskit-aer qiskit-ibm-runtime.
The four-step workflow
Every Qiskit program, from a two-qubit demo to a research experiment, follows the same pattern, often called the patterns workflow: map the problem to circuits, optimise for hardware, execute, then post-process.
Your first circuit: the Bell state
The Bell state is the "hello world" of quantum computing because it demonstrates entanglement in just two gates. Start with both qubits in |00>. A Hadamard on qubit 0 creates an equal superposition. A CNOT (CX) with qubit 0 as control and qubit 1 as target then copies the branch into the second qubit, producing (|00> + |11>)/√2.
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
from qiskit_aer.primitives import SamplerV2
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
backend = AerSimulator()
pm = generate_preset_pass_manager(optimization_level=1, backend=backend)
isa_qc = pm.run(qc)
job = SamplerV2(default_shots=1024).run([isa_qc])
counts = job.result()[0].data.c.get_counts()
print(counts) # e.g. {'00': 508, '11': 516}
Key fact: A perfect Bell pair never yields "01" or "10". Over 1,024 shots you expect roughly 512 each of 00 and 11, with statistical spread of about ±16 (one standard deviation, √(1024×0.25)).
What the transpiler really does
Real processors do not run arbitrary gates. IBM's current Heron-class devices expose a small native set (for example cz, rz, sx, x), and qubits connect only to a few neighbours on a heavy-hex lattice. Transpilation does three jobs: translation (rewrite H and CX into native gates), layout and routing (choose physical qubits and insert SWAPs where the coupling map forbids a direct interaction), and optimisation (cancel redundant gates, merge single-qubit rotations).
The idea mirrors technology mapping in classical synthesis: Synopsys Design Compiler or Cadence Genus maps RTL onto a standard-cell library, then place-and-route handles physical constraints. Qiskit's transpiler plays the same role for quantum gates. If you have attended an ASIC flow class at ChipXpert, the analogy will feel natural.
| Optimization level | What it does | Use when |
|---|---|---|
| 0 | Translation and trivial layout only | Debugging the circuit |
| 1 | Light gate cancellation | Default for small tests |
| 2 | Noise-aware layout, commutation analysis | Medium circuits |
| 3 | Heaviest resynthesis, slowest compile | Depth-critical runs |
Key fact: Each two-qubit gate on today's hardware has an error around 0.1% to 1%, so every SWAP the router adds (three CX gates) directly lowers your result fidelity. Depth after transpiling matters more than depth before it.
Seeing it in motion
Run the Bell circuit many times and each shot lands in either the 00 or the 11 bucket. The animation below shows shots dropping into the two outcomes while "01" and "10" stay empty.
From simulator to real hardware
Moving to hardware changes only the backend. Save your IBM Quantum API token once, then pick the least busy device and rebuild the pass manager against it, because the native gate set and coupling map differ per chip:
from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2
service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False)
pm = generate_preset_pass_manager(optimization_level=3, backend=backend)
isa_qc = pm.run(qc)
job = SamplerV2(mode=backend).run([isa_qc], shots=1024)
print(job.job_id())
Jobs wait in a queue, so you retrieve results later by job ID. On real hardware you will see a few percent of "01" and "10" counts, caused by gate errors, readout error (often 1% to 3% per qubit) and decoherence. That leakage is a feature of learning: it is your first lesson in why error mitigation exists. For a deeper treatment of circuit patterns that follow this, see quantum error mitigation basics.
Interview angles worth rehearsing
Interviewers for quantum software roles rarely ask you to recite API names. They probe understanding. Expect questions such as: why does a Bell state violate classical correlation limits, what is the difference between a logical circuit and an ISA (instruction set architecture) circuit, and how would you estimate the cost of a routing pass? A strong answer ties the code to physics: Hadamard gives amplitude 1/√2 on each branch, CX is a conditional bit flip that preserves coherence, and measurement samples from the squared amplitudes.
Also be ready to discuss resource limits. A 127-qubit device cannot be simulated exactly, so you validate small instances on Aer, then scale up with Clifford-only or matrix-product-state simulators when the circuit structure allows. Show that you know when each simulator method applies, and you will stand out from candidates who only ran tutorials.
Common mistakes beginners make
- Skipping transpilation on hardware. Runtime rejects circuits containing non-native gates or illegal qubit pairs.
- Misreading bit order. Qiskit is little-endian: qubit 0 is the rightmost character in a count string such as "10".
- Too few shots. With 100 shots, the Bell ratio can wander by ±5 counts easily; use 1,000 or more.
- Trusting simulator numbers. An ideal Aer run is noise-free; add a noise model from a real backend before predicting hardware behaviour.
Key fact: Statevector simulation needs 2n complex amplitudes; at 16 bytes each, 30 qubits already needs about 16 GB, which is why simulators stop around 30 to 35 qubits on ordinary machines.
Ready to go beyond Bell states? Explore the quantum and VLSI learning paths in our CourseTron courses and build circuits with guided labs.
FAQ
Do I need a quantum computer to learn Qiskit?
No. The Aer simulator runs on a laptop, and IBM offers free-tier access to real devices for short runs.
What is the difference between Sampler and Estimator?
Sampler returns measurement bitstring samples (counts); Estimator returns expectation values of observables, which suits chemistry and optimisation.
Why does my hardware Bell result show 01 and 10?
Gate errors, readout errors and decoherence flip some outcomes. Higher transpiler optimisation and error mitigation reduce, but do not remove, them.
Is Qiskit only for IBM hardware?
Qiskit is open source and has provider plugins, but its richest integration is with IBM Quantum systems.