Quantum Computing: V B.Tech IDP
Quantum Computing: V B.Tech IDP
Computing
V B.Tech IDP
Overview
Data Representation
Gates - ONE,2 & 3 QUBIT QUANTUM GATES
Quantum circuits
Shor’s Algorithm
Conclusion
Introduction
Data Representation
Operations on Data
Shor’s Algorithm
Conclusion and Open Questions
Representation of Data - Qubits
A bit of data is represented by a single atom that is in one of
two states denoted by |0> and |1>(Ket notation). A single bit
of this form is known as a qubit
A physical implementation of a qubit could use the two
energy levels of an atom. An excited state representing |1>
and a ground state representing |0>.
Light pulse of
frequency for
Excited time interval t
State
Nucleus
Ground
State
Electron
State |0> State |1>
Representation of Data - Superposition
2 2
Where 1 and 2 are complex numbers and | 1 | + | 2 | = 1
Data Representation
Gates - ONE,2 & 3 QUBIT QUANTUM GATES
Quantum circuits
Shor’s Algorithm
Conclusion
Classical gates – not, swap
a b a’ b‘
0 0 0 0
0 1 1 0
1 0 0 1
1 1 1 1
Operations on Qubits - Reversible Logic
Ex.
Input Output
The AND Gate In these 3 cases,
A B C information is
0 0 0 being destroyed
A
0 1 0
C
B 1 0 0
1 1 1
H H
State State | State
0> + |1> |1>
|0>
Input Output
A - Target A’ A B A’ B’
0 0 0 0
0 1 1 1
B - Control B’ 1 0 1 0
1 1 0 1
Input Output
Carry Ones Carry Ones
Bit Bit Bit Bit
0 0 0 0
0 1 1 0
0 Carry Bit
Ones Bit
H
TOFFOLI Gate - Controlled Controlled NOT (CCN)
Input Output
A B C A’ B’ C’
A - Target A’ 0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
B - Control 1 B’ 0 1 1 1 1 1
1 0 0 1 0 0
1 0 1 1 0 1
C - Control 2 C’ 1 1 0 1 1 0
1 1 1 0 1 1
FREDKIN Gate - Controlled SWAP
Input Output
A B C A’ B’ C’
A - CONTROL A’ 0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
B – INPUT1 C’ 0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 1 0
C – INPUT2 B’ 1 1 0 1 0 1
1 1 1 1 1 1
A Universal Quantum Computer
Data Representation
Gates - ONE,2 & 3 QUBIT QUANTUM GATES
Quantum circuits
Shor’s Algorithm
Conclusion
Quantum circuits
•quite analogous to that for classical Boolean circuits.
•Like classical reversible circuits, the number of quantum
bits in must equal the number out.
•Each gate in a quantum circuit stands for a unitary
transformation on the affected q-bits, just as each classical gate
stands for a Boolean function. The unitary transformation acts
as the identity on the other bits.
Shor’s Algorithm
2 2
1. Choose an integer q such that N < q < 2N let’s pick 256
2. Choose a random integer x such that GCD(x, N) = 1 let’s pick 7
3. Create two quantum registers (these registers must also be
entangled so that the collapse of the input register corresponds to
the collapse of the output register)
• Input register: must contain enough qubits to represent
numbers as large as q-1. up to 255, so we need 8 qubits
• Output register: must contain enough qubits to represent
numbers as large as N-1. up to 14, so we need 4 qubits
Shor’s Algorithm - Preparing Data
1 255
∑ |a, 000>
√256 a=0
q-1
1
∑ |c> * e 2iac / q
√q c=0
Shor’s Algorithm - QFT
1
∑ |a> , |1>
√64 aA 1
255
∑ |c> * e 2iac / 256
√256 c=0
We compute:
Gcd(7 4/2 + 1, 15) = 5
Gcd(7 4/2 - 1, 15) = 3
We have successfully factored 15!
Shor’s Algorithm - Problems
The QFT comes up short and reveals the wrong period. This
probability is actually dependant on your choice of q. The
larger the q, the higher the probability of finding the correct
probability.
The period of the series ends up being odd
Data Representation
Operations on Data
Shor’s Algorithm
Conclusion and Open Questions
Conclusion