← Back to section · Software & Developer Tools
The Anatomy of Qiskit: A Layered Map of an SDK
Qiskit is not a single library but a layered quantum computing SDK: circuit layer, transpiler, primitive interfaces, simulator and runtime each do one job. This article draws the layered map and explains what each layer solves and how the layers connect.
People meeting Qiskit for the first time are often intimidated by its scale: after installation there are many importable modules, and tutorials jump between circuits, transpilation, runtimes and simulators. In fact Qiskit is not a single library but a layered software development kit in which each layer solves exactly one class of problem. Draw this layered map clearly, and every concrete feature you learn later has a known place — you know which layer it hangs on and how it connects to its neighbours, and troubleshooting becomes a matter of locating the right layer.
The core layer: circuits and transpilation
The core of Qiskit is the main qiskit package, which provides the two most fundamental capabilities. The first is circuit construction: QuantumCircuit is the central object, carrying quantum registers, classical registers, gate operations and measurements, and circuits can be composed, nested and parameterized. The second is transpilation: the transpile function rewrites an abstract circuit into an equivalent circuit that a specific backend can execute, handling basis-gate decomposition, layout, routing and optimization. The core layer cares only about the circuit itself, not about where the circuit will eventually run — this is the key to the layered design: the same circuit can be sent to a simulator or to real hardware without the circuit layer changing at all.
The execution interface layer: primitives
Between circuits and execution sits a standardized interface layer: the primitives. The two core primitives have a clear division of labour. The Sampler handles sampling and answers “which bitstrings will measurement produce, and with what frequencies”; the Estimator handles expectation values and answers “what is the expectation value of this observable on the state this circuit prepares”. Users program against the primitives, and backend differences are kept below the interface: use a local simulator to implement the primitives today, switch to a cloud hardware implementation tomorrow, and the application code barely changes. Variational algorithms, quantum machine learning and other higher-level applications are almost all built on the primitives, because sampling distributions and expectation values are exactly the inputs they need.
Simulation and running: two separate components
Aer is the simulator component of the Qiskit ecosystem, published as its own package qiskit-aer. It offers several simulation methods such as statevector and matrix product state, plus noise models, and plays the role of a high-performance stand-in, locally and in the cloud: verify circuit logic and noise behaviour on Aer before queueing for real hardware. The runtime (Qiskit Runtime) is the execution environment aimed at IBM’s cloud hardware, released as a separate client package; it deploys the primitive interface closer to the hardware and provides mechanisms such as sessions that reduce round-trip overhead for iterative algorithms. Both are independent components: someone doing only local simulation need not install the runtime, and someone running only simple jobs on real hardware can bypass Aer.
The application and ecosystem layer
Above that sits the application layer and the wider ecosystem. Officially and community-maintained extension packages cover natural science, optimization, machine learning, finance and other directions, assembling primitives and circuits into domain algorithms; textbooks, courses and certification systems form the learning ecosystem; third-party hardware vendors connect through compatible backends into the same interface set. The application layer changes far faster than the core layer, which is precisely the value of layering: with stable lower interfaces, the upper layers can experiment and reorganize quickly, while circuit code users wrote against the core layer is unaffected.
Reading the layers from import statements
Layering is not an abstraction on paper; it is written directly into the import statements of code. Writing from qiskit import QuantumCircuit, transpile means you are dealing with the core layer; from qiskit_aer import AerSimulator brings in the simulation component; importing a service class from the runtime client and taking a Sampler or Estimator from it means you are using the execution layer. The import path is the component boundary, which is why the first few lines of a tutorial tell you the shape of the whole program: core-only imports mean pure circuit construction and transformation; Aer appearing usually means local verification; a runtime client appearing means real hardware execution is involved. Cultivating the habit of reading imports before logic lets you locate any piece of Qiskit code quickly.
Conversely, error messages expose the layer too. Circuit-layer problems are construction-time errors: index out of range, wrong parameter shapes, incompatible instructions — thrown before the program runs at all. Transpilation-time problems relate to backend properties: unsupported basis gates, unsatisfiable coupling constraints. Only execution-time problems involve queues, sessions and result formats. Sorting exceptions into these three classes makes searching and asking for help far more precise. Many beginners describe all three classes mixed together and get no useful help, precisely because they have no layered map in mind.
Layers evolve at different speeds
Layering has another often-overlooked implication: the layers evolve at different speeds and have different stability. The core circuit layer is the most stable — the basic semantics of QuantumCircuit have not changed in years. The primitive interface is an abstraction established only recently and is still being adjusted in small ways. The runtime client changes fastest, following the cloud service, with frequent changes to options and behaviour. Application packages are reorganized from time to time. When arranging learning and project dependencies, this stability gradient is the guide: rest your own core code on the most stable layers, and confine use of volatile layers to a few files. A later article on version evolution expands on this; here it suffices to build the intuition that different layers have different lifespans.
What the map means for choosing what to adopt
The layered map also guides adoption decisions. A scenario that only needs local simulation for teaching is served by the core layer plus Aer; installing the whole ecosystem only adds size and version coupling. A project that will iterate variational algorithms on real hardware for a long time should centre on the runtime and primitive layers and will write comparatively little core-layer code. Judge which layers you actually need from the map first, then decide the scope of installation and learning — this avoids the “install everything, learn everything, taste everything shallowly” trap. Most of Qiskit’s sense of scale comes from viewing all layers stacked together; taken apart, each layer is actually quite restrained.
Summary
Qiskit’s anatomy can be remembered in one sentence: the core layer owns circuits, the transpiler owns adaptation, the primitives own the interface, Aer owns simulation, the runtime owns real-hardware execution, and the extension packages own domain applications. When a problem appears, first decide which layer it belongs to — a misdrawn circuit is a core-layer matter, a wrong result distribution concerns the junction between primitives and backend, and slowness usually lives in the transpilation or simulation-method layer. With the map in hand, every later deep-dive article is just a magnified view of one block of it.
Tags: QiskitQuantum Software StackSDK