Quantum Computing Principles and Concepts
Quantum Computing Principles and Concepts
Syllabus (8 Hours)
Wave Function in Ket Notation: Matrix form of wave function, Identity Operator,
Determination of I|0> and I|1>, Pauli Matrices and its operations on 0 and 1 states, Mention of
Conjugate and Transpose, Unitary Matrix U, Examples: Row and Column Matrices and their
multiplication (Inner Product), Probability, Orthogonality.
Quantum Gates:
Single Qubit Gates: Quantum Not Gate, Pauli -Z Gate, Hadamard Gate, Pauli Matrices, Phase
Gate (or S Gate), T Gate.
Multiple Qubit Gates: Controlled Gate, CNOT Gate (Discussion of 4 different input states),
Representation of Swap Gate, Controlled -Z Gate, Toffoli Gate, Accounting for the extra-
ordinary capacity of quantum computing, Model Realizations.
Pre-requisites: Matrices
Page | 1
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Principles of Quantum Information & Quantum Computing
The primary focus will be on learning how to quantify information. This will be done using a
concept known as entropy, a quantity that can be said to be a measure of disorder in physics.
Information is certainly the opposite of disorder, so we will see how entropy can be used to
characterize the information content in a signal and how to determine how many bits we need
to reliably transmit a signal. Later these ideas will be tied in with quantum information
processing.
Introduction:
Evolution in one region of science and technology leads to the discovery of a new one.
In less than a century, research and development of functional computing technologies have
renovated science, technology, and nation massively. The first practical computer around the
20th century was not capable of doing mathematical computations, on its own. Practical
devices need a solid physical implementation of theoretical concepts. Nowadays, computers
are solving problems instantly and accurately provided the input is relevant, and a set of
instructions given are favorable. It all started from World War II when Alan Turing created a
real general-purpose computer with a storable program model and is known as the ‘Universal
Turing Machine’. It was redesigned by Von Neumann and is now the most important
architecture for almost every computer. The computers and their physical parts kept improving
with time in terms of performance and their strengths. And gradually, the industry of computers
became larger than the military department which initiated it. The advancement in control and
understanding of humans over nature and physical systems has given us the latest electronic
devices we are utilizing today.
Page | 2
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
classical computing that uses binary bits 0 and 1 individually. The computers using such type
of computing are known as ‘Quantum Computers’. In such small computers, circuits with
transistors, logic gates, and Integrated Circuits are not possible. Hence, it uses the subatomic
particles like atoms, electrons, photons, and ions as their bits along with their information of
spins and states. They can be superposed and can give more combinations. Therefore, they can
run in parallel using memory efficiently and hence is more powerful. Quantum computing is
the only model that could disobey the Church-Turing thesis and thus quantum computers can
perform exponentially faster than classical computers.
Page | 3
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
can be in multiple quantum states simultaneously. Such phenomenon is known as superposition
of states. Due to this phenomenon a quantum computer can exhibit both ‘0’ and ‘1’ states at
the same time, as well as in number of intermediate superposed states. Thus, in a classical
computer information is expressed through single number either 0 or 1. A quantum computer
uses qubits which is described as a 0 and 1 at the same time giving us more processing power.
In particular, a two-bit classical computer to analyse 01 11 10 11, it has to follow a set of
instruction step by step to obtain a result. But for a two-qubit quantum computer, parallelism
allows to analyses every possibility at the given instant of time. Hence, computation time is
reduced drastically.
Quantum Computing:
The history of computing and information processing back to early forties of the past
century, when an English mathematician Alan Turing invented an idealized computer,
popularly known as “Turing machine”. This device performs computation with a simple set of
instructions and infinite memories. In general, a computing device contains many circuits that
includes inputs, outputs, wires and logic gates. These circuits will be implemented via
semiconductors, which have two functionalities namely, conductor and insulator. For a given
condition, it acts as a highspeed switch that leads and stops electricity.
Modern day computing devices such as computers, mobile phones, televisions, network
switches are based on integrated circuits of semiconductor. Although semiconductor is entirely
based on Physics of quantum mechanics, we do not refer these computers as “quantum
computers” but rather called “classical computers”. This is due to the fact that the data for logic
gates are represented by two logical input values 0 and 1 in the circuits using devices with
current on/off, high voltage/low voltage, and/or direction of magnetization up/down without
involving any quantum state of atom or molecule. Thus, the operation of present-day computers
is purely based on classical physics. They are governed by locality and the classical behavior
Page | 4
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
defined as only one state at the time. However, the behavior of modern quantum systems
implies that the world behaves quite differently.
A quantum system can be present in a superposition of many different states at the same
time, and can exhibit interference effects during the course of its evolution. Moreover, spatially
separated quantum systems may be entangled with each other and operations may have “non-
local” effects because of this. Quantum computation is the field that investigates the
computational power and other properties of computers based on quantum-mechanical
principles. An important objective is to find quantum algorithms that are significantly faster
than any classical algorithm solving the same problem. The following are few reasons to study
the quantum computing
3. Finally, to study and understand the power and limitations of the strongest possible
computational devices that can be realized through quantum principles.
Page | 5
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Moore’s law & its end:
In 1965, Gordon Moore predicted that the number of transistors on an integrated circuit
will doubles about every two years. This statement is known as Moore’s Law, signifying that
the computational progress will become significantly faster, miniaturized, and more efficient
over time. Also, it is regarded as one of the hallmark theories of the 21st century that carries
significant implications for the future of technological progress in semiconductor industry
along with its possible limitations.
Moore’s Law had a direct impact on the progress of computing power. This specifically means
that transistors in integrated circuits have become faster. According to present situation in
computing industry, Moore’s Law is estimated to reach its end sometime around 2025. This
implies that computers are expected to reach their maximum limit because the transistors will
not be able to perform within smaller circuits due increasingly higher temperature. This results
in thermal damage to the transistor chips and can be avoided to some extent by cooling the
transistor, yet, the energy required in this process will be significantly more than that needed
for the functioning of the transistor itself.
Whilst the more power results in the ability to carry out more advanced tasks through
computers, still it is not feasible to keep pushing the limit on smaller transistors. At some extent,
transistors will reach a smaller dimension where the quantum size effects will disrupt normal
operation. This leads to quantum tunneling, where electrons tunnel through the components of
the circuit. In general, processors rely on the logic gates, integrated components that either pass
or block the movements of electrons, to perform a specific operation. If electrons can simply
bypass or tunneled through logic gates at the quantum level, then the regular operation of the
processor will be hindered.
Page | 6
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Single particle quantum interference:
D1
A 45º C
45º D2
Beam splitters
S
B
45º O 45º
With this arrangement, the path length of photon along OAC is same as OBC, such that,
OAC = OBC. 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 the detector D1 which the photon reaches and never the detector D2. This effect is
explained as follows.
Every time 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 D1 will reinforce, and thus will be detected there. This means that
the photon has in reality travelled not one but both paths simultaneously and underwent self-
interference to be detected only at D1.
This experiment is known as ‘Single particle quantum interference’, the fact that the
particle exists in both the paths (states) and it considered superposition.
Page | 7
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Differences between classical and quantum computing:
Sl.
Classical computing Quantum computing
No.
It works on the principle based on It works on the principle based on
1.
classical physics. quantum mechanics.
Information is stored in any of the Information is store in the form of
2. following forms: voltage, current, or quantum bit. Eg. Direction of an
magnetization. electron spin.
3. Information is stored in bits Information is stored in qubits
Used by large-scale multipurpose Used by high-speed, quantum
4.
computers and devices. mechanics-based computers.
Number of possible states are discrete: Number of possible states are
5.
0 or 1 continuous: infinite.
Output measurements are Output measurements are probabilistic,
deterministic, i.e., repeated i.e., measurements on superposed
6.
computations on any given input will states lead to probabilistic answers,
yield the same output. then it is reduced to 0 or 1.
Information processing is sequentially
carried out through logic gates. Eg. Information processing is carried out in
7.
AND, OR, NOT in a basis of parallel through quantum logic gates.
sequence.
Operations are governed by linear
8. Operations follow Boolean algebra.
algebra over Hilbert space.
There is no restriction in measuring There exist severe restrictions in
and copying signals. It possesses low measuring and copying signals. Also,
9.
error rates and can operate at room possess high error rates and to be
temperature. maintained at ultracold temperature
Page | 8
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
states, can also be prepared to a state that contains coherent superposition of both the states,
i.e., the atom can exist in states as a zero, a one 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
atom’s existence in each of these states. Since it follows quantum principles, it becomes a
quantum system and it is called as a quantum bit or a qubit. Thus, one qubit can encode at a
time both 0 and 1. In case of light a qubit may correspond to the superposed state of horizontal
and vertical polarization of photons apart from the two individual states of polarization.
Thus, a qubit can be defined as a quantum bit the counterpart in quantum computing to
the binary digit or bit of a classical computing. Similar to the bit is the basic unit of information
in a classical computer, a qubit is the basic unit of information in a quantum computer.
1 0
𝑄𝑢𝑏𝑖𝑡: = |0⟩ + |1⟩ = ( ) + ( ) = ( )
0 1
Qubit:
We know that, ‘bit’ is the fundamental concept of classical computation and classical
information. It can take values either ‘0’ or ‘1’. A digital computer both stores and processes
information using bits, which can be either 0 or 1. Physically, a bit can be anything that has
two distinct configurations: one represented by “0”, and the other represented by “1”. It could
Page | 9
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
be a light bulb that is on or off, a coin that is heads or tails, or any other system with two distinct
and distinguishable possibilities. In modern computing and communications, bits are
represented by the absence or presence of an electrical signal, encoding “0” and “1”
respectively.
A qubit is a quantum bit in quantum computation and quantum information. Qubit can
exist in |0⟩, |1⟩ and the combination (superposition) of both. Where, |0⟩ and |1⟩ are the
computational basis states in quantum computation.
In general, the qubit state |0⟩ can be written as the linear combination of both |0⟩ and |1⟩ as
follows;
Where, |𝛼⟩ and |𝛽⟩ are the complex numbers called probability amplitudes, such that,
|𝛼|2 + |𝛽|2 = 1
Which means, the probability of |𝜓⟩ exist in |0⟩ state is |𝛼|2 and the probability of |𝜓⟩ exist in
|1⟩ state is |𝛽|2.
Page | 10
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Note:
Properties of a Qubit:
(i) A qubit can be in a superposed state of the two states |0⟩ and |1⟩.
(ii) If measurements are carried out with a qubit in superposed state then the results that we
get will be probabilistic.
(iii) Due 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 it in the
present-day computers, as there will be no similarity between the copy and the original. This
is known as ‘no cloning principle’.
There are many kinds of qubits, some occurring naturally and others that are
engineered. Some of the most common types include: (i) Spin; (ii) Photons.
Electron will have either spin up ‘↑’ or spin down ‘↓’ or both. Same way photons in
terms of their polarization, right circular or left circular polarizations can be realized as |0⟩
and |1⟩ states of qubit respectively.
The Bloch sphere is a geometrical representation of pure single qubit states as a point on the
unit sphere.
Page | 11
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
We can visualize these distinct states, |0⟩ and |1⟩, as the north and south poles of a sphere of
radius 1 called the Bloch sphere (Fig. 3.3).
The operations on single qubits commonly used in quantum information processing can be
represented on the Bloch sphere.
The two qubits |0⟩ and |1⟩ represented by z and -z axis respectively. Here, as |0⟩ denotes the
upward spin of electron and |1⟩ denotes the downward spin of the electron.
At any point on the Bloch sphere, the state |𝜓⟩ can be represented by the equation;
Where, 𝛼 2 and 𝛽 2 are the probabilities of electron having upward and downward spins
respectively, such that, |𝛼|2 + |𝛽|2 = 1.
𝜃 𝜃
|𝜓⟩ = 𝐶𝑜𝑠 ( ) |0⟩ + 𝑒 𝑖𝜙 𝑆𝑖𝑛 ( ) |1⟩
2 2
Page | 12
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Single Qubits
A single classical bit has two possible states 0 & 1. Similarly, a single qubit can be
written as |0⟩ & |1⟩ in the computational states. A single qubit is a state vector in 2-D complex
vector space, C. It is in general written as 𝛼|0⟩ + 𝛽|1⟩, where 𝛼, 𝛽 ∈ 𝐶, such that, |𝛼|2 +
|𝛽|2 = 1 and |0⟩ & |1⟩ are orthonormal basis vectors.
Two Qubits:
Classically two bits can have four possible states such as 00, 01, 10 & 11. Similarly,
two qubits will need four computational basis states such as, |00⟩, |01⟩, |10⟩ & |11⟩, hence
four complex amplitudes to represent them.
The quantum state (two qubit) in the superposition form can be written as,
Where, 𝛼00 , 𝛼01 , 𝛼10 &𝛼11 are probability amplitudes, such that, |𝛼00 |2 + |𝛼01 |2 + |𝛼10 |2 +
|𝛼11 |2 = 1.
The rule of the measurement is still working in the same way. That is, the probability of |00⟩
state is |𝛼00 |2 .
Note:
If we have two separated qubits, we can describe their collective (total) state using the
tensor product as follows,
𝑎1 𝑏
Example: Let |𝑎⟩ = [𝑎 ] and |𝑏⟩ = [ 1 ]; then the tensor product (cross product)
2 𝑏
between them will be as follows;
𝑏1 𝑎1 𝑏1
𝑎1 𝑎1 [ ]
𝑏1 𝑏2 𝑎 𝑏
|𝑎⟩⨂|𝑏⟩ = |𝑎𝑏⟩ = [𝑎 ] ⨂ [ ] = [ ]= [ 1 2]
2 𝑏2 𝑏 𝑎2 𝑏1
𝑎2 [ 1 ]
𝑏2 𝑎2 𝑏2
Page | 13
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
𝑏1 𝑎1 𝑏1
𝑎1 𝑐1 𝑎1 [ ] 𝑐1 𝑐1
𝑏1 𝑏2 𝑎 𝑏
|𝑎⟩⨂|𝑏⟩⨂|𝑐⟩ = |𝑎𝑏𝑐⟩ = [𝑎 ] ⨂ [ ] ⨂ [𝑐 ] = [ ] ⨂ [𝑐 ] = [ 1 2 ] ⨂ [𝑐 ]
2 𝑏2 2 𝑏 2 𝑎2 𝑏1 2
𝑎2 [ 1 ]
𝑏2 𝑎2 𝑏2
𝑐1 𝑎1 𝑏1 𝑐1
𝑎1 𝑏1 [𝑐 ] 𝑎1 𝑏1 𝑐2
2
𝑐1 𝑎1 𝑏2 𝑐1
𝑎1 𝑏2 [𝑐 ] 𝑎1 𝑏2 𝑐2
2
= 𝑐1 = 𝑎2 𝑏1 𝑐1
𝑎2 𝑏1 [𝑐 ]
2 𝑎2 𝑏1 𝑐2
𝑐1 𝑎2 𝑏2 𝑐1
[𝑎2 𝑏2 [𝑐2 ]]
[𝑎2 𝑏2 𝑐2 ]
Exercise 1: Write the tensor product of the following qubits; (i) |01⟩, (ii) |0 +⟩, (iii) |+1⟩,
(iv) |− +⟩.
Page | 14
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Wave Function in Ket Notation
In Dirac notation of quantum mechanics, a wave function, 𝜓, represents the state of the
particle / system. Dirac or “bra-ket” notation is commonly used in quantum mechanics and
quantum computing. The state of a qubit is enclosed in the right half of an angled bracket,
called the “ket” can be written as |𝜓⟩ (called as Ket Psi). The complex conjugate of the wave
function (𝜓*) can be written as ⟨𝜓| (called as Bra Psi). In this chapter, here onwards, a wave
function and its conjugates are used in terms of Ket and Bra (Dirac) notations.
𝜓⃗ = 𝑎𝑖̂ + 𝑖𝑏𝑗̂
Where, 𝑖̂ and 𝑗̂ are unit vectors, which represent a column matrix as follows;
1 0
𝑖̂ = ( ) ; 𝑗̂ = ( )
0 1
1 0
Such that, 𝜓⃗ = 𝑎 ( ) + 𝑖𝑏 ( )
0 1
𝑎 0
𝜓⃗ = ( ) + ( )
0 𝑖𝑏
𝑎
This can be represented as; |𝜓⟩ = ( )
𝑖𝑏
The complex conjugate of |𝜓⟩ nothing but |𝜓⟩∗ = ⟨𝜓| known as ‘Bra’ vector can be represented
as a row matrix, as follows.
⟨𝜓| = (𝑎 𝑖𝑏)
Page | 15
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Identity Operator (𝐈̂)
An identity operator, 𝐈̂ is a matrix in which diagonal elements are non-zero, but 1 and all
other non-diagonal elements are zero. In terms of 2x2 matrix, an identity operator can be
represented as follows.
𝟏 𝟎
𝐈̂ = [ ]
𝟎 𝟏
𝐈̂|𝝍⟩ = |𝝍⟩
Proof:
1 0 1 1 1 0 0 0
Î|0⟩ = [ ] [ ] = [ ] = |0⟩ Î|1⟩ = [ ] [ ] = [ ] = |1⟩
0 1 0 0 0 1 1 1
Pauli matrices are a set of 2x2 complex matrices, which are Hermitian, Involutory & Unitary.
0 1 0 −𝑖 1 0
𝑋=[ ];𝑌 =[ ]; & 𝑍 = [ ]
1 0 𝑖 0 0 −1
Page | 16
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
The action of Pauli matrices on |0⟩ and |1⟩ are as follows;
Proof:
0 1 1 0 −𝑖 1 1 0 1
𝑋|0⟩ = [ ][ ] 𝑌|0⟩ = [ ][ ] 𝑍|0⟩ = [ ][ ]
1 0 0 𝑖 0 0 0 −1 0
0 0 0 1
= [ ] = [ ] = 𝑖[ ] = [ ]
1 𝑖 1 0
0 1 0 0 −𝑖 0 1 0 0
𝑋|1⟩ = [ ][ ] 𝑌|1⟩ = [ ][ ] 𝑍|1⟩ = [ ][ ]
1 0 1 𝑖 0 1 0 −1 1
1 −𝑖 1 0
= [ ] = [ ] = −𝑖 [ ] = [ ]
0 0 0 −1
Conjugate of a matrix can be obtained for a given matrix by replacing each element of the
matrix with its complex conjugate.
𝑖 2−𝑖
𝐴= [ ];
4+𝑖 1
Its conjugate is
Page | 17
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
−𝑖 2+𝑖
𝐴∗ = [ ]
4−𝑖 1
The transpose of a matrix can be obtained by interchanging its rows into columns or columns
into rows.
𝑖 2−𝑖
𝐴= [ ];
4+𝑖 1
Its transpose is
𝑖 4+𝑖
𝐴𝑇 = [ ]
2−𝑖 1
Hermitian Matrix:
𝐴̂ = 𝐴̂†
𝑎 𝑏 𝑎∗ 𝑐∗
That is 𝐴 = [ ] ⇔ 𝐴̂† = [ ∗ ]
𝑐 𝑑 𝑏 𝑑∗
1 𝑖
𝐴= [ ]
−𝑖 0
Page | 18
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
1 −𝑖 1 𝑖
Solution: 𝐴∗ = [ ] ⇔ (𝐴∗ )𝑇 = [ ]
𝑖 0 −𝑖 0
Unitary Matrix:
A matrix U is unitary if the matrix product of U and its conjugate transpose 𝑈 † (called U-
dagger) produces the identity matrix: 𝑈𝑈 † = 𝑈 † 𝑈 = 𝐼.
Or
That is, 𝑈 † = 𝑈 −1
Note:
1 𝑖
Problem: Is the matrix, 𝐴 = [ ] unitary?
1 𝑖
1 1
Solution: Consider 𝐴† = (𝐴∗ )† = [ ]
−𝑖 −𝑖
Then,
2
𝐴𝐴† = [
1 𝑖 1
][
1
] = [1 − 𝑖 2 1 − 𝑖 2 ] = [2 2
] = 2[
1 1
] ≠𝐼=[
1 0
]
1 𝑖 −𝑖 −𝑖 1−𝑖 1 − 𝑖2 2 2 1 1 0 1
Multiplying A by its conjugate transpose does not produce the identity matrix, so A is not
Page | 19
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
unitary.
𝛼1
|𝑣⟩ = (𝛼 )
2
Similarly, a complex conjugate of |𝑣⟩ denotes the row matrices represented as follows;
𝛼1 ∗
Where, (𝛼 ) = (𝛼1∗ 𝛼2∗ )
2
Note: The states |0⟩ and |1⟩ are usually represented by a column matrix as follows;
1 0
|0⟩ = ( ); |1⟩ = ( )
0 1
The complex conjugate of |0⟩ and |1⟩ denotes the row matrices represented as follows;
Inner Product:
𝛼1 𝛽
If we have two states, |𝜓⟩ = (𝛼 ) and |𝜑⟩ = ( 1 ); then we can multiply them by taking their
2 𝛽2
inner product as follows;
𝛽
= (𝛼1∗ 𝛼2∗ ) ( 1 )
𝛽2
= 𝛼1∗ 𝛽1 + 𝛼2∗ 𝛽2
Page | 20
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Hence, ⟨𝜓|𝜑⟩ is called the inner product or the multiplication of row and column matrix and
the result is always a scalar product.
Probability:
1 0 𝛼 0 𝛼
|𝜓⟩ = 𝛼 ( ) + 𝛽 ( ) = ( ) + ( ) = (𝛽 )
0 1 0 𝛽
𝛼
⟨𝜓|𝜓⟩ = (𝛼 ∗ 𝛽 ∗ ) (𝛽 )
= 𝛼𝛼 ∗ + 𝛽𝛽 ∗
= |𝛼|2 + |𝛽|2
Thus, we have
Orthogonality:
The states |𝜓⟩ and |𝜙⟩ are said to be orthogonal if their inner product is said to be zero.
That is,
⟨𝜓|𝜙⟩ = 0
Orthonormal:
Page | 21
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
That is, |𝜓⟩ and |𝜙⟩ should satisfy, ⟨𝜓|𝜙⟩ = 0; ⟨𝜓|𝜓⟩ = 1 and ⟨𝜙|𝜙⟩ = 1.
Example: Show that, states |0⟩ and |1⟩ are orthogonal with each other and parallel among
themselves.
Also,
1
⟨0|0⟩ = (1 0) ( ) = (1 ∗ 1) + (0 ∗ 0) = 1 + 0 = 1
0
&
⟨1|1⟩ = (0 0
1) ( ) = (0 ∗ 0) + (1 ∗ 1) = 0 + 1 = 1
1
Hence 0⟩ and |1⟩ are orthogonal with each other and parallel among themselves known as
orthonormal vectors.
𝛼1 𝛽
If we have two vectors |𝜓⟩ = [𝛼 ] and |𝜙⟩ = [ 1 ]; then the tensor product (cross product)
2 𝛽2
between them will be as follows;
𝛽1 𝛼1 𝛽1
𝛼1 𝛼1 [
]
𝛽1 𝛽2 𝛼 𝛽
|𝜓⟩⨂|𝜙⟩ = [𝛼 ] ⨂ [ ] = [ ]= [ 1 2]
2 𝛽2 𝛽1 𝛼2 𝛽1
𝛼2 [ ]
𝛽2 𝛼2 𝛽2
1 1
1[ ]
1 1
Solution: |0⟩⨂|0⟩ = |00⟩ = [ ] ⨂ [ ] = [ 0 ] = [0 ]
0 0 1 0
0[ ]
0 0
Exercise Problems. Find the tensor products of |01⟩, |10⟩ and |11⟩.
Page | 22
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Quantum Gates
0 1
𝑋= [ ]
1 0
The action of quantum NOT gate in the computational basis is as follows; That is it changes
|0⟩ to |1⟩ and vice versa. That is,
0 1 1 0
𝑋|0⟩ = [ ] [ ] = [ ] = |1⟩
1 0 0 1
0 1 0 1
𝑋|1⟩ = [ ] [ ] = [ ] = |0⟩
1 0 1 0
Also, in the superposition state, its action is linear, i.e. superposition is preserved.
Gate representation:
Page | 23
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Truth Table:
Input Output
|0⟩ |1⟩
|1⟩ |0⟩
In general,
0 1 0 1 1 0
Here, 𝑋𝑋 = [ ][ ]=[ ]=𝐼
1 0 1 0 0 1
2. Pauli Z-Gate:
1 0
𝑍=[ ]
0 −1
The action of Pauli Z-gate in the computational basis is as follows; It leaves |0⟩ unchanged
and inverts the sign of |1⟩ to −|1⟩. That is,
Page | 24
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
1 0 1 1
𝑍|0⟩ = [ ] [ ] = [ ] = |0⟩
0 −1 0 0
1 0 0 0 0
𝑍|1⟩ = [ ] [ ] = [ ] = − [ ] = −|1⟩
0 −1 1 −1 1
Also, in the superposition state, its action is linear, i.e. superposition is preserved.
Gate representation:
Truth Table:
Input Output
|0⟩ |0⟩
|1⟩ −|1⟩
Page | 25
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Note: Let us analyze the two Pauli Z-gates.
⇔
𝛼|0⟩ + 𝛽|1⟩ 𝛼|0⟩ + 𝛽|1⟩
In general,
1 0 1 0 1 0
Here, 𝑍𝑍 = [ ][ ]=[ ]=𝐼
0 −1 0 −1 0 1
3. Hadamard Gate:
It is defined as
1 1 1
𝐻= [ ]
√2 1 −1
The action of Hadamard Gate in the computational basis is as follows; It transforms |0⟩ into
|0⟩+|1⟩ |0⟩−|1⟩
and |1⟩ to . That is,
√2 √2
|0⟩+|1⟩ |0⟩−|1⟩
𝐻|0⟩ → and 𝐻|1⟩ →
√2 √2
1 1 1 1 1 1 1 1 0 |0⟩ + |1⟩
𝐻|0⟩ = [ ][ ] = [ ]= {[ ] + [ ]} =
√2 1 −1 0 √2 1 √2 0 1 √2
Page | 26
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
1 1 1 0 1 1 1 1 0 |0⟩ − |1⟩
𝐻|1⟩ = [ ][ ] = [ ]= {[ ] − [ ]} =
√2 1 −1 1 √2 −1 √2 0 1 √2
Also, in the superposition state, its action is linear, i.e. superposition is preserved.
Gate representation:
|0⟩+|1⟩ |0⟩−|1⟩
𝛼( )+𝛽( ) or
√2 √2
𝛼|0⟩ + 𝛽|1⟩ H 𝛼+𝛽 𝛼−𝛽
( ) |0⟩ + ( ) |1⟩
√2 √2
Truth Table:
Input Output
Or
𝛼+𝛽 𝛼−𝛽
( ) |0⟩ + ( ) |1⟩
√2 √2
Page | 27
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
H H
|0⟩ →
𝐻 |0⟩ + |1⟩ 𝐻
→
1
{(
|0⟩ + |1⟩
)+ ( ⇔
|0⟩ − |1⟩ 1
)} = {|0⟩ + |1⟩ + |0⟩ − |1⟩} = |0⟩
2
√2 √2 √2 √2
In general,
1 1 1 1 1 1 1 2 0 1 0
Here, 𝐻𝐻 = [ ] [ ] = 2[ ]=[ ]= 𝐼
√2 1 −1 √2 1 −1 0 2 0 1
The Phase gate (P - gate) is parametrized, that is it needs a number (𝜙) to tell it exactly what
to do.
1 0
𝑃(𝜙) = [ ] ; 𝜙 𝑖𝑠 𝑎 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟.
0 𝑒 𝑖𝜙
Page | 28
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
𝑖𝜙 𝑖𝜋
If 𝜙 = 𝜋 ⟹ 𝑒 =𝑒 = 𝐶𝑜𝑠𝜋 + 𝑖 𝑆𝑖𝑛𝜋 = 1 + 0 = 1
1 0 1 0
Then for 𝜙 = 𝜋, 𝑃(𝜙 = 𝜋) = [ ]=[ ] = 𝑍 − 𝑔𝑎𝑡𝑒.
0 𝑒 𝑖𝜋 0 1
4.1. S – gate
It is defined as
1 0
𝑆=[ ]
0 𝑖
𝜋
It is a P – gate with 𝜙 = 2 .
𝜋 𝑖𝜋 𝜋 𝜋
𝜙= ⟹ 𝑒 𝑖𝜙 = 𝑒 2 = 𝐶𝑜𝑠 ( ) + 𝑖 𝑆𝑖𝑛 ( ) = 0 + 𝑖(1) = 𝑖
2 2 2
The action of S-gate is; it rotates qubit state (vector) quarter turn around the Bloch sphere.
In the computational basis, it leaves |0⟩ unchanged and transforms |1⟩ to i|1⟩. That is,
1 0 1 1
𝑆|0⟩ = [ ] [ ] = [ ] = |0⟩
0 𝑖 0 0
1 0 0 0 0
𝑆|1⟩ = [ ] [ ] = [ ] = 𝑖 [ ] = 𝑖|1⟩
0 𝑖 1 𝑖 1
Also, in the superposition state, its action is linear, i.e. superposition is preserved.
Gate representation:
Page | 29
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
𝛼|0⟩ + 𝛽|1⟩ S 𝛼|0⟩ + 𝛽𝑖|1⟩
Truth Table:
Input Output
|0⟩ |0⟩
|1⟩ 𝑖|1⟩
If
1 0 1 0
𝑆=[ 𝑖𝜋 ]=[ ]
0 𝑒2 0 𝑖
1 0 1 0
𝑆† = [ −𝑖𝜋 ]=[ ]
0 𝑒 2 0 −𝑖
⟹ 𝑆𝑆 = 𝑍
Proof:
1 0 1 0 1 0 1 0
𝑆𝑆 = [ ][ ]=[ 2] = [ ]=𝑍
0 𝑖 0 𝑖 0 𝑖 0 −1
Page | 30
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
4.2. T – gate
𝜋
It is a P – gate with 𝜙 = 4 .
It is defined as
1 0 1 0
𝑇=[ 𝑖𝜋 ]; 𝑇† = [ 𝑖𝜋 ]
0 𝑒 4 0 𝑒4
The action of T-gate in the computational basis is it leaves |0⟩ unchanged and transforms |1⟩
𝑖𝜋
to 𝑒 4 |1⟩. That is,
𝑖𝜋
𝑇|0⟩ → |0⟩ and 𝑇|1⟩ → 𝑒 4 |1⟩
1 0 1 1
𝑇|0⟩ = [ 𝑖𝜋 ] [ ] = [ ] = |0⟩
0 𝑒4 0 0
1 0 0 0 𝑖𝜋
0 𝑖𝜋
𝑇|1⟩ = [ 𝑖𝜋 ] [ 𝑖𝜋 ] = [ 𝑖𝜋 ] = 𝑒 4 [ ] = 𝑒 4 |1⟩
0 𝑒4 𝑒4 𝑒4 1
Also, in the superposition state, its action is linear, i.e. superposition is preserved.
𝑖𝜋
𝛼|0⟩ + 𝛽|1⟩ → 𝛼|0⟩ + 𝑒 4 𝛽|1⟩
Gate representation:
𝑖𝜋
𝛼|0⟩ + 𝛽|1⟩ T 𝛼|0⟩ + 𝑒 4 𝛽|1⟩
Truth Table:
Page | 31
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Input Output
|0⟩ |0⟩
|1⟩ 𝑖𝜋
𝑒 4 |1⟩
𝛼|0⟩ + 𝛽|1⟩ 𝑖𝜋
𝛼|0⟩ + 𝑒 4 𝛽|1⟩
It has two inputs; (a) controlled bit and (b) target bit and two output qubits. The control qubit
stays the same, while the target obeys the following rule.
Its action is as follows; If the controlled bit is |0⟩ then the operation on the target bit is
unchanged. If the controlled bit is |1⟩ then the target bit is altered. That is
|0, 1⟩ ⟶ |0,1⟩
|1, 1⟩ ⟶ |1,0⟩
In general,
|𝐴, 𝐵⟩ ⟶ |𝐴, 𝐵 ⊕ 𝐴⟩
The CNOT gate performs an X gate on the target qubit if the control qubit is |1⟩. It is similar
to the classical XOR gate.
Gate representation:
Page | 32
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
The action of the CNOT gate is depends on the type of input state. There are four input states,
they are;
Case 1: If the input state is |00⟩, the output will be |00⟩, that is target is unaltered.
Case 2: If the input state is |01, the output will be |01⟩, that is target is unaltered.
Case 3: If the input state is |10⟩, the output will be |11⟩, that is target is altered.
Case 4: If the input state is |11⟩, the output will be |10⟩, that is target is altered.
Input Output
Page | 33
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
1 0 0 0
𝑈𝐶𝑁 = [0 1 0 0]
0 0 0 1
0 0 1 0
2. Toffoli gate:
It has 3 inputs and 3 outputs. Any classical circuit can be replaced by an equivalent circuit
containing only reversible elements by using reversible gate called Toffoli gate.
Toffoli gates can be used to simulate irreversible classical logic gates and ensures that quantum
gates are capable of performing any computations that a classical computer can do.
Gate representation:
|𝐴⟩ |𝐴⟩
|𝐵⟩ |𝐵⟩
|𝐶⟩ |𝐶 ⊕ 𝐴𝐵⟩
Page | 34
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Input Output
Note: 0⊕0=0
0⊕1= 1
1⊕0= 1
1⊕1= 0
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
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]
3. Swap gate:
Page | 35
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
It is a simple quantum circuit containing 3 quantum gates. The circuit is read from left to
right and each line represents a quantum passage.
Gate representation:
|𝑎⟩ |𝑏⟩
≡
|𝑏⟩ |𝑎⟩
Input Output
|00⟩ |00⟩
|01⟩ |10⟩
|10⟩ |01⟩
|11⟩ |11⟩
4. Controlled Z-gate:
It is another example of controlled gate. It is a gate in which the operation is of the kind “if A
is true, then do B”.
Page | 36
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
Gate representation:
Control 𝑇𝑟𝑢𝑒
Target Z 𝐷𝑜
1 0 0 0
𝑈𝑍 = [0 1 0 0]
0 0 1 0
0 0 0 −1
Input Output
|00⟩ |00⟩
|01⟩ |01⟩
|10⟩ |10⟩
|11⟩ −|11⟩
Note:
Page | 37
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
In case of classical computers, AND & NOT gates can compute any function. Hence
AND & NOT gates ae called as universal gates.
In case of quantum computers, CNOT & single qubit gates can build up any unitary
operation on ‘n’ qubits. Hence, CNOT + single qubit gates are universal for quantum
computer.
Quantum Computation:
|0⟩
Measurement
|0⟩
|0⟩
|0⟩
In quantum computation the following steps should be followed in order to perform the
computation involved with universal gates such as CNOT and single qubit gates.
Process:
Note: Any Unitary matrix can be a general single qubit gate. The Unitary condition is;
Page | 38
I & II-Semester, Engineering Physics (BPHY102/202)
Department of Physics
† † (𝑈 𝑇 )∗
𝑈𝑈 = 𝐼 ⇒ 𝑈 =
Answer: Unitary matrix preserve length. That is, ‖|𝑈|𝜓⟩‖ = ‖𝜓⟩‖ for all |𝜓⟩
Proof: Consider,
∗
= ∑(𝑈𝑗𝑘 𝜓𝑘 ) (𝑈𝑗𝑙 𝜓𝑙 )
𝑗𝑘𝑙
†
= ∑ 𝑈𝑘𝑗 𝑈𝑗𝑙 𝜓𝑘∗ 𝜓𝑙
𝑗𝑘𝑙
= ∑ 𝛿𝑘𝑙 𝜓𝑘∗ 𝜓𝑙
𝑘𝑙
= ∑ 𝜓𝑘∗ 𝜓𝑘
𝑘
‖|𝑈|𝜓⟩‖2 = ‖𝜓⟩‖2
Conclusion: Let M be a matrix, then ‖|𝑀|𝜓⟩‖ = ‖𝜓⟩‖ for all |𝜓⟩ iff M is Unitary.
Page | 39
I & II-Semester, Engineering Physics (BPHY102/202)