0% found this document useful (0 votes)
16 views

Quantum Computing Notes-Additional Info

Uploaded by

hardikgaonkar58
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Quantum Computing Notes-Additional Info

Uploaded by

hardikgaonkar58
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

BMS Institute of Technology and Management 22PHYS12

Quantum computing
Wave function in Ket notation

A wave function in quantum physics is a mathematical description of the quantum state of an


isolated quantum system. Denoted as  .

The wave function is a complex-valued probability amplitude, and the probabilities for the
possible results of measurements made on the system can be derived from it.

Probability =  *  
2
is a positive deterministic value

where  is complex and  * is conjugate.


Mathematically, we describe every quantum state with a vector.

   iˆ  i ˆj

Its conjugate is  *   iˆ  i ˆj

Then,  *    ( iˆ  i ˆj ).( iˆ  i ˆj )   2   2
2
is the probability

Matrix form of Wave function

The physical state of a system is represented in quantum mechanics by elements of a Hilbert


space; these elements are called state vectors. The state vectors in different bases by means of
function expansions. This is analogous to specifying an ordinary (Euclidean) vector by its
components in various coordinate systems. The meaning of a vector is, of course, independent
of the coordinate system chosen to represent its components. Similarly, the state of a
microscopic system has a meaning independent of the basis in which it is expanded.

In quantum mechanics, bra–ket notation, or Dirac notation, is used to denote quantum states.
Bra–ket notation was effectively established in 1939 by Paul Dirac.

A ket is of the form  Mathematically it denotes a vector, in an abstract (complex) vector

space and physically it represents a state of some quantum system.

1  0 
The basis vector iˆ and ˆj can be written in matrix form as iˆ  0    and ˆj  1   
0  1 

Then    iˆ  i ˆj becomes    0  i 1

1  0    
Then,       i     
0  1  i  
Department of Physics P a g e 1 | 27
BMS Institute of Technology and Management 22PHYS12

1  0    
 *      i     
0  1  i 

    
 *   .  matrix multiplication is not possible.
i  ( 2 x1)  i  ( 2 x1)

Orthonormal (orthogonal) matrices are matrices in which the columns vectors form an
orthonormal set (each column vector has length one and is orthogonal to all the other colum
vectors).

† † T
Hence A matrix  is multiplied to  gives probability. Where,   *

 
    i     2   2

i.e., 
i 

But    is a bra

Hence    2  2 is the probability

Then according to normalization rule   1


Identity operators

Identity matrix In is an n x n matrix with all diagonal entries equal to 1 and all others zero.
1 0 
I  
0 1  ( 2 x 2 )

Determination of I 0 and I 1

1  0 
Matrix representation of 0    and 1    States,
0  1 

1 0 1 1  0  1
I0        0
 0 1  0  0  0  0 

1 0 0 0  0 0
I1        1
0 1 1  0  1 1
Applying I to |0> and |1> states to show there is no change.

Department of Physics P a g e 2 | 27
BMS Institute of Technology and Management 22PHYS12

Truth table for Identity matrix.


Input Out put
0 0
1 1
 0  1  0  1

Pauli matrices and its operation on 0 and 1

There are three extremely useful matrices called Pauli matrices that are often used in quantum
computing.
0 1 
x  X  
1 0 

0  i 
 y Y  
i 0 

1 0
Z  Z   
0  1
Note: Pauli matrices satisffy the unitary condition.
 X 2 Y 2  Z 2  I

0 1 
x  X  
1 0 

 0 1  1   0  0   0 
X 0 =   =   =  = 1
1 0 0 1  0  1

0 1 0  0  1 1
X 1 =   =  =  = 0
1 0 1 0  0 0

0  i  1 0  0 0
Y 0 = = = =i1
i 0  0  i  0   i 

0  i  0   0  i  1 
Y 1 =    =  =  i  =  i 0
i 0  1 0  0 0 

1 0  1 1  0  1
Z 0 =   =  =  = 0
0  1 0 0  0 0

1 0  0   0  0   0 
Z 1 =   =  = = 1
0  1 1  0  1   1

Department of Physics P a g e 3 | 27
BMS Institute of Technology and Management 22PHYS12

Hermitian matrix

A hermitian matrix is a square matrix, which is equal to its conjugate transpose matrix. The
non-diagonal elements of a hermitian matrix are all complex numbers. The complex numbers
in a hermitian matrix are such that the element of the ith row and jth column is the complex
conjugate of the element of the jth row and ith column.

Mathematically, a Hermitian matrix is defined as A square matrix, A = [aij]n × n such that

(A*)T = A,

where (A*)T = A† is the conjugate transpose of A.

Since A is Hermitian, A† A  AA†


Hermitian Matrix of Order 2 x 2

 1 3  2i   1 3  2i 
If A    is a complex matrix, A*   is the complex conjugate of
3  2i 2  3  2i 2 

A.

 1 3  2i 
A  * T

2 
A
3  2i

Here the non-diagonal are complex numbers. Only the first element of the first row and the
second element of the second row are real numbers. Also, the complex number of the first-row
second element is a conjugate complex number of the second-row first element.

Unitary Matrix

A matrix U of order n is said to be unitary if

U † .U  U .U †  I n
In quantum mechanics, the conjugate transpose is referred to as the Hermitian adjoint of a
matrix and is denoted by a dagger (†).

The real analogue of a unitary matrix is an orthogonal matrix. Unitary matrices have significant
importance in quantum mechanics because they preserve norms, and thus, probability
amplitudes.

Department of Physics P a g e 4 | 27
BMS Institute of Technology and Management 22PHYS12

Principles of quantum information and quantum computing.

Introduction to Quantum Computing

Quantum computing is a rapidly-emerging technology that harnesses the laws of quantum


mechanics to solve problems too complex for classical computers. Quantum theory explains
the behavior of energy and material on the atomic and subatomic levels. Quantum computing
uses subatomic particles, such as electrons or photons.

Quantum bits, or qubits, allow subatomic particles to exist in more than one state (i.e., 1 and
0) at the same time. Unlike a normal computer bit, which can be either 0 or 1, a qubit can exist
in a multidimensional state. Theoretically, linked qubits can "exploit the interference between
their wave-like quantum states to perform calculations that might otherwise take millions of
years.

Classical computers today employ a stream of electrical impulses (1 and 0) in a binary manner
to encode information in bits. This restricts their processing ability, compared to quantum
computing. The power of quantum computers grows exponentially with more qubits. Classical
computers that add more bits can increase power only linearly.

Moore’s law& its end

Gordon Moore, the co-founder of Intel, indicated that - due to the shrinking size of transistors
to the nanoscale (allowing integrated circuits to be composed of more transistors, resulting in
more powerful computer systems) - every year, twice as many transistors would be able to fit
onto computer chips. Hence, Moore’s Law was born. After 1975, the estimate changed to a
doubling of transistors every two years.

Moore's law is the observation that the number of transistors in a dense integrated circuit (IC)
doubles about every two years. Moore's law is an observation and projection of a historical
trend rather than a law of physics.

Engineers were able to consistently create computer systems/chips with double the number of
transistors, resulting in a number of more advanced technologies being developed, from smart
technology, to mobile technology, to wearable technology, to faster processors, to more robust
computers, to faster/more efficient data centers like cloud computing. Engineers were able to
dedicate time to develop more efficient nanotechnology systems whereby transistors went from
being millimeters to nanometers. However, feats in engineering and physics have been pushed

Department of Physics P a g e 5 | 27
BMS Institute of Technology and Management 22PHYS12

to their limit, and while more power results in more resources and more abilities to carry out
advanced tasks via computers, engineers are unable to keep pushing the limit on smaller
transistors, and thus, computer systems may have reached their limit in transistor capacity and
power. Hence, industry leaders are asserting that Moore’s Law has come to an end, and
computers will no longer have many more transistors every year.

Single particle quantum interference

Quantum computing involves the concept of superposition. To understand the idea of


superposition it is appropriate to know about an experiment which is concerned with a
phenomenon know as single-particle quantum interference.

In this experiment light from a source S falls upon an half-silvered mirror i.e., a mirror which
reflects 50% of the incident light and transmits the rest 50% as shown in figure 1. The reflected
light is detected by the detector D1, and the transmitted part is detected by D2. If we consider
the light to be a stream of photons, then 50% of them will reach D1 and the rest 50% reach D2.
If the source were to emit one photon at a slow rate, then as per probabilistic prediction, we
may say that over a period of time after a number of photons were emitted, D1 would have
received 50% of them and D2 the rest 50%.

It means, each time a photon is emitted we assume that it is either reflected and travels along
OY, or transmitted and travels along OX. Since a photon is quantised, we don’t consider it to
split into two with one-half going along OY and other travelling along OX (i.e., at one time,
the photon is detected by either D1 or D2, but never together). But because of the wave nature
associated with the photon, the photon must a measurement is carried out it is said to collapse
to cpllapse to only that path concerned to the measurement. There is a method to demonstrate
this by extending the above experiment as follows.

Let there be two fully silvered mirrors at two points A and B, and half silvered mirror at C such
that the mirror A and B reflect the light (photons) exactly to the point C where another half
silvered mirror lies. All the mirrors lie with their planes inclined at 45 to the incident light.
The path length OACOCB.

Department of Physics P a g e 6 | 27
BMS Institute of Technology and Management 22PHYS12

With this arrangement, after a photon leaves the source and travels-up its path here also one
expects that it will be detected by either D1 or D2. However, as per quantum mechanical
considerations, it is always only the detector D1 which the photon reaches and never the
detector D2. This effect is explained as follows.

Everytime a photon leaves the source, the two sets of waves that represent the photon existing
simultaneously along the two paths, would always cancel each other before reaching D2. But
those which proceed to reach D1 will reinforce and thus will be detected there. This means that
the photon has in reality travelled not one but both the paths simultaneously and underwent self
interference to be detected only at D1.

This experiment is known as single-particle quantum interference and the fact that it exists in
both the paths (states) is considered superposition.

Quantum superposition and concept of qubit

In a classical computer, a bit is represented by a physical quantity with two states to represent
0 and 1. It can be the voltage in a circuit (e.g. 5 V for 1 and 0 V for 0). It can be the
magnetization direction in a magnetic drive (e.g. up for 1 and down for 0). It can be the charge
density in the charge storage layer in the flash memory (e.g. low for 1 and high for 0). In a
quantum computer, the information is represented by qubits. Like the classical bit, each qubit
still has two distinct states and we say that they are orthogonal to each other because they
cannot exist with 100% certainty at the same time. We also call them the basis vectors or basis
states most of the time. We can still label them as “0” and “1.” In addition to the two distinct
states, a qubit may also have many other states which are the superposition of the two distinct
states (or the basis states). This is what is fundamentally different from the classical bit. In

Department of Physics P a g e 7 | 27
BMS Institute of Technology and Management 22PHYS12

these states, the two distinct (orthogonal) basis states are allowed to exist at the same time with
<100% certainty. Superposition is one of the fundamental operation principles in quantum
computing. Superposition allows us to perform a calculation on multiple basis states at the
same time, which is not possible in classical computing.

We learned superposition in wave theory in which two wavelets can superimpose on each other.
In electromagnetism, light can be polarized in any direction. Any linear polarization is just a
linear combination of horizontal and vertical polarization. If we represent the horizontal
polarization as a horizontal vector (Vx) and the vertical polarization as a vertical vector (Vy)
any linear polarization, V, is just a linear combination of the two vectors.

We can write

V   Vx   V y

where α and β are just some numbers (coefficients) and Vx and Vy are the horizontal and vertical
polarization unit vectors (which are basis vectors in this case), respectively. Vx and Vy are the
orthogonal states in the system.

There is a genius called Dirac and he decided to write in this way

V   Vx   V y

This is called the Dirac ket notation.

A qubit can be in a linear combination or superposition of the two states 0 and 1 as:

  0   1

The number α and β are complex, but generally taken as real without any loss. In other words,
a qubit is a vector in a two dimentional complex vector space.

An example of a qubit state could be:

1 1
  0  1
2 2

So a qubit can exist in a continuum states between 0 and 1 .

The sum of probabilities of 0 and 1 adds to 1.

Department of Physics P a g e 8 | 27
BMS Institute of Technology and Management 22PHYS12

We can examine    0   1 to find out whether it is in the state 0 or 1 . When we

measure a qubit, we get either the result 0 with probability  or 1 with probability  .
2 2

Naturally, the sum

   1
2 2

Since the probabilities must add up to one. So we can interpret this as the condition that the
qubit’s state can be normalised to length 1. A qubit’s state is therefore, a unit vector in a two-
dimentional complex vector space.

1 1
  0  1
2 2
2
When measured gives the result of 0 for 1 
1
 0.5 or 50% of the time and a result of 1
2 2
2
for 1 
1
 0.5 or 50% of the time.
2 2

We come to the important conclusion that a qubit can exist in a coherent superposition of states
0 and 1 only till it measured upon measurement, it gives only one of the states 0 or 1 .

Single and two qubits. Extension to N qubit

The quantum mechanical notation of Dirac (known as Ket notation), the states of a qubit are
represented as 0 and 1 as a classical bit can be in the state of 0 and 1.

Any quantum data processing can be done by one and two qubit gates acting on qubits.

For example, if we consider the case of two-qubit XRO (also called controlled –NOT) gate, it
flips the second input provided the first input is 1 . Otherwise stays unchanged. A

superposition at the stage of input gives a superposition of outputs. This is recognised as


entangled state.

With two such qubits, the four states of two ordinary bits can be taken at once and represented
as one state.

i.e., 00, 01, 10, 11

Going further, if we consider a register composed of three classical bits, then the register can
store only one out of eight possible configurations given by,
Department of Physics P a g e 9 | 27
BMS Institute of Technology and Management 22PHYS12

000, 001, 010, 011, 100, 101, 110, 111

One can show that, three qubits can store all eight numbers in a quantum superposition.

If we keep adding qubits to the register we increase its capacity exponentially i.e., three qubit
can store 8 different numbers. Four qubit can store 16 different numbers, and so on.

This means, by using N qubits, any of 2 N states can be formed with just one state. Therefore,
it becomes possible to perform super-parallel processing of problems which need to have 2 N
inputs. This is the origin of its mega-calculating capacity. With the increase in the number of
qubits, the effect grown exponentially. Ultimately for getting the answer, some kind of
observation needs to be made on the quantum system serving as qubits. For the reson that the
qubits are quantum mechanical nature, the answer comes out in probabilistic form. But when
answer is probabilistic, it may come with different values at the end of different observations.
To overcome this kind of uncertainty, a method called quantum interference will be made use
of. In this method, operations are carried out such that we get answers with probabilities very
near 1 (ie., it is almost certain).

Classical and quantum information comparison

Technically any information could be reliazed in terms of various distinctive steps that follows
certain logic. For instance, in computer applications, information could be reduced in terms of
bits (0 and 1). Further it could be processed in terms of logic gates (NOT, AND). But both bits
and logic gates are not materials but electrical effects. However the effects manifest following
certain physical laws which are classical in nature. This is classical information.

Information could also be obtained through entities such as photons or nuclear spins which
obey quantum information. But unlike classical information, quantum information cannot be
read or copied without disturbing the system which bear them.

The quantum information is realized through different possible states of a quantum system
called qubits. Further processing is achieved through one-and two-qubit gate operation. It is
called quantum computing.

Differences between classical & quantum computing

In classical computers, a bit is a fundamental unit of information, classically represented as 0


or 1 in the digital computer such as the magnetization on a hard disc or the charge on a

Department of Physics P a g e 10 | 27
BMS Institute of Technology and Management 22PHYS12

capacitor. A document, for example, comprises of n-characters stored in the hard drive of a
typical computer which is accordingly described by a string of 8n 0’s and 1’s.

In quantum computing the concept is fundamentally different. It is neigther a capacitor nor


magnetization on the disc, but a quantum system such as an atom or a photon is used to encode
the information. We can choose two electronic states of an atom or two different polarization
orientations of light for the two states. But as per quantum mechanics, the atom, apart from the
two distinct electroic states, can be also prepared in a state which is said to be a coherent
superposition of both the states. i.e., the atom can exist in state as a 0, a 1, or simultaneously
both as 0 and 1. It will not be known definitely, in which of these states the atom would be. But
a number called probability factor associated with the corresponding states provides the
probability of the atoms existence in each of these states. Since it follows quantum principles,
it becomes a quantum system and is called a quantum bit or a qubit. Thus one qubit can
encode at a time both 0 and 1. If we refer to the case of light, a qubit may correspond to the
superposed state of horizontal and verticle polarization of photons apart from the two individual
states of polarization.

Hence qubit can be defined as follows. “A qubit is a quantum bit the counterpart in quantum
computing to the binary digit or bit of classical computing. Just as bit is the basic unit of
information in a classical computer, a qubit is the basic unit of information in a quantum
computers”.

Properties of a qubit

 A qubit can be in a superposed state of two states 0 and 1 .

 If measurements are carried out with a qubit in superposed state then the results that we
get will be probabilistic. (not deterministic as we get in bits in classical computer).
 Qwing to the quantum nature, the qubit changes its state at once when subjected to
measurement. This means, one canot copy information from qubits the way we do in
the present computers, as there will be no similarity between the copy and the original.
This is known as ‘no cloning principle’.

Department of Physics P a g e 11 | 27
BMS Institute of Technology and Management 22PHYS12

Representation of qubit by Bloch sphere

The Bloch sphere is a geometrical representation of pure single-qubit states as a point on the
unit sphere. Operations on single qubits commonly used in quantum information processing
can be represented on the Bloch sphere.

The geometric representation of a qubit is done with a Bloch sphere as follows;

Given an orthonormal basis, any pure state  of a two level quantum states can be written as

a superposition of the basis vectors 0 and 1 .

i.e.,    0   1

where the coefficient of (or contribution from) each of the two basis vectors is a complex
number. This means that the state is described by four real numbers.

We also know from quantum mechanics that the total probability of the system has to be one:
  1
2
or equivalently  1

We can write  using the following representation:

   
  cos  0  e i sin   1
2 2

   
  cos  0  cos  i sin  sin   1
2 2

i.e.,   cos   and   cos  i sin  sin   


2 2
Where 0     and 0    2

Department of Physics P a g e 12 | 27
BMS Institute of Technology and Management 22PHYS12

For   0 and   0

  0 and is along +Z axis.

For    and   0

  1 and is along - Z axis.

For    and   
2 2

0 i1
  and is a superposition state along +Y axis.
2

For    and   3
2 2

0 i1
  and is a superposition state along - Y axis.
2

0 1
  and is a superposition state along +X axis.
2

For    and   
2

0 1
  and is a superposition state along - X axis.
2

The sphere provides a useful means of visualizing the state of a single qubit and serves as an
excellent testbed for ideas about quantum computing.

Department of Physics P a g e 13 | 27
BMS Institute of Technology and Management 22PHYS12

Quantum Gate
A classical computer is build using an electrical circuit having wires and logic gates. Similarly,
a quantum computer is built from a quantum circuit containing wires and elementary quantum
gates to transmit and manipulate quantum information.

Single Qubit Gates

There are single bit gates in classical computing like NOT gate, which work on only a single
bit. Similarly, single qubit gates are those that act on only single quantum bit.

Quantum NOT Gate

An analogous quantum NOT gate for qubits can be defined as a process that takes the same
state 0 to the state 1 and vice versa and is the quantum analogues for the NOT gate. However

in case of superposition, the quantum NOT gate acts linearly in that the sate

 0   1 is taken to the state  1   0 so that the roles of 0 and 1 states have been
interchanged.

Pauli – X, Y and Z matrices

There are three extremely useful matrices called Pauli matrices that are often used in quantum
computing.

0 1 
x  X  
1 0 

0  i 
 y Y  
i 0 

1 0
Z  Z   
0  1
Note: Pauli matrices satisffy the unitary condition.

 X 2 Y 2  Z 2  I

X Gate

There is an easy way of representing the X gate or quantum NOT gate in matrix form, which
follows the linearity of quantum gates. It is represented by the matric X as;

Department of Physics P a g e 14 | 27
BMS Institute of Technology and Management 22PHYS12

1  0 
Note: Matrix representation of 0    and 1   
0  1 

0 1 
x  X  
1 0 

 0 1  1   0  0   0 
X 0 =   =   =  = 1
1 0 0 1  0  1

0 1 0  0  1 1
X 1 =   =  =  = 0
1 0 1 0  0 0

 
If the quantum state  0   1 is written in vector notation as   then
 

0 1   0      
X (  0   1 )=    =   =   = 1   0
1 0      0   
Truth table for Pauli X gate or quantum NOT gate
Input Out put
0 1
1 0
 0  1 1  0

X
Input  0   1 otuput  1   0

X gate or Quantum NOT gate


It can be verified that the X gate satisfies the unitary condition that

X †.X  I
0 1 0 1  0  1 0  0 1 0
1 0 1 0  0  0 1  0   0 1
      
Y gate

There is an easy way of representing the Y gate in matrix form, which follows the linearity of
quantum gates. It is represented by the matric Y as;

0  i 
 y Y  
i 0 

0  i  1 0  0 0
Y 0 = = = =i1
i 0  0  i  0   i 

Department of Physics P a g e 15 | 27
BMS Institute of Technology and Management 22PHYS12

0  i  0   0  i  1 
Y 1 =    =  =  i  =  i 0
i 0  1 0  0 0 

0  i     0  i    i 
Y (  0   1 )=  = = = i 1  i 0
i 0     i  0  i 

Truth table for Y gate


Input Out put
0 i1
1 i 0
 0  1 i 1  i 0

Y
Input  0   1 out put i 1  i 0

Pauli Y gate
It can be verified that the Y gate satisfies the unitary condition that

Y † .Y  I
0  i  0  i   0  1 0  0 1 0
 i 0   i 0   0  0 1  0   0 1 
      

Z gate

The Z gate is defined as


1 0
Z  Z   
0  1

1 0  1 1  0  1
Z 0 =   =  =  = 0
0  1 0 0  0 0

1 0  0   0  0   0 
Z 1 =   =  = = 1
0  1 1  0  1   1

1 0      0   
Z (  0   1 )=    =  =  = 0   1
0  1    0      
Truth table for Y gate
Input Out put
0 0
1 1
 0  1  0  1

Department of Physics P a g e 16 | 27
BMS Institute of Technology and Management 22PHYS12

Z
Input  0   1 output  0   1

Quantum Z gate

It can be verified that the Z gate satisfies the unitary condition that

Z † .Z  I
1 0  1 0  1  0 0  0 1 0
0  1 0  1  0  0 0  1  0 1
      
Hadamard Gate

Hadamard gate is defined as


1 1 1 
H  1  1
2  

The Hadamard gate is at times considered the “square-root” of a NOT gate as it transform 0
0 1
into , which may be considered mid-way between 0 and 1 . Similarly, it transform a
2
0 1
1 into , which can also be described as mid-way between 0 and 1 .
2

Thus the state  0   1 is transformed as

1 1 1    1    
1  1      
2    2    

H
Hadamard gate
Relationship between Hadamard and Pauli gates

There is an algebraic relation between the Hadamard and Pauli matrices,


X Z
H
2

1 1 1  1 0 1 1 1 0 
1  1     
2   2 1 0 2 0  1

Phase Gate (or S Gate)


The Phase gate or S gate can be defined as

Department of Physics P a g e 17 | 27
BMS Institute of Technology and Management 22PHYS12

1 0 
S 
0 i 

It effect on 0 is

1 0 1 1  0  1
S 0 =       0
0 i  0  0  0  0 

i.e output is 0

It effect on 1 is

1 0 0 0  0  0  0 
S 1 =          i   i 1
0 i  1  0  i   i  1

i.e output is i 1

1 0      0    
S(  0   1 )=    =   =   =  0  i 1
0 i     0  i  i 

i.e out put is  0  i 1

Truth table of S gate


Input Out put
0 0
1 i1
 0  1  0  i 1

S
Input  0   1 Output  0  i 1

S gate
S gate satisfies the unitary condition that

S † .S  I
1 0  1 0 1  0 0  0 1 0
 0  i  0 i   0  0 0  1   0 1 
      
T Gate
T gate is defined as follows
1 0 
T   
 i 

0 e  4  

It is also referred as the /8 gate since it can also be expressed as


Department of Physics P a g e 18 | 27
BMS Institute of Technology and Management 22PHYS12

 i     i  
 
T e  8  e  8  0 
  i  
 
 0 e  8  

If input is 0 , then the output is

1 0  1 1
T 0 =    0
 i 
 
0 e  0 0
 4 

i.e. the state 0 , means same state.

If input is 1 , then output is

1 0 0  0   i 
 
T 1 =    i   e  4  1
  4 
 i 
 
 4 
0 e  1 e  
 i 
 
i.e. the state e  4  1 .

It transforms the state  0   1 as

1 0      i 
 
T(  0   1 )=      i     0   e 4  1
 i 
 
0 e     e 4  
 4 

 i 
 
To  0   e  4 
1 .

Truth table of T gate


Input Out put
0 0
 i 
1  
 4 
e 1
 0  1  i 
 
 0   e 4  1

Relation between S and T gates


There is an algebraic relation between T and S gates
S=T2

1 0 1 0i   1 0i   1 0
0 i  =         
  0 e 4   0 e 4   0 i 

Multiple Qubit Gates

We can generalize from single qubit to multiple qubit gates. Examples of classical multiple
input gates include AND, OR, XRO, NAND, NOR etc. Similarly we have multiple qubit gates.
Department of Physics P a g e 19 | 27
BMS Institute of Technology and Management 22PHYS12

A controlled gate is one in which the operation is of the kind “If A is true, then do B”. A is
usually refered to as the control qubit and B as the target qubit. If the control qubit is 0,then the
target qubit is not altered. If the control qubit is 1, then the target qubit is transformed. Hoever,
the control qubit remains unaltered in both the cases.

Controlled gate, CNOT Gate, (Discussion for 4 different input states).

The multi-qubit quantum logic gate is the controlled NOT or CNOT gate. The circuit of the
CNOT gate is shown in figure. The gate has two input qubits. (1) Control qubit and (2) Target
qubit.

Control qubit

a a

b ba
Target qubit
Figure. CNOT gate
If the control qubit of the gte is set to 0, then the target qubit is not altered. If the control qubit
is set to 1, then the target qubit is inverted. Figure shows a control gate with the control qubit
a and target qubit b .

(1) Input state 0 0 (Control qubit = 0, Target qubit = 0)

Both the bits remain unaltered. Hence, the output state is the same as the input state or

00  00

(2) Input state 01 (Control qubit = 0, Target qubit = 1)

Both the bits remain unaltered. Again, the output state is the same as the input state or

01  01

(3) Input state 10 (Control qubit = 1, Target qubit = 0)

The target qubit is flipped to 1. Therefore, the output state has both qubits 1, or

10  11

(4) Input state 11 (Control qubit = 1, Target qubit = 1)

Department of Physics P a g e 20 | 27
BMS Institute of Technology and Management 22PHYS12

The target qubit is flipped to 0. Therefore, the output state becomes 10 , or

11  10

CNOT can be represented in the matrix form as


1 0 0 0
0 1 0 0
U CN 
0 0 0 1
 
0 0 1 0

The matrix representation is written with respect to the amplitude for 0 0 , 01 , 10 and 11

in that order. Thus the first column describes the transformation that occurs to 0 0 and so on.

The output state Y can also be understood as

 00  1 0 0 0  0 0 
    
01   0 1 0 0  01
Y 
 10  0 0 0 1   10 
    
 11  0 0 1 0  11 

The CNOT gate can be regarded as a type of generalized XOR gate since the action of the gate
can be considered as

a, b  a, b  a

Where  stands for module-2 addition, which is the same as that achived by a XRO gate. In
other words, the control qubit and the target qubit are XROed and stored in the target qubit.

1 0 0 0 1 1
0 1 0 0 0 0
U CN 00     00
0 0 0 1   0  0 
    
0 0 1 0   0  0 

1 0 0 0  0  0 
0 1 0 0 1 1
U CN 01     01
0 0 0 1  0  0 
    
0 0 1 0  0  0 

1 0 0 0  0  0 
0 1 0 0 0 0
U CN 10     11
0 0 0 1 1 0
    
0 0 1 0 0 1

Department of Physics P a g e 21 | 27
BMS Institute of Technology and Management 22PHYS12

1 0 0 0 0 0
0 1 0 0 0 0
U CN 11     10
0 0 0 1 0 1
    
0 0 1 0 1 0

Truth table of a CNOT gate


Input Out put
00 00
01 01
10 11
11 10

UCN gate satisfies the unitary condition that



UCN .UCN  I
1 0 0 0 1 0 0 0 1 0 0 0
0 1 0 0 0 1 0 0 0 1 0 0
 
0 0 0 1 0 0 0 1  0 0 1 0
    
0 0 1 0 0 0 1 0  0 0 0 1

Swap gate,

The swap gate is a simple quantum circuit containing three quantum gates. The circuit is read
from left to right and each line represents a quantum passage, maybe of time, perhaps a physical
particle such as a photon or a particle of light to move from one location to another space.

1 0 0 0
0 0 1 0
U SWAP 
0 1 0 0
 
0 0 0 1

Swap gate equivalent schematic symbol notation

The output of the first CNOT gate is a, b  a, a  b .

This is fed as input to the second gate which also does modulo 2 addition but the result is placed
in the first qubit now.
Department of Physics P a g e 22 | 27
BMS Institute of Technology and Management 22PHYS12

Its output becomes a  a  b),, a  b  b, a  b

This is now fed to the third gate which performs modulo 2 addition and places the result in the
second qubit.

The output finally becomes b, a  b)  b,  b, a .

Thus, the overall effect is that the two qubits have been swapped.

1 0  0  0 
0  1  0   
Note: Matrix representation of 00    , 01    , 10    and 11  0
0  0  1  0 
       
0  0  0  1 

1 0 0 0 1 1
0 0 1 0 0 0
U SWAP 00     00
0 1 0 0 0 0
    
0 0 0 1 0 0

1 0 0 0  0  0 
0 0 1 0 1 0
U SWAP 01     10
0 1 0 0 0 1
    
0 0 0 1  0  0 

1 0 0 0  0  0 
0 0 1 0 0 1
U SWAP 10     01
0 1 0 0 1 0
    
0 0 0 1  0  0 

1 0 0 0   0  0 
0 0 1 0 0 0
U SWAP 11     11
0 1 0 0   0  0 
    
0 0 0 1 1 1

Truth table of a swap gate


Input Out put
00 00
01 10
10 01
11 11
Controlled -Z gate
The controlled-Z gate is another example of a controlled gate, i.e. gates in which the operation
is of the kind “If A is true, then do B”.

Department of Physics P a g e 23 | 27
BMS Institute of Technology and Management 22PHYS12

Control qubit

Target qubit Z

Fig. Contolled Z-Gate


The action of a controlled Z-gate is specified as follows.
1 0 0 0
0 1 0 0 
UZ  
0 0 1 0
 
0 0 0  1

Truth table of a controlled Z-gate


Input Out put
00 00

01 01

10 10

11  11

1 0 0 0  1 1
0 1 0 0  0 0
U Z 00     00
0 0 1 0  0 0
    
0 0 0  1 0 0

1 0 0 0  0   0 
0 1 0 0  1 1
U Z 01     01
0 0 1 0  0   0 
    
0 0 0  1 0 0

1 0 0 0  0  0 
0 1 0 0  0 0
U Z 10     10
0 0 1 0  1 1
    
0 0 0  1 0 0

Department of Physics P a g e 24 | 27
BMS Institute of Technology and Management 22PHYS12

1 0 0 0  0   0 
0 1 0 0  0  0 
U Z 11      11
0 0 1 0  0   0 
    
0 0 0  1 1  1

Toffoli gate (CCNOT, CCX, TOFF)

Any classical logic cicuit can be build using a quantum circuit. Any classical circuit can be
replaced by an equivalent circuit containing only reversible element, by using a reversible gate
called Toffoli Gate.

Control qubit a a

Control qubit b b

Target qubit c c  ab

Fig. Toffoli gate

The Toffoli gate has three input bits ( a , b and c ) and three output bits ( a , b and c ).

The first two bits are control bits which remain unaffected by the action of the Toffoli gate.
The third is the target bit which is inverted if both the control bits are 1; else it is left unchanged.

Input Output
a b c a b c

0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
1 1 1 1 1 0
The Toffoli gate can be expressed as an 8 by 8 matrix as follows

Department of Physics P a g e 25 | 27
BMS Institute of Technology and Management 22PHYS12

1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0

0 0 1 0 0 0 0 0
 
0 0 0 1 0 0 0 0
UT  
0 0 0 0 1 0 0 0
 
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1
 
0 0 0 0 0 0 1 0

It can be verified that this matrix is unitary and thus the Toffoli gate is a legitimate quantum
gate. The quantum Toffoli gate can be used to simulate irreversible classical logic gates and
ensures that quantum gates are capable of performining any computation that a classical
computer can do.

U T .U T  I
1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
 
0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0  0 0 1 0 0 0 0 0
     
0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0  0

0 0 1 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0  0 0 0 0 1 0 0 0
     
0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0  0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1  0 0 0 0 0 0 1 0
     
0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1

Toffoli gate is its Own Inverse.

The Toffoli gate is its own inverse since applying it once to the input, a, b, c gives the output,
a, b, c  ab .

Applying it to another Toffoli gate gives the output


a, b, (c  ab)  ab  a, b, c

As the modulo-2 sum of a number with itself gives 0. Hence, the Toffoli gate is a reversible
gate and is its own inverse.

Department of Physics P a g e 26 | 27
BMS Institute of Technology and Management 22PHYS12

Department of Physics P a g e 27 | 27

You might also like