1. Fundamentals Of Quantum Computing
Part I
Pradosh K Roy FIETE , C.Eng
Professional Alumnus , Massachusetts Institute of Technology
1
2. 1.Computational Complexity : NP Complete Class , BQP Class
2. Essential Matrix Algebra : Hermitian , Unitary , Normal Matrices
3. Classical versus Quantum World
Registers and Two State Quantum Systems
4. Characteristics of Quantum Systems
Superposition , Qubit , Born Normalization ,
Bloch Diagram Representation , Computational Basis
Tensor Product , 2 Qubit Register , n Qubit Register ,
Problems and Solutions
5. Quantum Logic Gates and Quantum Circuits
Pauli Spin Gates X , Y , Z ; Rotation Gate 𝑅 𝜃
Hadamard Gate , Bloch Diagram Representation
2 Qubit Gates : CNOT Gate , CH Gate
Problems and Solutions
6. Matrix Representation of Serial and Parallel Operations
7. Elementary Arithmetic Operations.
Selected References
2
3. 1. Computational Complexity : NP Complete Class
Complexity of a problem T(n) Time required to solve it and measured
in the number of elementary steps required by the algorithm .
The complexity T(n) is a function of the size of the problem n.
The kind of problems that computers can solve in a reasonable amount of
time, even for large values of n, are those for which an algorithm exists that
uses a number of steps governed by a polynomial e.g. an3 + bn2 +c .
Leaving the low order terms such as bn2 and the constants in the above
example , we say that the complexity of the algorithm is O(n3). “Computer
scientists call such an algorithm efficient, and problems that can be solved by
an efficient algorithm are said to be in the Complexity Class P, which
stands for polynomial time” .
3
4. Computational Complexity : NP Complete Class
However , there are problems for which the complexity
increases exponentially with the problem size n e.g 2 𝑛, 3 𝑛…..
This class known as Nondeterministic Polynomial (NP) contains
a huge number of problems of practical interest in physical
sciences, engineering, economics, and biological sciences. It may
be noted that P problems are contained in NP Class,
𝑷 ⊆ 𝑵𝑷 .
Hardest of the NP problems are known as NP Complete Class.
Stephen Cook, An Overview of Computational Complexity , CACM Volume 26 Number
6 , June 1983
4
6. Scot Aronson , The limits of Quantum , Scientific American , March 2008
6
7. Best Known Classical Algorithm 𝑶 [𝒆 𝟏.𝟗 𝒍𝒐𝒈𝒏
𝟏
𝟑
(𝒍𝒐𝒈 𝒍𝒐𝒈 𝒏)
𝟐
𝟑
Peter Shor’s Quantum Algorithm 𝑶 [(𝐥𝐨𝐠 𝒏) 𝟐 (𝐥𝐨𝐠 𝐥𝐨𝐠 𝒏)(𝐥𝐨𝐠 𝐥𝐨𝐠 𝐥𝐨𝐠 𝒏)
Estimate the time difference for n=1000
A Simple Example : Integer Factoring Algorithm
7
8. 2. Essential Matrix Algebra
Rows : m Horizontal list of Scalars
Columns : n Vertical list of Scalars
8
SeymourLipschutz,MarcLarsLipson,LinearAlgebra4thEdition,
Schaum’sOutlineSeries,2009
16. 16
Let A be a complex matrix—that is, a matrix with complex
entries. Recall that if z = a+ jb is a complex number, then
z =a-jb is its conjugate. The conjugate of a complex matrix A,
written A* , is the matrix obtained from A by taking the
conjugate of each entry in A. That is, if 𝐀 = 𝑎𝑖𝑗 then 𝐴∗ =
𝑏𝑖𝑗 𝑤ℎ𝑒𝑟𝑒 𝑏𝑖𝑗 = 𝑎𝑖𝑗
∗
The two operations of transpose and conjugation commute for
any complex matrix A, and the special notation 𝑨 𝐻 is used for
the conjugate transpose of A. That is
𝑨 𝐻 = 𝑨∗ 𝑇 = 𝑨 𝑇 ∗
.It may be noted that if A is real , then 𝑨 𝐻 = 𝐴 𝑇
Complex Matrices
17. 17
A complex matrix A is said to be Hermitian or skew-Hermitian according as
to
whether
𝑨 𝐻
= 𝑨 𝑜𝑟 𝑨 𝐻
= −𝑨
Thus 𝐀 = 𝑎𝑖𝑗 is Hermitian if and only if symmetric elements are
conjugate—that is, if each 𝑎𝑖𝑗= 𝑎𝑗𝑖
∗
in which case each diagonal element
𝑎𝑖𝑖 must be real. Similarly, if A is skew-symmetric, then each diagonal
element 𝑎𝑖𝑖 = 0 .
A complex matrix A is Unitary if 𝑨 𝑯
𝑨−𝟏
= 𝑨−𝟏
𝑨 𝑯
= 𝑰 that is, if 𝑨 𝑯
= 𝑨−𝟏
Thus, A must necessarily be square and invertible. We note that a complex matrix
A is unitary if and only if its rows (columns) form an orthonormal set relative to
the dot product of complex vectors. Unitary operators are important because they
describe the time evolution of a quantum state. The Pauli operators are both
Hermitian and Unitary.
18. 18
A complex matrix A is said to be Normal if it commutes with 𝑨 𝐻 that is,
if 𝑨𝑨 𝑯 = 𝐴 𝐻 𝑨 . Thus, A must be a square matrix. Hermitian and unitary
operators are normal.
Seymour Lipschutz, Marc Lars Lipson, Linear Algebra 4th Edition ,
Schaum’s Outline Series , 2009
19. 19
2x2 Matrices Frequently Used in Quantum Computing
Definition . The Pauli Matrices
With respect to the computational basis , the matrix
representation of the Pauli Matrices X , Y and Z are
given by
𝑿 =
𝟎 𝟏
𝟏 𝟎
, 𝒀 =
𝟎 −𝒊
𝒊 𝟎
, 𝒁 =
𝟏 𝟎
𝟎 −𝟏
Definition . The 2x2 Identity Matrix
𝐈 =
𝟏 𝟎
𝟎 𝟏
20. Quantum Computation represents an important
change of paradigm, where the concept of bit gets
transformed into a quantum bit, or qubit, which
affords for an enormous information storage and
processing capacity. In this course, the basic
concepts of Quantum Computation will be
introduced at a conceptual level.
20
3. Classical vs Quantum World
21. Quantum Computation is becoming a viable
alternative for High Complexity Problems, too
hard to address in classical computation, with or
without acceleration. Recently, IBM , Google has
demonstrated that there are particular problems
that can be solved efficiently on a quantum
computer, while demanding prohibitively
high resources in classical computation.
21
Classical vs Quantum World
22. 22
Binary digit, the bit represents a logical state ,
having only one of two values . It may be physically
implemented with a two-state device e.g. flip-flop
circuit. These values are most commonly
represented as either 0 or1, but other representations
such as true/false, yes/no, +/−, or on/off are
common. The correspondence between these values
and the physical states of the
underlying storage or device is a matter of
convention, and different assignments may be used
even within the same device or program
Bits and Instruction Set Architectures
23. Registers are primitives used in hardware design that are
also visible to the programmer when the computer is completed, so you can
think of registers as the bricks of computer construction
23
Bits and Instruction Set Architectures
The MIPS word is 32 bits long, so we can represent 232
different 32-bit patterns. It is natural to let these
combinations represent the numbers from 0 to 𝟐 𝟑𝟐 − 𝟏
24. 1. Instructionsarerepresentedasnumbers.
2. Programs are stored in memory to be read or written, just
like data. These principles lead to the Von Neumann
stored-program concept; One consequence of
instructions as numbers is that programs are often
shipped as files of binary numbers. The commercial
implication is that computers can inherit ready-made
software provided they are compatible with an existing
instruction set. Such “binary compatibility” often leads
industry to align around a small number of instruction
set architectures
24
Bits and Instruction Set Architectures
26. 26
Any two-level quantum system can form a qubit, and
there are two predominant ways to form a qubit using the
electronic states of an ion:
1. Two ground state Hyperfine levels (these are called
"hyperfine qubits")
2. A Ground state level and an Excited level (these are
called the "optical qubits")
Qubits & Historical Two-State Atomic Systems
28. 1. Wave-particle duality—A quantum object generally has both wave-
and particle-like properties. While the evolution of the system follows a
wave equation, any measurement of the system will return a value
consistent with it being a particle
2. Superposition—A quantum system can exist in two or more states at once,
referred to as a “superposition” of states or a “superposition state.” The wave
function for such a superposition state can be described as a linear combination of
the contributing states, with complex coefficients. These coefficients describe the
magnitude and relative phases between the contributing states.
3. Coherence—When a quantum system’s state can be described by a set of
complex numbers, one for each basis state of the system, the system state is said
to be “coherent.” Coherence is necessary for quantum phenomena such as
quantum interference, superposition, and entanglement. Small interactions with
the environment cause quantum systems to slowly decohere. The environmental
interactions make even the complex coefficients for each state probabilistic.
4. Characteristics of Quantum Systems
28
29. 4. Entanglement—Entanglement is a special property of some (but not all)
multi-particle superposition states, where measurement of the state of one
particle collapses the state of the other particles, even if the particles are
far apart with no apparent way to interact. This arises when the wave
functions for different particles are not separable (in mathematical terms,
when the wave function for the entire system cannot be written as a
product of the wave functions for each particle). There is no classical
analogue to this phenomenon.
5. Measurement—Measurement of a quantum system fundamentally
changes it. In the case where the measurement yields a well-defined value,
the system is left in a state corresponding to the measured value. This is
commonly referred to as “collapsing the wave function.”
Characteristics of Quantum Systems
29
30. 30
5.111 Principles of Chemical Science
https://ocw.mit.edu/courses/chemistry/5-111-principles-of-chemical-science-fall-2008/
Energy level diagram for the H atom : Optical Qubit
31. 31
Consider a system with k distinguishable states [Energy level of Hydrogen Atom].
For example, the electron in an atom might be either in its ground state or one of
k−1 excited states, each of progressively higher energy. As a classical system, we
might use the state of this system to store a number between 0 and k−1. The
superposition principle says that if a quantum system is allowed to be any one of
number of different states then it can also be placed in a linear superposition of
these states with complex coefficients. Thus the quantum state of the k-state
system above is described by a sequence of k complex numbers 𝑎0, 𝑎1, … … … 𝑎 𝑘−1.
The superposition principle
𝑎𝑗 𝑖𝑠 said to be the amplitude for the state j. We will require that the
amplitudes are normalized so that sum of the amplitudes squared is one. It is
natural to write the state of the system as a k dimensional vector
𝑎0
𝑎1
.
.
.
𝑎 𝑘−1
CS 294-2 Lecture 1 Introduction, Axioms, Bell Inequalities , Spring 2007
Umesh Vazirani , UC Berkeley,
32. 32
This linear superposition |𝜓 > = 0
𝑘−1
𝑎𝑗|𝑗 > is part of the private
world of the electron. For us to know the electron’s state, we must make a
measurement. Measuring |𝜓 > in the standard basis |0> , |1> yields with
probability |𝑎𝑗|2
. One important aspect of the measurement process is that
it alters the state of the quantum system: the effect of the measurement is
that the new state is exactly the outcome of the measurement. i.e., if the
outcome of the measurement is j, then following the measurement, the qubit
is in state |j> . This implies that you cannot collect any additional
information about the amplitudes 𝑎𝑗 by repeating the measurement. This
property forms the basis of quantum cryptography where the presence of an
eavesdropper necessarily alters the quantum state being transmitted.
The Measurement Principle
CS 294-2 Lecture 1 Introduction, Axioms, Bell Inequalities , Spring 2007
Umesh Vazirani , UC Berkeley,
33. 33
This basic unit of information in quantum computing is
called the qubit, which is short for quantum bit . While a
qubit is going to look in some way superficially similar to a
bit, it is fundamentally different which allows us to do
information processing in new and interesting ways.
Like a bit, a qubit can also be in one of two states. In the
case of a qubit, for reasons that for the moment will seem
utterly obscure, we label these two states by |0> and |1> In
quantum theory an object enclosed using the notation | >
can be called a state, a vector, or a ket
34. 𝝍 > = 𝜶 𝟎 > + 𝜷 |𝟏 >
While amplitudes 𝜶 𝒂𝒏𝒅 𝜷 are complex numbers , the
probability of finding the system in the state |𝟎 > 𝒊𝒔 𝜶 𝟐 and
the probability of finding the system in the state |𝟏 > 𝒊𝒔 |𝜷 | 𝟐 .
𝜶 𝐚𝐧𝐝 𝜷 are constrained by the Max Born’s Normalization
Condition :
|𝜶 | 𝟐 + |𝜷 | 𝟐 = 𝟏 .
The states |𝟎 > 𝒂𝒏𝒅 |𝟏 > can also be represented by the
column vectors
|𝟎 > =
𝟏
𝟎
|𝟏 > =
𝟎
𝟏
1 Qubit Register |𝜓 >
34
|𝜶| 𝟐 = 𝜶∗ 𝜶 , |𝜷| 𝟐 = 𝜷∗ 𝜷
𝝍 > = 𝜶 𝟎 > + 𝜷|𝟏 > = 𝜶
𝟏
𝟎
+ 𝜷
𝟎
𝟏
=
𝜶
𝜷
35. The Dual Vector < 𝜓|
35
In quantum physics < 𝝍| is sometimes called the dual vector
If a ket is a column vector, the dual vector < 𝝍| is a row
vector whose elements are the complex conjugates of the
elements of the column vector. In other words, when working
with column vectors, the Hermitian conjugate is computed in
two steps:
1. Write the components of the vector as a row of numbers.
2. Take the complex conjugate of each element and arrange them
in a row vector
36. 36
|𝝍 >=
𝒊
𝟐
|𝟎 > +
√𝟑
𝟐
|𝟏 >
The Column Vector Representation of this state is
|𝝍 > =
𝒊
𝟐
𝟑
𝟐
The dual vector is found by computing the complex conjugate of each
element and then arranging the result as a row vector. In this case
< 𝝍| =
−𝒊
𝟐
√𝟑
𝟐
37. 37
Using the dual vector to find the inner product makes the
calculation easy. The inner product or scalar product is
calculated in the following way:
< 𝒂|𝒃 > = 𝒂 𝟏
∗
𝒂 𝟐
∗
… … . 𝒂 𝒏
∗
𝒃 𝟏
𝒃 𝟐
. .
. .
𝒃 𝒏
= 𝒂 𝟏
∗
𝒃 𝟏 + 𝒂 𝟐
∗
𝒃 𝟐 + ⋯ … … … 𝒂 𝒏
∗
𝒃 𝒏
=
𝒊=𝟏
𝒏
𝒂𝒊
∗
𝒃𝒊
The Inner Product < 𝜓|𝜓 >
39. 39
Emily Grumbling and Mark Horowitz ; Quantum Computing: Progress and Prospects ; Washington, DC: The
National Academies Press. 2019 ; Pp.272
When a qubit is in the state | ψ⟩ = | 0⟩, the result of measurement will be |0>
with a probability of 100 percent , which is not unlike what happens with a
classical bit. Similarly, measurement of a qubit in state | ψ⟩ = | 1⟩ will yield an
outcome of |1> with a probability of 100 %
For a qubit in a superposition state, the outcome is less simple—the outcome of
measurement, even of a known state, cannot be predicted with certainty. For
example , the superposition state |ψ> = 1/√2 |0> + 1/√2 |1> has an equal
probability (50 percent) of yielding either outcome (probability being the square
of the amplitude, or ½). Repeated preparation and measurement of this state
will yield a random sequence of outcomes approaching an equal incidence of
each as the number of trials increases, as would a classical coin flip. Accordingly,
this state can be thought of as a “quantum coin.”
After measuring a certain value, the qubit is left in the state corresponding to
that value. For example, if the outcome of measurement is 1, the post
measurement qubit is in the state | ψ⟩ = | 1⟩, regardless of the state it was in
prior to measurement.
Measurement of a Qubit
40. 1 Qubit Examples
40
Emily Grumbling and Mark Horowitz ; Quantum Computing: Progress and Prospects ; Washington, DC: The
National Academies Press. 2019 ; Pp.272
41. 41
For each of the following qubits , if a measurement is made what is
the probability that we find the qubit in state |0> ?
Problem 4.1
42. 42
Example.
The Pauli Operators are given by
𝑿 =
𝟎 𝟏
𝟏 𝟎
, 𝒀 =
𝟎 −𝒊
𝒊 𝟎
, 𝒁 =
𝟏 𝟎
𝟎 −𝟏
in the |0> , |1> basis. Find the action of these operators on the basis states by
considering the column vector representations of |0> and |1>.
Recall that the basis states are given by
|𝟎 > =
𝟏
𝟎
𝒂𝒏𝒅 |𝟏 > =
𝟎
𝟏
It may be easily verified that
𝑿|𝟎 > =
𝟎 𝟏
𝟏 𝟎
𝟏
𝟎
=
𝟎
𝟏
= |𝟏 >
𝑿|𝟏 > =
𝟎 𝟏
𝟏 𝟎
𝟎
𝟏
=
𝟏
𝟎
= |𝟎 >
𝒀|𝟎 > =
𝟎 −𝒊
𝒊 𝟎
𝟏
𝟎
=
𝟎
𝒊
= 𝒊|𝟏 >
𝒀|𝟏 > =
𝟎 −𝒊
𝒊 𝟎
𝟎
𝟏
=
−𝒊
𝟎
= −𝒊|𝟎 >
𝒁|𝟎 > =
𝟏 𝟎
𝟎 −𝟏
𝟏
𝟎
=
𝟏
𝟎
= |𝟎 >
𝒁|𝟏 > =
𝟏 𝟎
𝟎 −𝟏
𝟎
𝟏
=
𝟎
−𝟏
= −|𝟏 >
43. 43
Representing Composite States
Let ||𝜑 > ∈ 𝑯 𝟏 and |𝜒 > ∈ 𝑯 𝟐 be two vectors that belong
to the Hilbert spaces used to construct H. We can construct a
vector |𝜓 > ∈ 𝐻 using the tensor product in the following
way: |𝝍 > = |𝝓 > |𝝌 >
48. 48
If two qubit states are represented by
Calculate the tensor product |𝑎 > |𝑏 >
Problem 4.2
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
50. 50
Solution 4.2
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
𝝍 > = 𝜶 𝟎 𝟎𝟎 > + 𝜶 𝟏 𝟎𝟏 > + 𝜶 𝟐 𝟏𝟎 > + 𝜶 𝟑|𝟏𝟏 >
Verify that the sum of probabilities of the 2 qubit states
is 1.
Compare the result with the general expression for a 2 qubit register and
find the coefficients 𝜶 𝟎 , 𝜶 𝟏, 𝜶 𝟐, 𝜶 𝟑
55. 55
If |𝜓 > =
1
2
(|0 > |0 > −|0 > |1 > +|1 > |0 > −|1 > |1 > )
could it be written as a product state ?
Problem 4.4
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
56. 56
If two states are not entangled, we say that they are a
product state or separable. If |𝜓 > ∈ 𝑯 𝑎 and |𝜑 > ∈
𝑯 𝑏 and |𝜒 > = |𝜓 > |𝜙 >, then |𝜒 > is a product
state.
Theorem.
Let |𝜓 > =
𝑎
𝑏
𝑐
𝑑
, the state is separable only if
ad = bc
2 Qubit State : Entanglement
58. 58
A system of two qubits is in the state |00> . We operate on this
state with H⊗H, where H is the Hadamard matrix. Is the state H
⊗H |00> entangled?
Problem 4.5
𝐻 =
1
√2
1 1
1 −1
, 𝐻 𝐻 =
1
√2
𝐻 𝐻
𝐻 −𝐻
,and |00 > =
1
0
0
0
, Hence
This is also a product state
59. 59
Emily Grumbling and Mark Horowitz ; Quantum Computing: Progress and Prospects ; Washington, DC: The
National Academies Press. 2019 ; Pp.272
60. And a Three Qubit Register is the superposition of eight states
𝜓 > = 𝛼0 000 > + 𝛼1 001 > + 𝛼2 010 > + 𝛼3 011 > + 𝛼4 100 > + ⋯ . . ,
Let’s consider a 3 qubit register with three pairs of amplitudes 𝛼𝑖, 𝛽𝑖 such as
1/√2
1/√2
1/√2
−1/√2
1/2
3/2
The above result means that the probabilities to represent the states
|000> , ……. |111> are 1/16, 3/16, …… 3/16 respectively. Consequently a
3 qubit register contains the information of eight states.
3 Qubit Register : |𝜓 > |𝜑 > |𝜒 >
60
62. 3 Qubit Register : Representation as Column Vectors
Quantum Registers are Straightforward Extension of
Quantum Bits (qbits)
62
63. 63
Let’s consider a 3 qubit register with three pairs of amplitudes 𝜶𝒊, 𝜷𝒊 such as
𝟏/√𝟐
𝟏/√𝟐
𝟏/√𝟐
−𝟏/√𝟐
𝟏/𝟐
𝟑/𝟐
Show that the 3 qubit register is represented by :
Problem 4.6
64. 64
The three pairs of amplitudes 𝛼𝑖, 𝛽𝑖 are
1/√2
1/√2
1/√2
−1/√2
1/2
3/2
The 1 qubit registers are
|ψ> = 1/√2 |0> +1/√2 |1>
|ϕ> =1/√2 |0> - 1/√2 |1>
|χ> = 1/( 2) |0> +(√3)/√2 |1>
The 3 bit register is represented by
|ψ> |ϕ> |χ> =
( 1/√2 |0> +1/√2 |1> ) (1/√2 |0> -1/√2 |1>) (1/ 2|0> +(√3)/2 |1> )
Problem 4.6
65. This scheme could be generalised to n qubits whose general
state can be any superposition of 2n different classical states ,
with amplitudes whose squared magnitudes sum to unity :
|𝜓 > = 0≤𝑥<2 𝑛 𝛼 𝑥 |𝑥 > 𝑛 ; 0≤𝑥<2 𝑛 |𝛼 𝑥|
2
= 1.
In the context of quantum computation, the set of 2n classical
states – all the possible Tensor Products of n individual qubit
states |0 > 𝑎𝑛𝑑 |1 > – is called the computational basis
n Qubit Register
65
A collection of n qubits is called a quantum register of size n.
66. 66
Classically, if we put together a subsystem that stores k bits of
information with one that stores l bits of information, the total
capacity of the composite system is k+l bits. Or put another way, if k
bits of information are required to describe the state of the first
subsystem and l bits to describe the second, then k+l bits suffice to
describe the composite system. From this viewpoint, the situation
with quantum systems is extremely paradoxical. We need k complex
numbers to describe the state of a k-level quantum system. Now
consider a system that consists of a k-level subsystem and an l-level
subsystem. To describe the composite system we need kl complex
numbers
The Significance of Tensor Products
CS 294-2 Lecture 2 Hilbert Spaces, Tensor Products, Quantum Gates, Bell
Sates , Spring 2007 Umesh Vazirani , UC Berkeley
67. 67
If the state of the system was known to be a tensor product state|𝜙 > |𝜓 >
then only k+l complex numbers would suffice. It follows that most states of the
composite system are not tensor product states. They are entangled states. This
brings up another question: one might wonder where nature finds the extra
storage space when we put these two subsystems together. An extreme case of
this phenomenon occurs when we consider an n qubit quantum system. The
Hilbert space associated with this system is the n-fold tensor . Thus nature must
“remember” of 2 𝑛
complex numbers to keep track of the state of an n qubit
system. For modest values of n of a few hundred, 2 𝑛 is larger than estimates on
the number of elementary particles in the Universe. This is the fundamental
property of quantum systems that is used in quantum information processing.
Finally, note that when we actually a measure an n-qubit quantum state, we see
only an n-bit string - so we can recover from the system only n, rather than 2 𝑛
,
bits of information.
The Significance of Tensor Products
CS 294-2 Lecture 2 Hilbert Spaces, Tensor Products, Quantum Gates, Bell States
, Spring 2007 Umesh Vazirani , UC Berkeley
72. 3 Level Quantum Systems : Qutrit
Extending the scheme to three-levels , we can define a system where the
basic unit of memory is called a qutrit. It has three basis states, |0⟩, |1⟩,
and |2⟩.The state of the qutrit can be represented as a superposition in
the form of a linear combination:
|𝝍 > = 𝜶 𝟎 > + 𝜷 𝟏 > +𝜸 |𝟐 >
With a normalization constraint
𝜶 𝟐 + 𝜷 𝟐 + 𝜸 𝟐 = 𝟏
A system containing n qutrits has 𝟑 𝒏 basis states ( as opposed to 𝟐 𝐧
states for qubits).
72
73. Multilevel Quantum Systems : Qudit
Generalizing the scheme we can define qudit as a quantum unit of
information, which may be in any of 𝑛 basis states |0⟩, |1⟩, |2⟩, . . . |𝑛 − 1⟩ or
in any superposition of those.
|𝝍 > = 𝜶 𝟎 𝟎 > + 𝜶 𝟏 𝟏 > +𝜶 𝟐 𝟐 > + ⋯ … 𝜶 𝒏 𝒏 − 𝟏 >
with a normalization constraint
𝜶 𝟎
𝟐 + 𝜶 𝟏
𝟐 + 𝜶 𝟐
𝟐 + ⋯ … … . 𝜶 𝒏
𝟐 = 𝟏
The state of the qudit can also be generally represented as the following
column matrix
|𝝍 > = ( 𝜶 𝟎 , 𝜶 𝟏 , 𝜶 𝟐 , … … … . . 𝜶 𝒏) 𝑻
73
74. 74
The expectation value of an operator is the mean or average
value of that operator with respect to a given quantum state
i.e. superposition state . In other words, we are asking the
following question: If a quantum state |ψ> is prepared many
times, and we measure a given operator A each time, what is
the average of the measurement results?
We write the expectation value as
< 𝑨 > = < 𝝍 𝑨 𝝍 >
The Expectation Value of an Operator
76. 76
Recalling X|0> = |1> and X|1> = |0> , we get
Solution 4.7
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
77. 77
An operator acts on qutrit basis in the following way
𝐴|0 > = 1 > , 𝐴 1 > = 1/ 2( 0 > + 1 > , 𝐴 2 > = 0
Find <A> for the state
𝜓 > = 1/2 0 > −𝑖/2|1 > +
1
2
|2 >
Problem 4.9
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
79. In classical computing sets of logic gates are connected to
construct digital circuits. Similarly quantum logic gates
compute the output states from the input states where the
inputs in general are superposition states. Mathematically,
quantum gates are described by the Unitary Matrices, and
their application is accomplished through multiplication of
the respective matrix by the state vector . Since these unitary
transformations are rotations in the Bloch Sphere then Q-
gates are reversible gates. For 1-qubit we require a matrix of
degree 2 i.e. a quantum gate acting on a single qubit will be
2x2 unitary matrix. A 2-qubit gate can be implemented with
a 4x4 matrix. It is known that a handful of single-qubit gates
and one two-qubit gate are sufficient to implement an
arbitrary quantum algorithm.
5. Quantum Gates and Circuits
79
81. Quantum Gates
Quantum gates are fundamentally Unitary Matrices,
and their applications are accomplished through
multiplication of the respective matrix by the state
vector.
Theorem 5.1
It is now mathematically established that a couple of single-
qubit gates and one two-qubit gate are sufficient to implement
an arbitrary quantum algorithm.
Quantum Gates and Circuits
81
82. 82
Quantum Circuit including a Quantum Register , input state |ψ> ,
information processing step U(t) and output , as a result of measuring
or observing the sate of each qubit.
Quantum Genetic Algorithms for Computer Scientists, Rafael Lahoz-Beltra , Computers 2016,
5, 24; doi:10.3390/computers5040024
83. 𝑿 =
𝟎 𝟏
𝟏 𝟎
, 𝒀 =
𝟎 − 𝒊
𝒊 𝟎
, 𝒁 =
𝟏 𝟎
𝟎 − 𝟏
𝑿 = 𝑼 𝑵𝑶𝑻 =
𝟎 𝟏
𝟏 𝟎
So with respect to the standards or computational basis,
the X matrix acts as a NOT operator
1 qubit Quantum Gates : Pauli Matrices
83
84. 𝑍 =
1 0
0 − 1
The Z operator is sometimes called the phase flip gate because
it takes a qubit 𝜓 > = 𝛼 0 > + 𝛽|1 >
into a state
𝜓′ > = 𝛼 0 > −𝛽|1 >
This is easy to see using the matrix representation :
1 qubit Quantum Gate : Phase flip Gate
84
88. 1 qubit Quantum Gate : Hadamard Basis
That is, the Hadamard gate has turned a state that, with
respect to the standard or computational basis, had the
probability |𝜶| 𝟐
of finding the system in the state |0 > and
the probability |𝜷| 𝟐 of finding the system in the state |1 >
into a state that has the probability |𝛼|2 of finding the system
in the state | +> and the probability |𝛽|2 of finding the
system in the state | −> .
𝑯|𝝍 > = 𝜶
|𝟎 > +|𝟏 >
𝟐
+ 𝜷
|𝟎 > − |𝟏 >
√𝟐
Define | +> =
𝟏
𝟐
(|𝟎 > + 𝟏 > 𝒂𝒏𝒅 |− > = 𝟏/ 𝟐(|𝟎 > −|𝟏 >)
88
89. 𝑯|𝟎 > = 𝑯
𝟏
𝟎
=
𝟏
𝟐
|𝟎 > +
𝟏
𝟐
|𝟏 > = 𝟏/√𝟐
𝟏
𝟏
.
Therefore, if we measure or observe the qubit state then
we will have exactly 50% chance of seeing the state as
either 0 or 1. One of the applications of Hadamard gate is
the initialization of a quantum register. Generalizing the
H gate multiplication by |0 > to an n-qubit register that
stores the value |0 𝑛 > results in a superposition or
mixed state
1 qubit Quantum Gate : Hadamard Gate
89
90. We can prepare n- qubits in the state |0 > and apply to each
qubit in parallel its own H gate to produce an equal
superposition state of all the qubits in the register
𝐻
𝑛
|0 > = 1/√2 𝑛
𝑗=0
2 𝑛−1
|𝑗 >
90
95. 2 Qubit Gate : Controlled NOT
We have to do it with respect to the states
|00> , |01> , |10> , and |11>.
The matrix will be a 4×4 matrix given by
95
96. 2 Qubit Gate : Controlled NOT
The action of CNOT Gate can be described in terms of the XOR Operation as
follows
|𝑎, 𝑏 > = |𝑎, 𝑏⨁𝑎 >
If the control qubit is |0> , nothing happens to the target qubit. If the control
qubit is |1> , the NOT or X Matrix is applied to the target qubit.
Prove the results using Matrix Multiplication
96
98. 2 Qubit Gate : Controlled Hadamard Gate
Find the action of the CH Gate on the input states |01> and |11>
98
99. 99
Problem 5.1
Find the action of CH Gate when the inputs are |01> and |11>
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
100. 100
The states |01> and |11> may be written in the column vector representation as
|01 > =
1
0
0
1
=
0
1
0
0
|11 > =
0
1
0
1
=
0
0
0
1
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
101. 101
𝐶𝐻|11 > = 1/ 2(|10 > − 11 >
McMahon, David M. , Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
102. 102
M. Roetteler and K.M. Svore, 2018, Quantum computing: Codebreaking and
beyond, IEEE Security & Privacy 16(5):22-36.
Commonly used 1-, 2-, and 3-qubit quantum gates
103. 103
M. Roetteler and K.M. Svore, 2018, Quantum computing: Code breaking and
beyond, IEEE Security & Privacy 16(5):22-36.
Commonly used 1-, 2-, and 3-qubit quantum gates
104. 104
6. Matrix Representation of Serial and Parallel
Operations
It is sometimes helpful to break down the Quantum
Algorithms in terms of matrices. There are two basic
rules in this context . The first is that if a Set of
Operations is Performed in Series, then this is
represented by a Matrix Product. We represent a set of
operations performed in series (i.e., in time) by
starting with the first operation on the left followed
by subsequent operations moving to the right.
105. 105
The matrix representation of the following sequence
of operations is written down by multiplying the
matrices in reverse order
𝒁𝑯𝑷 𝜽 𝑐𝑎𝑛 𝑏𝑒 𝑑𝑖𝑎𝑔𝑟𝑎𝑚𝑎𝑡𝑖𝑎𝑙𝑙𝑦 𝑠ℎ𝑜𝑤𝑛 𝑎𝑠
Circuit Diagram for the application of a Phase Gate
followed by Hadamard Gate and Z Gates
106. 106
Explicitly we have
1 0
0 −1
1/√2
1 1
1 −1
1 0
0 𝑒 𝑖𝜃 = 1/√2 1 𝑒 𝑖𝜃
−1 𝑒 𝑖𝜃
(ii) When quantum operations are performed in parallel
(same time) we compute the Tensor Product , for
example Hadamard Gates in Parallel is represented
by the following matrix
108. 108
= 1/(√2^3 ) (|000> +|001> +|010> +011> +|100> +|101> +110> +|111>
Another Useful Example
109. 109
Quantum Interference
The application of a Hadamard gate to an arbitrary qubit is
an example of quantum interference. Let’s recall 𝐻|𝜓 >
, 𝜓 > = 𝛼 0 > + 𝛽 |1 >
𝑯 = 𝟏/√𝟐
𝟏 𝟏
𝟏 − 𝟏
, 𝑯|𝝍 > = 𝟏/ 𝟐
𝟏 𝟏
𝟏 −𝟏
𝜶
𝜷
Thus 𝐻 |𝜓 > =
𝛼+𝛽
2
|0 > +
𝛼−𝛽
2
|1 >
𝑯
√𝟐
(|𝟎 > + 𝟏 > = |𝟎 > 𝒂𝒏𝒅
𝑯
𝟐
(|𝟎 > − 𝟏 > = |𝟏 >
110. 110
Hadamard gate transforms |ψ> → |0 >. This is a manifestation of quantum
interference—mathematically this means the addition of probability
amplitudes.
There are two types of interference, positive interference in which probability
amplitudes add constructively to increase or negative interference in which
probability amplitudes add destructively to decrease.
.
𝑯 = 𝟏/√𝟐
𝟏 𝟏
𝟏 − 𝟏
, 𝑯|𝝍 > = 𝟏/ 𝟐
𝟏 𝟏
𝟏 −𝟏
𝜶
𝜷
Thus 𝐻 |𝜓 > =
𝛼+𝛽
2
|0 > +
𝛼−𝛽
2
|1 >
𝑯
√𝟐
(|𝟎 > + 𝟏 > = |𝟎 > 𝒂𝒏𝒅
𝑯
𝟐
(|𝟎 > − 𝟏 > = |𝟏 >
111. 111
In the case of
𝐻
√2
(|0 > + 1 > = |0 > we have the following
1. Positive interference with regard to the basis state |0> . The
two amplitudes add to increase the probability of finding |0>
upon measurement. In fact in this case it goes to unity meaning we
are certain to find |0>.
2. Negative interference where by the terms |1 > and −|1 >cancel.
We go from a state where there was a 50% chance of finding 1
upon measurement to one where there is no chance of finding 1
upon measurement.
Quantum interference plays an important role in the development
of Quantum Algorithms.
112. 112
Elementary Arithmetic Operations +/−
Step 1. We incorporate the two numbers that we wish to add/subtract in
the angles of the rotation gates 𝑅 𝑦 𝜃 𝑎𝑛𝑑 𝑅 𝑦(𝜑) , explicitly
represented by
𝑹 𝑦 𝜃 =
𝐶𝑜𝑠
𝜃
2
−𝑆𝑖𝑛
𝜃
2
𝑆𝑖𝑛
𝜃
2
𝐶𝑜𝑠
𝜃
2
𝑹 𝑦 𝜑 =
𝐶𝑜𝑠
𝜑
2
−𝑆𝑖𝑛
𝜑
2
𝑆𝑖𝑛
𝜑
2
𝐶𝑜𝑠
𝜑
2
Step 2. Prepare a state |𝝍 > 𝑔𝑖𝑣𝑒𝑛 𝑏𝑦
|𝝍 > = 𝑹 𝑦 𝜃 𝑹 𝑦 𝜙 |𝟎 >
114. 114
Step 4. The probability of finding the state 𝜓 > 𝑡𝑜 𝑏𝑒 𝑖𝑛 𝑠𝑡𝑎𝑡𝑒 0 > is
given by
𝑷|0 > = |𝐶𝑜𝑠 [
𝜃 + 𝜑
2
]| 2
𝜃 + 𝜑 = 2 𝐶𝑜𝑠−1 √𝑷|0 >
Thus by measuring the state |𝝍 > 𝑖𝑛 𝑡ℎ𝑒 computational basis |0> , |1> ,
we get P(|0>) from which we obtain the required sum 𝜽 + 𝝋 .
Let’s add 0987 and 4589 . Since these two numbers can't fit into the allowable
values of the angles 𝜃 𝑎𝑛𝑑 𝜑 , we divide them by 10000 to get 0.0987 and 0.4589.
Next with 𝜃 = 0.0987 𝑎𝑛𝑑 𝜑 = 0.4589 , we apply them on initial state |0>.
The resulting state is measured subsequently. P|0> = 0.92493 , our required sum
is 0:0987 + 0:4589 = 2 𝐶𝑜𝑠−1
0.92483 = 0.5550 . The resulting sum is 5550
although we expect it to be 5576. Try to Explore
115. 115
The quantum circuit for addition of two numbers. The numbers to be added,
987 and 4589 here, are encoded into the angles of the Ry gates. The second Ry
gate is followed by the measurement gate which measures the qubit in the z-
basis to give the probability of finding the output state in |0> and |1> i.e., the
values of P(|0>) and P(|1>) respectively. From these probabilities, we can
calculate the sum of the two numbers.
The quantum circuit for addition of two numbers
116. 116
Elementary Arithmetic Operations ×/÷
Step 1. We incorporate the two numbers that we wish to
multiply in the angles of the rotation gates
𝜃 = 2 𝑆𝑖𝑛−1 𝑚 𝑎𝑛𝑑 (𝜑 = 2 𝑆𝑖𝑛−1 𝑛) , or
𝑚 = 𝑆𝑖𝑛
𝜃
2
𝑎𝑛𝑑 𝑛 = 𝑆𝑖𝑛
𝜑
2
Step 2. We Prepare a state |𝜓 > by applying 𝑅 𝑦 𝜃 𝑎𝑛𝑑 𝑅 𝑦 𝜑
gates separately on two qubits initialized in state |0>
|𝝍 > = 𝑹 𝑦 𝜃 ⊗ 𝑹 𝑦 𝜙 |00 >
118. 118
Step 4. It is evident from the above that the probability for
finding the state |𝜓 > 𝑡𝑜 𝑏𝑒 𝑖𝑛 𝑡ℎ𝑒 𝑠𝑡𝑎𝑡𝑒 |11 > is
𝑃 11 > = |𝑆𝑖𝑛
𝜃
2
𝑆𝑖𝑛
𝜑
2
| 2
𝑃 11 > = |𝑚𝑛| 2
𝑚𝑛 = 𝑃(|11 >)
119. 119
Let us multiply the two numbers 42.5 and 52.5 . Since these two numbers can not fit
into the allowable values for the angles 𝜃 = 2 𝑆𝑖𝑛−1
𝑚 𝑎𝑛𝑑 𝜑 = 2 𝑠𝑖𝑛−1
𝑛 (which
ranges between -2 and 2) we divide them by 100 to get 0.425 and 0.525. Then we take
𝜃 = 2 𝑆𝑖𝑛−1 0.425 𝑎𝑛𝑑 𝜑 = 2 𝑠𝑖𝑛−1 0.525 .. Next, we accordingly construct Ry
(0:877) and Ry (1:105) and apply them on an initial state |00>. We then measure the
resulting state to find out the probability of getting state |11> using the measurement
gate in z-basis. The resulting measurement outcome can be seen in
P (|11>) =0.04993
(which is otherwise 4.993%). Hence, referring to step 4, we can find our required sum
as
0.425 × 0.525 = 0.049933 = 0.22345
We can see that the resulting multiplication is 2234.5 although we would expect it to
be 2231.25.
120. 120
Reference : A Novel Approach for Basic Arithmetic Operations in Quantum Computing
Kanishk Bansal,Subhashish Barik, Bikash K. Behera, Amar Singh Rana, and Prasanta K. Panigrahi ,
https://www.researchgate.net/publication/340102586_A_Novel_Approach_for_Basic_Arithmetic_
Operations_in_Quantum_Computing
The quantum circuit for multiplication of two numbers.
121. 121
QFT and Shor’s Algorithm
QFT for n=32 , How many qubit registers are required to implement
n= 1024 point QFT ?
123. 123
Research Trends in Quantum Computing
1. Quantum and Post-Quantum Cryptography
National Institute of Standards and Technology, 2018, “Post-Quantum Cryptography,”
last modified May 29, 2018, http://csrc.nist.gov/groups/ST/post-quantum-crypto/
2. Quantum Solver for Linear System of Equations : Aram Harrow MIT
3. Quantum Computational Complexity , Waltrous , Waterloo Canada
4.Superconducting Quantum Processor : William Oliver MIT Experimental
5.Quantum Support Vector Machine for big data classification.
Physical review letters, 113(13):130503, 2014. MIT
6. Quantum Hopfield neural network , Seth Loyd MIT 2018
7. Quantum algorithms for supervised and unsupervised machine learning MIT
8. Quantum Genetic Algorithms Exeter UK ,Spain ,Italy ,Korea
Convergence of Quantum GA : Quantum Schema Theorem
9. Quantum Programming Lagnuages and Compilers Princeton Chicago
10. Classical Homomorphic Encryption for Quantum Circuits UC Berkeley
11. Quantum Error Correcting Codes Caltech
12. https://www.ibm.com/blogs/research/2019/12/qiskit-openpulse/
Open Resource : IBM Q Experience
125. Trapped Ion Quantum Computer
125
Emily Grumbling and Mark Horowitz ; Quantum Computing: Progress and Prospects ;
Washington, DC: The National Academies Press. 2019
126. 126
Google has reached quantum supremacy – here's what it should do next
Read more: https://www.newscientist.com/article/2217835-google-has-reached-
quantum-supremacy-heres-what-it-should-do-next/#ixzz6Q4qoLc00
New Scientist 5th October , 2019
128. 128
Quantum supremacy is not universal - there will
always be some tasks that classical computers
will do better than quantum computers. The IBM
and Google quantum computers are built in similar ways.
Microsoft, DWave, Intel and IonQ have quantum
computer ventures, with different designs.
130. Andrew Glassner , Quantum Computing, Part 1 , IEEE Computer Graphics and Applications , July’August 2001
Andrew Glassner , Quantum Computing, Part 2 , IEEE Computer Graphics and Applications , Sept./October 2001
Andrew Glassner , Quantum Computing, Part 3 , IEEE Computer Graphics and Applications , Nov./December, 2001
DMITRI MASLOV ,YUNSEONG NAM , JUNGSANG KIM , An Outlook for Quantum Computing , Vol. 107, No. 1 PROCEEDINGS OF
THE IEEE . , January 2019 , Pp. 5-10 .
Emily Grumbling and Mark Horowitz ; Quantum Computing: Progress and Prospects ; Washington, DC: The National Academies
Press. 2019 ; Pp.272 https://doi.org/10.17226/25196
Aaronson,Scot , The Limits of Quantum , Scientific American , March 2008 , p. 62-69
ELEANOR RIEFFEL , WOLFGANG POLAK , An Introduction to Quantum Computing for Non-Physicists , ACM Computing Surveys,
Vol. 32, No. 3, September 2000, pp. 300–335.
SALONIK RESCH, ULYA R. KARPUZCU, Quantum Computing: An Overview Across the System Stack , 2919,
https://arxiv.org/abs/1905.07240
Michael A Nielsen and Isaac L Chuang. Quantum computation and quantum information, Cambridge University Press , 2010
Peter Shor’s Web page at http://www.research.att.com/~shor/papers/ .
L.K. Grover, “Quantum Mechanics Helps In Searching For A Needle In A Haystack,” Physical Review Letters, vol. 79, no.2, July
1997, pp. 325-328.
L.K. Grover, A Framework for Fast Quantum Mechanical Algorithms, LANL 9711043, 1997. https://arxiv.org/abs/quant-
ph/9711043
Artur Ekert, Patrick Hayden and Hitoshi Inamori , Basic concepts in quantum computation , https://arxiv.org/pdf/quant-
ph/0011013.pdf
John Preskill Lecture Notes , http://www.theory.caltech.edu/~preskill/ph229
McMahon, David (David M.) . Quantum Computing Explained 2008 by John Wiley & Sons Inc ., New Jersey.
A Novel Approach for Basic Arithmetic Operations in Quantum Computing , Kanishk Bansal,Subhashish Barik, Bikash K. Behera,
Amar Singh Rana, and Prasanta K. Panigrahi ,
https://www.researchgate.net/publication/340102586_A_Novel_Approach_for_Basic_Arithmetic_Operations_in_Quantum_Co
mputing
130
Selected References