Quantum Machine Learning 101

Shubham Agnihotri
7 min readAug 23, 2020

--

As part of the peer learning series, Quantum Computing India had a session on Quantum Machine Learning 101 hosted by me. Here’s a quick log of the session. In the end, you will find full video link.

Table of Contents

  • What is Quantum Machine Learning and Why do we need it?
  • What all Problems can Quantum Machine Learning Solve?
  • What is Quantum Data and how is it useful?
  • How is that data getting generated and fed?
  • What is Hybrid Quantum Classical Model?
  • Applications of Quantum Machine Learning
  • How to Learn Quantum Machine Learning?

Quantum Machine Learning

What is it & Why do we need it?

In Short Quantum Machine Learning is Machine learning performed over Quantum Computer. The properties of Quantum mechanics make it special explained later.

Quantum Machine learning is build on two concepts i.e. Quantum Data and Hybrid Quantum Classical Model.

The Problems it can solve..

Current Neural Networks are able to easily create a classification model with parallel computing. This is an easy problem and Quantum Machine Learning will not be solving this.. It is MADE FOR SOMETHING BIG. For example: Currently Facial Recognition happens in fraction of seconds and is more than 99% accurate.. QML will not be targeting this problem

Quantum Machine Learning Deal with solving probabilistic models or graph structures that are not feasible in classical computers i.e. they fall in the category of NP Hard or NP Complete problem.

In One sentence: It is used for Solving problem which have a finite input and output but infinite possibilities.

Quantum Machine Learning Consists of two parts:

  • Quantum Data
  • Hybrid Quantum Classical Model

Quantum Data

Quantum data is a type of data which exhibits entanglement and superposition leading to a probability distribution that classical computer will take exponential amount of resource to store and represent.

Understanding Quantum Data

Lets dive in to example comparing with classical computers (CC):

  • CC stores either 1 or 0 in a bit, 8 bits make a byte, 1024 bytes makes a kilo byte, etc.
  • each bit stores electric current i.e. 0 represents no current and 1 represents presence of current.
  • Qubits are basic building block of quantum computers, which stores the measure of 1 amplitude and measure of 0 amplitude. These amplitudes can be turned into probabilities when entangled with other Qubits which can represents a lot of information.

The Beauty:

  • Qubit can represents 2 bits i.e. either 1 or 0
  • If we have 2 qubits we can represents 4 bits
  • 29 Bits can represents about 540 million numbers i.e. 2²⁹ = 540 M where as 29 qubits can represent about 540 M bits.
  • So n bits is classical meaning 2ⁿ in Quantum at a time.

This big amount of resource is far beyond classical super computers.

Data is core of Machine Learning, Machine Learning requires huge amount of data, and if the data stored is in quantum space then we can store a lot of it with very less space required.

Lets take another example to understand this concept of Quantum Data

  • There are 8 wires which represents 8 bits in a Classical Computer.
  • Total amount of information that can be stored is 2⁸= 256
  • Signals in the wire can be either 0 or 1 i.e. no electricity and electricity is present.
  • In quantum information is encoded in particles like electrons. electrons can be in 2 states i.e. 0 and 1. But when we come to quantum mechanics it exhibits a property called super position which allows the electron to be partially present in both the states.
  • This means that the electron can be both in partial 0 and partial 1.
  • So instead if 2 wires a single qubit can do that task of storing two bits. Thus in this way huge amount of resources can be saved.
  • Even accessing those big amount of data via Quantum Computer will be fast.

How is that data getting generated and fed?

Quantum data is any data which is either generated by any quantum computer or any other quantum mechanical device.

Currently there is no way in which this external quantum data to the Quantum Machine.

So either it has to be classical data or has to be generated by the machine itself(as done by google to prove quantum Supremacy).

So for the Quantum Supremacy experiment Google used quantum data

Quantum Circuit

Which was prepared by Cirq Circuits using sycamore processor.

Hybrid Quantum Classical Model

Fusion resulting in Something Incredibly strong!!

It is a combination of Quantum Circuits with classical Models, leveraging the power of both computing.

Existing Libraries and their integration

This image contains the list of existing libraries where one can build their QML Solutions.

Algorithms Implemented

  • Q SVM
  • Q Means
  • QNN
  • QGANs

Q-Means

  • At a high level q-means algorithm has similar steps as that of classical k-means algorithm.
  • It is specifically developed to address clustering problem on large datasets and aimed to bring in savings with respect to time.
  • It can also be considered to be a robust version of classical k-means algorithm.

QSVM

  • In simple, Quantum feature maps are non linear transformation function to find hyperplane
  • Quantum feature maps are used to convert classical data to quantum states and build the kernel on these states.
  • once we get kernel matrix, the training is same as classical

Quantum Neural Networks

  • A QNN is a parametrized Quantum Computational model/ parameterized Quantum Circuit that is run over a Quantum Computer
  • The backpropagation for the quantum circuit is :
  • ∇_θ QuantumCircuit (θ) = QuantumCircuit( θ + s) — QuantumCircuit( θ- s)
  • here the gradient is calculated from the difference of the output produced from the shift of angle

Here σ represents the activation function.

By parameterized circuit we mean that the rotation angles of the gates are specified by the components of a classical input vector.

The flow: The output of the NN goes in as the input for the PQC which gives an output which can be used as an input for the final layers.

Applications of QML

Chemicals simulation:

One projects to in the form of quantum data and an algorithm mapped over it to form a structure that will act as vaccine for Covid 19 would be very easy in Quantum Machine Learning. The search space would be vast where as the search speed will also be fast.

Quantum Matter Simulation:

Quantum Machine learning can be used to design matter which can sustain high temperatures and has superconductivity any other properties of matter which have many body quantum effects meaning the collective behaviour of a group of interacting particles in quantum space. These behaviours are very complex in nature, and to link them to elementary laws is very difficult.

Quantum Control:

Machine Learning models can be used to design the open and closed loop controls, calibration and error mitigation.

Mostly trying to develop a device to view the quantum state before the collapse of the wave function

Quantum Communication Networks:

Use Machine learning to identify non orthogonal states to construct quantum repeaters, receivers and purification units. Basically moving towards the idea of Quantum Internet.

Dimensionality Reduction:

Support vector Machines work in hyperplanes and when the dimensions go high, classical computers fail.

But when it comes to quantum computers we can see exponential speedups. It works on feature maps and segregates them based on those maps.

Questions that may arise

Do we need classical ML skill?

Short answer: Yes

Longer One: It is a combination of Machine Learning with Quantum computing, so if you are an enthusiast and don’t know ML. Then I would recommend to get your ML concepts right because Quantum realm is complex, and this is where we are trying to fit out classical world into it. So if we don’t have a hands over it.. it will be tough..!!

Books For QML —

  • Dancing with Qubits

Required skills —

  • Passion
  • Perseverance
  • Dedication
  • Python
  • ML Algorithms
  • Linear Algebra
  • Statistics
  • Probability
  • Vectors
  • Libraries — Tensorflow/ Qiskit/ Pennylane.. anything you like

References

Quantum Machine Learning Team:

--

--