In our previous blog here we have explained the Quantum supremacy experiment. If you are not familiar with Quantum gates, QISKIT, and different algorithms, it’s applications and resources, I would recommend you to first go through the documentation of IBM-Q and QISKIT, for a detailed context. This blog is for all of you out there who are looking to get up-to-speed quickly on how to use the IBMQ and Qiskit library for running the quantum version of SVM (QSVM) on your computer. I will be talking about the Qiskit library and its uses in the coming sections.
What is QSVM?
Quantum Support Vector Machine (QSVM) is a quantum version of the Support Vector Machine (SVM) algorithm which uses quantum laws to perform calculations. QSVM uses the power of Quantum technology and quantum software to improve the performance of classical SVM algorithms that run on classical machines with CPUs or GPUs.
Quantum Machine Learning takes on two major steps -in the first step classical data is converted to quantum data with computations on the quantum computer and the second step the computer converts the quantum result back into the classical format.
Let’s take a look at the different components involved in implementing QSVM?
Kernel trick – used for classifying the dataset into various classes using SVM, which transforms the data to find an optimal boundary between the possible outputs. Data that seems hard to separate in its original space by a simple hyperplane can be separated by applying a non-linear transformation function(known as feature map) in space known as feature space. The Inner product for each pair of data points in the set is computed to assess the similarity between them and this in turn is used to classify the data points in this new feature space (the higher the value of the inner product more similar they are to each other) and this collection of inner products is called the kernel.
Qiskit consists of four foundational elements (Source):
- Qiskit Terra: used to compose the quantum programs at the level of circuits
- Qiskit Aer: accelerates the development via simulators, emulators, and debuggers
- Qiskit Ignis: to address noise and errors
- Qiskit Aqua: used to build algorithms and applications
Installing Qiskit and accessing IBM Q
Here we explain how to code a quantum computer.
For installing Qiskit, to investigating the latest algorithms click here
IBM Q Account offers access to the most advanced cloud-based IBM Q quantum systems and simulators. It helps us to develop, run and monitor jobs/programs by making a stable connection between Qiskit and Quantum computers/devices. Follow these steps to set up your Qiskit environment to send jobs to IBM Q systems.
Qiskit framework consists of three high-level steps:
- Build: design a quantum circuit to solve the problem in hand.
- Execute: run experiments on different backends
- Analyze: calculate summary statistics and visualize the results of the experiments.
To get started with the basics of Qiskit. Here is documentation and video tutorials
Now let us see how the quantum algorithm actually works?
Firstly, superposition is created using the quantum circuit. After encoding and manipulating the information using superposition, we apply interference on the superpositioned states to get the final result.