Bernstein–Vazirani algorithm – Wikipedia

From Wikipedia, the free encyclopedia

Quantum algorithm

Bernstein-Vazirani quantum circuit.png

The Bernstein–Vazirani algorithm, which solves the Bernstein–Vazirani problem, is a quantum algorithm invented by Ethan Bernstein and Umesh Vazirani in 1992.[1] It is a restricted version of the Deutsch–Jozsa algorithm where instead of distinguishing between two different classes of functions, it tries to learn a string encoded in a function.[2] The Bernstein–Vazirani algorithm was designed to prove an oracle separation between complexity classes BQP and BPP.[1]

Problem statement[edit]

Given an oracle that implements a function

f:{0,1}n{0,1}{displaystyle fcolon {0,1}^{n}rightarrow {0,1}}

in which

f(x){displaystyle f(x)}

is promised to be the dot product between

x{displaystyle x}

and a secret string

s{0,1}n{displaystyle sin {0,1}^{n}}

modulo 2,

f(x)=xs=x1s1x2s2xnsn{displaystyle f(x)=xcdot s=x_{1}s_{1}oplus x_{2}s_{2}oplus cdots oplus x_{n}s_{n}}

, find

s{displaystyle s}

.

Algorithm[edit]

Classically, the most efficient method to find the secret string is by evaluating the function

n{displaystyle n}

times with the input values

x=2i{displaystyle x=2^{i}}

for all

i{0,1,...,n1}{displaystyle iin {0,1,…,n-1}}

:[2]

In contrast to the classical solution which needs at least

n{displaystyle n}

queries of the function to find

s{displaystyle s}

, only one query is needed using quantum computing. The quantum algorithm is as follows: [2]

Apply a Hadamard transform to the

n{displaystyle n}

qubit state

|0n{displaystyle |0rangle ^{otimes n}}

to get

Next, apply the oracle

Uf{displaystyle U_{f}}

which transforms

|x(1)f(x)|x{displaystyle |xrangle to (-1)^{f(x)}|xrangle }

. This can be simulated through the standard oracle that transforms

|b|x|bf(x)|x{displaystyle |brangle |xrangle to |boplus f(x)rangle |xrangle }

by applying this oracle to

|0|12|x{displaystyle {frac {|0rangle -|1rangle }{sqrt {2}}}|xrangle }

. (

{displaystyle oplus }

denotes addition mod two.) This transforms the superposition into

Another Hadamard transform is applied to each qubit which makes it so that for qubits where

si=1{displaystyle s_{i}=1}

, its state is converted from

|{displaystyle |-rangle }

to

|1{displaystyle |1rangle }

and for qubits where

si=0{displaystyle s_{i}=0}

, its state is converted from

|+{displaystyle |+rangle }

to

|0{displaystyle |0rangle }

. To obtain

s{displaystyle s}

, a measurement in the standard basis (

{|0,|1}{displaystyle {|0rangle ,|1rangle }}

) is performed on the qubits.

Graphically, the algorithm may be represented by the following diagram, where

Hn{displaystyle H^{otimes n}}

denotes the Hadamard transform on

n{displaystyle n}

qubits:

The reason that the last state is

|s{displaystyle |srangle }

is because, for a particular

y{displaystyle y}

,

Since

sy=0{displaystyle soplus y={vec {0}}}

is only true when

s=y{displaystyle s=y}

, this means that the only non-zero amplitude is on

|s{displaystyle |srangle }

. So, measuring the output of the circuit in the computational basis yields the secret string

s{displaystyle s}

.

See also[edit]

References[edit]