Bernstein-Vazirani Algorithm

#quantum #qnickel

Part of Womanium Quantum + AI 2024 program


Definition

Bernstein-Vazirani algorithm is another algorithm that proves the quantum advantage and not designed to be practically effective for a specific task.

Problem

Let's define f as a function such that

f:{0,1}n{0,1}f(x)=xs

Where xs is the inner product of x and s, such that

xs=(x0.s0+x1.s1++xn1.sn1)(mod2)

The goal is to query f to find the secret string s.

Classically, we would need n queries of f, where n is the length of the string s. Each query will be a string of zeros except for one bit at position i, this will let us know the value of si, doing this n times will give us all of the bits of s.

Bernstein-Vazirani Algorithm

The algorithm is very similar to Deutsch-Jozsa Algorithm, except for the oracle used.

DJA.png

We start applying the algorithm from the initial state |0n|0

|0n|0IX|0n|1HnH1Nx{0,1}n|x|Uf1Nx{0,1}nUf|x|=1Nx{0,1}n(1)f(x)|x|=1Nx{0,1}n(1)xs|x|

Now we discard of the ancilla qubit and continue to apply the Hadamard gates.

1Nx{0,1}n(1)xs|x|1Nx{0,1}n(1)xs|xHn1Nx{0,1}n1Nz{0,1}n(1)xz+xs|z=1Nx{0,1}nz{0,1}n(1)xz+xs|z

Now, let's look at the state where z=s, if we were able to get this then it will be the final answer.

1Nx{0,1}nz{0,1}n(1)xz+xs|zz=s1Nx{0,1}n(1)xs+xs=1Nx{0,1}n(1)2(xs)

But we know that:

(1)2(i)=1,iZ1Nx{0,1}n(1)2(xs)=1Nx{0,1}n1=1NN=NN=1

Therefore, we know that after applying the algorithm we will measure the string s with a probability of 100%.

Conclusion

Bernstein-Vazirani algorithm is another algorithm that proves the special advantage that quantum computers posses.

Its problem define a function that uses a secret string to apply an inner product with the input then give a 1 bit result. The algorithm shows how we can find the value of the secret string in one query of the function, where after the algorithm we will measure the value of the secret string.

Practicality

The problem for Bernstein-Vazirani algorithm was specially tailored to show the quantum advantage and it doesn't have an effective practical use.


< Prev | Next: Simon's Algorithm >