0% found this document useful (0 votes)
8 views25 pages

Lecture 6

Quantum algorithms involve encoding data into qubits, applying quantum gates, and measuring the results. Implementing these algorithms on real quantum computers requires consideration of gate sets, qubit connectivity, and noise sources. The document also discusses various quantum algorithm paradigms, the concept of quantum oracles, and the Deutsch algorithm, which demonstrates quantum advantages over classical circuits.
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)
8 views25 pages

Lecture 6

Quantum algorithms involve encoding data into qubits, applying quantum gates, and measuring the results. Implementing these algorithms on real quantum computers requires consideration of gate sets, qubit connectivity, and noise sources. The document also discusses various quantum algorithm paradigms, the concept of quantum oracles, and the Deutsch algorithm, which demonstrates quantum advantages over classical circuits.
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/ 25

Quantum Algorithms

Quantum algorithms
A quantum algorithm consists of
three basic steps:
• Encoding of the data, which could
be classical or quantum, into the
state of a set of input qubits.
• A sequence of quantum gates
applied to this set of input qubits.
• Measurements of one or more of
the qubits at the end to obtain a
classically interpretable result.
Using a real quantum computer
There are several issues to consider when implementing an algorithm
on real quantum computers, for example:
• What is the available gate set with which the user can state their algorithm?
• What physical gates are actually implemented?
• What is the qubit connectivity (i.e., which pairs of qubits can two-qubit gates
be applied to)?
• What are the sources of noise (i.e., errors)?

These are not the gates that are physically implemented by their quantum computer.
IBM has a compiler that translates the gates into products of gates from a physical gate set.
User-programmed gates are usually decomposed into multiple physical
gates, and hence could lead to a longer physical algorithm.
Examples:

𝑈𝑈𝑈 𝜋𝜋, 0, 𝜋𝜋
𝑈𝑈𝑈 0, 𝜋𝜋
• Textbook algorithms
are typically written
for a fully-connected
hardware, which
means that one can
apply a two-qubit gate
to any two qubits.
• Real quantum
computers may not
have full connectivity.

Explore the Documentation:


Native Gates
Noise
• The two main sources of noise:
• Gate Infidelity: refers to the fact that the user-
specified gates do not precisely correspond to the
physically implemented gates. Gate infidelity is
usually worse for multi-qubit gates than for one-
qubit gates, so typically one wants to minimize the
number of multi-qubit gates in one’s algorithm
• Decoherence: refers to the fact that gradually over
time the quantum computer loses its
“quantumness” and behaves more like a classical
object. After decoherence has fully occurred, the
computer can no longer take advantage of quantum
effects
Teleportation of the one-qubit state in decoherence
environments November 2011, Journal of Physics B
Atomic Molecular and Optical Physics 44(2)
Classes of Quantum Algorithms

Algorithmic Paradigms:
• Quantum Fourier Transform (QFT)
• Grover Operator (GO)
• Harrow-Hassidim-Lloyd (HHL)
• Variational Quantum Eigenvalue solver (VQE)
• Hamiltonian simulation (SIM)
Oracles/Deutsch
Quantum Oracles
• Boolean Functions: A Boolean function is a function that has one or
more binary digits (0 or 1) as input, and one binary digit as output.
• From Unary Gates to Boolean Functions:
A classical unary gate takes a single classical bit in and produces a
single classical bit out. In the language of functions, it is nothing other
than a Boolean function of one bit

mod-2 applies
• Negation Operator (Reversible Operation):

This f is reversible, and in fact is its own inverse, since f(f(x)) = x


• Irreversible Operation: Other example is the XOR (2-bits)
• Oracles for Unary Functions: Black box that computes some unary
function f(x)

using this black box with certain fundamental quantum gates one can build a new
gate that:

• Takes two bits in


• Has two bits out
• Is unitary (and therefore reversible),
• Computes the function f when presented the proper input
• Has the same computational complexity as the black box f,
whose irreversible function we want to reproduce.
“𝑈𝑈𝑓𝑓 ” the quantum oracle for f
• Class Example: compute the matrix for 𝑈𝑈𝑓𝑓 when f(x) = 0, the constant
(and irreversible) 0 operation. Starting with the construction of the
matrix of any linear transformation and moving on from there
• 𝑼𝑼𝒇𝒇 is always its own Inverse:

• 𝑼𝑼𝒇𝒇 computes 𝒇𝒇(𝒙𝒙):

• The output of 𝑼𝑼𝒇𝒇 for a CBS is always a separable state:


• Oracles for Functions of Two • Multiple input Oracle
Boolean Inputs

• The key points are the same:


• 𝑈𝑈𝑓𝑓 is its own inverse
• 𝑈𝑈𝑓𝑓 emulates 𝑓𝑓(𝑥𝑥) by setting 𝑦𝑦 = 0,

|𝑥𝑥⟩2 , 𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 𝑥𝑥 ∈ 0,1,2,3, …


Oracles for n Qubit Functions

We assume that circuit theory enables us to build an 𝑛𝑛 + 1 -in, 𝑛𝑛 + 1 -out


oracle 𝑈𝑈𝑓𝑓 , defined on the 2𝑛𝑛+1 2n+1 computational basis kets
Oracles for n Qubit Functions
• 𝑈𝑈𝑓𝑓 is its own inverse
• 𝑈𝑈𝑓𝑓 emulates 𝑓𝑓(𝑥𝑥) by setting y = 0

• The oracle is of the same spatial circuit


complexity as 𝑓𝑓 𝑥𝑥 :
It grows in size at the same rate as 𝑓𝑓 grows
relative to the number of inputs, 𝑛𝑛.
The Deutsch Algorithm

• Can one design a quantum circuit that out-performs, in a


fundamental way, a classical circuit? The affirmative answer arrived
in 1985 from David Deutsch who outlined an algorithm, now called
Deutsch’s algorithm, that hinted at quantum capabilities beyond the
reach of the classical circuit model. Although the algorithm is of
limited practical value, it introduced the concepts of quantum
parallelism and quantum interference.
The Deutsch Algorithm
• A function of a single bit can be either constant ( f (0) = f (1)), or
balanced ( f (0) ≠ f (1)). These properties are global, because in order
to establish them we need to calculate both f (0) and f (1) and
compare the results.

Classically we use the black box function f twice in order to determine its nature
• 𝑈𝑈𝑓𝑓 is typically represented by a black box that has n input wire leads and m output wire leads. The
black box in a reversible quantum circuit must represent a unitary operator, and so should have
an equal number of input and output leads.
𝑇𝑇0 :The two-qubit register is in the 𝑇𝑇1 :State |𝜓𝜓(𝑡𝑡1 )⟩ is processed by Uf ,
direct product state and because it is a linear operator

𝑇𝑇1 :Each q-bit is processed by a


Hadamard gate
𝑇𝑇3 : The register is processed by a Hadamard gate in the upper wire, and the identity operator in
the lower. Thus
𝑇𝑇4 : The measurement device interrogates the state of the qubit represented by the upper wire.
The measurement apparatus points to the value 0 if the upper wire qubit is in state |0⟩, or 1 if it is
in state |1⟩. Because |𝜓𝜓(𝑡𝑡3 )⟩ is a linear superposition of those states we need to calculate, using
the Born rule, the relative outcome probabilities.

Lower wire Upper wire

Measuring Device is
in Upper wire
Two outcomes are possible. If f (0) = f (1) Regardless of the value f (0), we find that

If f (0) = f (1) the meter is certain to


register the value 0, and the value 1 if
f(0) ≠ f (1), as that event is mutually
exclusive from the latter

You might also like