0% found this document useful (0 votes)
36 views200 pages

Module 2 - Quantum Computing

Module 2 covers Quantum Computing, focusing on quantum circuits, algorithms, and the principles of quantum mechanics necessary for understanding quantum computing. It discusses key concepts such as superposition, entanglement, and tunneling effects, along with the historical context of quantum revolutions and the development of quantum computers. The module also introduces qubits as the fundamental unit of quantum information, contrasting them with classical bits.

Uploaded by

Prajakta Patkari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views200 pages

Module 2 - Quantum Computing

Module 2 covers Quantum Computing, focusing on quantum circuits, algorithms, and the principles of quantum mechanics necessary for understanding quantum computing. It discusses key concepts such as superposition, entanglement, and tunneling effects, along with the historical context of quantum revolutions and the development of quantum computers. The module also introduces qubits as the fundamental unit of quantum information, contrasting them with classical bits.

Uploaded by

Prajakta Patkari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 200

Module 2

Quantum Computing

Prepared By,
Dr. Mukta Nivelkar
Syllabus content Module 2
Quantum Circuits – Quantum algorithms, Single Orbit operations, Control Operations,
Measurement, Universal Quantum Gates, Simulation of Quantum Systems, Quantum
Fourier transform, Phase estimation, Applications, Quantum search algorithms –
Quantum counting – Speeding up the solution of NP – complete problems – Quantum
Search for an unstructured database. Problems on Boolean functions and Quantum
gates, Quantum gates and circuits.
Self-learning Topics: Application of Quantum Computing
Books
Text Books:
1. Chris Bernhardt,” Quantum Computing for Everyone”, (The MIT Press) Hardcover – Illustrate
,September 2020,
2. Willi-Hans Steeb; “Problems and Solutions in Quantum Computing and Quantum Information”,
Yorick Hardy
3. Academic Consulting and Editorial Services (ACES) Private Limited, January 2020.
4. M.A. Nielsen and I.Chuang, “Quantum Computation and Quantum Information”, Cambridge
University Press 2010.
References Books:
1. Computer Science: An Introduction by N. David Mermin 5. Yanofsky's and Mannucci , Quantum
Computing for Computer Scientists.
2. Parag K. Lala ,Quantum Computing: A Beginner's Introduction Paperback” , McGraw Hill
November 2020.
3. V. Sahni, “Quantum Computing”, Tata McGraw-Hill Publishing company,2007.
Introduction to Quantum Computing
• Quantum computing is a science based on
principles of information theory and quantum
mechanics
Introduction to Quantum Computing

• Quantum computing is a science based on


principles of information theory and quantum
mechanics
• In its structure it defines the universal language to
efficiently write quantum algorithms
Introduction to Quantum Computing

• Quantum computing is a science based on


principles of information theory and quantum
mechanics
• In its structure it defines the universal language
to efficiently write quantum algorithms
• Quantum algorithms are particular algorithms
that exploit some properties deriving from
quantum mechanics
Introduction to Quantum Computing

• Quantum computing is a science based on


principles of information theory and
quantum mechanics
• In its structure it defines the universal
language
to efficiently write quantum algorithms
• Quantum algorithms are particular
algorithms that exploit some properties
deriving from quantum mechanics
• In order to work, quantum algorithms
therefore need to operate through computers
capable of manipulating objects in which the
quantum component is sufficiently manifest
Introduction to Quantum Computing

• Quantum computing is a science based on


principles of information theory and
quantum mechanics
• In its structure it defines the universal
language to efficiently write quantum
algorithms
• Quantum algorithms are particular
algorithms that exploit some properties
deriving from quantum mechanics
• In order to work, quantum algorithms
therefore need to operate through computers
capable of manipulating objects in which the
quantum component is sufficiently manifest
• Such computers are called Quantum
Computers
Quantum Mechanics

• To understand quantum computing, we don't


necessarily have to be an expert in quantum
mechanics
Quantum Mechanics

• To understand quantum computing, we don't


necessarily have to be an expert in quantum
mechanics
• To understand at least the idea behind it,
however, it is good to know some fundamental
principles
Quantum Mechanics

• To understand quantum computing, we don't


necessarily have to be an expert in quantum
mechanics
• To understand at least the idea behind it,
however, it is good to know some fundamental
principles
• The first principle we need to know is
undoubtedly the superposition principle
Quantum Mechanics

• To understand quantum computing, we don't Quantum Superposition Principle


necessarily have to be an expert in quantum In the quantum mechanical regime, objects do not manifest only a
mechanics single state, but all the possible states that they can assume at the
• To understand at least the idea behind it, same time (superposition state). If significantly disturbed (for
example, with a measurement), the superposition state collapses
however, it is good to know some fundamental
and the object is forced to assume a classical state.
principles
• The first principle we need to know is
undoubtedly the superposition principle
Quantum Mechanics

• To understand quantum computing, we don't Measurement


necessarily have to be an expert in quantum With the term observation (or measurement) of a quantum state,
mechanics we mean that process which, through special instruments,
• To understand at least the idea behind it, quantifies a certain quantity belonging to a microscopic object.
however, it is good to know some fundamental This measurement can be seen as a sort of intrusion of the
principles macroscopic world into the microscopic world: consequently, it
inevitably perturbs the quantum state of matter, causing the state
• The first principle we need to know is to collapse into a classical state, the only category of states that
undoubtedly the superposition principle we, humans of the macroscopic world, can recognize.
Quantum Mechanics

• To understand quantum computing, we don't Quantum Entanglement


necessarily have to be an expert in quantum Phenomenon closely related to the superposition principle and the
mechanics collapse of the quantum state into a classical state after a
• To understand at least the idea behind it, measurement, this principle states that there is a particular
condition that can bind two quantum particles regardless of
however, it is good to know some fundamental
distance.
principles
This link is such that the observation of one of the two particles is
• The first principle we need to know is also reflected on the other, conditioning the classical state in
undoubtedly the superposition principle which it collapses (which can be the same or diametrically
opposite)
• Second principle is quantum entanglement
Quantum Mechanics
• To understand quantum computing, we don't Tunnelling Effect
necessarily have to be an expert in quantum
mechanics By definition, we speak of tunneling effect when a particle
• To understand at least the idea behind it, manages to make a transition that is not normally possible
however, it is good to know some fundamental according to the rules of classical mechanics.
principles In simple words, this principle states that, under certain
circumstances, a quantum particle can cross energy barriers, as if
• The first principle we need to know is a ball could be able to pass through a wall instead of bouncing
undoubtedly the superposition principle against it!
• Second principle is quantum entanglement
• Third one is the tunneling effect
The First Quantum Revolution
• Despite their strange nature, over the
years more and more experiments
have validated the theories of
quantum mechanics

Laser Transistor

GP
S Touch
Screen
The First Quantum Revolution
• Despite their strange nature, over the years
more and more experiments have validated
the theories of quantum mechanics
• As often happens in science, therefore, after
confirming the theories with numerous
experiments (exploration phase), we moved on
to the exploitation phase, i.e. the Laser Transistor
concretization of the results obtained by the
theory in order to improve everyone's lives.

GPS
Touch
Screen
The First Quantum Revolution
• Despite their strange nature, over the years more
and more experiments have validated the theories
of quantum mechanics
• As often happens in science, therefore, after
confirming the theories with numerous experiments
(exploration phase), we moved on to the
exploitation phase, i.e. the concretization of the Laser Transistor
results obtained by the theory in order to improve
everyone's lives.
• The exploitation phase of quantum physics starts
between 1960 and 1970, in the period that we could
define as the First Quantum Revolution, and
continues to this day.

GP
S Touch
Screen
The Second Quantum Revolution
• While in the first quantum revolution the
basic concept was:
We are able to exploit quantum mechanics to
dominate the behavior of a systemof atoms
The Second Quantum Revolution

• While in the first quantum revolution the basic concept was: We are able to exploit quantum mechanics to dominate
the behavior of a systemof atoms
• In the context of the second quantum revolution, however, the key concept becomes: We are able to exploit
quantum mechanics to dominate the behavior of a single quantum object
The Second Quantum Revolution

• While in the first quantum revolution the basic concept was: We are able to exploit quantum mechanics to
dominate the behavior of a system of atoms
• In the context of the second quantum revolution, however, the key concept becomes: We are able to
exploit quantum mechanics to dominate the behavior of a single quantum object
• Quantum Technologies are born: Quantum Computing is one of them
The Idea of a Quantum Computer
• The authorship of the quantum computer idea is
historically attributed to the famous physicist
Richard P. Feynman
The Idea of a Quantum Computer
• The authorship of the quantum computer idea is historically
attributed to the famous physicist Richard P. Feynman
• Feynman was one of the first to think of an alternative computer,
albeit in the midst of the development of classical computers (1982).
His idea was basically that of using computers that had as a basis for
calculation not classical objects, such as the bits crossed by the
current, but some other object in which quantum behaviors could
manifest themselves visibly.
The Idea of a Quantum Computer
The Idea of a Quantum Computer
• The authorship of the quantum computer idea is historically
attributed to the famous physicist Richard P. Feynman
• Feynman was one of the first to think of an alternative
computer, albeit in the midst of the development of classical
computers (1982). His idea was basically that of using
computers that had as a basis for calculation not classical
objects, such as the bits crossed by the current, but some
other object in which quantum behaviors could manifest
themselves visibly.
• With the sentence reported in the previous slide, Feynman has
attracted the attention of the scientific community to a non-
trivial problem
The Idea of a Quantum Computer
• The authorship of the quantum computer idea is historically
attributed to the famous physicist Richard P. Feynman
• Feynman was one of the first to think of an alternative computer,
albeit in the midst of the development of classical computers
(1982). His idea was basically that of using computers that had as a
basis for calculation not classical objects, such as the bits crossed
by the current, but some other object in which quantum behaviors
could manifest themselves visibly.
• With the sentence reported in the previous slide, Feynman has
attracted the attention of the scientific community to a non-trivial
problem
• In parallel, many other scientists (Deutsch, Benioff) also began to
develop the concept of quantum computer: quantum computing
was born
The Qubit
• In classical computing, the basic logical unit for a computer
is the BIT
The Qubit
• In classical computing, the basic logical unit for a computer
is the BIT
• The BIT is an object capable of assuming only two states, on
and off (commonly 0 and 1)
The Qubit
• In classical computing, the basic logical unit for a computer
is the BIT
• The BIT is an object capable of assuming only two states, on and
off (commonly 0 and 1)
• The bit is considered the basic logical unit of a computer since every
problem, regardless of its complexity, must be translated into binary
language understandable to a computer through the manipulation of
its bits.
The Qubit
• In classical computing, the basic logical unit for a computer
is the BIT
• The BIT is an object capable of assuming only two states, on and
off (commonly 0 and 1)
• The bit is considered the basic logical unit of a computer since
every problem, regardless of its complexity, must be translated
into binary language understandable to a computer through the
manipulation of its bits.
• The idea behind quantum computing is to replace the bit with
something that is capable of manifesting evident quantum
behaviors, first of all superposition (between the 0 and 1 state)
The Qubit
• In classical computing, the basic logical unit for a computer
is the BIT
• The BIT is an object capable of assuming only two states, on and
off (commonly 0 and 1)
• The bit is considered the basic logical unit of a computer since every
problem, regardless of its complexity, must be translated into binary
language understandable to a computer through the manipulation of
its bits.
• The idea behind quantum computing is to replace the bit with
something that is capable of manifesting evident quantum behaviors,
first of all superposition (between the 0 and 1 state)
• This something is called Qubit
The Qubit

• A QUBIT is the quantum equivalent of a bit: it


can be represented by an atom, a trapped ion or
by macroscopic objects which, under particular
conditions, can exhibit quantum behaviors
The Qubit
• A QUBIT is the quantum equivalent of a bit: it
can be represented by an atom, a trapped ion or
by macroscopic objects which, under particular
conditions, can exhibit quantum behaviors
• On the basis of the qubit chosen, it is
determined what state is the 0-state and what
state is the 1-state (it can be, for example, the
direction of the current that runs through the
superconducting qubit or the spin for an atom)
The Qubit

• A QUBIT is the quantum equivalent of a bit: it


can be represented by an atom, a trapped ion or
by macroscopic objects which, under particular
conditions, can exhibit quantum behaviors
• On the basis of the qubit chosen, it is determined
what state is the 0-state and what state is the 1-
state (it can be, for example, the direction of the
current that runs through the superconducting
qubit or the spin for an atom)
• In this way, the qubit allows us to take
quantum effects into account in its
manipulation
The Qubit

• But how can we manipulate qubits while


taking into account the effects induced by
quantum mechanics? To do this, we need to
start introducing the concept of quantum
computing
The Qubit
• But how can we manipulate qubits while
taking into account the effects induced by
quantum mechanics? To do this, we need to
start introducing the concept of quantum
computing
• Quantum computing is a science that
combines the mathematical formalism of
quantum mechanics with the creation of
computing circuits of classical computation
The Qubit

• But how can we manipulate qubits while


taking into account the effects induced by
quantum mechanics? To do this, we need to
start introducing the concept of quantum
computing
• Quantum computing is a science that
combines the mathematical formalism of
quantum mechanics with the creation of
computing circuits of classical computation
• To fully understand it, it is good to first do a
little review of the tools that we will use
during this lesson
The Qubit
• But how can we manipulate qubits while
taking into account the effects induced by
quantum mechanics? To do this, we need to
start introducing the concept of quantum
computing
• Quantum computing is a science that
combines the mathematical formalism of
quantum mechanics with the creation of
computing circuits of classical computation
• To fully understand it, it is good to first do a
little review of the tools that we will use
during this lesson
• Let's start with a quick review of linear
algebra and quantum mechanics
mathematical formalism
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum computing it


is not absolutely necessary to be an expert in
quantum mechanics. However, it can be
convenient to know a minimum of formalism
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary
to be an expert in quantum mechanics.
However, it can be a convenient to
know a minimum of formalism
• Dirac Notation: a way to indicate a
vector of elements
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary
to be an expert in quantum mechanics.
However, it can be convenient to know
a minimum of formalism
• Dirac Notation: a way to indicate a
vector of elements
• Inner (dot) Product
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary to be
an expert in quantum mechanics. However, it
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements
• Inner (dot) Product
• Outer (tensor) Product
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary to be
an expert in quantum mechanics. However, it
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary to be
an expert in quantum mechanics. However, it
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary to be
an expert in quantum mechanics. However, it
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
• Tensor product between matrices
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary to be
an expert in quantum mechanics. However, it
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
• Tensor product between matrices
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum


computing it is not absolutely necessary to be
an expert in quantum mechanics. However, it
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
• Tensor product between matrices
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum a complex square matrix U is unitary if its


computing it is not absolutely necessary to be conjugate transpose U* is also its inverse, that is,
an expert in quantum mechanics. However, it if
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
• Tensor product between matrices
• Unitary Matrices
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum a complex square matrix U is unitary if its


computing it is not absolutely necessary to be conjugate transpose U* is also its inverse, that is,
an expert in quantum mechanics. However, it if
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements Unitary matrices have significant importance in
quantum mechanics because they preserve norms.
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
• Tensor product between matrices
• Unitary Matrices
Quantum Mechanics and Linear Algebra

• To understand the basics of quantum a complex square matrix U is unitary if its


computing it is not absolutely necessary to be conjugate transpose U* is also its inverse, that is,
an expert in quantum mechanics. However, it if
can be convenient to know a minimum of
formalism
• Dirac Notation: a way to indicate a vector of
elements Unitary matrices have significant importance in
quantum mechanics because they preserve norms.
• Inner (dot) Product
• Outer (tensor) Product
• Matrix-Vector Multiplication
• Tensor product between matrices
• Unitary Matrices
What “preserve norms” means?

• In quantum mechanics, the state of a system is described by a state vector ∣ψ⟩ in a complex vector
space.
• This vector’s norm (or “length”) represents the total probability of all possible outcomes, and it must
always be 1 for a valid physical state.
Why it matters in quantum mechanics?
• Probability conservation: Since the square of the norm corresponds to total probability, norm
preservation means probability is neither lost nor gained during evolution.
• Reversible evolution: Because U†U=I, a unitary transformation can always be reversed
(important for deterministic quantum evolution).
• Time evolution operator: The Schrödinger equation’s solution involves a unitary operator U(t) so
that quantum states evolve without changing total probability.
U dagger
Qubits and Bloch Sphere
• A qubit is defined as a ray of the Bloch sphere.
Qubits and Bloch Sphere
• A qubit is defined as a ray of the Bloch sphere.
• The Bloch sphere is a mathematical object defined in C2, whose
elements on the surface can be identified by the coordinates
Qubits and Bloch Sphere
• A qubit is defined as a ray of the Bloch sphere.
• The Bloch sphere is a mathematical object defined in C2, whose
elements on the surface can be identified by the coordinates

• The poles of the Bloch sphere represent the classical states


0 and 1. As we can see, they are highlighted in Dirac
notation since they are defined by two vectors
Qubits and Bloch Sphere
• A qubit is defined as a ray of the Bloch sphere.
• The Bloch sphere is a mathematical object defined in C2, whose
elements on the surface can be identified by the coordinates

• The poles of the Bloch sphere represent the classical states


0 and 1. As we can see, they are highlighted in Dirac
notation since they are defined by two vectors
• Without losing generality, we can analyze the Bloch sphere only in
the real field, ignoring the variable phi and bringing us back to a
circumference
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere

Withthis choice of coordinates, the classicalstates|0> and |1> represent a base.


Anyother state of the system can thereforebe representedas a linear
combination of the classical states
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere

Superposition

Writtenin this way, the relationship betweenthe coordinatesof a qubit and the
superposition principle beginsto appearclear.

In mathematicalterms, the superpositionstate manifested bya qubit is


expressedas a linearcombination of the classicalstates0 and 1
Qubits and Bloch Sphere

Measuringa qubit: the wavefunction

Even if it can be representedmathematically,it will neverbe


possible to observea state of superposition.

Quantum computing,like classical computing, involves the measurement


operation,whichaims to makeknownthe value of a certain qubit / bit

The fundamental difference isthat the measurementof a qubit destroysthe


superpositionstate, forcing the qubit to assumeone of the two classical
values(collapse of the wave function)
Qubits and Bloch Sphere
Alphaand Beta, commonly calledamplitudes,are directly relatedto the
probability of observinga qubit in one of the corresponding classicalstates
Qubits and Bloch Sphere
Alphaand Beta, commonly calledamplitudes,are directly relatedto the
probability of observinga qubit in one of the corresponding classicalstates
Qubits and Bloch Sphere
Alphaand Beta, commonly calledamplitudes,are directly relatedto the
probability of observinga qubit in one of the corresponding classicalstates
Qubits and Bloch Sphere
Alphaand Beta, commonly calledamplitudes,are directly relatedto the
probability of observinga qubit in one of the corresponding classicalstates
Qubits and Bloch Sphere
Alphaand Beta, commonlycalledamplitudes,are directly related to the probability
of observinga qubit in one of the correspondingclassicalstates
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Qubits and Bloch Sphere
Two Qubits System
Two Qubits System
• What are the mathematical representations of these two qubits as a function
of the classical states?
Two Qubits System
• What are the mathematical representations of these two qubits as a function
of the classical states?
Two Qubits System
• What are the mathematical representations of these two qubits as a function
of the classical states?

• What are the probabilitiesof obtaining the classical states 0 and 1


after taking a measurement?
Two Qubits System
• What are the mathematical representations of these two qubits as a function
of the classical states?

• What are the probabilitiesof obtaining the classical states 0 and 1


after taking a measurement?
Two Qubits System
• What are the probabilitiesof obtaining the classical states 0 and 1 after
taking a measurement?

• Considering that the two measurements are independent event, what could
be the probability of observing one of the four possible combinations of
classical states?
Two Qubits System
• What are the probabilitiesof obtaining the classical states 0 and 1 after
taking a measurement?

• Considering that the two measurements are independent event, what could
be the probability of observing one of the four possible combinations of
classical states?
Two Qubits System
• Considering that the two measurements are independent event, what could
be the probability of observing one of the four possible combinations of
classical states?

• The wave function that represents the possible states of a system


composedof two qubits is a function with 4 different terms (22)
Two Qubits System
• Considering that the two measurements are independent event, what could
be the probability of observing one of the four possible combinations of
classical states?

• By extracting the square root of the values obtained as the probability


of obtaining a combinationof classical states,I can therefore obtain a
descriptionof the wave function relative to the systemcomposedof the
two qubits
Two Qubits System
• Considering that the two measurements are independent event, what could
be the probability of observing one of the four possible combinations of
classical states?

• By extracting the square root of the values obtained as the probability


of obtaining a combinationof classical states,I can therefore obtain a
descriptionof the wave function relative to the systemcomposedof the
two qubits
Two Qubits System
Multi Qubits System
Multi Qubits System
Multi Qubits System


Multi Qubits System

In general, a systemwithN qubits iscompletely describedby a vectorwith 2N elements


Multi Qubits System

Anotherwayto describe the representationofa systemof qubits using the wave functions of
the qubits that make up the systemis throughthe concept of outerproduct (or tensor product).
In formulas:
Multi Qubits System

We haveseen, therefore,howit is possible to describe the wavefunctionof a systemof qubits


startingfrom the wave functionsof each single qubit
Multi Qubits System

We haveseen, therefore,howit is possible to describe the wavefunctionof a systemof qubits


startingfrom the wave functionsof each single qubit
Multi Qubits System

We haveseen, therefore,howit is possible to describe the wavefunctionof a systemof qubits


startingfrom the wave functionsof each single qubit
Multi Qubits System

We haveseen, therefore,howit is possible to describe the wavefunctionof a systemof qubits


startingfrom the wave functionsof each single qubit
Multi Qubits System
We haveseen, therefore,howit is possible to describethe wavefunctionof a systemof qubits starting
from the wave functionsof each single qubit

However,the reverse statement is not so true. We will see in the course of the lesson an example of a
systemof qubitsthat cannot be decomposedinto the tensor product of several qubits
Classical bit manipulation
Classical bit manipulation
Classical bit manipulation
Quantum Gates
• Mathematically speaking, the Quantum
Gates (operators capable of acting on a
system composedof N qubits) can be
represented as square matrices of size equal
to 2N
Quantum Gates
• Mathematically speaking, the Quantum
Gates (operators capable of acting on a
system composedof N qubits) can be
represented as square matrices of size equal
to 2N
• In order to act as quantum gates, matrices must
meet a couple of important prerequisites
Quantum Gates
• Mathematically speaking, the Quantum
Gates (operators capable of acting on a
system composedof N qubits) can be
represented as square matrices of size equal
to 2N
• In order to act as quantum gates, matrices must
meet a couple of important prerequisites
1: They must be unitary matrices: one of the
reasons for this choice is that quantum gates
are defined as operators that take qubits in input
and return qubits in output. Consequently,it is
important that the application of quantum gates
does not modify the length of the input vector
Quantum Gates
• Mathematically speaking, the Quantum
Gates (operators capable of acting on a
system composedof N qubits) can be
represented as square matrices of size equal
to 2N
• In order to act as quantum gates, matrices must
meet a couple of important prerequisites
2: The number of input qubits must equal the
number of output qubits. This implies that it is not
possible to construct quantum gates for non-
reversible operations, ie where it is not possible
to trace the input states by observing only the
output states (such as the XOR gate). However,
it is possible to make these operations
reversible
Quantum Gates
• Mathematically speaking, the Quantum
Gates (operators capable of acting on a
system composedof N qubits) can be
represented as square matrices of size equal
to 2N
• In order to act as quantum gates, matrices must
meet a couple of important prerequisites
2: The number of input qubits must equal the
number of output qubits. This implies that it is not
possible to construct quantum gates for non-
reversible operations, ie where it is not possible
to trace the input states by observing only the
output states (such as the XOR gate). However,
it is possible to make these operations
reversible
X (NOT) Gate
X (NOT) Gate
X (NOT) Gate
X (NOT) Gate
X (NOT) Gate
X (NOT) Gate
Single Qubit Quantum Gates
Hadamard Gate
Hadamard Gate
Hadamard Gate
Hadamard Gate
Hadamard Gate
Hadamard Gate
Single Qubit Quantum Gates
Two qubits Gates: Swap gate
Two qubits Gates: Swap gate
Two qubits Gates: Swap gate
Two qubits Gates: Swap gate
Two qubits Gates: Swap gate
Two qubits Gates: Swap gate
Two qubits Gates: Swap gate
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates: CNOT (Controlled-NOT) Gate
The Controlled-NOTlogic gate (abbreviated to
CNOT) is a quantumlogic gate that acts on
two qubits.

The two qubits involved in the transformationare


identified with the namesof control qubit (the
black dot) and target qubit (the white circle with
the cross)

CONTROL

TARGET

The purpose of a CNOT gate is:


invert the amplitudesof the target qubit if and only
if the control qubit is in state | 1>
Two qubits Gates
Quantum Circuits
Quantum Circuits
• A quantum circuit is a set of quantum gates acting
on a systemof qubits
Quantum Circuits
• A quantum circuit is a set of quantum gates acting
on a systemof qubits
• Each quantum circuit is characterized by a depth,
i.e. the longest path from the input (or from a
preparation) to the output (or a measurement
gate), moving forward in time along qubit
wires.
Quantum Circuits
• A quantum circuit is a set of quantum gates acting
on a systemof qubits
• Each quantum circuit is characterized by a depth,
i.e. the longest path from the input (or from a
preparation) to the output (or a measurement
gate), moving forward in time along qubit
wires.
• Gates on the same level act simultaneously on
the entire systemof qubits. The order is from left
to right
Quantum Circuits
• A quantum circuit is a set of quantum gates acting
on a systemof qubits
• Each quantum circuit is characterized by a depth,
i.e. the longest path from the input (or from a
preparation) to the output (or a measurement
gate), moving forward in time along qubit
wires.
• Gates on the same level act simultaneously on
the entire systemof qubits. The order is from left
to right
• By convention, the systemalways starts from a
state of all at rest (i.e. all qubits in the classic
state 0)
Combine Quantum Gates
• Let's suppose we have a circuit like the one in
the figure
Combine Quantum Gates
• Let's suppose we have a circuit like the one in
the figure
• Furthermore, suppose we are in the middle of a
larger quantum circuit, which however only
involves two qubits. In this case, the wave function
of the systemcan be represented by the product
of the wave functions of the individual qubits
Combine Quantum Gates
• Let's suppose we have a circuit like the one in
the figure
• Furthermore, suppose we are in the middle of a
larger quantum circuit, which however only
involves two qubits. In this case, the wave function
of the systemcan be represented by the product
of the wave functions of the individual qubits
• Or, more generally, it can be represented by non-
decomposable coefficients (we will see an
example shortly)
Combine Quantum Gates
• Let's suppose we have a circuit like the one in
the figure
• Furthermore, suppose we are in the middle of a
larger quantum circuit, which however only
involves two qubits. In this case, the wave function
of the systemcan be represented by the product
of the wave functions of the individual qubits
• Or, more generally, it can be represented by non-
decomposable coefficients (we will see an
example shortly)
• The questiontherefore is: how should I act on
the total wave function of the systemto reflect
the applicationof the Hadamard gate only on the
first qubit?
Combine Quantum Gates
• The answer is: Tensor
Product
Combine Quantum Gates
• The answer is: Tensor Product
• To build the matrix that acts on a system
composedof several qubits, it is sufficient to
identify all the gates operating on the systemat
the same level (identifying the empty spaces with
identity matrices)
Combine Quantum Gates
• The answer is: Tensor Product
• To build the matrix that acts on a system
composedof several qubits, it is sufficient to
identify all the gates operating on the systemat
the same level (identifying the empty spaces with
identity matrices)
• The desired matrix will therefore be the tensor
product of all gates at the same level, starting
from the top and proceeding downwards.
Combine Quantum Gates
• The answer is: Tensor Product
• To build the matrix that acts on a system
composedof several qubits, it is sufficient to
identify all the gates operating on the systemat
the same level (identifying the empty spaces with
identity matrices)
• The desired matrix will therefore be the tensor
product of all gates at the same level, starting
from the top and proceeding downwards.
Combine Quantum Gates
• The answer is: Tensor Product
• To build the matrix that acts on a system
composedof several qubits, it is sufficient to
identify all the gates operating on the systemat
the same level (identifying the empty spaces with
identity matrices)
• The desired matrix will therefore be the tensor
product of all gates at the same level, starting
from the top and proceeding downwards.
Combine Quantum Gates
• The answer is: Tensor Product
• To build the matrix that acts on a system
composedof several qubits, it is sufficient to
identify all the gates operating on the systemat
the same level (identifying the empty spaces with
identity matrices)
• The desired matrix will therefore be the tensor
product of all gates at the same level, starting
from the top and proceeding downwards.
Combine Quantum Gates
Single Qubit Quantum Gates
Single Qubit Quantum Gates
Combine Quantum Gates
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an
alternative method for building the CNOT
gate
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an
alternative method for building the CNOT
gate
• In general, this method can be used to
build generic controlled gates
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an
alternative method for building the CNOT
gate
• In general, this method can be used to
build generic controlled gates
• In addition to the CNOT gate, we will see
what form the reverse CNOT gate must
have (i.e. with target and control qubits
exchanged)
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an
alternative method for building the CNOT
gate
• In general, this method can be used to
build
generic controlled gates
• In addition to the CNOT gate, we will see
what form the reverse CNOT gate must
have (i.e. with target and control qubits
exchanged)
• This method is based on this
alternative form for the CNOTgate
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an
alternative method for building the CNOT
gate
• In general, this method can be used to
build
generic controlled gates
• In addition to the CNOT gate, we will see
what form the reverse CNOT gate must
have (i.e. with target and control qubits
exchanged)
• This method is based on this
alternative form for the CNOTgate

• That can be read as: “if the first qubit is 0,


do nothing. If the first qubit is 1, apply X”
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an
alternative method for building the CNOT
gate
• In general, this method can be used to
build
generic controlled gates
• In addition to the CNOT gate, we will see
what form the reverse CNOT gate must
have (i.e. with target and control qubits
exchanged)
• This method is based on this
alternative form for the CNOTgate

• That can be read as: “if the first qubit is 0,


donothing. If the first qubit is 1, apply X”
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an
alternative method for building the CNOT
gate
• In general, this method can be used to
build
generic controlled gates
• In addition to the CNOT gate, we will see
what form the reverse CNOT gate must
have (i.e. with target and control qubits
exchanged)
• This method is based on this
alternative form for the CNOTgate

• That can be read as: “if the first qubit is 0,


donothing. If the first qubit is 1, apply X”
Alternative Controlled Gates
• In this section, without going into too much
detail, I would like to show you an alternative
method for building the CNOT gate
• In general, this method can be used to build
generic controlled gates
• In addition to the CNOT gate, we will see what
form the reverse CNOTgate must have (i.e.
with target and control qubits exchanged)
• This method is based on this alternative
form for the CNOTgate

• That can be read as: “if the first qubit is 0, do


nothing. If the first qubit is 1, apply X”
Alternative Controlled Gates
• Reverse CNOT
gate
Alternative Controlled Gates
• Reverse CNOT gate
• This time, if we want to use the method
described above, we need to understand
how to modify the summation expressed in
the previous slide
Alternative Controlled Gates
• Reverse CNOT gate
• This time, if we want to use the method
described above, we need to understand
how to modify the summation expressed in
the previous slide
• The reverse CNOT reverses the roles of
target qubit and control qubit from the
original CNOT. Its description, therefore,
is:
Alternative Controlled Gates
• Reverse CNOT gate
• This time, if we want to use the method
described above, we need to understand
how to modify the summation expressed in
the previous slide
• The reverse CNOT reverses the roles of
target qubit and control qubit from the
original CNOT. Its description, therefore,
is:
• If the second qubit is zero, do nothing. If
the second qubit is one, apply the quantum
gate X to the first qubit
Alternative Controlled Gates
• Reverse CNOT gate
• This time, if we want to use the method
described above, we need to understand
how to modify the summation expressed in
the previous slide
• The reverse CNOT reverses the roles of
target qubit and control qubit from the
original CNOT. Its description, therefore,
is:
• If the second qubit is zero, do nothing. If
the second qubit is one, apply the quantum
gate X to the first qubit
Alternative Controlled Gates
• Reverse CNOT gate
• This time, if we want to use the method
described above, we need to understand
how to modify the summation expressed in
the previous slide
• The reverse CNOT reverses the roles of
target qubit and control qubit from the
original CNOT. Its description, therefore,
is:
• If the second qubit is zero, do nothing. If
the second qubit is one, apply the quantum
gate X to the first qubit
Alternative Controlled Gates
• Reverse CNOT gate
• This time, if we want to use the method
described above, we need to understand
how to modify the summation expressed in
the previous slide
• The reverse CNOT reverses the roles of
target qubit and control qubit from the
original CNOT. Its description, therefore,
is:
• If the second qubit is zero, do nothing. If
the second qubit is one, apply the quantum
gate X to the first qubit
Alternative Controlled Gates
• Constructionof generic controlled
gates
Alternative Controlled Gates
• Constructionof generic controlled gates
• The idea is always the same: you think
about the gate you want to use and it
applies only when the conditions we want to
impose are satisfied
Alternative Controlled Gates
• Constructionof generic controlled gates
• The idea is always the same: you think
about the gate you want to use and it
applies only when the conditions we want to
impose are satisfied
• Some examples are:
Alternative Controlled Gates
• Constructionof generic controlled gates
• The idea is always the same: you think
about the gate you want to use and it
applies only when the conditions we want to
impose are satisfied
• Some examples are:
Alternative Controlled Gates
• Constructionof generic controlled gates
• The idea is always the same: you think
about the gate you want to use and it
applies only when the conditions we want to
impose are satisfied
• Some examples are:

• Exercise: find the


gates
Alternative Controlled Gates
Alternative Controlled Gates
Alternative Controlled Gates
Alternative Controlled Gates
Alternative Controlled Gates
Alternative Controlled Gates
Alternative Controlled Gates
First Circuit example
First Circuit example
First Circuit example
First Circuit example
First Circuit example
First Circuit example
First Circuit example
First Circuit example
First Circuit example
First Circuit example
First Circuit example

No Way!
First Circuit example
Q1

Applying Hadamard on |0⟩ and then CNOT results in:

1. (|00⟩ + |11⟩)/√2

2. |00⟩

3. (|00⟩ - |11⟩)/√2

4. (|01⟩ + |10⟩)/√2
Solution
Q1

Applying Hadamard on |0⟩ and then CNOT results in:

1. (|00⟩ + |11⟩)/√2

2. |00⟩

3. (|00⟩ - |11⟩)/√2

4. (|01⟩ + |10⟩)/√2
Bell state Solution

You might also like