{ "cells": [ { "cell_type": "markdown", "source": [ "# Quantum Kernel Methods for IRIS dataset classification with [TorchQuantum](https://github.com/mit-han-lab/torchquantum).\n", "
\n", "\n", "
\n", "\n", "Tutorial Author: Zirui Li, Hanrui Wang\n" ], "metadata": { "id": "_IbXAq46NDHo" } }, { "cell_type": "markdown", "source": [ "###Outline\n", "1. Introduction to Quantum Kernel Methods.\n", "2. Build and train an SVM using Quantum Kernel Methods.\n", "\n", "In this tutorial, we use `tq.op_name_dict`, `tq.functional.func_name_dict` and `tq.QuantumDevice` from TorchQuantum.\n", "\n", "You can learn how to build a Quantum kernel function and train an SVM with the quantum kernel from this tutorial.\n" ], "metadata": { "id": "01AwyLuHUFbX" } }, { "cell_type": "markdown", "source": [ "##Introduction to Quantum Kernel Methods.\n" ], "metadata": { "id": "slU3ib_mURDX" } }, { "cell_type": "markdown", "source": [ "###Kernel Methods\n", "Kernels or kernel methods (also called Kernel functions) are sets of different types of algorithms that are being used for pattern analysis. They are used to solve a non-linear problem by a linear classifier. Kernels Methods are employed in SVM (Support Vector Machines) which are often used in classification and regression problems. The SVM uses what is called a “Kernel Trick” where the data is transformed and an optimal boundary is found for the possible outputs.\n", "\n", "\n", "####Quantum Kernel\n", "Quantum circuit can transfer the data to a high dimension Hilbert space which is hard to simulate on classical computer. Using kernel methods based on this Hilbert space can achieve unexpected performance." ], "metadata": { "id": "qJv0wED75YTq" } }, { "cell_type": "markdown", "source": [ "###How to evaluate the distance in Hilbert space?\n", "Assume S(x) is the unitary that transfer data x to the state in Hilbert space. To evaluate the inner product between S(x) and S(y), we add a Transpose Conjugation of S(y) behind S(x) and measure the probability that the state falls on $|00\\cdots0\\rangle$" ], "metadata": { "id": "d4zraAesQ2vr" } }, { "cell_type": "markdown", "source": [ "\n", "