Module-3 Quantum Computing
Module-3 Quantum Computing
Quantum Computing
Moore’s law & its end, Differences between Classical & Quantum computing. Concept of
qubit and its properties. Representation of qubit by Bloch sphere. Single and Two qubits.
Quantum Gates
Single Qubit Gates: Quantum Not Gate, Pauli – X, Y and Z Gates, Hadamard Gate, S Gate,
T Gate. Multiple Qubit Gates: Controlled gate, CNOT Gate, Swap gate.
Numerical Problems.
08 Hours
Introduction
Quantum computing is a rapidly emerging technology that utilizes the laws of quantum
mechanics to solve problems too complex for classical computers. It is based on the
principles of quantum mechanics which provides a description of the behaviour of very small,
atomic, subatomic particles. Due to the way these particles behave, operations in a quantum
computer can be done much faster than in traditional computers. It is a multidisciplinary field
comprising aspects of physics, mathematics, computer science and electrical engineering.
Quantum computing has opened up opportunities across several industries and disciplines,
from pharmaceuticals, chemical engineering, information and communications technology to
finance, automotive, and aerospace etc.
Superposition
Superposition is a process in which the quantum system is capable of being in several
different states at the same time. The superposition of qubits gives quantum computers their
inherent parallelism and allowing them to process millions of operations simultaneously.
For example, consider a coin toss scenario. When you flip the coin, it ends up as heads or
tails. However, if we consider the state of the coin when it is suspended in the air, it holds
both heads and tails simultaneously. Similarly, quantum particles such as electrons are in a
state of quantum superposition until they are measured. As a result, the ‘uncertainty’ factor is
taken care of in quantum computers.
Entanglement
Quantum entanglement occurs when two systems link so closely that knowledge about one
gives you immediate knowledge about the other, no matter how far apart they are. Quantum
processors can draw conclusions about one particle by measuring the other. Entanglement is
the ability of qubits to correlate their state with other qubits.
For example, one can conclude that, if one qubit spins upward the other will always spin
downward and vice versa. Quantum entanglement allows quantum computers to solve
complex problems faster.
Quantum interference
Quantum interference is a method of controlling the quantum states in a quantum machine by
reinforcing or diminishing the wave functions of quantum particles. As a result, quantum
states leading to a correct output can be amplified, while one can subsequently cancel the
states yielding a wrong output.
Statement – “It states that the number of transistors on a microchip doubles every two
years.”
Moore's prediction has been used in the semiconductor industry to guide long-term planning
and to set targets for research and development. Advancements in digital electronics, such as
the reduction in quality-adjusted microprocessor prices, the increase in memory
capacity (RAM and flash), the improvement of sensors, and even the number and size
of pixels in digital cameras, are strongly linked to Moore's law. These ongoing changes in
digital electronics have been a driving force of technological and social change, productivity,
and economic growth.
Moore's Law implies that computers, machines that run on computers, and computing power
all become smaller, faster, and cheaper with time as transistors on integrated circuits
become more efficient.
There is a limit to Moore's Law, as transistors approach the size of a single atom, their
functionality begins to get compromised due to the particular behaviour of electrons at that
scale. In a 2005 interview, Moore himself stated that his law “can't continue forever.”
Moore's Law, which describes the historical increases in computing power is likely to end
this decade due to physical limitations and exponentially rising costs. New chip architectures
and materials will be used to develop new types of computing that will promote future
technological gains.
computing. Just as a bit is the basic unit of information in a classical computer, a qubit is the
basic unit of information in a quantum computer. Qubit = quantum form of a bit. Qubits can
present 3 main properties: i) Superposition (ability to be in a state of 0 and 1 at the same
time), ii) Entanglement (spooky action at a distance) iii) Tunnelling (finite probability of a
particle moving through barriers). One qubit can take the value of two bits. Two qubits can
take the value of four bits. In general, n qubits can take the value of 2n bits. Quantum
computers use quantum bits or qubits to measure and extract information.
Unlike the bits of classical computers, which can store a 1 or 0, qubits can store multiple
values at the same time. A quantum bit can exist in superposition states, subjected to
incompatible measurements, and even be entangled with other quantum bits. Having the
ability to harness the powers of superposition, interference and entanglement the qubits are
fundamentally different and much more powerful than classical bits. This theoretically gives
them a huge speed advantage over classical computers and algorithms. Qubits represent
atoms, ions, photons or electrons and their respective control devices that are working
together to act as computer memory and a processor. A Qubit can be physically implemented
by the two states of an electron or horizontal and vertical polarizations of photons.
In quantum mechanics, the general quantum state of a qubit can be represented by a linear
superposition of its two orthonormal basis states (or basis vectors) and are usually denoted as
|0⟩ and |1⟩. They are written in the conventional “Dirac or bra-ket” notation ( |0⟩ and |1⟩),
pronounced as "ket 0" and "ket 1" respectively. These two orthonormal basis states {|0⟩, |1⟩}
together called computational basis are said to span the two-dimensional linear vector
(Hilbert) space of the qubit.
A pure qubit state of a single qubit |𝜓⟩ can be described by linear combination of |0⟩ and |1⟩:
|𝜓⟩ = 𝛼|0⟩ + 𝛽|1⟩
Where α and β are the probability amplitudes and are both complex numbers. When we
measure this qubit in the standard basis, according to the Born rule the probability of
outcome |0⟩ with value “0” is |𝛼|2 and the probability of outcome |1⟩ with value “1” is |𝛽|2.
Because the absolute squares of the amplitudes equate to probabilities, from the theory of
probability α and β must satisfies the equation,
|𝛼|2 + |𝛽|2 = 1
Properties of qubits
A qubit can be in a superposed state of the 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 unlike how it’s deterministic in a classical computer.
Owing to the quantum nature, the qubit changes its state at once when subjected to
measurement. This means, one cannot copy information from qubits the way we do in the
present computers, as there will be no similarity between the copy and the original. This is
known as "no cloning principle".
The Bloch sphere is a unit 2-sphere, with antipodal points corresponding to a pair of mutually
orthogonal state vectors. The north and south poles of the Bloch sphere are typically chosen
to correspond to the standard basis vectors |0⟩ and |1⟩ respectively. This choice is arbitrary.
However, the points on the surface of the sphere correspond to the pure states of the system
and the interior points correspond to the mixed states. The Bloch sphere may be generalized
to an n-level quantum system.
Bloch sphere. This Bloch sphere picture is elegant and powerful for the qubit. It helps one to
visualize the superposition of quantum states in terms of the angular coordinates and the
unitary operations on the state as rotations on the unit sphere.
The north and south poles are used to represent the basis states |0⟩ and |1⟩ respectively, the
other locations are the superposition of |0⟩ and |1⟩ states. Any point |𝜓⟩ on this sphere is
represented by equation,
|𝜓⟩ = 𝛼|0⟩ + 𝛽|1⟩
Where α and β are the probability amplitudes satisfying the condition |𝛼|2 + |𝛽|2 = 1.
The Bloch sphere allows the state of the qubit to be represented by unit spherical co-
ordinates, 𝜃 (polar angle) and 𝜙 (azimuth angle). The Bloch sphere is represented by the
equation,
𝜃 𝜃
|𝜓⟩ = 𝐶𝑜𝑠 |0⟩ + 𝑒 𝑖𝜑 𝑆𝑖𝑛 |1⟩
2 2
Here 0 ≤ θ ≤ π and 0 ≤ φ ≤ 2π. The normalization condition is given by,
𝜃2 𝜃2
|𝐶𝑜𝑠 | + |𝑆𝑖𝑛 | = 1
2 2
Two qubit
A two-qubit system has 4 computational basis states denoted as |00⟩, |01⟩, |10⟩, |11⟩. The
pictorial representation of two qubit is as follows: 𝛼|00⟩ + 𝛽 |01⟩ + 𝛾 |10⟩ + 𝛿|11⟩
1 0 0 0
I|1⟩ = ( )( ) = ( )
0 1 1 1
∴ I|1⟩ = |1⟩
Thus, the operation of identity matrix(operator) on |0⟩ and |1⟩ leaves the states unchanged.
1 0 0 0
𝜎0 |1⟩ = ( )( ) = ( )
0 1 1 1
∴ 𝜎0 |1⟩ = |1⟩
0 1 0 1
𝜎𝑥 |1⟩ = ( )( ) = ( )
1 0 1 0
∴ 𝜎𝑥 |1⟩ = |0⟩
0 −𝑖 0 −𝑖 1
𝜎𝑦 |1⟩ = ( ) ( ) = ( ) = −𝑖 ( )
𝑖 0 1 0 0
∴ 𝜎𝑦 |1⟩ = −𝑖|0⟩
1 0 0 0 0
𝜎𝑧 |1⟩ = ( )( ) = ( ) = −( )
0 −1 1 −1 1
∴ 𝜎𝑧 |1⟩ = −|1⟩
Conjugate of a matrix
A conjugate matrix is a complex matrix, in which all its elements have been replaced by their
complex conjugates, i.e., the sign of the imaginary part of all its complex numbers have been
changed.
̅
The conjugate matrix of any matrix A is denoted with a horizontal bar above it: A
For example, let A is a matrix such that,
1+𝑖 2 + 3𝑖
A=[ ]
5 − 2𝑖 4
To find the conjugate of this matrix A we find the conjugate of each element of matrix A i.e.,
̅ =[ 1−𝑖
A
2 − 3𝑖
]
5 + 2𝑖 4
This is the conjugate of a 2×2 matrix A.
Transpose of a matrix
The transpose of a matrix is exchanging the rows of the matrix for its columns, i.e., the
transpose of a matrix is obtained by changing the rows into columns and columns into rows
for a given matrix. The transpose of a matrix is indicated by writing a “T” at the top right of
the matrix (AT).
For example, let A is a matrix such that,
4 6 2
𝐴=[ ]
5 8 1
To transpose matrix A we just have to interchange its rows for its columns. So, the first row
of the matrix becomes the first column of the matrix, and the second row of the matrix
becomes the second column of the matrix:
4 5
𝑇
𝐴 = [6 8]
2 1
Logically, the dimension of a matrix changes when it is transposed. In this case, matrix A
was a 2×3 dimension matrix, and its transpose is a 3×2 dimension matrix.
Hermitian matrix
The matrix that is equal to its conjugate-transpose is called Hermitian. Thus, for any matrix A
If A† = A then it is called Hermitian or Self-Adjoint matrix.
For example, let A is a matrix such that,
4 3+𝑖
A=[ ]
3−𝑖 9
The conjugate of A is given by
̅=[ 4
A
3−𝑖
]
3+𝑖 9
The conjugate transpose of a matrix is
4 3+𝑖
A† = [ ]
3−𝑖 9
∴ A† = A
Unitary matrix
If a matrix U is said to be unitary, the product of the matrix and the conjugate transpose of a
matrix is equal to the Identity matrix. In other words, a matrix whose inverse is equal to its
conjugate transpose is known as unitary matrix.
Thus, If U is a unitary matrix then we have
U. U † = I
U. U −1 = I
For example, let U is a matrix such that,
1 1
U = √2 √2
1 1
i − i
[√2 √2 ]
The conjugate transpose of U is,
1 1
− 𝑖
U = √2
† √2
1 1
i
[√2 √2 ]
Let us take U. U † ,
1 1 1 1
𝑖 −
U. U = † √2 √2 × √2 √2
1 1 1 1
i − i i
[√2 √2 ] [√2 √2 ]
1 1 1 1 1 1 1 1
× + × − × i+ × i
†
U. U = √2 √2 √2 √2 √2 √2 √2 √2
1 1 1 1 1 1 1 1
i× − i× − i× i− i× i
[√2 √2 √2 √2 √2 √2 √2 √2 ]
1 1 𝑖 𝑖
+ − +
2 2 2 2
U. U † = [ ]
𝑖 𝑖 𝑖2 𝑖2
− − −
2 2 2 2
1 0
U. U † = [ ]
0 1
∴ U. U † = I
Let us consider,
𝛼1
|𝜓⟩ = [ 𝛽 ]
1
𝛼2
⟨𝜓|𝜑⟩ = [𝛼1∗ 𝛽1∗ ] [𝛽 ]
2
Orthogonality
If two quantum states |𝜓⟩ and |𝜑⟩ are said to be orthogonal if their inner product is zero.
Mathematically it can be written as ⟨𝜓|𝜑⟩ = 0
Let us consider the inner product of |0⟩ and |1⟩,
0
⟨0|1⟩ = [1 0] [ ]
1
⟨0|1⟩ = 0
Orthonormality
If two quantum states |𝜓⟩ and |𝜑⟩ are said to be orthonormal if,
Quantum gates
In quantum computing a quantum logic gate is a basic quantum circuit operating on a small
number of qubits. A qubit is useless unless it is used to carry out a quantum calculation. The
quantum calculations are achieved by performing a series of fundamental operations, known
as quantum logic gates. They are the building blocks of quantum circuits similar to the
classical logic gates in conventional digital circuits. Unlike many classical logic gates,
quantum logic gates are reversible. It is possible to perform quantum computing using only
reversible gates.
A quantum State is given by 𝛼|0⟩ + 𝛽|1⟩ and its matrix representation is given by [𝛽𝛼]. Hence
The quantum not gate circuit and the truth table are shown below.
Y gate
The Y gate is represented by Pauli matrix 𝜎𝑦 or Y. This gate maps |0⟩ state to 𝑖|1⟩ state and
|1⟩ state to −𝑖|0⟩ state.
The matrix representation of Y Gate and its operation on |0⟩ and |1⟩ are as follows,
0 −𝑖 1 0 0
𝑌|0⟩ = [ ] [ ] = [ ] = 𝑖[ ]
𝑖 0 0 𝑖 1
∴ 𝑌|0⟩ = 𝑖|1⟩
0 −𝑖 0 −𝑖 1
𝑌|1⟩ = [ ] [ ] = [ ] = −𝑖 [ ]
𝑖 0 1 0 0
∴ 𝑌|1⟩ = −𝑖|0⟩
Thus the Y-gate defines the transformation
𝑌(𝛼|0⟩ + 𝛽|1⟩) = 𝛼𝑌|0⟩ + 𝛽𝑌|1⟩ = −𝑖𝛽|0⟩ + 𝑖𝛼|1⟩
The quantum Y gate is represented by
Z gate
The Z-gate is represented by Pauli matrix 𝜎𝑧 or 𝑍. This gate leaves a |0⟩ state unchanged but
flips the sign of the |1⟩ state to −|1⟩.
The matrix representation and the operation of Z-gate on |0⟩ and |1⟩ are as follows,
1 0 1 1
𝑍|0⟩ = [ ] [ ]=[ ]
0 −1 0 0
∴ 𝑍|0⟩ = |0⟩
1 0 0 0 0
𝑍|1⟩ = [ ] [ ] = [ ] = −[ ]
0 −1 1 −1 1
∴ 𝑍|1⟩ = −|1⟩
Thus the Z-gate defines the transformation
𝑍(𝛼|0⟩ + 𝛽|1⟩) = 𝛼𝑍|0⟩ + 𝛽𝑍|1⟩ = 𝛼|0⟩ − 𝛽|1⟩
The circuit symbol and the truth table of Z-gate are as follows.
1 1 1 0 1 1
𝐻|1⟩ = [ ] [ ]= [ ]
√2 1 −1 1 √2 −1
1
∴ 𝐻|0⟩ = (|0⟩ − |1⟩) = | −⟩
√2
The circuit representation of Hadamard gate operating on |0⟩ and |1⟩ states is,
1 0 0 0
𝑆|1⟩ = [ ] [ ] = [ ] = 𝑖|1⟩
0 𝑖 1 𝑖
∴ 𝑆|1⟩ = 𝑖|1⟩
Thus, the S gate defines the transformation,
𝑆(𝛼|0⟩ + 𝛽|1⟩) = 𝛼𝑆|0⟩ + 𝛽𝑆|1⟩ = 𝛼|0⟩ + 𝑖𝛽|1⟩
𝝅
T gate or 𝟖 gate
The T gate is a single qubit operation represented in the matrix form as,
1 0 1 0
𝑇=[ 𝑖𝜋 ] = [0 1 + 𝑖]
0 𝑒4 √2
The T gate is related to S gate by the relation, S = T2
The operation of T gate on |0⟩ and |1⟩ states is given by,
1
0
𝑇|0⟩ = [0 1 + 𝑖 ] [1] = [1]
0 0
√2
∴ 𝑇|0⟩ = |0⟩
1 0 0
1 + 𝑖 0 1+𝑖 0
𝑇|1⟩ = [0 ] [ ] = [ + 𝑖] =
1 [ ]
1 √2 1
√2 √2
1+𝑖
∴ 𝑇|1⟩ = |1⟩
√2
The circuit symbol for T gate is given by,
Controlled gates
A gate with operation of kind "If 𝐴 is True then do 𝐵" is called controlled gate. The qubit |𝐴⟩
is called Control qubit and |𝐵⟩ is the Target qubit. The target qubit is altered only when the
control qubit is |1⟩. The control qubit remains unaltered during the transformations.
Swap gate
The SWAP gate is two-qubit operation. Expressed in basis states. The SWAP gate swaps the
state of the two qubits involved in the operation.
The matrix representation of Swap gate is as follows,
1 0 0 0
0 0 1 0
𝑆𝑊𝐴𝑃 = [ ]
0 1 0 0
0 0 0 1
The SWAP gate interchanges the input states say, |∅⟩ and |𝜓⟩. The schematic swap gate
circuit symbol is as follows, which is equivalent to the combined circuit of 3 CNOT gates and
the overall effect is that two input qubits are swapped at the output.