Module 3 - Quantum Computing
Module 3 - Quantum Computing
BPHYS102/202
MODULE-3
QUANTUM COMPUTING
Quantum Computing is the area of study focused on developing computing methods based on the
principle of quantum theory. Quantum computing is based on the principle of quantum
superposition. In Quantum computing, the information is encoded in quantum system such as
atoms, ions or quantum dots. One quantum rule in particular creates enormous incentives to apply
quantum mechanics to computing. The algorithms are also written based on quantum principles in
which, Shor’s algorithm for factorization and Grover’s search algorithm are basics. (Grover is an
Indian born Physicist working in Bell Labs). The process of computation is incredibly fast but it
has to be done by the help of quantum computers which are yet to be realized in practice. It is
expected that 140 digit log number could be factored a billion (109 ) times faster than classical
computation. It is so powerful that a search engine can search every part of internet in half an hour.
In the year 1965, Gordon Moore observed increasing performance in the first few generations of
the integratedcircuit (IC) technology. Moore predicted that it would continue to improve at an
exponential rate with the performance per unit cost increasing by a factor or two every 18 months
are so. The computer industry has followed this prediction since then. But actually the doubling
was occurring in every 24 months or 2 years. The following plot shows the 50 years of Moore’s
law. The question that arises is how long can Moore’s law continues to hold and what are the
ultimate limitations?. According to the semiconductor size data the size has reached 5 nanometer
in 2021. The Demise of the Transistor in the quantum scale could be expected as the dimensions
decrease further. Quantum effects can cascade it he micro scale realm causing problems for current
microelectronics. The most typical effects are Electron tunneling among the circuit lines. Thus
Quantum Computation is the option for the further generation.
1
Applied Physics for CSE Stream RNS Institute Of Technology
Information storage is bit based on voltage or Information storage is Quantum bit based on
charge etc. direction of an electron spin.
Classical computers use binary codes i.e. bits 0 or Quantum computers use Qubits i.e. 0, 1 and
1 to represent information. both of them simultaneously to run machines
faster.
Operations are defined by Boolean Operations are defined by linear algebra over
Hilbert Space and can be represented by
Algebra. unitary matrices with complex elements.
2
Applied Physics for CSE Stream RNS Institute Of Technology
Quantum bits, called qubits are similar to bits having two measurable states called 0 and 1 states.
Qubits can also be in a superposition state of these 0 and 1 states as shown in the figure. A qubit
can be in a superposition of both 0 and 1. Qubits can be expressed in quantum mechanical states
with mathematical formula, Dirac or “brac–ket” notation is commonly used in quantum mechanics
and quantum computing. The state of a qubit is enclosed in the right half of an angled bracket,
called the “ket”. A qubit |𝜓⟩ could be in |0⟩ or |1⟩ state which is the superposition of both |0⟩
and |1⟩ state.
Where α and β called the amplitude of the states which are a complex number.
Properties of Qubits
i) A qubit can be in a superposed state of the two states 0 and 1. Qubit is a superposition of both
|0⟩ and |1⟩ state is given by
|ψ⟩ = α |0⟩+ β |1⟩.
ii) If measurements are carried out with a qubit in superposed state then the results that we get will
be probabilistic unlike how it’s deterministic in a classical computer. The total probability of all
the states of the quantum system must be 100%.
i.e. |α|2 + |β|2 =1 is called Normalization rule.
iii) Owing to the quantum nature, the qubit changes its state at once when subjected to measurement.
This means, one cannot copy information from qubits the way we do in the present computers
and is known as "no cloning principle".
A Qubit can be physically implemented by the two states of an electron or horizontal and vertical
polarizations of photons as |↓⟩ and |↑⟩.
The pure state space qubits (Two Level Quantum Mechanical Systems) can be visualized using an
imaginary sphere called Bloch Sphere. It has a unit radius.
3
Applied Physics for CSE Stream RNS Institute Of Technology
The Arrow on the sphere represents the state of the Qubit. The north and south poles are used to
represent the basis states |0⟩ and |1⟩ respectively. The other locations are the superposition of |0⟩
and |1⟩ states and represented by |𝜓⟩ = α |0⟩+ β |1⟩ with |α|2 + |β|2 =1.
Thus a Qubit can be any point on the Bloch Sphere. The Bloch sphere allows the state of the qubit
to be represented unit spherical co-ordinates. They are the polar angle θ and the azimuth angle ϕ.
Case i) For φ =0 and θ=0 then |𝜓⟩ = |0⟩ which is along +z axis.
Case ii) For φ=0 and θ = 180 then |𝜓⟩ = |1⟩ which is along -z axis.
𝜋 1
Case iii) For φ =0 and θ= 2 𝑡ℎ𝑒𝑛 |𝜓⟩ = (|0⟩ + |1⟩) which is along +X axis.
√2
𝜋 1
Case iv) For φ =0 and θ= − 𝑡ℎ𝑒𝑛 |𝜓⟩ = (|0⟩ − |1⟩) which is along -X axis.
2 √2
i) Single qubit
A Single qubit has two computational basis states |0⟩ and |1⟩. It is in general written as by |𝜓⟩
= α |0⟩+ β |1⟩. Such that |α| 2 + |β| 2 =1
iii) N qubit
A multi-qubit system of N qubits has 2N computational basis states. For example a state of 3 qubits
has 23 computational basis states. Thus for N-qubit the computational basis states are denoted has
|000 … … 00⟩ |000 … . .01⟩ |10 … … .00⟩ |10 … … .01⟩ .
The wave function could be expressed in ket notation as |𝜓⟩ (ket Vector), ψ is the wave function.
𝛼
The quantum state is given by |𝜓⟩ = α |0⟩ + β |1⟩ and in matrix form |𝜓⟩ = (𝛽 ) . The matrix
1
form of the states |0⟩ and |1⟩ is given by |0⟩ = ( ) 𝑎𝑛𝑑 |1⟩ = (0)
0 1
Identity Operator
1 0
The operator of type 𝐼 = [ ] is called identity operator. When an identity operator acts on a
0 1
state vector its keeps the state intact. By analogy we study identity operator as an identity matrix.
Let us consider the operation of Identity operator on |0⟩ and |1⟩states. As per the principle of
identity operation 𝐼 |0⟩ = |0⟩ and |1⟩ = |1⟩ .
1 0 1 1
𝐼 |0⟩ = [ ] [ ] = [ ] = |0⟩
0 1 0 0
1 0 0 0
𝐼 |1⟩ = [ ] [ ] = [ ] = |1⟩
0 1 1 1
Thus the operation of identity matrix (operator) on |0⟩ and |1⟩states leaves the states unchanged.
5
Applied Physics for CSE Stream RNS Institute Of Technology
Pauli Matrices
Pauli Matrices are set of 2 × 2 matrices. Which are very much useful in the study of quantum
computation and quantum information. The pauli matrices are given by
0 1 0 −𝑖 1 0
𝜎𝑥 = 𝑋 = [ ] , 𝜎𝑦 = 𝑌 = [ ] and 𝜎𝑧 = 𝑍 = [ ]
1 0 𝑖 0 0 −1
Pauli Matrices operating on |𝟎⟩ and |𝟏⟩ States
0 1 1 0
1. 𝜎𝑥 |0⟩ = [ ] [ ] = [ ] = |1⟩
1 0 0 1
0 1 0 1
𝜎𝑥 |1⟩ = [ ] [ ] = [ ] = |0⟩
1 0 1 0
0 −𝑖 1 0
2. 𝜎𝑦 |0⟩ = [ ] [ ] = [ ] = 𝑖|1⟩
𝑖 0 0 𝑖
0 −𝑖 0 −𝑖
𝜎𝑥 |1⟩ = [ ] [ ] = [ ] = −𝑖|0⟩
𝑖 0 1 0
1 0 1 1
3. 𝜎𝑧 |0⟩ = [ ] [ ] = [ ] = |0⟩
0 −1 0 0
1 0 0 0
𝜎𝑧 |1⟩ = [ ] [ ] = [ ] = −|1⟩
0 −1 1 −1
Conjugate of a Matrix
It is possible to find the conjugate for a given matrix by replacing each element of the matrix
with its complex conjugate.
The conjugate of a complex number is found by switching the sign of the imaginary part.
The complex conjugate of 1 is just 1 and the complex conjugate of +i is −i.
1 𝑖
𝐴=[ ]
1 𝑖
1 −𝑖
𝐴∗ = [ ]
1 −𝑖
6
Applied Physics for CSE Stream RNS Institute Of Technology
Transpose of a matrix
The first row turns into the first column, second row turns into the second column.
1 𝑖
𝐴=[ ]
1 𝑖
A matrix U is unitary, if the matrix product of U and its conjugate transpose U † (called U-
dagger) produces the identity matrix.
UU† = U†U = I = 1
0 1
Let 𝑈=[ ]
1 0
0 1
Conjugate of U is 𝑈 ∗ = [ ]
1 0
0 1
Transpose of U is 𝑈 † = [ ]
1 0
0 1 0 1 0 1
𝑈𝑈 † = [ ][ ]=[ ]=𝐼
1 0 1 0 1 0
0 1 0 1 0 1
𝑈†𝑈 = [ ][ ]=[ ]=𝐼
1 0 1 0 1 0
𝑈𝑈 † = 𝐼
7
Applied Physics for CSE Stream RNS Institute Of Technology
𝛼1
𝑡ℎ𝑒𝑛 |𝜓⟩ = [ 𝛽 ] ; Row vector |𝜓⟩ = [𝛼1 , 𝛽1 ] ,Where Bra vector is a complex conjugate of ket
1
vector.
𝛼1
|𝜓 ∗⟩ = [ 𝛽 ] and |𝜓⟩† = [𝛼1 ∗ , 𝛽1 ∗ ]
1
Thus Brac is the complex conjugate of ket and conversely ket is the complex conjugate of Brac.
Two states |𝜓⟩ and |𝜙⟩ are said to be orthogonal if their inner product is Zero.
Mathematically ⟨𝜓|𝜙⟩ = 0
The two states are orthogonal means they are mutually exclusive. Like spin up and Spin down of
an electron.
1
Consider the inner product of and ⟨0|1⟩= [1, 0] [ ] = [0 + 0] = 0
0
Two states |𝜓⟩ and |𝜙⟩ are said to be orthonormal if their inner product is one.
Mathematically ⟨𝜓|𝜙⟩ = 1
QUANTUM GATES
In quantum computing a quantum logic gate is a basic quantum circuit operating on a small number
of qubits. A qubit is useless unless it is used to carry out a quantum calculation. The quantum
calculations are achieved by performing a series of fundamental operations, known as quantum
logic gates. They are the building blocks of quantum circuits similar to the classical logic gates in
conventional digital circuits.
8
Applied Physics for CSE Stream RNS Institute Of Technology
In Quantum Computing the quantum NOT gate for qubits takes the state |0⟩ to |1⟩ and vice
versa. It is analogous to the classical not gate. The Matrix representation of Quantum Not Gate is
given by
0 1
𝑋=[ ]
1 0
0 1 1 0
𝑋|0⟩ = [ ] [ ] = [ ] = |1⟩
1 0 0 1
0 1 0 1
𝑋|1⟩ = [ ] [ ] = [ ] = |0⟩
1 0 1 0
α
A Quantum State is given by 𝛼 |0⟩ + 𝛽 |1⟩ and its matrix representation is given by [β]
α 0 1 α β
X[β]=[ ] [ ]=[ ]
1 0 β α
Thus the quantum state becomes 𝛼 |1⟩ + 𝛽 |0⟩. Similarly, The input 𝛼 |1⟩ + 𝛽 |0⟩ to the quantum
not gates changes the state to 𝛼 |0⟩ + 𝛽 |1⟩. The quantum not gate circuit and the truth table are as
shown below
Input Output
|0⟩ |1⟩
|1⟩ |0⟩
𝛼 |0⟩ + 𝛽 |1⟩ 𝛼 |1⟩ + 𝛽 |0⟩
9
Applied Physics for CSE Stream RNS Institute Of Technology
Pauli Y Gate is represented by Pauli matrix 𝜎𝑦 or 𝑌. This gate Maps |0⟩ state to 𝑖 |1⟩ state and |1⟩
state to −𝑖 |0⟩ state. The Y Gate and its operation is as given below
0 −𝑖 1 0
𝑌|0⟩ = [ ] [ ] = [ ] = 𝑖|1⟩
𝑖 0 0 𝑖
0 −𝑖 0 −𝑖
𝑌|1⟩ = [ ] [ ] = [ ] = −𝑖|0⟩
𝑖 0 1 0
Quantum Y Gate
Input Output
|𝟎⟩ 𝑖|1⟩
|1⟩ -𝑖 |𝟎⟩
10
Applied Physics for CSE Stream RNS Institute Of Technology
The Z-gate is represented by Pauli Matrix or 𝑍. Z Gate maps input state |𝑘⟩ to (−1)|𝑘⟩.
The Matrix representation and the operation of Z-Gate on |0⟩ and |1⟩ are as follows
1 0 1 1
𝑍 |0⟩ = [ ] [ ] = [ ] = |0⟩
0 −1 0 0
1 0 0 0
𝑍|1⟩ = [ ] [ ] = [ ] = −|1⟩
0 −1 1 −1
(𝛼 |0⟩ + 𝛽 |1⟩) = 𝛼𝑍 |0⟩ + 𝛽𝑍 |1⟩ = 𝛼 |0⟩ − 𝛽 |1⟩
The circuit symbol and the truth table of Z-Gate are as follows
Input Output
|𝟎⟩ |𝟎⟩
|1⟩ -|1⟩
3) Hadamard Gate
The Hadamard Gate is a truly quantum gate and is one of the most important in Quantum
Computing. It is has similar characteristics of √ 𝑁𝑂𝑇 Gate. It is a self-inverse gate. It is used to
create the superposition of |0⟩ and |1⟩ states.
11
Applied Physics for CSE Stream RNS Institute Of Technology
1 1 1
The Matrix representation of Hadamard Gate is as follows 𝐻 = √2 [ ].
1 −1
The Hadamard Gate and the output states for the |0⟩ and |1⟩ input states are represented as follows.
|0⟩ H 𝟏
= √𝟐 |0⟩ +
𝟏
|1⟩
√𝟐
𝟏 𝟏
|1⟩ H = √𝟐 |0⟩ - |1⟩
√𝟐
Input Output
|0⟩ + |1⟩
|0⟩
√2
|0⟩ − |1⟩
|1⟩
√2
The phase gate turns a |0⟩ into |0⟩ and a |1⟩ into 𝑖 |1⟩ .
1 0
S=[ ]
0 𝑖
12
Applied Physics for CSE Stream RNS Institute Of Technology
1 0 1 1
𝑆 |0⟩ = [ ] [ ] = [ ] = |0⟩
0 𝑖 0 0
Similarly the effect of S gate on input |1⟩ is given by
1 0 0 0
𝑆|1⟩ = [ ] [ ] = [ ] = 𝑖|1⟩
0 𝑖 1 𝑖
The transformation of state |𝜓⟩ is given by
Input Output
|0⟩ |0⟩
|1⟩ 𝑖|1⟩
𝛑
5) T -Gate / Gate
𝟖
1 0 1 0
T= [ ] = [0
𝑖𝜋 1+𝑖]
0 𝑒 4 √𝟐
13
Applied Physics for CSE Stream RNS Institute Of Technology
1 0 1 1
T|0⟩ = [0 1+𝑖] [ ] = [ ] = |0⟩
√𝟐
0 0
1 0 0 0 1+𝑖
T|1⟩ = [0 1+𝑖] [ ] = [1+𝑖] = |1⟩
√𝟐 1 √𝟐
√𝟐
π
T -Gate is also called 8 Gate is shown below
𝑖𝜋
𝑖𝜋 −
𝑒 [𝑒 0]
8
T= 8
𝑖𝜋
0 𝑒8
1+𝑖
𝛼 |0⟩ + 𝛽 |1⟩ T 𝛂 |𝟎⟩ + 𝛃|𝟏⟩
√𝟐
Input Output
|0⟩ |0⟩
1+𝑖
|1⟩ |1⟩
√𝟐
1+𝑖
𝛼 |0⟩ + 𝛽 |1⟩ α |0⟩ + β|1⟩
√2
Multiple Qubit Gates operate on Two or More input Qubits. Usually on of them is a control qubit
and other is target qubit.
Controlled Gates
14
Applied Physics for CSE Stream RNS Institute Of Technology
The Gate with operation of kind "If ’𝐴’ is True then do ’𝐵’" is called Controlled Gate. The |𝐴⟩
Qubit is called control qubit and |𝐵⟩ is the Target qubit. The target qubit is altered only when the
control qubit state is |1⟩. The control qubit remains unaltered during the transformations.
The CNOT gate is a typical multi-qubit logic gate and the circuit is as follows.
Consider the operations of CNOT gate on the four inputs |00⟩, |01⟩,|10⟩ and |11⟩.
Here in the inputs to the CNOT Gate the control qubit is |0⟩. Hence no change in the state of
Target qubit |0⟩.|00⟩ → |00⟩
Here in the inputs to the CNOT Gate the control qubit is |0⟩. Hence no change in the state of
Target qubit |1⟩.|01⟩ → |01⟩
Here in the inputs to the CNOT Gate the control qubit is |1⟩. Hence the state of Target qubit flips
from |0⟩ to |1⟩. |10⟩ → |11⟩
15
Applied Physics for CSE Stream RNS Institute Of Technology
Here in the inputs to the CNOT Gate the control qubit is |1⟩. Hence the state of Target qubit flips
from |1⟩ to |0⟩. |11⟩ → |10⟩
2. Swap Gate
The SWAP gate is two-qubit operation. Expressed in basis states, the SWAP gate swaps the state
of the two qubits involved in the operation. The Matrix representation of the Swap Gate is as
follows
The swap gate is a combined circuit of 3 CNOT gates and the overall effect is that two input qubits
are swapped at the output. The Action and truth table of the swap gate is as follows.
16
Applied Physics for CSE Stream RNS Institute Of Technology
Input Output
|00⟩ |00⟩
|01⟩ |10⟩
|10⟩ |01⟩
|11⟩ |11⟩
3. Controlled Z Gate
In Controlled Z Gate, The operation of Z Gate is controlled by a Control Qubit. If the control
Qubit is |𝐴⟩ is equal to |1⟩ then only the Z gate transforms the Target Qubit |𝐵⟩ as per the Pauli-Z
operation.
The schematic circuit of controlled Z gate and the truth table are as follows
Input Output
|00⟩ |00⟩
|01⟩ |01⟩
|10⟩ |10⟩
|11⟩ -|11⟩
17
Applied Physics for CSE Stream RNS Institute Of Technology
4. Toffoli Gate
The Toffoli Gate is also known as CCNOT Gate (Controlled-Controlled-Not). It has three inputs
out of which two are Control Qubits and one is the Target Qubit. The Target Qubit flips only when
both the Control Qubits are |1⟩. The two Control Qubits are not altered during the operation.
The Toffolli matrix is unitary. The Toffolli Gate is its own inverse. It could be used for NAND
Gate Simulation.
18
Applied Physics for CSE Stream RNS Institute Of Technology
MODULE - 03
QUANTUM COMPUTING
1. State and explain Moore’s law. Elucidate the differences between Classical and
Quantum computing.
2. Define a bit and qubit and explain the properties of qubit.
3. Explain the representation of qubit using Bloch sphere.
4. What is an identity operator? Explain the matrix representation of 0 and 1 states and
apply identity operator I to |𝟎⟩ and|𝟏⟩ states.
5. Explain the following matrices with examples: (i) Unitary, (ii) Transpose, and (iii)
Conjugate.
𝟏 𝟒 + 𝟑𝒊
6. Check if, matrix A=[ ] is Hermitian.
𝟒 − 𝟑𝒊 𝟓
7. State the Pauli matrices and apply Pauli Matrices on the state |𝟎⟩ and|𝟏⟩.
8. Explain Orthogonality and Orthonormality with an example for each.
9. Explain Single qubit gate and multiple qubit gate with an example for each.
10. Discuss Quantum NOT gate mentioning its matrix representation and truth table.
11. Discuss Pauli’s X, Y and Z gate mentioning its matrix representation and truth table.
12. Show that Hadamard gate is Unitary.
13. Discuss the working of phase gate and T gate mentioning its matrix representation and
truth table.
14. Discuss the CNOT gate and its operation on four different input states.
19