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

Module 3 Quantum Computing CSE UPR

Find me important questions and answers for the btech first sem exams

Uploaded by

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

Module 3 Quantum Computing CSE UPR

Find me important questions and answers for the btech first sem exams

Uploaded by

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

Bangalore Institute of Technology

(An Autonomous Institution affiliated to VTU)


Department of Physics
Study Material for I Year B.E., 2024-25
CSE stream

Course Title: Applied Physics for CSE Stream


Course Code: BPHYS102/202

MODULE-3: Quantum Computing


Syllabus:
Principles of Quantum Information & Quantum Computing:
Introduction to quantum computing, Moore’s law and its end, Differences between Classical
and quantum computing, Concept of qubit and its properties, Representation of a qubit by
Bloch sphere, Single and two qubits, Extension to N qubits, Brief introduction to quantum
entanglement and quantum teleportation.
Dirac Representation and Matrix Operations:
Matrix representation of 0 and 1 states, Identity operator (I), Applying I to ∣0 and ∣1
states, Pauli matrices and its operations on ∣0 and ∣1 states, Explanation of conjugate of a
matrix and transpose of a matrix. Unitary matrix (U), Row and column matrices and their
multiplication (Inner Product), Probability and quantum superposition, Normalization rule,
Orthogonality, Orthonormality.
Quantum Gates:
Single qubit gates: Quantum NOT gate, Pauli -X, Y and Z gates, Hadamard gate, Phase gate
(or S gate), T Gate,
Multiple qubit gates: Controlled gate, CNOT Gate (Discussion for 4 different input states),
Representation of swap gate, Controlled Z gate, Toffoli gate. Numerical Problems

Principles of Quantum Information & Quantum Computing

Introduction to Quantum Computing:


Quantum computing is a field comprising the aspects of computer science, physics and
mathematics. It makes use of the principles of quantum mechanics to solve complex
problems faster than classical computers. Information in quantum computing is encoded in
quantum systems such as atoms, ions or quantum dots. A key highlight of quantum
computing is the development of quantum algorithms like Shor’s algorithm and Grover’s
algorithm, which make computation extremely fast compared to classical computers.
Quantum computers can perform computational tasks such as factorizing a number or
carrying out searches in database exceptionally fast. Quantum computer networks can
efficiently transmit and receive information in unusual ways. They find immense potential in
the science of cryptography (science of maintaining secrecy and security in communication).
Moore’s law & its end:

In 1965, Gordon Moore observed that the number of transistors on a microchip doubles
approximately every two years. This is known as Moore’s law. The above plot shows
Moore’s prediction about number of transistors per chip for 50 years. The computer industry
has followed this prediction since then. Because of this, conventional computers have
increased the speed and miniaturisation at an exponential rate. As transistors become very
small and reach the sizes on the nanometer scale, quantum effects like tunnelling of electrons
occur which cause problems for the present day microelectronics. Clearly there is an upper
limit for the miniaturisation. Also, miniaturisation will have direct impact on the progress of
computing power. What this means specifically, is that transistors in integrated circuits have
become faster. The faster the integrated circuit conducts electricity, the faster the computer
operates. This means that computers are projected to reach their limits because transistors
will be unable to operate within smaller circuits at increasingly higher temperatures. This
will lead to slowdown in the advancement of computer hardware. So, Moore’s law should
come to an end soon. All these observations have encouraged the development of new
computing system called quantum computing.

Qubit and its properties

The units of information processing system in classical system are bits. A bit has just two
possible states (namely, ‘0’ and ‘1’). This basic unit of information in quantum computing is
called the qubit, which is the short form of quantum bit. A qubit has two basic states
represented by |0⟩ and |1⟩. But it can also exist in a superposition state, which is a state other
than |0⟩ or |1⟩. A single qubit can thus encode an infinite number of classical bits.
Properties:

1. Superposition: A qubit can be in a superposition of states 0 and 1. But we can know


if the state is 0 or 1 only after the measurement.
2. Probabilistic Nature: The determination of the states of a qubit is probabilistic in
nature. In other words, we determine the sates 0 or 1 only with certain probability.
3. Entanglement: Qubits can be entangled with one another. When two qubits are
entangled, they remain connected even when separated by very large distances.
4. No-cloning principle: A qubit changes its state when subjected to measurement.
Therefore it is impossible to copy information from qubits in the way we do it in
classical computers. This is known as "no cloning principle"

Differences between classical & quantum computing

Classical computing Quantum computing


Information is stored in bits Information stored in qubits
Information processing is carried out by logic Information processing is carried out by
gates e.g. NOT, AND, OR etc. Quantum logic gates e.g. Pauli -X, Y and Z
gates, Hadamard gate, Phase gate etc.
Circuit behaviour is governed by classical Circuit behaviour is governed by quantum
physics mechanics
Operations are defined by Boolean Algebra Operations are defined by linear algebra
Calculations are deterministic. This means The calculations are probabilistic. This
that same output is obtained every time if means that multiple possible outputs are
inputs are repeated obtained if inputs are repeated
Data processing is carried out by logic and in Data processing is carried out by quantum
sequential order logic at parallel instances
Suited for complex tasks like optimization
Suited for everyday processing tasks problems, data analysis and simulations
No restrictions exist on copying or measuring Severe restrictions exist on copying and
signals measuring signals
Additional Information
The superposition state is a linear combination of the states |0⟩ and |1⟩. If we label this
state
|𝜓⟩, a superposition state is written as |𝜓⟩ = α|0⟩+ β|1⟩ -----------------(1)

Here α, β are complex numbers. That is, the numbers of the form z = x + iy, where i =
√−1. The laws of quantum mechanics tell us that the modulus squared of α, β in the
above equation gives us the probability of finding the qubit in state|0⟩ or |1⟩. In other
words,

|α|2: Tells us the probability of finding |𝜓⟩ in state |0⟩

|β|2: Tells us the probability of finding |𝜓⟩ in state |1⟩

Therefore, when we measure a qubit we get either the result 0, with probability |α| 2, or
the result 1, with probability |β|2. Also, the total probability |α|2 + |β|2 = 1, according
to theory of probability. Thus, we cannot examine a qubit to determine its quantum state,
that is, the values of α and β. Instead, quantum mechanics tells us that we can only
acquire much more restricted information about the quantum state. It is because a qubit
can exist in a continuum of states between |0⟩ and |1⟩ until it is observed. So, we have to
keep in mind that when a qubit is measured, it only gives ‘0’ or ‘1’ as the measurement
result – probabilistically. For example, a qubit can be in the state
1 1
|0⟩ + |1⟩
√2 √2

1 1
By comparing with equation (1) we get α = and β =
√2 √2

1
Which means |α|2= |β|2 = 2
, Therefore, the measurement gives 0 fifty percent of the
time and 1 another fifty percent of the time.

Examples for physical systems used to realize qubits:

1. In the atom model, the electron can exist in either the ‘ground’ or ‘excited’ state,
which we call |0⟩ and |1⟩, respectively as shown in below figure. By shining light
on the atom, with appropriate energy and for an appropriate length of time, it is
possible to move the electron from the |0⟩ to |1⟩ and vice versa. But, by reducing
the time we shine the light, an electron initially in the state |0⟩ can be moved
‘halfway’ between |0⟩ and |1⟩, into the | +⟩ state.

2. Two different polarisations of a photon.


3. Alignment of a nuclear spin in a uniform magnetic field.

epresentation of a qubit by Bloch Sphere


Representation of a qubit by Bloch Sphere

Bloch Sphere representation of a qubit

To represent qubits geometrically, we use a three dimensional sphere of unit radius called
Bloch sphere. It provides a useful means of visualising the state of a single qubit. A qubit can
be any point on the Bloch sphere and each point on the surface of the Bloch sphere represents
one possible superposition of the states |0⟩ and |1⟩. The superposition state is generally
written as |𝜓⟩ = α|0⟩+ β|1⟩. The north and south poles represent the states |0⟩ and |1⟩
respectively.
The state of a qubit on a Bloch sphere in terms of spherical co-ordinates such as polar angle 𝜃
and the azimuth angle ∅ is given by
𝜃 𝜃
|𝜓⟩ = cos ( ) |0⟩ + 𝑒 𝑖∅ sin ( ) |1⟩
2 2
o
For ∅ = 0 and 𝜃 = 0, the state |𝜓⟩ corresponds to |0⟩ and is along +Z- axis.
For ∅ = 0o and 𝜃 = 180o, the state |𝜓⟩ corresponds to |1⟩ and is along -Z- axis.
Like this there are infinite points on the sphere and hence a qubit has capacity to store more
information compared to a classical bit.

NOTE:
When 𝜃 = 90o, the vector is in the x-y plane
1
For ∅ = 90o, |𝜓⟩ = (|0⟩+ 𝑖|1⟩), is a superposition state along + y axis.
√2
1
For ∅ = -90o, |𝜓⟩ = 2 (|0⟩- 𝑖|1⟩), is a superposition state along - y axis.

1
For ∅ = 0o, |𝜓⟩ = 2 (|0⟩+ |1⟩), is a superposition state along + x axis.

1
For ∅ = 180 , |𝜓⟩ = 2 (|0⟩ −|1⟩), is a superposition state along - x axis.
o

Single and two qubits, extension to N qubits

Single qubit: A single qubit has two computational basis states |0⟩ and |1⟩. The single qubit
system |𝜓⟩ is mathematically represented by |𝜓⟩ = α|0⟩+ β|1⟩ where α, β are complex
numbers. It is pictorially represented as shown below.

Two qubits: A two qubit system has four computational basis states denoted by|00⟩,|01⟩,
|10⟩ and |11⟩. The two qubit system |𝜓⟩ is mathematically represented by
|𝜓⟩ = 𝛼00 |00⟩+𝛼01 |01⟩+𝛼10 |10⟩+ 𝛼11 |11⟩ and is pictorially represented as shown below.
The four states define various possibilities. Thus a two qubit system can store all four
numbers simultaneously.

Eextension to N qubits: An N qubit system has 2𝑁 computational basis states represented as


|00 … .00⟩, |00 … .01⟩, |00 … .10⟩ … … … . . |11 … .11⟩. So, if a state has 4 qubits then there
will be 24 computational basis states. The pictorial representation of an N qubit system is as
shown below.

Quantum entanglement:

It is a phenomenon in which two or more particles are interconnected in such a way that the
state of one particle directly affects the state of the other. This means that when two particles
are entangled, their properties like spin or polarisation are linked even if they are far apart.
So, if we measure the state of one particle, we instantly know the state of the other particle
irrespective of the distance between them. The principle on which entanglement works is
quantum mechanics. Particles that we entangle could be photons, electrons, and even larger
particles.

Quantum entanglement is fundamental to technologies like quantum computing, quantum


cryptography and quantum teleportation.
Quantum Entanglement works as follows:

 Entanglement happens when particles interact in a specific way, such as through


collisions or certain quantum operations.
 Once entangled, they are described by a single, shared wave function, which defines
their combined properties.
 This wave function implies that both particles exist in a superposition of states until
measured. Measurement of one particle’s state "collapses" the wave function,
determining the state of both particles simultaneously.

Quantum teleportation:

Quantum teleportation is a process that transfers the state of a quantum particle (like an atom
or photon) from one location to another without physically moving the particle itself. This
process is based on quantum entanglement and classical communication between two
locations. It doesn’t involve physically moving objects but rather transferring their quantum
information. Quantum teleportation doesn’t mean a particle disappears from one place and
reappears in another. Instead, it’s the information about the quantum state that is transferred,
with the state being “reconstructed” at the destination. This is critical to quantum
communication and computing since it allows quantum information to be transmitted over
long distances without direct physical transfer.
Applications of Quantum teleportation:

 Quantum teleportation is fundamental in quantum computing and quantum networks.


It allows the transfer of information between quantum processors or across quantum
networks without physical movement of the particles.
 Quantum Cryptography: Teleportation could enable secure data transfer, as
eavesdropping would disturb the quantum states and signal interference.
 Quantum Repeaters: Quantum teleportation is essential for creating "repeaters" in
quantum communication, which extends the distance of secure quantum
communication links over thousands of kilometres.

Additional Information
Here’s a breakdown of how quantum teleportation works:
1. Quantum Entanglement’s Role in Teleportation
 Quantum teleportation begins with two particles (often photons) that are
entangled. When two particles are entangled, the state of one particle
instantaneously affects the other, even across vast distances.
 The sender (often referred to as Alice) has one of these entangled particles, and
the receiver (Bob) has the other.
2. Teleporting Quantum States
 To teleport a third particle's quantum state (let's call it particle C) to Bob's particle,
Alice performs a special measurement called a Bell-state measurement on particle C
and her entangled particle.
 This measurement collapses both particles' states, meaning particle C’s
information is now "imprinted" on the entangled pair.
3. Classical Communication
 Alice sends the result of her Bell-state measurement to Bob through classical
communication (phone, internet, etc.), which is necessary for Bob to apply the
final step.
 Based on the measurement result, Bob performs a specific operation on his
particle to adjust it to match the original quantum state of particle C.
4. Result: Quantum State Transfer
 After Bob’s adjustments, his particle will now be in the exact quantum state that
particle C originally held, meaning the "information" about particle C’s state has
effectively been teleported.
Limitations of Quantum Teleportation
 Quantum teleportation doesn’t allow for faster-than-light communication because
it still requires a classical signal, which is limited by the speed of light.
 The process doesn’t transport physical objects or particles, only quantum states.
So it’s not the kind of teleportation often seen in science fiction but is more about
data transfer.

Dirac representation and matrix operations:


Dirac representation of 0 and 1 states:

In quantum mechanics, the Dirac notation (also known as "bra-ket" notation) is used to
represent quantum states in a compact form. Notation for a quantum state is 𝜓 is ∣ 𝜓 ⟩. The
notation ∣ ⟩ indicates that it is a vector and is called a ket vector. For example; ∣0⟩ and ∣1⟩.
The ket also establishes the initial state of an event.

The notation ⟨ ∣ is called a bra vector. It is the complex conjugate transpose of the ket. For
example; ⟨0∣ and ⟨1∣. The bra represents the final state of an event.

Matrix representation of 0 and 1 states:

In quantum mechanics, 0 and 1 states are represented by kets |0⟩ and |1⟩. They are also
denoted by the column matrices as;

1 0
|0⟩ = [0] and |1⟩ = [1]

Identity Operator I:

1 0
The Identity Operator I is given by 𝐼 = [ ]
0 1
It is the simplest operator, and does nothing to any ket on application, ie. I|𝑢⟩ = |𝑢⟩

On applying I to |0⟩ and |1⟩ , no change occurs as shown below

1 0 1 1
[ ] [ ] =[ ]
0 1 0 0

1 0 0 0
[ ] [1] = [1]
0 1

Pauli Matrices and its operations on 0 and 1 states:

Pauli matrices:

These are 2 by 2 matrices and their corresponding notations are shown below. The Pauli
matrices are very useful in the study of quantum computation and quantum information.

1 0
𝜎0 = 𝐼 = [ ]
0 1
0 1
𝜎1 = 𝜎𝑋 = 𝑋 = [ ]
1 0
0 −𝑖
𝜎2 = 𝜎𝑌 = 𝑌 = [ ]
𝑖 0
1 0
𝜎3 = 𝜎𝑧 = 𝑍 = [ ]
0 −1
Operation of Pauli matrices on |𝟎⟩ and |𝟏⟩ states

We know that |0⟩ = [10] and |1⟩ = [01]

Applying X on |0⟩ and |1⟩ states, we get


0 1 1 0∗1 + 1∗0 0
X|0⟩ = [ ] [ 0] = [ ] = [1] = |1⟩
1 0 1∗1 + 0∗0
0 1 0 0∗0 + 1∗1 1
X|1⟩ = [ ] [ 1] = [ ] = [0] = |0⟩
1 0 1∗0 + 0∗1

As noted above, since X transforms one state to another, it is sometimes called the NOT
operator.

Applying Y on |0⟩ and |1⟩ states, we get

0 −𝑖 1 0∗1 − 𝑖∗0 0
Y|0⟩ = [ ] [ ] =[ ] = [ ] = 𝑖|1⟩
𝑖 0 0 𝑖∗1 + 0∗0 𝑖

0 −𝑖 0 0∗0 − 𝑖∗1 −𝑖
Y|1⟩ = [ ] [1] = [ ] = [ 0 ] = −𝑖|0⟩
𝑖 0 𝑖∗0 + 0∗1

Applying Z on |0⟩ and |1⟩ states, we get

1 0 1 1∗1 + 0∗0 1
Z|0⟩ = [ ] [0] = [ ] = [0] = |0⟩
0 −1 0∗1 − 1∗0
1 0 0 1∗0 + 0∗1 0
Z|1⟩ = [ ] [ ] =[ ] = [−1] = −|1⟩
0 −1 1 0∗0 − 1∗1

Conjugate of a matrix:

If a matrix A consists of a complex number as elements, then the matrix obtained by the
corresponding conjugate complex elements is called the conjugate of A and is denoted by 𝐴∗

0 𝑖 0 −𝑖
If A = [ ] then 𝐴∗ = [ ]
𝑖 0 −𝑖 0
𝑖 0 −𝑖 0
If A = [ ] then 𝐴∗ = [ ]
𝑖 0 −𝑖 0
1 𝑖 1 −𝑖
If A = [ ] then 𝐴∗ = [ ]
1 𝑖 1 −𝑖
1 + 3𝑖 1+𝑖 1 − 3𝑖 1−𝑖
If A = [ ] then 𝐴∗ = [ ]
2𝑖 1 − 4𝑖 −2𝑖 1 + 4𝑖
Transpose of a matrix:

If A is a matrix of order 𝑚 × 𝑛, then a matrix of order 𝑛 × 𝑚 is obtained by interchanging the


rows and columns of matrix A and is called the transpose of matrix A. Transpose of A is
denoted by 𝐴𝑇 .

1 𝑖 1 1
If A = [ ] then 𝐴𝑇 = [ ]
1 𝑖 𝑖 𝑖
0 1 0 𝑖
If A = [ ] then 𝐴𝑇 = [ ]
𝑖 0 1 0
1 + 3𝑖 2𝑖 1 + 3𝑖 1+𝑖
If A = [ ] then 𝐴𝑇 = [ ]
1+𝑖 1 − 4𝑖 2𝑖 1 − 4𝑖
Unitary Matrix U:

A Unitary matrix is represented as U. Conjugate transpose of U is 𝑈 † (pronounced as U-


dagger).

The property of a Unitary matrix is such that 𝑈𝑈 † = I

where I is a unit matrix (a square matrix having unit elements in the principal diagonal or
leading diagonal and zero element everywhere else). Unitary operators are important because
they describe the time evolution of a quantum state.

Row and Column Matrices and their multiplication (Inner Product):

In order to find the inner product, let us consider two states |𝜓⟩ and |𝜙⟩ as defined below.

𝛼 𝛼
|𝜓⟩ = [ 𝛽 1 ] and |𝜙⟩ = [ 𝛽 2 ] because ket vectors are column matrices
1 2

Now, ⟨𝜓| = [𝛼1∗ 𝛽1∗ ] because bra vectors are row matrices

𝛼2
Now, the inner product is given by ⟨𝜓|𝜙⟩ = [𝛼1∗ 𝛽1∗ ] [ ] = 𝛼1∗𝛼2 + 𝛽1∗𝛽2
𝛽2

Quantum Superposition and Probability:

Quantum superposition is a fundamental principle of quantum mechanics, which states that a


quantum system, like an electron or a photon, can exist in multiple states at once until it is
measured. In other words, instead of being in a single definite state, the particle can exist in a
combination of all possible states simultaneously. The system collapses into one definite
classical state only when we observe it (or measure it).

Let us consider a ket vector given by |ψ⟩ = α|0⟩ + β|1⟩. Here, the ket vector |ψ⟩ represents a
quantum state which is formed by superposition of 0 and 1 classical states. Also, α and β are
the complex numbers which tell us about the probability of getting the state 0 or state 1
respectively as the outcome of the measurement of |ψ⟩.

|ψ⟩ = α |0⟩ + β |1⟩ can also be written as |ψ⟩ = α [10] + β [01] = [𝛽𝛼]

Which implies that ⟨𝜓| = [ 𝛼 ∗ 𝛽 ∗ ]

Now, ⟨𝜓|𝜓⟩ =[ 𝛼 ∗ 𝛽 ∗ ] [𝛽𝛼] = 𝛼 ∗ 𝛼 + 𝛽 ∗ 𝛽 = |𝛼|2 + |𝛽|2 = 1, this is because the total


probability is equal to 1.

Therefore, ⟨𝜓|𝜓⟩ = 1

The above condition is called normalisation condition.


Orthogonality:

Two ket vectors | 𝜓 ⟩ and |∅⟩ are said to be orthogonal if their inner product is zero. Therefore
the condition for orthogonality is ⟨𝜓|∅⟩ = 0

For example: |0⟩ and |1⟩ states are orthogonal since their inner product is zero as shown
below.

⟨0|1⟩ = (1 0) (01) = 0 + 0= 0

NOTE: (i) Horizontal and vertical polarisation states of a photon are orthogonal

(ii) Spin up and spin down states of an electron are orthogonal

Orthonormality:

Two ket vectors | 𝜓 ⟩ and |∅⟩ are said to be orthonormal if

(i) | 𝜓 ⟩ and |∅⟩ are normalised and


(ii) | 𝜓 ⟩ and |∅⟩ are orthogonal to each other

For example: Consider the set {⟨0|, |1⟩}

⟨0|0⟩ = (1 0) (10) = 1 × 1 + 0 × 0 = 1 (normalized)

⟨0|1⟩ = (1 0) (01) = 1 × 0 + 0 × 1 = 0 (orthogonal)

⟨1|0⟩ = (0 1) (10) = 0 × 1 + 1 × 0 = 0 (orthogonal)

⟨1|1⟩ = (0 1) (01) = 0 × 0 + 1 × 1 = 1 (normalized)

Hence the set {⟨0|, |1⟩} is orthonormal

Quantum Gates
A quantum gate or a quantum logic gate is a basic quantum circuit operating on a small
number of qubits. Quantum logic gates are the building blocks of quantum circuits, like how
classical logic gates are for conventional digital circuits. Quantum gates are unitary operators,
and are described as unitary matrices.

Single Qubit Gates:

Quantum Not Gate: A quantum NOT gate for a qubit is a process that takes the state |0⟩ to
the state |1⟩ and vice-versa. It is analogous to classical NOT gate. In, general, it changes
quantum state from α|0⟩+ β|1⟩ to α|1⟩+ β|0⟩.
A quantum NOT gate is represented in matrix form by matrix X as shown below.

0 1
𝑋=[ ]
1 0

𝛼
If the quantum state α|0⟩+ β|1⟩ is written in vector notations as [𝛽 ]

Then output from the quantum NOT gate is

𝑋 [𝛽𝛼 ] = [01 1 𝛼
0
𝛽
] [𝛽 ]=[𝛼 ] or α|1⟩+ β|0⟩

Similarly, if the input to the quantum NOT gate is α|1⟩+ β|0⟩

𝛽 1 𝛽 𝛼
Then the output becomes 𝑋[𝛼 ] = [01 0
] [𝛼 ]=[𝛽 ] or α|0⟩+ β|1⟩

Following are the circuit symbol and truth table for quantum NOT gate

Input Output
|0⟩ |1⟩
|1⟩ |0⟩
α|0⟩+ β|1⟩ α|1⟩+ β|0⟩

Pauli Z gate:

Pauli Z gate is defined as

1 0
𝑍=[ ] (Recall Pauli matrices)
0 −1
If it operates on |0⟩, we get

1 0 1 1
[ ] [0]= [0] ie Z|0⟩= |0⟩
0 −1

If it operates on |1⟩, we get

1 0 0 0
[ ] [1]= [−1] ie Z|1⟩= −|1⟩
0 −1

Thus the state α|0⟩+ β|1⟩ is transformed to α|0⟩- β|1⟩

Following are the circuit symbol and truth table for Pauli Z gate
α|0⟩- β|1⟩

Input Output
|0⟩ |0⟩
|1⟩ −|1⟩
α|0⟩+ β|1⟩ α|0⟩- β|1⟩

Similarly for Pauli X and Y Gates

0 1
𝑋=[ ] (Recall Pauli matrices)
1 0
0 −𝑖
𝑌=[ ]
𝑖 0
and similar kind of operation can be carried out on |0⟩ and |1⟩ as shown in the truth table
below:

Truth table for Pauli X Gate


Input Output
|0⟩ |1⟩
|1⟩ |0⟩
α|0⟩+ β|1⟩ α|1⟩+ β|0⟩

Truth table for Pauli Y Gate


Input Output
|0⟩ 𝑖|1⟩
|1⟩ −𝑖|0⟩
α|0⟩+ β|1⟩ 𝑖𝛼|1⟩ − 𝑖 β|0⟩

Hadamard Gate:

Hadamard Gate is defined as

1 1 1
𝐻= [ ]
√2 1 −1
If Hadamard Gate operates on |0⟩, we get

1 1 1 𝟏 0 (|0⟩+|1⟩)
] [0]= [1
𝟏 𝟏 𝟏 1
[
√𝟐 1 −1 √𝟐 1
] = [
√𝟐 0
] + [
√𝟐 1
] = √2

If Hadamard Gate operates on |1⟩, we get

1 1 0 (|0⟩−|1⟩)
1] = [1 [0
1 𝟏 𝟏 𝟏
[ ] [ ]= [−1 0] − 1] =
√2 1 −1 1 √𝟐 √𝟐 √𝟐 √2
In general, if the quantum state α|0⟩+ β|1⟩ is written in vector notations as [𝛽𝛼 ], it is
transformed due to Hadamard Gate as

𝟏 1 1 𝛼 1 𝛼+𝛽 𝛼+𝛽 𝛼−𝛽 |0⟩+|1⟩ |0⟩−|1⟩


[ ] [ ]= [ ]= |0⟩+ |1⟩ = 𝛼 +𝛽
√𝟐 1 −1 𝛽 √2 𝛼−𝛽 √2 √2 √2 √2

Following are the circuit symbol and truth table for Hadamard gate

Input Output
|0⟩ (|0⟩ + |1⟩)
√2
|1⟩ |0⟩ − |1⟩
√2
|0⟩+|1⟩ |0⟩−|1⟩
α|0⟩+ β|1⟩ 𝛼 +𝛽
√2 √2

Phase Gate (or S Gate):

The S or phase gate is defined as

1 0
𝑆=[ ]
0 𝑖
The effect of phase gate on |0⟩

1 0 1 1
[ ] [0]= [0]
0 𝑖

Hence the output is |0⟩

The effect of phase gate on |1⟩

1 0 0 0
[ ] [1]= [ 𝑖 ]
0 𝑖

Hence the output is 𝑖|1⟩

The S or phase gate transforms the state α|0⟩+ β|1⟩ as

1 0 𝛼 𝛼
[ ] [𝛽 ]= [𝑖𝛽 ] to the state α|0⟩+ 𝑖β|1⟩
0 𝑖
Following are the circuit symbol and truth table for S or phase gate

Input Output
|0⟩ |0⟩
|1⟩ 𝑖|1⟩
α|0⟩+ β|1⟩ α|0⟩+ 𝑖 β|1⟩

T Gate:

The T Gate is defined as

1 0
𝑇=[ 𝑖𝜋 ]
0 𝑒𝑥𝑝( )
4
If the input is |0⟩, then the output is

1 0 1 1
𝑒𝑥𝑝( 4 )] [0] = [0]
[0 𝑖𝜋

i.e the state is |0⟩,

If the input is |1⟩, then the output is

1 0 0 0
[0 𝑒𝑥𝑝( 4 )] [1]= [exp(𝑖𝜋4)]
𝑖𝜋

𝑖𝜋
i.e the state is 𝑒𝑥𝑝( 4 ) |1⟩,

It transforms the state α|0⟩+ β|1⟩ as

1 0 𝛼 𝛼
[0 𝑒𝑥𝑝( 4 )] [𝛽]= [βexp(𝑖𝜋4)]
𝑖𝜋

𝑖𝜋
to α|0⟩+ βexp( 4 )|1⟩

The following are the truth table and circuit symbol for a T Gate
Input Output
|0⟩ |0⟩

|1⟩ 𝑖𝜋
exp( )|1⟩
4
𝑖𝜋
α|0⟩+ β|1⟩ α|0⟩+𝛽exp( 4 )|1⟩

Multiple Qubit Gates:

Controlled gate:

A controlled gate is one in which the operation is of the kind “If A is true then B is also true”.
A is usually referred to as control qubit and B is 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
(inverted). However, the control qubit remains unaltered in both cases.

Controlled NOT (CNOT Gate):

The circuit symbol of CNOT Gate control qubit A and target qubit B is shown below

where ⊕ is modulo 2 addition (Modulo 2 addition/subtraction is performed using an XOR


gate in classical computing. For ex: 0 ± 0 = 0; 0 ± 1 = 1; 1 ± 0 = 1; 1 ± 1 = 0)

This kind of Gate has two input qubits:


(a) Control qubit: It is shown by the top line in the figure
(b) Target qubit: It is shown by the bottom line in the figure
For input state |00⟩ (control qubit = 0 and target qubit = 0): Both the bits remain unaltered
and hence the output state becomes |00⟩, which is same as input state.

For input state |01⟩ (control qubit = 0 and target qubit = 1): Both the bits remain unaltered
and hence the output state becomes |01⟩, which is same as input state.

For input state |10⟩ (control qubit = 1 and target qubit = 0): The target qubit is flipped to 1.
Therefore the output state becomes |11⟩

For input state |11⟩ (control qubit = 1 and target qubit = 1): The target qubit is flipped to 0.
Therefore the output state becomes |10⟩.
The matrix representation of CNOT Gate is as follows:

Truth table for CNOT Gate

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

In general, |𝐴, 𝐵⟩ |𝐴, 𝐵 ⊕ 𝐴⟩

SWAP Gate:

A SWAP Gate is a quantum circuit symbol which contains three quantum Gates

In a SWAP Gate the output of the first CNOT Gate is fed as input to the second Gate and this
result is fed to the third Gate. Therefore two qubits are swapped in the final output.

In general, |𝐴, 𝐵⟩ |𝐵, 𝐴⟩

The matrix representation of SWAP Gate is as follows:

Truth table for SWAP Gate

Input Output
|00⟩ |00⟩
|01⟩ |10⟩
|10⟩ |01⟩
|11⟩ |11⟩
Controlled -Z gate:

The circuit symbol of Controlled -Z gate Gate is shown below

The matrix representation of Controlled -Z gate is as follows:

Truth table for Controlled -Z gate

Input Output
|00⟩ |00⟩
|01⟩ |01⟩
|10⟩ |10⟩
|11⟩ −|11⟩
Toffoli Gate:

It is a reversible Gate having three inputs (a, b, c) and three output bits (a’, b’ c’). The first
two bits are control bits which remain unaffected by the action of Toffoli Gate. The third is
the target bit which is inverted if both the control bits are 1; else it does not change. The
quantum Taffolli Gate can be used to simulate irreversible classical logical Gates and ensures
that they are capable of doing any computation.

The circuit symbol of Toffoli Gate is shown below


The matrix representation of Toffoli Gate is as follows:

Truth table for Toffoli Gate

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

You might also like