Registry / ai-ml / qiskit

qiskit

JSON →
library2.5.2pypypi✓ verified 26d ago

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 qiskit
INSTALL
IMPORT
SIG · QISKIT
Q
qiskit
ai-mlpythonv2.5.2
Install
12.3s avg
Import
1234ms
Disk
405MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.5.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.915 runs
build_error
glibc
py 3.10–3.915 runs
installs and imports cleanly · install 12.3s · import 1.234s · 397MB
405MB installed
● package 405MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QuantumCircuit
✓ from qiskit import QuantumCircuit
StatevectorSampler
✓ from qiskit.primitives import StatevectorSampler
✗ from qiskit.providers.aer import StatevectorSimulator
Qiskit 2.x and later uses the `qiskit.primitives` module for execution, replacing older simulator backends like `AerSimulator` or `BasicAer` for many common workflows. `AerSimulator` still exists in `qiskit_aer` for advanced simulation.
AerSimulator
✓ from qiskit_aer import AerSimulator
✗ from qiskit.providers.aer import AerSimulator
As of Qiskit 1.x, `qiskit_aer` is a separate package and its components are imported directly from `qiskit_aer`.
plot_histogram
✓ from qiskit.visualization import plot_histogram
QiskitRuntimeService
✓ from qiskit_ibm_runtime import QiskitRuntimeService
✗ from qiskit import IBMQ
The legacy `IBMQ` module for managing IBM Quantum accounts was replaced by `QiskitRuntimeService` in `qiskit-ibm-runtime`.

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.

import matplotlib.pyplot as plt from qiskit import QuantumCircuit from qiskit.primitives import StatevectorSampler # Create a Bell state circuit qc = QuantumCircuit(2, 2) # 2 qubits, 2 classical bits qc.h(0) # Apply Hadamard gate to qubit 0 qc.cx(0, 1) # Apply CNOT gate with control qubit 0 and target qubit 1 qc.measure([0, 1], [0, 1]) # Measure both qubits into classical bits # Visualize the circuit print("Circuit Diagram:") print(qc.draw(output='text')) # Run on a local simulator using the Sampler primitive sampler = StatevectorSampler() job = sampler.run([qc], shots=1024) result = job.result() # Get measurement counts counts = result[0].data.meas.get_counts() print("\nMeasurement Counts:", counts) # Plot histogram of results plot_histogram(counts) plt.title("Bell State Measurement") plt.show()
qiskit --version
Debug
Known issues
breakingMajor breaking changes occurred between Qiskit 0.x and 1.x, and again between 1.x and 2.x. Upgrading from 0.x to 1.x cannot be done via `pip install -U qiskit` and requires a fresh installation, ideally in a new virtual environment, due to a new packaging structure.
fix
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.
affects: <1.0.0
breakingThe Qiskit Primitives API (Sampler and Estimator) underwent significant changes and is mandatory for Qiskit 2.x. Existing algorithm libraries built on Qiskit 1.x primitives will be incompatible. Additionally, the default `shots` parameter changed (e.g., from implicit unlimited to 10000), which can drastically alter algorithm behavior and reproducibility if not explicitly set.
fix
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.
affects: 1.x.x to 2.x.x
breakingThe `qiskit.pulse` module, which provided pulse-level control, was removed in Qiskit 2.0.
fix
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.
affects: >=2.0.0
deprecatedThe `QuantumCircuit.duration` attribute is deprecated in Qiskit 2.x and is recommended to be replaced by `QuantumCircuit.estimate_duration()` due to evolving complexities in classical control flow.
fix
Replace `circuit.duration` with `circuit.estimate_duration()`.
affects: >=2.0.0
breakingLegacy `c_if` conditions on individual instructions have been removed in Qiskit 2.0. Classical conditions must now be expressed using `IfElseOp` or the `if_test` context manager.
fix
Refactor conditional logic to use `circuit.if_test` (as a context manager) or explicitly construct `IfElseOp` instances. Avoid direct use of `Instruction.condition`.
affects: >=2.0.0
gotchaThe minimum required NumPy version was bumped to `1.21` in Qiskit 2.3.1. Users with older NumPy installations might encounter compatibility issues.
fix
Ensure NumPy is updated to at least version `1.21`: `pip install --upgrade numpy`.
affects: >=2.3.1
Upgrade
Version history
2.5.2latest on PyPI · released Aug 13, 2026
Audit
Dependencies
pythonrequiredRequired Python version.
numpyrequiredCore dependency for numerical operations.
qiskit-aeroptionalHigh-performance simulators for local execution, including noise models. Recommended for simulation workflows.
qiskit-ibm-runtimeoptionalAllows submission of circuits and programs to IBM Quantum systems.
matplotliboptionalRequired for various visualization functions, e.g., plot_histogram.
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
qiskit — pip install qiskit · libregistry