0% found this document useful (0 votes)
16 views

Deutsch's Algorithm Notes.

The document describes Deutsch's algorithm, which can determine if a function is balanced or constant using only one call to the function, as opposed to two calls classically. It introduces the four possible input/output combinations for a function that takes a bit and returns a bit. It then explains how quantum functions are implemented as unitary operators and shows the circuit for Deutsch's algorithm.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Deutsch's Algorithm Notes.

The document describes Deutsch's algorithm, which can determine if a function is balanced or constant using only one call to the function, as opposed to two calls classically. It introduces the four possible input/output combinations for a function that takes a bit and returns a bit. It then explains how quantum functions are implemented as unitary operators and shows the circuit for Deutsch's algorithm.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Deutsch’s Algorithm

Introduction

Imagine the following: you are given a function f:B→B where B={0,1}. So this function
takes zero or one and returns zero or one.

What are the possible input/output combinations of this function?

 First combination: f0(0)→1 and f0(1)→1


 Second combination: f1(0)→0 and f1(1)→1
 Third combination: f2(0)→1 and f2(1)→0
 Fourth combination: f3(0)→0 and f3(1)→0.

Notice that for the first and the fourth combinations, the output doesn’t change irrespective of
the input. The output is constant; hence the function is said to be constant in both
combinations. The second and the third combinations though are different: the number of
zeros in the output is the same as the number of ones. There is a balance in the output; hence
we call it balanced in both combinations.

Balanced and constant functions

A function is said to be constant if . It is said to be balanced if

Without being told which one or being allowed to look inside, we are asked if it is balanced
or constant. This is called Deutsch’s problem.

Deutsch’s problem Let be an oracle. Is f balanced or constant?

On a classical computer the only thing to do is to evaluate the function for both values of x
and compare them, i.e. we need to make two calls to the function. However, we shall see that
we can answer this question on a quantum computer with only one call to the function. We
get less information than classically, because we don’t determine the individual values of f (0)
and f (1), but we do determine whether or not f is constant. Hence Deutsch’s problem may be
thought of as determining whether a coin to be tossed is honest or not with just one toss of the
coin.

As we have discussed, a quantum function f is implemented by a Unitary operator U f as


shown
in Fig. 1. We often call the upper qubit the “input” qubit, because it contains the input x in the
initial state on the left, and call the lower qubit the “output” qubit because it contains
information on the value of the function in the final state on the right. This terminology can
be a bit confusing, though, because both qubits are present in the initial state and the final
state. You will recall that we need to have the same number of qubits in the initial and finite
states in order to make the function reversible. The function U f in Fig. 1 is its own inverse as

can be seen since , the identity. If this is not obvious note that y ⊕ f (x) ⊕ f (x) = y.
(Adding 0 to 0 gives 0 and adding 1 to 1 mod 2 also gives 0.)

The blackbox routine Uf for a function f (x) which takes a 1-qubit input x and computes a 1-
qubit function f (x). Here x and y are computational basis states |0 〉 or |1〉. However, to
gain a quantum speedup, we will input superpositions, generated by Hadamard gates, as
shown in Fig. 2. We obtain the result of inputing a superposition from the results of inputing
computational basis states by using linearity. Recall that time runs from left to right in circuit
diagrams.

Circuit for Deutsch’s algorithm. The initial state (on left) has |0 〉in the upper (input) qubit
and |1〉in the lower (output) qubit. Hadamard gates are applied to both qubits both before
and after the function Uf (which we assume to be an unknown black box). In the final state
the lower qubit is unchanged at |1. A measurement is made of the final value (on right) of the
upper qubit. If this is unchanged, i.e. x = 0, then the function is constant, while if the upper
qubit has flipped, i.e. x = 1, then the function is not constant. One can also start with the
upper qubit as |1〉 and find the same conclusion: if the upper qubit is unchanged the function
is constant whereas if it has flipped the function is not constant.

You might also like