Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives. It provides tools for creating and manipulating quantum programs, and running them on prototype quantum devices on IBM Quantum Platform or on local simulators. The library follows a Semantic Versioning strategy, with major releases (containing breaking changes) approximately once a year, and minor releases every three months introducing new features and bug fixes.
pip install qiskitVerified import paths — ran on the pinned version, not inferred.
This quickstart builds a Bell state (two entangled qubits), visualizes the circuit, runs it on a local `StatevectorSampler`, and then displays the measurement outcomes as a histogram. It demonstrates basic circuit creation, execution via primitives, and result visualization.
For upgrades from Qiskit 0.x to 1.x (or later major versions), create a new virtual environment and install Qiskit clean: `python -m venv .venv && source .venv/bin/activate && pip install qiskit`. Always review the official migration guides for specific version changes.
Update code to use the new `qiskit.primitives` interface. Explicitly set the `shots` parameter in `Sampler.run()` or `Estimator.run()` calls to ensure consistent behavior, especially when migrating algorithms.
For pulse-level control, consider using Qiskit 1.x (which had bug-fix support until Sept 2024 and security support until March 2025) or exploring direct access to fractional gates on newer IBM Quantum QPUs. There is no direct migration path for `qiskit.pulse` functionality in Qiskit 2.x.
Replace `circuit.duration` with `circuit.estimate_duration()`.
Refactor conditional logic to use `circuit.if_test` (as a context manager) or explicitly construct `IfElseOp` instances. Avoid direct use of `Instruction.condition`.
Ensure NumPy is updated to at least version `1.21`: `pip install --upgrade numpy`.