Intro To Quantum AI
Intro To Quantum AI
Computing and ML
A ground up explanation
Harsha.B 24/08/21
Classical Computing
Basic De initions
1 0
State Vector
A state vector is a vector which
Total 2 Possibilities (0, 1) 1 0 contains all the possible states a
system can be in, and aims to points
0 1 us towards which state the system
(0) (1) currently is in
2 Bits
1 0 0 0
0 0 0 1
In a quantum computer, a
single qubit is said to be in a
superposition of 0 and 1
1 0
0 1
Qubit
0〉 1〉
{
1 0 0 0
1 0 0 1 0 0
0 1 0 0 1 0
(0) (1) 0 0 0 1
1 100% probability of being in this state (0) 0 0% probability of being in this state (0,1)
(0) 0 0% probability of being in this state (1) (1,0) 1 100% probability of being in this state (1,0)
1 0
0 1
Qubit
0〉 1〉
Q = ɑ 0 〉+ β 1 〉
Quantum Superposition
What does it mean?
0
1 0 State Vector Probability of States
1
0
ɑ |ɑ2| 00 〉
(1,0) β |β2| 01 〉
A classical 2 bit system in (1,0) state γ |γ2| 10 〉
δ |δ2| 11 〉
ɑ
γ
The sum of all these
This 2 Qubit system can be values must be equal to 1
δ represented in this manner
Q = 1/√2 0 〉+ 1/√2 1〉
This means Q has a (1/√2)2 chance of being in 0 〉and a (1/√2)2 chance of being in 1〉
50% 50%
Ψ 〉 = cos(θ/2) 0 〉+ eiɸsin(θ/2) 1〉
Here:
Regardless of how complex a qubit’s state vector is, after Eg: If we measure the following qubit 1000 times:
measurement, it will always collapse to one discrete state
Q = 1/√2 0 〉+ 1/√2 1〉
β δ
Qubit A Qubit B
A〉 B〉
Suppose we have two individual qubits having their own quantum states.
Now if we are to consider both of these qubits to be in the same system,
we will have to consider more overall possibilities of the system because
now there are 2 qubits existing simultaneously instead of single qubits.
ɑ
A
ɑδ
AB 〉= A 〉Ⓧ B 〉=
β
B
βδ
Tensor
Product
𝛄
𝛄
𝛄
We’ve looked at how Qubits are represented
Now let’s look at how they are manipulated
Quantum Gates and Circuits
How we harness the power of qubits
Quantum Circuits vs Classic Circuits
Unlike classical logic gates, quantum
logic gates will always have equal
Junctions like these are not possible in Quantum Circuits
number of inputs and outputs
ɑ
U
β
Q
This is how we can represent a quantum gate in a circuit
a b β’ c d β
U=
c d
The size of the matrix depends U
on the number of qubits we are
operating on, since here it’s one Q Q’
qubit, it’s a 2x2 matrix
Quantum Gates
The basic gates
0 1 ɑ β
Pauli-X X Action: Rotates 180o around X axis
1 0 β ɑ
Pauli-Y
0 -i ɑ
Y
-iβ
Action: Rotates 180o around Y axis
i 0 β iɑ
1 0 ɑ ɑ
Pauli-Z Z Action: Rotates 180o around Z axis
0 -1 β -β
cos(θ/2) -isin(θ/2)
cos(θ/2) -sin(θ/2)
Ry(θ) e-iθY/2
sin(θ/2) cos(θ/2)
Here is where a concept called “Gate
Exponentiation” is applied. These
three gates are considered to be
exponents of the Pauli matrices
e-iθ/2 0
Rz(θ) e-iθZ/2
0 eiθ/2
What are quantum operations doing?
ɑ ɑ’
U
β β’
a b
c d
Multiple qubit gates
When we have multiple qubits, the
required matrix to perform an
operation on this quantum state
will be bigger (In this case 4x4)
A U0
ɑ ɑ
A
U
ɑδ ɑδ
β β B U1
B
βδ βδ
4X4 Matrix If there are two separate gates acting on each qubit,
we can represent these two gates as 1 whole gate by
applying a tensor product between the two gates
U
A
U = U0 Ⓧ U1
B
𝛄
𝛄
𝛄
𝛄
Controlled Gates
A
This means that U1 is applied on
qubit B only if qubit A is set to 1
B U1
Unitary Matrices
U†U = I
This is the only constraint for a
matrix to be considered a valid
U
quantum gate!
f
Unitary Matrices
Ψ0 〉 Ψ1 〉 Ψ2 〉 Ψ3 〉
archy13/Shutterstock
Overview of the QML process
Parameterized Quantum
Gates
Classical Encoded
data Bits
6-> 110
Parameterized quantum circuits