The basics of quantum computing, associated mathematics, DJ algorithms and coding details are covered.
These slides are used in my videos https://youtu.be/6o2jh25lrmI, https://youtu.be/Wj73E4pObRk, https://youtu.be/OkFkSXfGawQ and https://youtu.be/OkFkSXfGawQ
2. Introduction
For whom?
Those who wanted to learn Quantum Computing but got
frustrated/ confused, looking at the notations and
mathematics given in textbooks & videos
Those who are not aware and/ or want to learn Quantum
Computing.
3. Introduction
Why Quantum Computing?
We are approaching physical limit of computer technology (Moore’s law - the number
of transistors on a microchip doubles every two years, though the cost of computers
is halved)
It is expected that quantum computer will solve a real-world problem that can’t be
solved with classical computer at all or in shorter time
IBM, Google, Microsoft, Honeywell and many other companies are spending a lot in
quantum computing – It is going to be big market
4. Real World Problems
Delta Airlines - reschedule flights after hurricanes
Daimler – developing advanced low cost, greener batteries
JP Morgan - improving stock trading strategies
Cambridge Quantum Computing - advance cryptography for device security (extending Shor
algorithm)
Google and IBM - improving artificial intelligence
Cleaner Fertilizer manufacturing
Drug Development
..........
https://builtin.com/hardware/quantum-computing-applications
5. Cyber Security/ Data Encryption
RSA (Rivest–Shamir–Adleman) is an algorithm used by modern computers to encrypt
and decrypt messages. The algorithm is based on the fact that finding the factors of a
large composite number is difficult (eg. 8633 has two prime factors – 89 and 97)
Approximate time taken for factorization in classical computer - 90 s for a 40-digit
number, 10 min for a 50-digit number, 2 h for a 60-digit number, 20 h for a 70-digit
number and 100 h for a 75-digit number.
Private key (kept with the bank) is a function of two prime numbers
Public key (given to customer) is a function of product of these two prime numbers
https://simple.wikipedia.org/wiki/RSA_algorithm
6. Cleaner Fertilization
Fertilizer is made by heating and pressurizing atmospheric nitrogen into
ammonia
The so-called Haber process, consumes three percent (approx.) of annual
global energy output and accounts for more than one percent of greenhouse
gas emissions
Some bacteria perform that process naturally. The active site of nitrogenase
(enzyme used by nitrogen fixing bacteria) is made up of transition metals (iron,
cobalt, and platinum) which have many electrons and the quantum mechanical
behavior of those electrons can’t be modelled on classical computers
Sundar Pichai, Google’s CEO, recently told MIT that he thinks the quantum
improvement of Haber process is roughly a decade away.
7. Quantum basics
"Anyone who claims to understand quantum theory is either
lying or crazy"
"If you think you understand quantum mechanics, you don't
understand quantum mechanics."
- Richard Feynman
8. Quantum Basics ....contd.
In classical computing, a bit has two possible states: either 0 or 1
In quantum computing, a qubit (short for “quantum bit”) is a unit of quantum
information - the quantum analogue to a classical bit
Superposition, which states that instead of holding one binary value (“0” or
“1”) like a classical bit, a qubit can hold a combination of “0” and “1”
simultaneously
In classical computing for example if there are 4 bits, then the combination of 4
bits can represent 24
=16 values in total but one value a given instant
(0000, 0001,...., 0100,.....1111)
0, 1,......... 4,........... 15
But in a combination of 4 qubits, all 16 values are possible at once.
9. Quantum Basics ....contd.
Entanglement – It is a property of two or more qubits that allows a set of qubits to
express higher correlation than is possible in classical systems
The qubits will remain linked even when they are separated by any distance
When one of the qubits is manipulated, the manipulation happens instantly to its
entangled twin. Einstein euphemistically called “spooky action at a distance”
Entanglement is also a point of weakness for quantum computers. Interference from
the outside world can break the fragile correlation (entanglement) between two or
more qubits
Any number of Qubits can be entangled as described by Greenberger–Horne–
Zeilinger state (GHZ state).
10. Qubits ....Contd.
To write the state of a classical bit, we express as 0 or 1
State of a Qubit is expressed in a different way, even when it is
measured as 0 or 1
|0 and |1
It is part of the bra-ket notation, introduced by Dirac
It means that the states are expressed in terms of vectors. The symbols |
and are called ‘ket’ and tell us that it is a column vector. Similarly, row
vector is expressed as ⟨ and | and called ‘bra’
11. Qubits
Qbit/ qubit – Quantum Bit – Physical Implementation
To create a qubit, scientists must find a spot in a material where they can access and control
these quantum properties. It can be made from molecules, atoms, electrons, ions, photons…
Superconducting loops (current oscillates back-and-forth around a circuit loop)
Trapped Ions (Lasers are used to cool and trap ions or atoms and put them in a
superposition state)
Silicon Quantum Dots (Artificial atoms are created by adding an electron to pure silicon, and
then microwaves are used to control the superposition state)
Diamond Vacancies (diamond lattice is combined with a nitrogen atom and vacancy, and a
superposition state is controlled by light)
.......
https://en.wikipedia.org/wiki/Qubit
12. Quantum Computer (HW)
Too early to have one in every home (in fact in every country)
We need a classical computer to work with a quantum computer
Quantum Computers are available for everyone at free of cost including simulators
through cloud service
Hardware Manufacturers
IBM (53, Transmon Qbit , Superconducting circuit, 18 computers)
Google (72, Superconducting circuit, 5 computers)
Honeywell (QV – 64, Ions excited by laser, 6 computers)
Riggit (128, Superconducting circuit,?)
Dwave (2048 Qbits Annealer, Superconducting loop, ?)
IonQ (79/160, Trapped ion,?)
15. Vectors & Complex numbers
Complex Numbers
Complex Numbers have real part and imaginary part
a + ib, where a is real part, b is imaginary part and 𝑖2
= −1, 𝑖 = −1
Complex conjugate of 2 + i is 2 – i and their product is a real number (5)
Euler’s formula, 𝑒𝑖𝜑
= 𝑐𝑜𝑠𝜑 + 𝑖𝑠𝑖𝑛𝜑
Vectors
Vectors are used to represent quantities that have both magnitude and
direction, and may be added, subtracted and scaled (i.e. multiplied by a
real number) for forming a vector space
The Dot Product gives a scalar (ordinary number) as answer, and is
sometimes called the scalar product
a · b = |a| × |b| × cos(θ)
|a| is the magnitude of vector a
|b| is the magnitude of vector b
θ is the angle between vector a and b
16. Simple matrix operations
Multiplication & Division by scalar
2 ∗
1 2
3 4
=
2 4
6 8
, 2 ÷
1 2
3 4
=
0.5 1
1.5 2
,
3
2
5
2
3.5
−9
2
=
1
2
3 5
7 −9
Matrix Addition & Subtraction
1 2
3 4
+
5 6
7 8
=
6 8
10 12
,
5 6
7 8
−
1 2
3 4
=
4 4
4 4
Matrix multiplication
If A is an n × m matrix and B is an m × p matrix, then the product C = AB is defined to be n x p matrix
18. Unitary Matrices
A Unitary Matrix is a complex square matrix in which its conjugate
transpose is also its inverse
Square matrix where number of rows and columns are equal
3 4
−5 1
,
1 + 𝑖 1 − 𝑖
1 − 𝑖 1 + 𝑖
,
1 0
0 1
,
5 −9 𝑒2
−𝑖
7
2
8
4 𝜋 2
Complex Conjugate & Conjugate Transpose
A =
1 + 2𝑖 −5
𝑖 2
𝐴 =
1 − 2𝑖 −5
−𝑖 2
𝐴 𝑇
=
1 − 2𝑖 −𝑖
−5 2
19. Unitary Matrices
A Unitary Matrix is a complex square matrix in which its conjugate
transpose is also its inverse
1 + 𝑖
2
1 − 𝑖
2
1 − 𝑖
2
1 + 𝑖
2
=
1
2
1 + 𝑖 1 − 𝑖
1 − 𝑖 1 + 𝑖
M𝑢𝑙𝑡𝑖𝑝𝑙𝑦𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 𝑖𝑡𝑠 𝑐𝑜𝑛𝑔𝑢𝑔𝑎𝑡𝑒 transpose,
1
4
1 + 𝑖 1 − 𝑖
1 − 𝑖 1 + 𝑖
1 − 𝑖 1 + 𝑖
1 + 𝑖 1 − 𝑖
=
1
4
4 0
0 4
=
1 0
0 1
= 𝐼2
Therefore, the conjugate transpose is its inverse
20. Unitary Matrices
All Quantum logic gates are represented by unitary matrices
and they are reversible
Applying Hadamard gate on |0 ,
𝐻|0 =
1
2
1 1
1 −1
1
0
=
1
2
1 + 0
1 − 0
=
1
2
1
1
=
|0 + |1
2
Applying Hadamard gate again on the result,
𝐻
|0 + |1
2
=
1
2
1 1
1 −1
1
2
1
1
=
1
2
1 + 1
1 − 1
=
1
2
2
0
=
1
0
= |0
21. Definitions
Euclidean space is what we are all familiar with. It is just a mathematical space (set
of objects that conform to certain rules) that agrees with our own physical world.
Hilbert space is a generalization of this idea to an infinite number (meaning more) of
dimensions having the property that it is complete or closed.
A basis of a vector space (C, R) is a minimal collection of vectors such that every
vector in that space can be expressed as a linear combination of the basis vectors
(for C2 3
2
&
4
−𝑖
, and R2 ,
1
0
&
0
1
The computational basis is simply the basis states composed by (any of) the distinct
quantum states that the qubit can be in physically and can be measured
If a and b are vectors and if their dot product a * b (written as a . b = |a| |b| cos (𝜃)
where 𝜃 is angle between the two vectors) = 0, then a and b vectors are orthogonal
(perpendicular) vectors and it happens when 𝜃 = π/2. If orthogonal vectors have unit
length (magnitude), then they are orthonormal vectors (>2?)
24. • Let us define a state of a Qubit which is not completely 0 or 1 but a combination of both
|𝑞 =
1
2
|0 +
𝑖
2
|1
• In vector form it can be represented as |𝑞 =
1
2
𝑖
2
• It can also be represented as [0.70710678+0.i 0+0.70710678i] which indicates the portion
of 0 is same as 1
• Therefore, when we measure the Qubit |𝑞 , the probability of getting 0 and 1 is same and it is
0.5
https://en.wikipedia.org/wiki/Qubit
Qubits ....contd.
25. The amplitude of the state vector contains the information on probability.
But, once measured, the state is known with certainty (0 or 1)
For example, |q = α|0 +β|1 is the state before measurement and once
measured, it collapses to 0 or 1 and will not change its state but will
behave like a classical bit
Therefore, during quantum computation, we must allow the qubits to
explore more complex states and measurements are only done when we
need to extract an output
Probability of measuring a state |q in the state |x is given by
p(|x )=|⟨x|q |2 (take the inner product of |x and the state we are
measuring (in this case |q ), then square the magnitude
Qubits Measurement
26. Multiple Qubits
Like a bit has two possible states (0 and 1), two qubits have four possible states: (00, 01, 10,
11)
|𝜓 = 𝛼|00 + 𝛽|01 + 𝛾|10 + 𝛿|11
● Probability of measuring |00 state is
𝑝(|00 ) = 00 𝜓 2
= 1 0 0 0
𝛼
𝛽
𝛾
𝛿
2
= 𝛼 2
● 𝑆𝑢𝑚 𝑜𝑓 𝑝𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦 𝑜𝑓 𝑚𝑒𝑎𝑠𝑢𝑟𝑖𝑛𝑔 𝑎𝑙𝑙 𝑠𝑡𝑎𝑡𝑒𝑠 𝑖𝑠
𝛼 2 + 𝛽 2 + 𝛾 2 + 𝛿 2 = 1
A two-qubit state |ψ is an entangled state if and only if there not exist two one-qubit states
|a = α|0 +β|1 and |b = γ|0 +𝛿|1
27. Quantum GATES
In classical computers, we have gates like
AND, OR, NAND, XOR,....
Quantum logic gates are the building blocks
of quantum circuits, like classical logic gates
are for conventional digital circuits
Gates, Symbols & Unitary Matrices
Typical Quantum Circuit (software)
28. Quantum GATES .....contd.
Hadamard Gate – widely used to set a Qubit in superposition
H =
1
2
1 1
1 −1
• It maps the basis states |0 to
|0 + |1
2
and |1 to
|0 − |1
2
• The output states are also represented as |+ and |−
respectively
29. Quantum GATES .....contd.
Controlled Not (CNOT) – work with 2 Qubits (Control & Target)
• Applying CNOT on |11 ,
1 0 0 0
0 1 0 0
0 0 0 1
0 0 1 0
x
0
0
0
1
=
0
0
1
0
which is |01
30. Quantum GATES .....contd.
X Gate (also called NOT gate)
Switches the amplitudes of the states |0 and |1 . Rotates the state
around X axis by π radians
Y & Z Gates
X, Y and Z gates are also called Pauli Gates
31. Quantum GATES .....contd.
Toffoli Gate (also called CCNOT gate)
This gate has 3-bit inputs and outputs. If the first two bits are set, it flips
the third bit
32. Until Now
Qubit can take any state – 0, 1, a combination of both
(superposition)
Qubits(n) can be entangled to get 2𝑛
states simultaneously
Minimum knowledge on mathematics is sufficient to start
States of Qubits can be manipulated to do the required
computation. Algorithms are written with Gates represented by
Unitary matrices
States of Qubits can be measured, and the outcome will be like
classical bits (one of 2𝑛
possibilities)
34. Deutsch-Jozsa Algorithm
The significance of the DJ algorithm is it was the first example
(historically) on the benefit of a quantum algorithm over classical
computation
It is an algorithm designed for execution on Quantum computers
and has the potential to be more efficient than classical algorithm by
taking advantage of the quantum superposition and entanglement
principles
35. Deutsch-Jozsa Algorithm
We are given a hidden Boolean function f , which takes as input a string of bits, and returns either 0
or 1, that is:
f:{0,1}n → {0,1}
The property of the given Boolean function is that it is guaranteed to either be constant or balanced.
A constant function returns all 0s or all 1s for any input, while a balanced function returns 0s
for half of all inputs and 1s for the other half.
Example : f(0,1,1,0) → 1,1,1,1 & f(0,1,0,1) → 0, 0,0,0 - constant
f(0,1,0,1) → 1,0,1,0 (0 for two inputs and 1 for other two inputs) - balanced
Minimum of 2 and a maximum of 2𝑛−1 + 1 queries/ invocations are required to get a probability of
success = 1 in classical approach
( eg. Results may be 0 and 1, or 0,0,0,..,1,1,1,..)
1 Query is sufficient to get the right answer in quantum approach
42. Quantum Computer (SW)
Hardware companies and some cloud service companies provide access and libraries/ tools
for working with Quantum computer/ simulator
Some of the software available now are:
IBM QISKIT
Circuit composer
Python Jupyter notebook
Google Cirq
Riggeti Forest
Microsoft Azure Quantum/ Q#
Dwave Leap/ Ocean
Amazon Braket
https://algassert.com/quirk (simulator only)
44. Summary
Oracles are used for representing block box function
Ancilla bits are extra bits being used to achieve some specific goals in
computation
States of Qubits can be manipulated to do the required computation
through gates. Algorithms are written with Gates represented by Unitary
matrices
States of Qubits are measured at the end of computation and the outcome
will be like classical bits (one of 2𝑛 possibilities).
Choose the hardware/ software which is comfortable for you
45. References
Funny Introduction on Qubit
https://www.youtube.com/watch?v=T2DXrs0OpHU
Toy Quantum circuit simulator
https://www.youtube.com/watch?v=aloFwlBUwsQ
For Quantum gates
https://en.wikipedia.org/wiki/Quantum_logic_gate
Full Quantum computing
https://www.youtube.com/watch?v=X2q1PuI2RFI&list=PL1826E60FD05B44E4
For Linear Algebra
https://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-spring-2010/video-lectures/
46. References …contd.
Textbook
Quantum Computation and Quantum Information by Michael A Nielsen and Isaax L.
Chuang
Documents
https://qiskit.org/textbook/preface.html
https://qiskit.org/documentation/getting_started.html
https://docs.microsoft.com/en-us/quantum/
47. What Next?
YOU
• You can give feedback on the videos and what you are expecting next.
• You can go through the references and other videos/ documents and
start coding…….
I
• Based on your feedback in terms of likes, subscription, replies,….on this
video, I will come back with what is needed for most of you.
• If this video does not develop much interest on quantum computing now,
I will hold on for some time……
Welcome to Quantum computing simplified. I am Kathiresan and I will take you through this series of videos.
I have made this video for addressing the need of two categories of people. The first set of people who have made an attempt to learn Quantum Computing but could not proceed after getting frustration or confusion looking at the notation and mathematics given in different sources. I also had a similar experience and I tried to give only the essential things in a simplified way so that you can start again and get into difficult areas as you progress. The second of people are those who have no idea of Quantum Computing but want to learn now. I request all of you to go through all the 4 parts of video to get complete picture and to get into programming Quantum Computers. The first set of people can skip this Introduction video if they are already aware of the content.
Let us understand why do wen need Quantum computing. We are approaching the physical limit of existing transistor technology. In the last few decades, we were getting more and more powerful computers at lower and lower cost. That will not be the situation in future as we have almost reached the limit for reducing the thickness. That means we need to look for alternate technologies in order to meet our computational need. Quantum computing is one such technologies (not the only technology). It is expected that quantum computer will solve a real-world problem that can’t be solved with classical computer at all or in shorter time. Because of this advantage, IBM, Google, Microsoft, Honeywell and many other companies are spending a lot of money in developing hardware and software for Quantum computers. It is going to be big market and it is better to get into this at the early stage.
Let us look at some of the real-world problems that are being worked currently. Delta Airlines is trying to reschedule their flights after hurricanes or any other natural calamity in a shorter time. Daimler is using QC to develop greener and low cost batteries. JP Morgan is trying to improve their stock trading strategies. In UK, people are working on how to improve cryptography. Google and IBM are using QC to improve AI/ ML. Those who are in this field will know that it takes a lot of time to train the model. Cleaner fertilizer manufacturing and drug development are the two areas where classical computers cannot do much. Like this there are many applications as given in the link. We will see little more details on two of these applications.
We have a threat on Cyber security and data encryption. Modern computers use RSA algorithm to encrypt and decrypt messages. It is based on the fact that finding the factors of a large composite number is difficult. For example, if I give 8633 and ask you to get its prime factors, you may take a day to get the numbers 89 and 97. But, if you use a computer, it may take a second or a fraction of it. But, that is for a 4 digit number. If the number of digits go up, for example if it a 40 digit number then present day compute will take 90s and if it is a 75 digit number then it may take 100hour. But a quantum computer can do it in much less time. We need to develop a better algorithm in future to avoid hacking of our passwords. You can know more about RSA algorithm, please visit Wikipedia link given here.
Today, fertilizer Fertilizer is made by heating and pressurizing atmospheric nitrogen into ammonia. It is called Haber process and the problem with the process is it consumes three percent (approx.) of annual global energy output and accounts for more than one percent of greenhouse gas emissions. At the same time, Some bacteria perform that process naturally with less power and without spoiling the environment. It uses an enzyme called nitrogenase which is made up of transition metals (iron, cobalt, and platinum) which have many electrons and the quantum mechanical behavior of those electrons can’t be modelled on classical computers. Sundar Pichai has told MIT guys that he thinks the quantum improvement of Haber process is roughly a decade away. I am sure with more people like you it can be accelerated. I hope you are convinced the need for quantum computer and let us try understand what it is.
These statements “"Anyone who claims to understand quantum theory is either lying or crazy“ and "If you think you understand quantum mechanics, you don't understand quantum mechanics.“ were made by Richard Feynman a great physicist and got noble prize for his work on quantum mechanics. He is also called father of quantum computer. The reality is we do not have understand the quantum mechanics to use quantum computer. So just try to know the theories but you don’t’ understand them. It is good if you are able to understand. It is like other physical theories – force, mass, velocity, acceleration, etc. which can be understood, felt, perceived.
In classical computing, we have bits which have two possible states: either zero or one. In QC, we have qubit, derived from quantum bit. The qubit has two great properties which make the QC powerful. The first one is Superposition, which states that instead of holding one binary value (“0” or “1”) like a classical bit, a qubit can hold a combination of “0” and “1” simultaneously. In classical computing for example if there are 4 bits, then the combination of 4 bits can represent 2^4=16 values in total but one value a given instant. We will have values from 0000 representing o to 1111 representing 15. But at any instant, we can represent one of these 16 numbers. But in a combination of 4 qubits, all 16 combinations are possible at once. Looks strange, don’t worry. You will understand this phenomenon in subsequent slides.