Qiskit Machine Learning overview#

Vue d’ensemble#

Qiskit Machine Learning introduit des blocs de calcul fondamentaux, tels que Quantum Kernels et Quantum Neural Networks, utilisés dans différentes applications, y compris la classification et la régression. D’une part, ces blocs sont très faciles à utiliser et permettent aux utilisateurs d’essayer rapidement un premier modèle sans connaissances en informatique quantique particulière; d’autre part, Qiskit Machine Learning est très flexible et permet aux utilisateurs plus avancés de l’utiliser pour des recherches de pointe dans le domaine.

Qiskit Machine Learning provides the FidelityQuantumKernel class class that makes use of the BaseStateFidelity algorithm introduced in Qiskit and can be easily used to directly compute kernel matrices for given datasets or can be passed to a Quantum Support Vector Classifier (QSVC) or Quantum Support Vector Regressor (QSVR) to quickly start solving classification or regression problems. It also can be used with many other existing kernel-based machine learning algorithms from established classical frameworks.

Qiskit Machine Learning defines a generic interface for neural networks that is implemented by different quantum neural networks. Two core implementations are readily provided, such as the EstimatorQNN and the SamplerQNN. The EstimatorQNN leverages the BaseEstimator primitive from Qiskit and allows users to combine parametrized quantum circuits with quantum mechanical observables. The circuits can be constructed using, for example, building blocks from Qiskit’s circuit library, and the QNN’s output is given by the expected value of the observable. The SamplerQNN leverages another primitive introduced in Qiskit, the BaseSampler primitive. This neural network translates quasi-probabilities of bitstrings estimated by the primitive into a desired output. This translation step can be used to interpret a given bitstring in a particular context, e.g. translating it into a set of classes.

The neural networks include the functionality to evaluate them for a given input as well as to compute the corresponding gradients, which is important for efficient training. To train and use neural networks, Qiskit Machine Learning provides a variety of learning algorithms such as the NeuralNetworkClassifier and NeuralNetworkRegressor. Both take a QNN as input and then use it in a classification or regression context. To allow an easy start, two convenience implementations are provided - the Variational Quantum Classifier (VQC) as well as the Variational Quantum Regressor (VQR). Both take just a feature map and an ansatz and construct the underlying QNN automatically.

In addition to the models provided directly in Qiskit Machine Learning, it has the TorchConnector, which allows users to integrate all of our quantum neural networks directly into the PyTorch open source machine learning library. Thanks to Qiskit Algorithm’s gradient algorithms, 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.

Next Steps#

Getting started

Migration Guide