0% found this document useful (0 votes)
139 views26 pages

Module 3 Quantum Computing Quantum Gates

Uploaded by

Abid Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views26 pages

Module 3 Quantum Computing Quantum Gates

Uploaded by

Abid Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

MODULE 3 : Quantum Computing & Quantum Gates


Syllabus content (As per VTU)
Introduction to Quantum Computing
Moore’s law & its end, Differences Between Classical and Quantum Computing
Concept of Qubit, Properties of Qubits, Representation of Qubits by Bloch Sphere, Single and Two
qubits and Extension to N qubits.
Linear Algebra, Column and Row Matrices,Dirac Representation and Matrix Operations, Matrix
Representation of 0 and 1 States.
Identity Operator, Pauli Matrices, Conjugate of a Matrix, Transpose of a Matrix, Hermitian, Unitary
Matrix,
Inner Product - Multiplication of Row and Column Matrices, Probability, Orthogonality,
Orthonormality.
Quantum Gates, Introduction to Quantum Gates
Single Qubit Gates; Quantum Not Gate, Pauli-X,Y and Z Gates, Hadamard Gate, Phase Gate or S Gate
T Gate or 8 Gate
Multiple Qubit Gates; Controlled Gates, Controlled Not Gate or CNOT Gate, Swap Gate, Controlled Z
Gate, Toffoli Gate

1|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Introduction
Quantum Computing is the area of study focused on developing computing methods based on the
principle of quantum theory. Quantum Physics explains the nature and behaviour of energy and
matter on the quantum (atomic and subatomic) scale. Elementary particles such as protons,
neutrons and electrons can exist in two or more states at a time. This fundamental behaviour is
utilized in designing the quantum computation processing units. Quantum computing uses a
combination of bits of 1’s, 0’s and both 1 and 0 at a time to perform computational tasks with
greater efficiency.
In Quantum computing, the information is encoded in quantum system such as atoms, ions or
quantum dots.

Moore’s law & its end


In 1965, Gordon E. Moore—co-founder of Intel—postulated that “the number of transistors in a IC
chip doubles about every eighteen months”. This is also known as Moore's Law.
Moore made this statement based on noticing emerging trends in chip manufacturing industry and
his prediction became the golden rule known as Moore's Law. Moore predicted that it would
continue to improve at an exponential rate for every 2 years. Semiconductor industry has followed
his prediction to guide long term planning and to set targets for R&D since then functioning to some
extent. Here is a graphical representation.

According to Moore’s law, the number of transistors per integrated circuit chip is doubles
approximately every 18 – 24 months. The present limit is approximately 10 8 transistors per chip and
the typical size of circuit components is of the order of 100 nanometers. That means, we have
reached the atomic size for storing a single bit of information and quantum effects have become
unavoidably dominant. Taking all these factors into consideration, it is necessary to look for

2|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

alternative ways of computing methods. One such alternative is quantum computing. Quantum
computers are based on quantum bits (qubits) and use quantum effects like superposition and
entanglement to their benefit, hence overcoming the problems of classical computing.

Differences between classical and quantum computing


Key points classical computing quantum computing
Basis of Large scale multipurpose computer High speed computer based on quantum
computing based on classical physics. mechanics.
Information Bit-based information storage using Quantum bit-based information storage
storage voltage/charge. using electron spin or polarization.
Bit values Bits having a value of either 0 or 1 can Qubits have a value of 0, 1 or sometimes
have a single value at any instant. linear combination of both, (a property
known as superposition).
Number of The number of possible states is 2 The number of possible states is infinite
possible which is either 0 or 1. since it can hold combinations of 0 or 1
states along with some complex information.
Output Deterministic (repetition of Probabilistic (repetition of computation on
computation on the same input gives superposed states gives probabilistic
the same output) answer)
Gates used for Logic gates (AND, OR, NOT, etc.) Quantum gates (X, Y, Z, H, CNOT etc.)
processing
Operations Operations use Boolean Algebra. Operations use linear algebra and are
represented with unitary matrices.
Circuit Circuit implemented in macroscopic Circuits implemented in microscopic
implementati technologies technologies.
on
Data Data processing is carried out by logic Data processing is carried out by quantum
processing and in sequential order. logic at parallel instances.

Concept of bit and qubit and its properties of quibits:


Bit: A digital computer stores and processes information using bits which can be either 0 or
1. Physically, a bit can be anything that has two distinct configurations: one represented by
“0”, and the other represented by “1”. It could be a system with two distinct and
distinguishable possibilities. In modern computing and communications, bits are

3|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

represented by the absence or presence of an electrical signal, encoding “0” and “1”
respectively.
Qubit is the physical carrier of quantum information. It is the quantum version of a bit, and
its quantum state can be written in terms of two levels, labelled |0⟩ and |1⟩.
| ⟩ this notation is known as ‘ket’ notation and  | is known as ‘brac’ notation. Both are
together called as Dirac notations ‘Ket’ are analogous to a column vector. They are also
called basis vectors and represented by two-dimensional column vectors as follows

⟩ ⟩

The qubit can be in any one of the two states as well as in the superposed state
simultaneously. In quantum computation two distinguishable states of a system are needed
to represent a bit of data.
For example, two states of an electron orbiting a single atom. Spin up is taken as |1⟩ and
spin down is taken as |0⟩. Similarly ground state energy level is |0⟩ and excited state level is
|1⟩
Superposition of two states:
The difference between qubits and classical bits is that a qubit can be in a linear
combination (superposition) of the two states |0⟩ and |1⟩.
For ex, if  and  are the probability amplitudes of electron in ground state (ie, in |0⟩ state)
and in excited state (ie, in |1⟩ state) then the linear combination of two states is
|ψ⟩ = α |0⟩ + β|1⟩
The numbers α and β are complex but due to normalization conditions
|∝|2 + | |2 = 1.
Here |∝|2 is the probability of finding | ⟩ in state |0⟩ and
| |2 is the probability of finding | ⟩ in state |1⟩.
So, that when a qubit is measured, it only gives either ‘0’ or ‘1’ as the measurement result –
probabilistically.
Consider the following example of qubit representation

⟩ ⟩ ⟩

∴∝= =

|∝|2 = | |2 = 1/2

4|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

This means that with 50% probability the qubit will be found in |0⟩ state as well as in |1⟩
state. The superposed states are also called as space states where as |0⟩ and |1⟩ are called
basis states.

Properties of qubits
1. Qubits make use of discrete energy state particles such as electrons and photons.
2. Qubits exists in two quantum state |0⟩ and |1⟩ or in a linear combination of both
states. This is known as superposition.
3. Unlike classical bits, qubit can work with the overlap of both 0 & 1 states.
For ex, a 4-bit register can store one number from 0 to 15 (because of 2 n = 24=16),
but 4-qubit register can store all 16 numbers.
4. When the qubit is measured, it collapses to one of the two basis states |0⟩ or |1⟩
5. Quantum entanglement and quantum tunnelling are two exclusive properties of
qubit.
6. State of the qubits is represented using Bloch sphere.

Representation of Qubits by Bloch Sphere: (single qubit state)


Bloch sphere is an imaginary sphere which is used to represent pure single-qubit states as a point
on its surface. It has unit radius. Its North Pole and South Pole are selected to represent the basis
states namely |0⟩ and |1⟩. North Pole represents |0⟩ (say spin up) and South Pole represents |1⟩
(say spin down ). All other points on the sphere represent superposed states (ie, state space).
Bloch sphere allows the state of a qubit to be represented in spherical coordinates (ie, r,  and ). It
is as follows

5|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

The state qubit |ψ⟩ on the Bloch sphere makes an angle  with z-axis and its projection
(azimuth) makes angle  with x-axis as shown. It is clear from the fig that 0 <  <  and
0 <  < 2.
|ψ⟩ is represented as
|ψ⟩ = α |0⟩ + β|1⟩
It can be proved that
|Ψ⟩ = ( /2) |0⟩ + ( /2) |1⟩ − − − (1)
Using this equation we can represent |ψ⟩ for different  and  as follows
Case-1: let  = 0 and  = 0, then eq (1) becomes
0
|Ψ⟩ = 0|0⟩ + 0|1⟩ = |0⟩ + 0
∴ |Ψ⟩ = |0⟩
Case-2: let  =  and  = 0, then eq (1) becomes
0
|Ψ⟩ = ( /2)|0⟩ + ( /2)|1⟩ = 0 + |1⟩
∴ |Ψ⟩ = |1⟩
Case-3: let  = /2 and  = 0, then eq (1) becomes
0
|Ψ⟩ = ( /4)|0⟩ + ( /4)|1⟩

⟩ ⟩ ⟩
⟩ ⟩

Case-4: let  = /2 and  = , then eq (1) becomes


|Ψ⟩ = ( /4) |0⟩ + ( /4) |1⟩

⟩ ⟩ ⟩
⟩ ⟩

In the above discussion we have represented only single qubit state. Bloch sphere is a nice
visualization of single qubit states.

Representation of Multiple Qubits (Two qubits and Extension to N qubits):


Two qubits:
Consider two qubits. They can be in any one of four possible states represented as |00⟩,
|01⟩, |10⟩ and |11⟩.

6|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

|00⟩= |01⟩= |10⟩= |11⟩=

The state qubit is (ie, linear combination of these four)


|⟩ = 00|00⟩ + 01|01⟩ + 10|10⟩ + 11|11⟩
For 2 qubit system we have 4 complex amplitudes namely 00, 01, 10 and 11. According to
normalization condition
2 2 2 2
| 00| +| 01| +| 10| +| 11| =1
Similarly if there are 3 qubits there will be 8 complex amplitudes.
In general for N qubits, there will be having 2N complex amplitudes. This means that a basis
state is represented by a number 0 to 2N-1.
The superposition state is represented as

⟩ ⟩

Qubit has two quantum states similar to the classical binary states. The qubit can be in any
one of the two states as well as in the superposed state simultaneously.

Dirac representation and Matrix operations:


In Quantum mechanics, Bra-Ket notation is a standard notation for describing quantum
states. The notation | ⟩ is known as ‘ket’ notation and  | is known as ‘bra’ notation. Both
are together called as Dirac notations.
Matrix representation of 0 and 1 states:
Consider a quantum state in a vector space represented by | ⟩. The notation |⟩ indicates that the
object is a vector and is called a ket vector. The examples of such ket vectors are like | ⟩, | ⟩ and
| ⟩ etc.
The wave function could be expressed in ket notation as | ⟩ (ket Vector), is the wave function.
Hence, any arbitrary state can be represented as

⟩ or |ψ⟩ = α |0⟩ + β |1⟩

The ‘ket’ vector typically represented as a column vector and ‘bra’ vector typically
represented as a row vector. The matrix for of the states |0⟩ and |1⟩ as follows;

⟩ ⟩ ket notations

⟨0| = [1 0] ⟨1| = [0 1] − − − − − bra notations

7|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Operators and matrices:


An operator is a mathematical rule that transform a given function into another function.
Consider an operator ‘A’ transforms the vector |a⟩ to another vector | ⟩, it can be written
as
⟩ ⟩
There are different types of operators like Linear operator, Identity operator, Null operator,
Inverse operator, Singular & non-singular operator etc.

Identity operator I :
The identity operator is an operator which, operating on a function, leaves the function
unchanged i.e. | ⟩ = | ⟩ It is given in matrix form by

This is also called as identity matrix. There will be no change when I operate on either |0⟩
state or |1⟩ state. It is explained as follows

∴ ⟩ ⟩
Similarly

∴ ⟩ ⟩
Identity matrix acts as number 1. It is always a square matrix.
Conjugate matrices:
If the elements in a matrix A are complex numbers, then the matrix obtained by the
corresponding conjugate complex elements is called the conjugate of A and is denoted by
∗.
For example

if then


if then

Transpose matrices
If columns and rows of a matrix A are interchanged then the resultant matrix is transpose of A and
represented as AT .

8|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

For example ,

if then


if then

Hermitian matrices:
The transpose of complex conjugate of a matrix is known as Hermitian operator and the
resultant matrix is known as Hermitian matrix. It is represented by
Let A be a matrix, A* be its complex conjugate and ∗ is its transpose then its Hermitian
matrix is = ∗T


if then

Unitary matrices:
Matrix A is said to be unitary if it produces an identity matrix I when multiplied by its
conjugate transpose
In other words, A is a unitary matrix if its conjugate transpose is equal to its reciprocal, ie

we can show that

Column and Row Matrices and their inner product:


The Column Vectors are called ket Vectors denoted by | ⟩ and are represented by Column
Matrices.
The Row Vectors are called Bra Vectors denoted by ⟨ | and are represented by Row
Matrices.
Let us consider a ket vector represented in the form of a column matrix.

The Row Matrix is represented as


∗ ∗

∗ ∗
Here,

Thus the Bra is the complex conjugate of ket and vice versa.

9|P age
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Inner product: The inner product of two vectors U and V in the complex space is a
function that takes U and V as inputs and produces a complex number as output.
In terms of Dirac notation, the inner product is given as ⟨ | ⟩ = C
In matrix form U and V are written a

⟩ ⟩

Their inner product is written as ⟨ | ⟩, but ⟨ | is equal to conjugate transpose of | ⟩


, ⟨ |=| ∗⟩−1 = | ⟩† = [ ∗ ∗
1 1 ]

∴⟨ | ⟩=[ 1
∗ ∗
1 ] = ∗
1 2 + ∗
1 2

The square root of the inner product of a vector with itself is also called as norm or the

length of the vector. It is given by


: Find the inner product of

⟩ ⟩

First we shall find the conjugate transpose of | ⟩


∗⟩


∴ ⟨ |= ⟩ =

∗ ∗

Orthogonality:
If the inner product of two vectors is equal to 0 then they are said to be orthogonal (or
perpendicular) to each other.
If ⟨ | ⟩ = 0 then | ⟩ and | ⟩ are perpendicular.
Consider,

⟩ ⟩

⟨ ⟩

Hence |0⟩ is perpendicular to |1⟩

10 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

The most important property of the inner product of a vector with itself is equal to one ie,
⟨ | ⟩=1
This is known as normalization condition. The physical significance of normalization is that
the "probability amplitude" of the quantum system

Orthonormality: If each element of a set of vectors is normalized and the elements are
orthogonal with respect to each other, we say the set is orthonormal.

Consider the set ⟩ ⟩

⟨ ⟩ normalized

⟨ ⟩ orthogonal

⟨ ⟩ normalized

⟨ ⟩ orthogonal

Hence set of |0 and |1 is orthonormal.


From the above relations, if states | ⟩ and | ⟩ are said to be orthonormal if
1. | ⟩ and | ⟩ are normalized.
2. | ⟩ and | ⟩ are orthogonal to each other.

Probability
Let us consider a Quantum State
| ⟩= |0⟩ + |1⟩

The inner product ⟨ | ⟩ is given by

⟨ ⟩ ∗ ∗ ∗ ∗

∗ ∗


This could also be written as
Thus the above equation represents Probability Density. As per the principle of
Normalization
∗ ⟨ ⟩
Thus it implies | ⟩ is normalized.

11 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Pauli Matrices:
These are the 2 × 2 complex matrices introduced by Pauli in order to account for the
interaction of the spin with an external electromagnetic field. They are given by

Properties of Pauli matrices:


 Square Pauli matrices gives identity matrix I

Similarly,

 Pauli matrices are unitary matrix.


† = 1, †=1 and †=1
 Pauli matrices are Hermitian:
Let A be a matrix, A* be its complex conjugate and † is its transpose. If A = † then the
matrix is Hermitian.

Operation of Pauli Matrices on 0 and 1 states


Three Pauli matrices X, Y and Z operates on states |0 and |1 as follows
 X operating on |0 and |1

 

 

 

 
Since X inverts each input (ie, |0 becomes |1 and |1 becomes|0).

12 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

It is also called as bit-flip gate.


If a superposed qubit goes through X gate, the result will be

⟩  

⟩  
 Y operating on |0 and |1

 

 

 

 
If a superposed qubit goes through Y gate, the result will be

⟩  

⟩  
 Z operating on |0 and |1

 

 

 

 
If a superposed qubit goes through Y gate, the result will be

⟩  

⟩  
Quantum Gates:
A quantum gate is a very simple computing device that performs quantum operation on
qubits. Quantum gates are one of the essential parts of a quantum computer and are the
building blocks of all quantum algorithms.

Quantum gates are mathematically represented as transformation matrices which operate


on inputs to give outputs.

13 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

There are different types of quantum gates. Single-qubit gates and multiple qubit gates.
These gates can flip a qubit from 0 to 1 as well as allowing superposition states to be
created.

Single-Qubit Gates:
Single qubit inputs are |0⟩ to |1⟩ and can be represented by matrix forms as

 

Single Qubit Gates are X- gate, Y-gate, Z- gate, H –gate, S-gate, T-gate.

1. X – Gate or Quantum Not Gate


X-gate is the single qubit input gate and is also called as Pauli X – gate or quantum
NOT gate.
The Matrix form of X is given by

Action of the X-gate on inputs: When X gate operates of inputs |0, |1, ⟩;
When X operates on |0 and |1 the output will be inverted (ie,|0 becomes |1 and
|1 becomes|0)

 

 

 

 
Since X inverts each input it is also called as bit-flip gate.
If a superposed qubit goes through X gate, the result will be

⟩  

⟩  
Gate representation is

|0⟩ + |1⟩ X |1⟩ + |0⟩

14 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Truth table is
X -gate
Input Output
|0⟩ |1⟩
|1⟩ |0⟩
|0⟩ + |1⟩ |1⟩ + |0⟩

2. Y – Gate : Y-gate is the single qubit input gate. This is also called as Pauli Y – gate.
The matrix form of Y gate is

Action of Y gate on inputs : When Y operates on |0 and |1

 

 

 

 
If a superposed qubit goes through Y gate, the result will be

⟩  

⟩  
Gate representation is

|0⟩ + |1⟩ Y |1⟩− |0⟩

Truth table is

Y -gate
Input Output
|0⟩ |1⟩
|1⟩ − |0⟩
|0⟩ + |1⟩ |1⟩− |0⟩

15 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

3. Z – Gate : Z-gate is the single qubit input gate. This is also called as Pauli Z – gate.
The matrix form of Z gate is

Action of Z gate on inputs: When Z operates on |0 and |1 the phase will change.
Hence this is also called as phase-flip gate

 

 

 

 
If a superposed qubit goes through Y gate, the result will be

⟩  

⟩  
Gate representation is

|0⟩ + |1⟩ Z |0⟩ − |1⟩

The truth tables for X, Y and Z gates are as follows;

Z-gate
Input Output
|0⟩ |0⟩
|1⟩ -|1⟩
|0⟩ + |1⟩ |0⟩ − |1⟩

4. Hadamard Gate (H-gate) – It is a single qubit gate and is also gate to

superposition. H gate acts on single qubit input and produce superposition state
output. Matrix form of H gate and its symbol is

16 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Action of H gate on inputs:


Let us find out what happens when Hadamard gate operates on a qubit that is in the
|0⟩ state

 ⟩ ⟩

⟩ ⟩

Let us find out what happens when Hadamard gate operates on a qubit that is in the
|1⟩ state.

 ⟩ ⟩

⟩ ⟩

If a superposed qubit goes through H gate, the result will be

 ⟩ ⟩

⟩ ⟩ ⟩ ⟩

Gate representation is

|0⟩ + |1⟩ H ⟩ ⟩ ⟩ ⟩
o
The truth table is as follows
Input Output
⟩ ⟩
|0⟩

⟩ ⟩
|1⟩

⟩ ⟩ ⟩ ⟩
|0⟩ + |1⟩

17 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Note: Difference between X, Y, Z and H gates is that in X, Y and Z gates, output is in


single state whereas in H gate output is superposed state.
5. Phase Gate (S Gate):
It is a single qubit gate. The Phase gate or S gate is a gate that transfers |0⟩ into |0⟩
and |1⟩ into |1⟩. The matrix form of S gate is

Action of S gate on inputs:


Consider S gate apply to a state |0⟩ it will remain same

 ⟩

 ⟩
If S gate apply to a state |1⟩ it will be transformed into |1⟩

 ⟩

 ⟩
S gate apply to the state |0⟩ + |1⟩ it transforms to the state |0⟩ + |1⟩

 ⟩ ⟩
The S gate representation is as follows

|0⟩ + |1⟩ S ⟩ ⟩
Input Output

The truth table is as follows


Input Output
|0⟩ ⟩
|1⟩ ⟩
|0⟩ + |1⟩ ⟩ ⟩

6. T- Gate : It is a single qubit gate and it is also called π/8 gate.


Its matrix form is

18 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Action of T gate on inputs:


If T gate operates on input is |0⟩ then the output is also |0⟩

 ⟩

 ⟩
If T gate operates on input is |1⟩ then the output is also |1⟩

 ⟩

 ⟩
If T gate operates on superposed state |0⟩ + |1⟩, It transforms to |0⟩ +
|1⟩

 ⟩ ⟩

 ⟩ ⟩
T Gate representation is

|0⟩ + |1⟩ T ⟩ ⟩⟩

The truth table is as follows


Input Output
|0⟩ ⟩
|1⟩ ⟩
|0⟩ + |1⟩ ⟩ ⟩

Multiple Qubit gates: Quantum gates operating on multiple qubits are called as multiple
qubit gates. Multiple Qubit Gates operate on Two or More input Qubits. Multiple qubit
consists of control gate and target gate. The action of gate as follows;

i) The Target qubit is altered only when the control qubit is |1⟩, and

ii) The control qubit remains unaltered during the transformations.

For two qubits, inputs qubits are |00⟩,|01⟩,|10⟩ and |11⟩

For three qubits, inputs qubits are |000⟩, |001⟩, |010⟩, |011⟩, |100⟩, |101⟩, |110⟩ and |111⟩

19 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

In multiple qubit gate, the input qubit applied in the form like | ⟩, first term | ⟩ goes to
control qubit and the second term | ⟩ goes to target qubit.

Some of the multiple qubit gate are as follows; Controlled gate (CNOT gate), Swap gate,
Controlled Z gate and Toffoli gate (CCNOT gate)

1. Controlled Gate (CNOT)


The CNOT gate is a two-qubit operation, where the first qubit is referred as the
control qubit | ⟩ and the second qubit as the target qubit | ⟩. If the control
qubit is |1⟩ then it will flip the target qubit state from|0⟩ to |1⟩ or from |1⟩ to
|0⟩. When the control qubit is in state |0⟩ then the target qubit remains
unchanged.
The symbolic representation is as follows. The upper line represents control
qubit and bottom line represents target qubit.

In the combined qubit, first term is control qubit and the second term is target
qubit. For ex, in | ⟩, A is control qubit and B is target qubit
Matrix form of CNOT Gate is given by

The Transformation could be expressed as | , ⟩ → | , ⊕ ⟩


Action of the gate: Consider the operations of CNOT gate on the four inputs
|00⟩,|01⟩,|10⟩ and |11⟩.
i) Operation of CNOT Gate for input |00⟩: |00⟩ → |00⟩
Here, control qubit is |0⟩. Hence no change in the state of Target qubit
|0⟩.

20 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

ii) Operation of CNOT Gate for input |01⟩: |01⟩ → |01⟩


Here, control qubit is |0⟩. Hence no change in the state of Target qubit
|1⟩
iii) Operation of CNOT Gate for input |10⟩: |10⟩ → |11⟩
Here, control qubit is |1⟩. Hence the state of Target qubit flips from |0⟩ to
|1⟩.
iv) Operation of CNOT Gate for input |11⟩: |11⟩ → |10⟩
Here control qubit is |1⟩. Hence the state of Target qubit flips from |1⟩
to |0⟩.

The Truth Table of operation of CNOT gate is as follows.

Input Output
|00⟩ ⟩
|01⟩ ⟩
|10⟩ ⟩
|11⟩ ⟩

2. Swap Gate:
SWAP gate is a two qubit operation gate and swaps the state of the two qubits
involved in the operation. It contains 3 CNOT gates.
The Matrix representation of the Swap Gate is as follows

The schematic symbol of swap gate circuit and its equivalent is shown in figure below.

21 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

The swap gate is a combined circuit of 3 CNOT gates (1 st CNOT gate, 2nd CONT gate and
3rd CNOT gate) and the overall effect is that two input qubits are swapped at the output.
Gate representation is

The Action of the swap gate is as follows.

v) Operation of SWAP Gate for input |00⟩: |00⟩ → |00⟩


vi) Operation of SWAP Gate for input |01⟩: |01⟩ → |01⟩
vii) Operation of SWAP Gate for input |10⟩: |10⟩ → |11⟩
viii) Operation of SWAP Gate for input |11⟩: |11⟩ → |10⟩

Gate Input to the gate Output of the gate


1 ⟩ ⊕ ⟩

2 ⊕ ⟩ ⊕ ⟩

3 ⊕ ⟩ ⟩
Truth table of the swap gate

Input Output
|00⟩ ⟩
|01⟩ ⟩
|10⟩ ⟩
|11⟩ ⟩

22 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

3. Controlled Z Gate: In Controlled Z Gate, The operation of Z Gate is controlled by a

Control Qubit. If the control Qubit is | ⟩ = |1⟩ then only the Z gate transforms the Target
Qubit | ⟩ as per the Pauli-Z operation. The action of Controlled Z-Gate could is specified
by a matrix as follows.

The controlled Z gate representation as follows.

Action of controlled Z gate is

ix) Operation of the Gate for input |00⟩: |00⟩ → |00⟩


Control qubit is |0⟩, Z gate remains unchanged.
x) Operation of the Gate for input |01⟩: |01⟩ → |01⟩
Control qubit is |0⟩, Z gate remains unchanged.
xi) Operation of the Gate for input |10⟩: |10⟩ → |10⟩
Control qubit is |1⟩, Z gate remains unchanged.
xii) Operation of the Gate for input |11⟩: |11⟩ → -|11⟩
Control qubit is |1⟩, Z gate flips the state from |1⟩ to -|1⟩.

Truth table of the controlled Z gate

Input Output
|00⟩ ⟩
|01⟩ |01⟩
|10⟩ |10⟩
|11⟩ ⟩

23 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

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 matrix representation the Gate is,.

Gate representation:

|a⟩ |a’⟩
==
|a’ |b⟩ |b’⟩

|c⟩ ⟩
|c’⟩=

Truth Table of Toffoli Gate.

Input to the gate |abc⟩ Output of the gate |a’b’c’⟩


|100⟩ |100⟩
|001⟩ |001⟩
|010⟩ |010⟩
|011⟩ |011⟩
|100⟩ |100⟩
|101⟩ |101⟩
|110⟩ |111⟩
|111⟩ |110⟩

24 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme

Questions from VTU Model and previous Question Paper.

1. Explain the representation of qubit using Block sphere.


2. Explain Moore’s law and its end.
3. Define bit and qubit. Explain the properties of qubit.
4. Elucidate the difference between classical computing and quantum computing.
5. Explain the matrix representation of 0 and 1 states and apply identity operator to |0⟩
and |1⟩.
6. State Pauli Matrices. Apply Pauli matrices on the states |0⟩ and |1⟩.
7. Explain Hadamard Gate. Apply Hadamard Gate on the states |0⟩ and |1⟩.
8. Discuss the CNOT gate and its operation of four different input states.
9. Explain single qubit gate and multiple qubit gate with an example for each.
10. Discuss the working of controlled Z gate mentioning the matrix representation and
truth table.
11. Discuss the working of Phase gate mentioning the matrix representation and truth
table.
12. Discuss the working of Swap gate mentioning the matrix representation and truth
table.
13. Discuss the working of Toffoli gate mentioning the matrix representation and truth
table.
14. Explain orthogonality and orthonormality with an example for each.
15. Find the inner product of states |11⟩ and |10⟩ draw the conclusion the result.

16. Given prove that

25 | P a g e
MODULE 3 : Quantum Computing & Quantum Gates CSE streams:2022scheme


17. Given ⟩ and ⟩ prove that

26 | P a g e

You might also like