Practical overview
When it fits
Use it when a Python project needs Qiskit-based building blocks for quantum machine-learning experiments, particularly kernel methods, QNNs, or hybrid PyTorch models.
Who it is for
- Python developers building quantum machine-learning experiments with Qiskit.
- Researchers and practitioners prototyping quantum classification or regression models.
- Developers integrating quantum neural networks into PyTorch workflows.
Documented uses
- Compute quantum kernel matrices and use them with quantum or classical kernel-based learning algorithms.
- Build and train quantum neural networks, including variational classifiers and regressors.
- Connect QNNs to PyTorch for hybrid quantum-classical neural-network workflows.
Requirements & limits
The library is open source under the Apache-2.0 license. The repository recommends installation through pip.
- The library is built on Qiskit and targets quantum hardware as well as classical simulators.
- PyTorch integration uses the optional
torchinstall extra and TorchConnector. - NLopt is required for global optimizers; sparse-array support is available through a separate optional install extra.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Qiskit Machine Learning in an existing Qiskit environment
Install the package in the Python environment where Qiskit is already installed.
Before you start
- Python environment with Qiskit installed, following Qiskit's installation instructions.
Steps
Activate the development environment where Qiskit is installed.
Run the command below.
pip install qiskit-machine-learningOptionally, install the PyTorch integration with the command below or sparse-array support with the command below.
pip install 'qiskit-machine-learning[torch]'pip install 'qiskit-machine-learning[sparse]'
Expected outcome
Qiskit Machine Learning is installed; pip automatically installs a compatible Qiskit version if one is not already present. Optional extras provide the corresponding PyTorch or sparse integration.
Guide limitations
- NLopt is required for global optimizers and is installed separately; the documented pip command is
pip install nlopton Windows and Linux, orbrew install nlopton macOS. - Qiskit has separate installation instructions for supported environments and platforms.
Set up a Qiskit Machine Learning source checkout
Install the development version from a local repository checkout, with optional editable installation or developer requirements.
Before you start
- A development environment with Qiskit installed, set up using Qiskit's source-install instructions first.
Steps
Clone the repository with the command below.
git clone https://github.com/qiskit-community/qiskit-machine-learning.gitChange into the new
qiskit-machine-learningdirectory.If you plan to run tests or linting checks, install developer requirements with the command below.
pip install -r requirements-dev.txtInstall the package with the command below, or use the command below for editable mode.
pip install .pip install -e .
Expected outcome
The checkout is installed in the development environment; editable mode applies project code changes without reinstalling.
Guide limitations
- This installs the version under development rather than the PyPI release.
- Latest project changes may require new or changed Qiskit features, so Qiskit should be installed from source first.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- qiskit-community/qiskit-machine-learning · Official homepage title · retained in its source language

