Download as pdf or txt
Download as pdf or txt
You are on page 1of 101

UNIT-V

QUANTUM
COMPUTING
CONTENT:

❖Principles of Quantum Information and Quantum computing

❖Concept of Qubit and its properties

❖Wave function in Ket notation

❖Quantum Gates
➢ Single Qubit Gates
➢ Multiple Qubit Gates

2
3
What is Quantum Computing?
• Quantum computing is the computer
technology based on the principles of
quantum theory, which explains the nature
and behaviour of energy and matter on the
quantum (atomic and subatomic) level.
• Quantum computing is essentially harnessing
and exploiting the amazing laws of quantum
mechanics to process information.
4
History of Quantum Computing
▪ “I think I can safely say that nobody understands
quantum mechanics” - Feynman
▪ 1982 - Feynman proposed the idea of creating machines
based on the laws of quantum mechanics instead of the
laws of classical physics.

▪ 1985 - David Deutsch developed the quantum turing machine,


showing that quantum circuits are universal.
▪ 1994 - Peter Shor came up with a quantum algorithm to factor
very large numbers in polynomial time.
▪1997 - Lov Grover develops a quantum search algorithm with
O(√N) complexity

5
History of Quantum Computing
• In 1994, Peter Shor devised an algorithm that could use
only 6 qubits to perform some basic factorizations ...
more cubits the more complex the numbers requiring
factorization became, of course.
• The first, a 2-qubit quantum computer in 1998, could
perform trivial calculations before losing decoherence
after a few nanoseconds.
• In 2000, teams successfully built both a 4-qubit and a
7-qubit quantum computer.
• Research on the subject is still very active, although
some physicists and engineers express concerns over
the difficulties involved in upscaling these experiments
to full-scale computing systems. 6
7
8
9
10
11
12
13
▪ Moore’ law slowing down
in 2020 it is flattened
out.

▪ Transistor cannot be
made smaller due to the
laws of Quantum
mechanics starts to take
over

▪ Post silicon era


14
15
16
17
Quantum interference in quantum computers

Quantum interference is beneficial in quantum computers and


used to perform calculations. It's important to note that
quantum computers aren't always exact systems with
definitive outcomes; instead, they employ probability to
produce approximate or most likely outcomes. Quantum
computers also calculate using qubit spin states or energy
levels, not positions.

Qubits are initially set in a quantum computer. These qubits


are then put into a superposition state. Quantum interference
can then be used to program the system
by operators or gates. The interference pushes the qubit
system probability so that the correct answer is more likely
and the incorrect answer is less likely. 18
APPLICATIONS

• Cryptography

• Artificial intelligence

• Teleportation

• Quantum
communication

19
Advantages

Faster computations:-
These type of computers can perform computation at a much
faster rate than normal computers. Quantum computers have
computation power higher than supercomputers also. They can
process data at 1000 times faster than normal computers and
supercomputers. Some calculations if performed by a normal
computer can take 1000 years is done by quantum computers in a
few seconds.
Best for simulation:-
Quantum computers are best for doing data simulation
computing. There are many algorithms created that can simulate
various things like weather forecasting, chemical simulation etc.

20
Advantages Cont.

Medicine creation:-
These type of computers can work better in the medical field. They
can detect diseases and can create a formula for medicines.
Different type of diseases can be diagnosed and tested in scientific
laboratories using these computers.
Google search:-
Quantum computers are used by Google to refine searches. Now
every search on Google can speed up by using these computers. Most
relevant results can be populated using quantum computing.
High privacy:-
These computers can make high encryption and is good at
cryptography. It is impossible to break the security of quantum
computers. Recently China has launched a satellite that uses
quantum computing and china claimed that this satellite cannot be
hacked. 21
Disadvantages

Algorithm creation:-
For every type of computation, it needs to write a new algorithm.
Quantum computers cannot work as classical computers, they
need special algorithms to perform tasks in their environment.
The low temperature needed:-
As the processing in these computers is done very deeply so it
needs a temperature of negative 460 degrees F. This is the lowest
temperature of the universe and it is very difficult to maintain
that temperature.
Not open for public:-
Due to the high range price they are not available for public use.
Also, the errors in these type of computers are high because they
are still in the development phase. Quantum computers work fine
in 10 qubits but after increasing qubits like 70 qubits, the
accuracy is not right. 22
• Decoherence
• Error correction
• Output observance
• Cost

23
What Is “Qubit”?

24
Qubit………………………..

• A classical binary bit is always in one of two states—0 or 1—while


a quantum bit or qubit exists in both of its possible states at
once, a condition known as a superposition.

• An operation on a qubit thus exploits its quantum weirdness by


allowing many computations to be performed in parallel.

• A two-qubit system would perform the operation on 4 values, a


three-qubit system on 8 and so forth.

25
26
27
Implementations of a “Qubit”
• Spin orientation of an electron
Most quantum particles behave like little magnets. We call this
property spin. The spin orientation is always pointing either
fully up or fully down but never in between. Using the spin
states of up and down, we can build a spin qubit.
= pointing up, = pointing down

28
Energy level of an atom
We can use the energy levels of electrons in neutral atoms
or ions as qubits. In their natural state, these electrons
occupy the lowest possible energy levels. Using lasers, we
can “excite” them to a higher energy level. We can assign
the qubit values based on their energy state.
= low energy state, = high energy state

29
PATH QUBIT:
The path a photon takes is another way to define a qubit. We
can actually put a photon in a superposition of being “here”
and “there”, by using beam-splitters.

= top path, = bottom path

30
Polarization of a photon.
Each photon carries an electromagnetic field
with a specific direction, known as its
polarization. The two states used to define
qubits are horizontal polarization and vertical
polarization.

= horizontal, = vertical

31
32
Wave Function Ψ(x, t)
• Gives all the information about the
particle

• Ψ 2
gives you the probability

• is a Complex vector quantity

33
Qubits
Two dimensional quantum systems are called qubits

A qubit has a wave function which we write as


ȁΨۧ

Examples:
Valid qubit wave functions:

ȁΨۧ Ψ

ȁΨۧ Ψ

Invalid qubit wave function:


ȁΨۧ Ψ
34
Measuring Qubits
A bit is a classical system with two possible states, 0 and 1

A qubit is a quantum system with two possible states and

When we observe a qubit, we get the result 0 or the result 1

0 or 1

If before we observe the qubit the wave function of the qubit

ȁΨۧ
then the probability that we observe is

and the probability that we observe is 35

“measuring in the computational basis”


Measuring Qubits Continued
new wave function
probability 0 ȁΨۧ

probability
ȁΨۧ
new wave function
1 ȁΨۧ

The wave function is a description of our system.

When we measure the system we find the system in one state


36

This happens with probabilities we get from our description


Measuring Qubits
Example:
We are given a qubit with wave function

ȁΨۧ Ψ

If we observe the system in the computational basis, then we


get outcome 0 with probability

new wave function

and we get outcome 1 with probability:

new wave function


37
Measuring Qubits
Example:
We are given a qubit with wave function
ȁΨۧ Ψ

If we observe the system in the computational basis, then we


get outcome 0 with probability

new wave function

and we get outcome 1 with probability:

38
What Is “Quantum”?

• A classical binary bit is always in one of two states—0 or 1—


while a quantum bit or qubit exists in both of its possible
states at once, a condition known as a superposition.

• An operation on a qubit thus exploits its quantum weirdness


by allowing many computations to be performed in parallel.

• A two-qubit system would perform the operation on 4


values, a three-qubit system on 8 and so forth.

39
Superposition gives quantum computers superior
computing power

Superposition allows quantum algorithms to process


information in a fraction of the time it would take even the
fastest classical systems to solve certain problems.

•The amount of information a qubit system can represent


grows exponentially. Information that 500 qubits can easily
represent would not be possible with even more than
2^500 classical bits.

•It would take a classical computer millions of years to find


the prime factors of a 2,048-bit number. Qubits could
perform the calculation in just minutes.
40
Representation of Data - Superposition

A single qubit can be forced into a superposition of the two states


denoted by the addition of the state vectors:

|> = 1 |0> + 2 |1>


Where 1 and 2 are complex numbers and |1 |2 + |  2|2 = 1

A qubit in superposition is in both of the


states |1> and |0> at the same time 41
Representation of Data - Superposition
Light pulse of
frequency  for time
interval t/2

State |0> State |0> + |1>

Consider a 3 bit qbit register. An equally weighted superposition of all


possible states would be denoted by:
1 1 1
 = 000 + 001 + ... + 111
8 8 8 42
Matrices - Introduction
Matrix algebra has at least two advantages:
•Reduces complicated systems of equations to simple
expressions
•Adaptable to systematic method of mathematical treatment
and well suited to computers

Definition:
A matrix is a set or group of numbers arranged in a square or
rectangular array enclosed by two brackets

 4 2 a b 
1 −1 − 3 0 c d 
   43

Matrices
Rectangular array of numbers

𝒂𝟏𝟏 𝒂𝟏𝟐 𝒂𝟏𝟑 ⋯ 𝒂𝟏𝒏


𝒂𝟐𝟏 𝒂𝟐𝟐 𝒂𝟐𝟑 ⋯ 𝒂𝟐𝒏
⋮ ⋮ ⋮ ⋱ ⋮
𝒂𝒎𝟏 𝒂𝒎𝟐 𝒂𝒎𝟑 ⋯ 𝒂𝒎𝒏

Each entry is an element 𝒂𝒓𝒐𝒘 ,𝒄𝒐𝒍𝒖𝒎𝒏


44
• Order of matrix

– Dimension
– Rows × columns

1 2 3
4 5 6 2×3

45
Square matrix – A matrix, where the number of rows
and columns are equal

2 3 𝑖
A= 6 3 1
0 2 5 3×3

Column matrix – A matrix with one column and any


number of rows

3
A = −𝑖
6 3×1
46
Row matrix – A matrix with one row and any number
of columns

𝐴 = −1 𝑜 𝑖 1×3

47
Matrix Operations
• Matrix addition and subtraction
– Both matrices must have same order
– Add or subtract corresponding elements
– COMMUTATIVE

3 1 0 −1 3 0
0 2 + −2 −3 = −2 −1
−4 −1 −4 −5 −8 −6

48
Matrix Operations
• Scalar multiplication
– Multiply a matrix with a
number
– Distribute
1 2 3 3 6 9
𝐴= 3 =
0 −1 −2 0 −3 −6

49
• Matrix multiplication

Number of columns in 1st = number of rows in 2nd

𝑚×𝒏 ∙ 𝒏×𝑝

Order of product m × p

Order is important

Multiplication - NOT COMMUTATIVE


50
Example

0
2 −1 7
• −2
0 6 −3 2×3
3 3 ×1

=
2 ∙ 0 + −1 −2 + 7 ∙ 3
0 ∙ 0 + 6 ∙ −2 + −3 ∙ 3 2×1

23
= 2×1
−21 51
Multiplication of a Column by a Row

A= 4 5 8 B= 2
1×3
6
Now, lets multiply A x B.
9 3×1
1x3 = 3x1

4 5 8 2 4 (2) + 5 (6) + 8(9) = 110


6
9
52
Transpose of a Matrix : Columns and rows
are interchanged

2 3 𝑖 2 6 0
𝐴= 6 3 1 𝐴𝑇 = 3 3 2
0 2 5 3×3 i 1 5 3×3

3
𝐴 = −𝑖 𝐴𝑇 = 3 −𝑖 6 1×3
6 3×1

53
Identity Matrix – This acts like the number one for matrices,
denoted with a capital I. This matrix must be a square matrix
and have the number one in the main diagonal and 0’s
everywhere else.

1 0 0
1 0 𝐼= 0 1
𝐼= 0
0 1 2×2 0 0 1 3×3

𝐴𝐼 = 𝐴 54
Complex Conjugate of a matrix : A
matrix with conjugate of the matrix
elements
0 3+𝑖
𝐴=
−𝑖 1 2×2

∗ 0 3−𝑖
𝐴 =
𝑖 1 2×2

55
Conjugate Transpose of a Matrix
0 3+𝑖
𝐴=
−𝑖 1 2×2
Step 1 : Take the
transpose
𝑇0 −𝑖
𝐴 =
3+𝑖 1 2×2
Step 2 : Take the
conjugate
𝑇 ∗ † 0 𝑖
𝐴 =𝐴 =
3−𝑖 1
56 2×2
Unitary Matrices
A matrix is unitary if

N x N identity
matrix

Equivalently a matrix is Unitary if

57
Unitary Example
Conjugate:

Conjugate
transpose:
Unitary?

58
Yes:
Vectors, Complex numbers and Matrices
“ket” is the th component of the vector

“column vector”

Example:
3 dimensional complex vectors

59
Computational Basis
Some special vectors:

Example:
2 dimensional complex vectors (also known as: a qubit!)

60
Computational Basis
Vectors can be “expanded” in the computational basis:

Example:

61
Bras and Kets
For every “ket,” there is a corresponding “bra” & vice versa

Relate to transpose of a matrix

Examples:

62
Antiket Math
Multiplied by complex number

Example:

Addition

Example:
63
Computational Bras vector
Computational Basis, but now for bras:

Example:

64
The Inner Product
Given a “bra” and a “ket” we can calculate an “inner product”

This is a generalization of the dot product for real vectors


65
Example

Complex conjugate of inner product: 66


The Inner Product in Comp. Basis

Inner product of computational basis elements:

67

Kronecker delta
The Inner Product in Comp. Basis

68
Norm of a Vector
Norm of a vector:

Equivalent to Ψ = ΨΨ 2

which is always a positive real number


it is (roughly) the length of the complex vector

Example:

69
Probability Always 1
The wave function of a N dimensional quantum system
is given by an N dimensional complex vector with norm equal
to one.

Example:
a valid wave function for a 3 dimensional quantum system

70
Orthogonality
Two vector x and y are orthogonal if they are perpendicular
to each other i.e. their dot product is 0.

71
Orthogonal states
Two states are said to be orthogonal if their inner
product is zero

𝑢𝑣 =0
OrthoNormal states

Two states are said to be orthonormal if

1. They are normalized


2. If they are orthogonal
72
QUANTUM GATES

In quantum computing and specifically the quantum


circuit model of computation, a quantum logic gate (or
simply quantum gate) is a basic quantum circuit operating
on a small number of qubits. They are the building blocks of
quantum circuits, like classical logic gates are for
conventional digital circuits.
Unlike many classical logic gates, quantum logic gates
are reversible. It is possible to perform classical computing
using only reversible gates.

Quantum gates are unitary operators, and are described


as unitary matrices relative to some basis.
73
Single Qubit Gates

74
Quantum NOT gate

75
76
Pauli-X or Quantum NOT gate

The Pauli-X gate is the quantum analog to the classical NOT gate, i.e. it
transforms a single qubit in state |0> to state |1> and vice versa. Its
symbol is usually a ‘X’ inside a square or a cross inside a circle:

Quantum circuit diagram of the Pauli-X quantum gate

Matrix representation of the Pauli-X quantum gate

Transformation of states by the Pauli-X quantum gate 77


Pauli-Y
The Pauli-Y quantum gate takes one qubit and rotates it
around the y-axis of the Bloch Sphere by π radians. Its symbol
is usually a ‘Y’ inside a square.

Matrix representation of the Pauli-Y quantum gate

Transformation of states by the Pauli-Y quantum gate

78
Pauli-Z
The Pauli-Z quantum gate takes one qubit and rotates it around
the z-axis of the Bloch Sphere by π radians. Its symbol inside a
quantum
circuit diagram is usually ‘Z’.
Matrix representation of the Pauli-Z quantum gate

Transformation of states by the Pauli-Z quantum gate


It effectively leaves the |0> state unchanged. this is also a
special case of the Phase Shift gate (with phase = π).

79
80
81
Hadamard
Quantum computing is all about making use of superposition . In order to create a
superposition, you can use the Hadamard gate which takes a single qubit and
transforms it into a perfectly balanced superposition of the |0> and |1> states
Quantum circuit diagram of the Hadamard gate

H=

Matrix representation of the Hadamard gate

Transformation of states by the Hadamard gate 82


83
84
Phase Gate or S Gate

85
86
87
88
89
90
Multiple Qubit Gates

91
Controlled Not
By the term ‘controlled’ we imply that the respective operation is only performed
in case another qubit is in the |1> state. This other qubit is called the control
qubit. In case of the Controlled Not (or CNOT) operation, we only switch the state
of the qubit if the control qubit is |1>

Quantum circuit diagram of the Controlled NOT gate

92

Matrix representation of the CNOT gate


Transformation of states by the CNOT gate (control qubit = left qubit)

Control Qubit

Target Qubit
93
Quantum Gates - Controlled NOT
▪A gate which operates on two qubits is called a
Controlled-NOT (CN) Gate. If the bit on the control
line is 1, invert the bit on the target line.
Input Output

A B A’ B’
A - Target A’
0 0 0 0

B- B’ 0 1 1 1
Control
1 0 1 0

1 1 0 1

94
Note: The CN gate has a similar behavior to the XOR gate with some
extra information to make it reversible.

95
96
Controlled Z gate

The controlled-Z or cz gate is another well-used two-qubit gate. Just as the


CNOT applies an X to its target qubit whenever its control is in state |1ۧ , the
controlled-Z applies a Z in the same case.

97
Toffoli (CNOT) Gate

The Toffoli gate is a controlled not (=CCNOT) gate.


So it only performs the not operation on a qubit if both
control qubits are in state |1>.
Toffoli gate is a 3-bit gate which is universal for
classical computation but not for quantum
computation.

Quantum circuit diagram of Toffoli gate


98
99
100
REMARKS

 Quantum computers have the potential to


revolutionize computation by making certain types
of classically intractable problems solvable.
 While no quantum computer is yet sophisticated
enough to carry out calculations that a classical
computer can't, great progress is under way.

101

You might also like