qiskit-machine-learning
Quantum Machine Learning
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Quantum Machine Learning
Basic Info
- Host: GitHub
- Owner: qiskit-community
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://qiskit-community.github.io/qiskit-machine-learning/
- Size: 74.4 MB
Statistics
- Stars: 847
- Watchers: 19
- Forks: 381
- Open Issues: 33
- Releases: 16
Topics
Metadata Files
README.md
Qiskit Machine Learning
<!--- long-description-skip-begin -->
What is Qiskit Machine Learning?
Qiskit Machine Learning introduces fundamental computational building blocks, such as Quantum Kernels and Quantum Neural Networks, used in various applications including classification and regression.
This library is part of the Qiskit Community ecosystem, a collection of high-level codes that are based
on the Qiskit software development kit. As of version 0.7, Qiskit Machine Learning is co-maintained
by IBM and the Hartree Center, part of the UK Science and
Technologies Facilities Council (STFC).
[!NOTE] A description of the library structure, features, and domain-specific applications, can be found in a dedicated ArXiv paper.
The Qiskit Machine Learning framework aims to be:
- User-friendly, allowing users to quickly and easily prototype quantum machine learning models without the need of extensive quantum computing knowledge.
- Flexible, providing tools and functionalities to conduct proof-of-concepts and innovative research in quantum machine learning for both beginners and experts.
- Extensible, facilitating the integration of new cutting-edge features leveraging Qiskit's architectures, patterns and related services.
What are the main features of Qiskit Machine Learning?
Kernel-based methods
The FidelityQuantumKernel
class uses the Fidelity)
algorithm. It computes kernel matrices for datasets and can be combined with a Quantum Support Vector Classifier (QSVC)
or a Quantum Support Vector Regressor (QSVR)
to solve classification or regression problems respectively. It is also compatible with classical kernel-based machine learning algorithms.
Quantum Neural Networks (QNNs)
Qiskit Machine Learning defines a generic interface for neural networks, implemented by two core (derived) primitives:
EstimatorQNN: Leverages theEstimatorprimitive, combining parametrized quantum circuits with quantum mechanical observables. The output is the expected value of the observable.SamplerQNN: Leverages theSamplerprimitive, translating bit-string counts into the desired outputs.
To train and use neural networks, Qiskit Machine Learning provides learning algorithms such as the NeuralNetworkClassifier
and NeuralNetworkRegressor.
Finally, built on these, the Variational Quantum Classifier (VQC)
and the Variational Quantum Regressor (VQR)
take a feature map and an ansatz to construct the underlying QNN automatically using high-level syntax.
Integration with PyTorch
The TorchConnector
integrates QNNs with PyTorch.
Thanks to the gradient algorithms in Qiskit Machine Learning, this includes automatic differentiation.
The overall gradients computed by PyTorch during the backpropagation take into account quantum neural
networks, too. The flexible design also allows the building of connectors to other packages in the future.
Installation and documentation
We encourage installing Qiskit Machine Learning via the pip tool, a Python package manager.
bash
pip install qiskit-machine-learning
pip will install all dependencies automatically, so that you will always have the most recent
stable version.
If you want to work instead on the very latest work-in-progress versions of Qiskit Machine Learning, either to try features ahead of their official release or if you want to contribute to the library, then you can install from source. For more details on how to do so and much more, follow the instructions in the documentation.
Optional Installs
PyTorch may be installed either using command
pip install 'qiskit-machine-learning[torch]'to install the package or refer to PyTorch getting started. When PyTorch is installed, theTorchConnectorfacilitates its use of quantum computed networks.Sparse may be installed using command
pip install 'qiskit-machine-learning[sparse]'to install the package. Sparse being installed will enable the usage of sparse arrays and tensors.NLopt is required for the global optimizers.
NLoptcan be installed manually withpip install nlopton Windows and Linux platforms, or withbrew install nlopton MacOS using the Homebrew package manager. For more information, refer to the installation guide.
Migration to Qiskit 1.x
[!NOTE] Qiskit Machine Learning depends on Qiskit, which will be automatically installed as a dependency when you install Qiskit Machine Learning. From version
0.8of Qiskit Machine Learning, Qiskit1.0or above will be required. If you have a pre-1.0version of Qiskit installed in your environment (however it was installed), you should upgrade to1.xto continue using the latest features. You may refer to the official Qiskit 1.0 Migration Guide for detailed instructions and examples on how to upgrade Qiskit.
Creating Your First Machine Learning Programming Experiment in Qiskit
Now that Qiskit Machine Learning is installed, it's time to begin working with the Machine Learning module. Let's try an experiment using VQC (Variational Quantum Classifier) algorithm to train and test samples from a data set to see how accurately the test set can be classified.
```python from qiskit.circuit.library import nlocal, zzfeaturemap from qiskitmachinelearning.optimizers import COBYLA from qiskitmachinelearning.utils import algorithmglobals
from qiskitmachinelearning.algorithms import VQC from qiskitmachinelearning.datasets import adhocdata
seed = 1376 algorithmglobals.randomseed = seed
Use ad hoc data set for training and test data
featuredim = 2 # dimension of each data point trainingsize = 20 test_size = 10
training features, training labels, test features, test labels as np.ndarray,
one hot encoding for labels
trainingfeatures, traininglabels, testfeatures, testlabels = adhocdata( trainingsize=trainingsize, testsize=testsize, n=feature_dim, gap=0.3 )
featuremap = zzfeaturemap(featuredimension=featuredim, reps=2, entanglement="linear") ansatz = nlocal(featuremap.numqubits, ["ry", "rz"], "cz", reps=3) vqc = VQC( featuremap=featuremap, ansatz=ansatz, optimizer=COBYLA(maxiter=100), ) vqc.fit(trainingfeatures, traininglabels)
score = vqc.score(testfeatures, testlabels) print(f"Testing accuracy: {score:0.2f}") ```
More examples
Learning path notebooks may be found in the Machine Learning tutorials section of the documentation and are a great place to start.
Another good place to learn the fundamentals of quantum machine learning is the Quantum Machine Learning notebooks from the original Qiskit Textbook. The notebooks are convenient for beginners who are eager to learn quantum machine learning from scratch, as well as understand the background and theory behind algorithms in Qiskit Machine Learning. The notebooks cover a variety of topics to build understanding of parameterized circuits, data encoding, variational algorithms etc., and in the end the ultimate goal of machine learning - how to build and train quantum ML models for supervised and unsupervised learning. The Textbook notebooks are complementary to the tutorials of this module; whereas these tutorials focus on actual Qiskit Machine Learning algorithms, the Textbook notebooks more explain and detail underlying fundamentals of quantum machine learning.
How can I contribute?
If you'd like to contribute to Qiskit, please take a look at our contribution guidelines. This project adheres to the Qiskit code of conduct. By participating, you are expected to uphold this code.
We use GitHub issues for tracking requests and bugs. Please
join the Qiskit Slack community
and use the #qiskit-machine-learning
channel for discussions and short questions.
For questions that are more suited for a forum, you can use the Qiskit tag in Stack Overflow.
Humans behind Qiskit Machine Learning
Qiskit Machine Learning was inspired, authored and brought about by the collective work of a team of researchers and software engineers. This library continues to grow with the help and work of many people, who contribute to the project at different levels.
How can I cite Qiskit Machine Learning?
If you use Qiskit Machine Learning in your work, please cite the "overview" paper to
support the continued development and visibility of the library. The BibTeX citation handle can be found in the
CITATION.bib file.
License
This project uses the Apache License 2.0.
Owner
- Name: Qiskit Community
- Login: qiskit-community
- Kind: organization
- Website: https://community.qiskit.org
- Repositories: 71
- Profile: https://github.com/qiskit-community
Citation (CITATION.bib)
@ARTICLE{2025arXiv250517756S,
author = {{Sahin}, M. Emre and {Altamura}, Edoardo and {Wallis}, Oscar and {Wood}, Stephen P. and {Dekusar}, Anton and {Millar}, Declan A. and {Imamichi}, Takashi and {Matsuo}, Atsushi and {Mensa}, Stefano},
title = "{Qiskit Machine Learning: an open-source library for quantum machine learning tasks at scale on quantum hardware and classical simulators}",
journal = {arXiv e-prints},
keywords = {Quantum Physics, Emerging Technologies, Machine Learning, Computational Physics},
year = 2025,
month = may,
eid = {arXiv:2505.17756},
pages = {arXiv:2505.17756},
archivePrefix = {arXiv},
eprint = {2505.17756},
primaryClass = {quant-ph},
adsurl = {https://ui.adsabs.harvard.edu/abs/2025arXiv250517756S},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
GitHub Events
Total
- Create event: 36
- Release event: 4
- Issues event: 83
- Watch event: 161
- Delete event: 33
- Issue comment event: 278
- Push event: 75
- Pull request review comment event: 50
- Pull request review event: 120
- Pull request event: 145
- Fork event: 45
Last Year
- Create event: 36
- Release event: 4
- Issues event: 83
- Watch event: 161
- Delete event: 33
- Issue comment event: 278
- Push event: 75
- Pull request review comment event: 50
- Pull request review event: 120
- Pull request event: 145
- Fork event: 45
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Manoel Marques | M****s@i****m | 194 |
| Anton Dekusar | 6****l | 86 |
| Steve Wood | 4****m | 50 |
| Christa Zoufal | o****f@z****m | 32 |
| Edoardo Altamura | 3****a | 24 |
| Julien Gacon | j****l@z****m | 15 |
| ElePT | 5****T | 12 |
| SooluThomas | s****o@g****m | 12 |
| Richard Chen | c****h@u****m | 12 |
| Declan Millar | d****r@i****m | 8 |
| M. Emre Sahin | 4****a | 8 |
| Matthew Treinish | m****h@k****g | 8 |
| Stefan Woerner | w****r@z****m | 7 |
| Eric Arellano | 1****o | 7 |
| jonvet | v****e@p****e | 4 |
| FelixLehn | 7****n | 4 |
| Gian Gentinetta | 3****n | 4 |
| Takashi Imamichi | 3****i | 4 |
| gabrieleagl | 7****l | 3 |
| david-alber | a****d@g****m | 3 |
| beichensinn | 3****n | 3 |
| andrenmelo | 4****o | 3 |
| a-matsuo | 4****o | 3 |
| Sashwat Anagolum | 4****m | 3 |
| Donny Greenberg | d****2@g****m | 3 |
| Caleb Johnson | c****4@o****m | 3 |
| Arnau Casau | 4****u | 3 |
| Rennes | d****6@g****m | 2 |
| murphytarra | 6****a | 2 |
| ebermot | 6****t | 2 |
| and 46 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 130
- Total pull requests: 317
- Average time to close issues: 4 months
- Average time to close pull requests: 20 days
- Total issue authors: 65
- Total pull request authors: 32
- Average comments per issue: 1.9
- Average comments per pull request: 2.01
- Merged pull requests: 239
- Bot issues: 0
- Bot pull requests: 82
Past Year
- Issues: 55
- Pull requests: 152
- Average time to close issues: 27 days
- Average time to close pull requests: 5 days
- Issue authors: 31
- Pull request authors: 16
- Average comments per issue: 1.16
- Average comments per pull request: 1.68
- Merged pull requests: 105
- Bot issues: 0
- Bot pull requests: 33
Top Authors
Issue Authors
- edoaltamura (26)
- woodsp-ibm (24)
- SaashaJoshi (5)
- OkuyanBoga (4)
- adekusar-drl (4)
- Herutriana44 (3)
- Jay-Patel-257 (2)
- kaistermaister1 (2)
- Next-di-mension (2)
- ironfrown (2)
- ElePT (2)
- rlosadagarcia (1)
- umairinayat (1)
- Siddharthgolecha (1)
- Ashad001 (1)
Pull Request Authors
- edoaltamura (86)
- mergify[bot] (76)
- woodsp-ibm (51)
- OkuyanBoga (22)
- adekusar-drl (8)
- arnaucasau (8)
- SanyaNanda (7)
- RishiNandha (6)
- dependabot[bot] (6)
- oscar-wallis (5)
- FelixLehn (5)
- declanmillar (4)
- Eric-Arellano (4)
- SooluThomas (3)
- ElePT (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 43,900 last-month
- Total docker downloads: 858
-
Total dependent packages: 10
(may contain duplicates) -
Total dependent repositories: 38
(may contain duplicates) - Total versions: 20
- Total maintainers: 1
pypi.org: qiskit-machine-learning
Qiskit Machine Learning: A library of quantum computing machine learning experiments
- Homepage: https://github.com/qiskit-community/qiskit-machine-learning
- Documentation: https://qiskit-community.github.io/qiskit-machine-learning/
- License: Apache-2.0
-
Latest release: 0.8.3
published 9 months ago
Rankings
Maintainers (1)
conda-forge.org: qiskit-machine-learning
- Homepage: https://github.com/qiskit-community/qiskit-machine-learning
- License: Apache-2.0
-
Latest release: 0.5.0
published over 3 years ago
Rankings
Dependencies
- Sphinx >=1.8.3,
- black *
- coverage >=4.4.0
- ddt >=1.2.0,
- discover *
- jupyter-sphinx *
- matplotlib >=2.1
- mypy >=0.780
- mypy-extensions >=0.4.3
- nbsphinx *
- networkx >=2.2,<2.6
- pylatexenc >=1.4
- pylint >=2.8.3,<2.14.0
- qiskit-aer *
- qiskit_sphinx_theme *
- reno >=3.4.0
- sphinx-autodoc-typehints <1.14.0
- sphinx-gallery *
- sphinx-panels *
- sphinxcontrib-spelling *
- stestr >=2.0.0
- dill >=0.3.4
- fastdtw *
- numpy >=1.17
- psutil >=5
- qiskit-terra >=0.20.0
- scikit-learn >=0.20.0
- scipy >=1.4
- setuptools >=40.1.0
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- ./.github/actions/install-machine-learning * composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- ./.github/actions/install-machine-learning * composite
- ./.github/actions/install-main-dependencies * composite
- ./.github/actions/run-tests * composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite