Module 3 Quantum Computing CSE UPR
Module 3 Quantum Computing CSE UPR
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.
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:
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,
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.
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.
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.
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 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:
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.
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.
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|𝑢⟩ = |𝑢⟩
1 0 1 1
[ ] [ ] =[ ]
0 1 0 0
1 0 0 0
[ ] [1] = [1]
0 1
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
As noted above, since X transforms one state to another, it is sometimes called the NOT
operator.
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
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:
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:
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.
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
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] = [𝛽𝛼]
Therefore, ⟨𝜓|𝜓⟩ = 1
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
Orthonormality:
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.
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 [𝛽 ]
𝑋 [𝛽𝛼 ] = [01 1 𝛼
0
𝛽
] [𝛽 ]=[𝛼 ] or α|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:
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
1 0 0 0
[ ] [1]= [−1] ie Z|1⟩= −|1⟩
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⟩
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:
Hadamard Gate:
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
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
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
1 0
𝑆=[ ]
0 𝑖
The effect of phase gate on |0⟩
1 0 1 1
[ ] [0]= [0]
0 𝑖
1 0 0 0
[ ] [1]= [ 𝑖 ]
0 𝑖
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:
1 0
𝑇=[ 𝑖𝜋 ]
0 𝑒𝑥𝑝( )
4
If the input is |0⟩, then the output is
1 0 1 1
𝑒𝑥𝑝( 4 )] [0] = [0]
[0 𝑖𝜋
1 0 0 0
[0 𝑒𝑥𝑝( 4 )] [1]= [exp(𝑖𝜋4)]
𝑖𝜋
𝑖𝜋
i.e the state is 𝑒𝑥𝑝( 4 ) |1⟩,
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⟩
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.
The circuit symbol of CNOT Gate control qubit A and target qubit B is shown below
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:
Input Output
|00⟩ |00⟩
|01⟩ |01⟩
|10⟩ |11⟩
|11⟩ |10⟩
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.
Input Output
|00⟩ |00⟩
|01⟩ |10⟩
|10⟩ |01⟩
|11⟩ |11⟩
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.
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