Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quantum-kittens
GitHub Repository: quantum-kittens/platypus
Path: blob/main/notebooks/quantum-machine-learning/supervised.ipynb
3855 views
Kernel: Python 3

Supervised learning

Supervised learning is the machine learning task of learning a function that maps an input to an output based on example input-output pairs. It infers a function from labeled training data consisting of a set of training examples, and its performance is calculated using a set of testing examples.

We can separate supervised learning into two types of problems: classification and regression.

  • Classification asks us to assign data into specific categories. E.g.: given a set of labeled images of chairs or tables, try to identify new photos of chairs or tables.

  • Regression asks us to understand the relationship between dependent and independent variables. It's commonly used to make predictions, e.g. given a series of historical stock prices, predict the future stock price.

The focus of much recent research in near term quantum supervised learning has been in classification, and with two methods in particular:

Quantum variational classification

Given an input set, X\mathcal{X}, and quantum Hilbert space, H\mathcal{H}, we encode data points xiX\vec{x}_i \in \mathcal{X} into quantum states using the quantum feature map, i.e. ParseError: KaTeX parse error: Undefined control sequence: \class at position 2: \̲c̲l̲a̲s̲s̲{_feature-map-e…, then process this state with a parameterized quantum circuit W(θ)W(\theta). The resultant states become ParseError: KaTeX parse error: Undefined control sequence: \class at position 2: \̲c̲l̲a̲s̲s̲{_state}{|\Psi(… where parameters are estimated by training to match the target states yi|y_i\rangle that represent the yiy_i labels of the training points.

This is covered in the next page.

Quantum kernel estimation

Given an input set, X\mathcal{X}, and quantum Hilbert space, H\mathcal{H}, data points xiX\vec{x}_i \in \mathcal{X} are encoded into a quantum state by means of the quantum feature map, i.e. UΦXHU_\Phi ∶ \mathcal{X} \rightarrow \mathcal{H}. The inner product of two quantum encoded quantum states define a kernel:

ParseError: KaTeX parse error: Undefined control sequence: \class at position 1: \̲c̲l̲a̲s̲s̲{_kernel-functi…

which is analogous to a kernel in classical machine learning.

This is covered in the Quantum kernel estimation page.

Both methods require a way to encode the data into a quantum state. There are several strategies to define the quantum feature map, or encoding, as discussed in a previous section. It is a key step in the success of the classification task, and to eventually obtain any quantum advantage, we need the feature map to be classically intractable.

References

  1. Maria Schuld and Francesco Petruccione, Supervised Learning with Quantum Computers, Springer 2018, doi:10.1007/978-3-319-96424-9.