mod03lec16 - Quantum Algorithms: Bernstein Vazirani Algorithm

NPTEL-NOC IITM
7 Sept 202115:03

Summary

TLDRThis lecture segment delves into the Bernstein-Vazirani algorithm, a quantum computing algorithm that demonstrates the superiority of quantum computers over classical ones in solving certain problems. The algorithm is designed to find a hidden bit string 'a' embedded in a function 'f', which is a dot product of 'a' and the input 'x'. While classical computers require exponential time to solve this with certainty, the quantum algorithm can do it with high probability in polynomial time. The lecture explains the classical and quantum solutions, emphasizing the need for 'n' queries in the classical approach and the efficient quantum method using Hadamard gates and an oracle. The implementation of the algorithm in Qiskit is also discussed, showcasing the practical application of quantum computing principles.

Takeaways

  • 😀 The Bernstein-Vazirani algorithm is a quantum algorithm that demonstrates quantum computers can solve certain problems with high probability in polynomial time, whereas classical computers cannot solve them with a probability greater than 1/2 in the same time.
  • 🧠 The algorithm is a follow-up to Deutsch's algorithm, addressing a problem where quantum computers can solve with certainty in polynomial time, while classical computers require exponential time or settle for probabilistic solutions.
  • 🔍 The problem statement involves an oracle function f that takes an n-bit input and outputs a single bit, either 0 or 1, with the guarantee that there exists a hidden bit string a such that f(x) = a · x mod 2.
  • 🎯 The goal of the Bernstein-Vazirani algorithm is to determine the hidden bit string a embedded in the function f using quantum computation.
  • 📊 Classical solutions require querying the oracle n times, one for each bit of a, which is both necessary and sufficient for classical algorithms to determine a.
  • 📚 The quantum solution involves applying Hadamard gates to all qubits, applying the oracle, and then applying Hadamard gates again before measurement, which allows the algorithm to determine a in a single query.
  • 🛠️ The implementation of the oracle in the algorithm requires an understanding of how to perform a quantum XOR operation, which is essential for the algorithm to function correctly.
  • 📈 The Bernstein-Vazirani algorithm highlights the potential of quantum computing to solve problems more efficiently than classical computing, showcasing an oracle separation between BQP and BPP complexity classes.
  • 🔑 The algorithm's success relies on the ability to apply and invert the Hadamard transform, which is crucial for the quantum state to collapse to the desired solution upon measurement.
  • 💡 The lecture concludes with a discussion of the algorithm's implementation in Qiskit, providing a practical example of how theoretical quantum algorithms can be realized in existing quantum computing frameworks.

Q & A

  • What is the Bernstein-Vazirani algorithm?

    -The Bernstein-Vazirani algorithm is a quantum algorithm that demonstrates a problem which quantum computers can solve with high probability in polynomial time, while classical computers cannot solve with a probability greater than 1/2 using the same time.

  • How does the Bernstein-Vazirani algorithm differ from Deutsch's algorithm?

    -While Deutsch's algorithm deals with determining if a function is constant or balanced, the Bernstein-Vazirani algorithm focuses on finding a hidden bit string 'a' embedded in a function f(x) = a·x mod 2, where 'a' is a binary vector and 'x' is the input.

  • What is the classical solution to the problem addressed by the Bernstein-Vazirani algorithm?

    -The classical solution involves querying the oracle with a sequence of inputs designed to isolate each bit of the hidden string 'a'. This requires n queries to the oracle to determine the n-bit string 'a'.

  • Why is the classical solution to the Bernstein-Vazirani problem limited to n queries?

    -The classical solution is limited to n queries because it is an underdetermined system of equations with n variables and n-1 equations, making it impossible to find a unique solution for 'a' with fewer than n queries.

  • How does the quantum solution to the Bernstein-Vazirani problem work?

    -The quantum solution uses a quantum circuit that applies Hadamard gates, the oracle, and another round of Hadamard gates to transform the initial state into the hidden bit string 'a'. This is achieved with fewer than n queries to the oracle.

  • What is the role of the oracle in the Bernstein-Vazirani algorithm?

    -The oracle in the Bernstein-Vazirani algorithm is a black box that takes an input x and outputs x XOR f(x), where f(x) is the function that encodes the hidden bit string 'a' as f(x) = a·x mod 2.

  • What is the significance of the Hadamard gate in the Bernstein-Vazirani algorithm?

    -The Hadamard gate is used to create a superposition of all possible states, which allows the quantum algorithm to query the oracle in a superposed state, enabling the extraction of information about the hidden bit string 'a' with fewer queries than the classical method.

  • How does the Bernstein-Vazirani algorithm demonstrate the advantage of quantum computing over classical computing?

    -The Bernstein-Vazirani algorithm shows that quantum computers can solve certain problems more efficiently than classical computers by leveraging quantum superposition and entanglement, which allows for the extraction of information with fewer queries to the oracle.

  • What is the output of the Bernstein-Vazirani algorithm?

    -The output of the Bernstein-Vazirani algorithm is the hidden n-bit string 'a' that is embedded in the function f(x). This is achieved by measuring the quantum state after applying the quantum circuit.

  • How is the implementation of the oracle in the Bernstein-Vazirani algorithm described in the script?

    -The implementation of the oracle in the Bernstein-Vazirani algorithm is described by showing how to apply a controlled-NOT gate for each bit of the input 'x' where the corresponding bit in the hidden string 'a' is 1. This effectively computes the dot product a·x mod 2.

Outlines

00:00

🧠 Bernstein Vazirani Algorithm Introduction

The paragraph introduces the Bernstein Vazirani algorithm as a follow-up to the Deutsch's algorithm. It discusses the problem that Bernstein and Vazirani aimed to solve, which is to demonstrate a problem that quantum computers can solve with high probability in polynomial time, while classical computers cannot solve with a probability greater than half in the same time. The classical computers would require exponential time to solve all inputs with certainty. The paragraph explains the motivation behind the algorithm, contrasting it with Deutsch's problem, and setting the stage for the problem statement that involves an oracle function f that outputs a dot x mod 2, where a is an n-bit string embedded in f. The goal is to find this hidden string a using quantum computation.

05:01

🔍 Classical Solution to Bernstein Vazirani Problem

This paragraph delves into the classical approach to solving the Bernstein Vazirani problem. It explains that the classical solution involves querying the oracle function f with a sequence of inputs designed to isolate each bit of the hidden string a. The process requires n queries, one for each bit of a, to determine the entire string. The paragraph also discusses why fewer queries are not possible classically by presenting a system of equations that illustrates the underdetermined nature of the problem with n variables and only n-1 equations. It concludes with the assertion that n queries are both necessary and sufficient for the classical solution.

10:01

🌌 Quantum Solution and Implementation

The final paragraph outlines the quantum solution to the Bernstein Vazirani problem, emphasizing the efficiency of quantum computation in solving it. It describes the quantum circuit that mirrors the one used in Deutsch's algorithm, involving the application of Hadamard gates, the oracle function, and another application of Hadamard gates. The paragraph explains that after these steps, measuring the quantum state will yield the hidden bit string a. It also touches on the implementation of the oracle function in quantum circuitry, detailing how to apply it based on the value of a. The summary concludes with a brief mention of the next topic, Grover's algorithm, to be discussed in the subsequent lecture.

Mindmap

Keywords

💡Bernstein Vazirani Algorithm

The Bernstein Vazirani Algorithm is a quantum algorithm designed to solve a specific problem with high probability in polynomial time, showcasing the potential of quantum computing over classical computing. In the video, it is presented as a follow-up to the Deutsch's algorithm, emphasizing its role in demonstrating quantum supremacy. The algorithm is used to find a hidden bit string 'a' embedded in a function 'f', which is a dot product between 'a' and the input 'x' mod 2. The script explains that while classical computers require exponential time to solve similar problems, quantum computers can do so efficiently.

💡Quantum Computers

Quantum computers are advanced computational devices that use the principles of quantum mechanics to process information. They are highlighted in the video as being capable of solving certain problems, like the Bernstein Vazirani problem, with a high degree of certainty in polynomial time, which is a significant advantage over classical computers. The script contrasts quantum computing with classical computing to emphasize the potential of quantum algorithms.

💡Classical Computers

Classical computers refer to traditional computing systems that process information based on binary digits (bits). In the context of the video, classical computers are shown to be less efficient than quantum computers for certain problems, requiring exponential time to solve with certainty. The script mentions that classical algorithms can solve problems with a negligible error probability in polynomial time, but not with the same efficiency as quantum algorithms.

💡Oracle

In the script, the term 'oracle' refers to a black-box function that is used in the algorithm to compute the output based on the input. Specifically, in the Bernstein Vazirani algorithm, the oracle is used to compute the function 'f(x) = a dot x mod 2'. The oracle is a crucial component in quantum algorithms, as it allows the algorithm to interact with the function in a way that is not possible with classical computing methods.

💡Hadamard Gate

The Hadamard gate is a quantum gate used in quantum computing to create superpositions of qubits. In the video, it is applied to all qubits at the beginning of the Bernstein Vazirani algorithm to prepare the initial state for computation. The script explains that applying the Hadamard gate to a state of all zeros results in an equal superposition of all possible states, which is a fundamental step in the quantum algorithm.

💡Qubit

A qubit, short for quantum bit, is the basic unit of quantum information in quantum computing. Unlike classical bits, which can be either 0 or 1, qubits can exist in a superposition of states. The script mentions qubits in the context of the initial state of the quantum algorithm and the application of quantum gates, such as the Hadamard gate, to manipulate their states.

💡Phase Kickback

Phase kickback is a phenomenon in quantum computing where the phase of a quantum state is influenced by the application of a quantum gate. In the video, phase kickback is discussed in the context of applying the oracle to the quantum state, which results in a phase shift that depends on the function 'f(x)'. This phase shift is crucial for the algorithm to determine the hidden bit string 'a'.

💡Measurement

Measurement in quantum computing refers to the act of observing a quantum system to obtain classical information. The script explains that after applying the Hadamard gate to the quantum state, the state is measured to obtain the bit string 'a'. Measurement is a critical step in quantum algorithms, as it collapses the superposition of states into a definite outcome.

💡Deutsch's Algorithm

Deutsch's Algorithm is a foundational quantum algorithm that demonstrates the ability of quantum computers to solve certain problems more efficiently than classical computers. In the video, it is mentioned as a precursor to the Bernstein Vazirani Algorithm, setting the stage for understanding the progression of quantum algorithms. The script uses Deutsch's Algorithm to contrast the capabilities of quantum and classical computers.

💡Quantum Supremacy

Quantum supremacy refers to the point at which quantum computers can solve problems that classical computers cannot solve in a reasonable amount of time. The video discusses the Bernstein Vazirani Algorithm as an example of a problem where quantum computers can achieve supremacy by solving it with high probability in polynomial time, while classical computers struggle to do so efficiently.

Highlights

Bernstein-Vazirani algorithm is a quantum algorithm that follows up on Deutsch's algorithm.

Quantum computers can solve certain problems with certainty in polynomial time, unlike classical computers which may require exponential time.

Classical computers can solve the Deutsch's problem probabilistically in polynomial time.

The intuition behind probabilistic algorithms for balanced functions is that they can quickly identify patterns by querying random points.

Bernstein and Vazirani's problem is designed such that quantum computers can solve it with high probability in polynomial time, but classical computers cannot solve it with better than 50% probability in the same time.

The Bernstein-Vazirani problem involves finding a hidden bit string 'a' embedded in a function 'f' using an oracle.

The function 'f' is defined as a dot product between 'a' and the input 'x' modulo 2.

The classical solution to the Bernstein-Vazirani problem requires querying the oracle 'n' times to determine the 'n'-bit string 'a'.

It's proven that classical algorithms cannot do better than 'n' calls to the oracle to determine 'a'.

The quantum solution to the Bernstein-Vazirani problem involves applying Hadamard gates to all qubits, applying the oracle, and then applying the Hadamard gates again.

The quantum algorithm can determine the bit string 'a' with high probability in just one query to the oracle.

The implementation of the oracle in the quantum circuit requires XORing the last qubit with the function 'f(x)' which is the dot product of 'a' and 'x'.

The Bernstein-Vazirani algorithm demonstrates a clear separation between the complexity classes BQP and BPP.

The algorithm showcases the potential of quantum computers to solve certain problems much more efficiently than classical computers.

The quantum solution is intuitively explained through the use of quantum superposition and the oracle's ability to introduce phase shifts.

The implementation of the Bernstein-Vazirani algorithm in Qiskit is straightforward and leverages the built-in functions for Hadamard gates and oracles.

The lecture concludes with a discussion on the practical applications and the transition to Grover's algorithm in the next part.

Transcripts

play00:01

[Music]

play00:16

all right

play00:17

let's get into the final portion of this

play00:19

part of the lecture

play00:21

where we'll discuss bernstein vazirani

play00:24

algorithm

play00:25

which you can think of it like a

play00:26

follow-up to deutsches

play00:30

so why did bernstein and vazirani what

play00:32

did they start with

play00:34

we saw that digesa

play00:37

proves

play00:38

that the quantum computers can solve a

play00:40

particular problem with certainty 100

play00:42

percent

play00:43

confidence in polynomial time

play00:46

but the classical computers

play00:48

have to take exponential time if they

play00:50

want to solve for all the inputs with

play00:53

certainty so for some of the inputs with

play00:55

certainty they need exponential but

play00:58

probabilistic algorithms are still

play01:00

practical

play01:01

right so that in the real world we are

play01:03

okay with allowing for wrong answers

play01:05

with very small negligible probability

play01:08

so if we allow for negligible

play01:11

probability

play01:13

the deutsche sub problem can be solved

play01:15

even by classical computers in

play01:17

polynomial time

play01:18

so if you look at it earlier

play01:21

we mentioned that the deutsch shows up

play01:23

problem

play01:24

uh to solve with percent certainty

play01:25

classical algorithms need to query for

play01:28

half of the inputs plus one points

play01:31

so at least one point more than half

play01:32

then

play01:34

but if you're okay with allowing for

play01:38

error with negligible probability

play01:41

then the classical algorithm is also

play01:43

quite simple

play01:45

you just query the function on some

play01:47

random set of points

play01:50

okay

play01:51

so if you do that

play01:53

even for a balanced function

play01:55

uh

play01:56

the classical algorithm can solve uh

play01:59

within polynomial time

play02:02

so the intuition behind there is just

play02:04

like simple for a balanced function we

play02:06

know that half of the inputs output 0

play02:08

and half of the inputs output 1.

play02:10

so it's like 2 buckets bucket of 0s and

play02:14

like

play02:15

bucket of inputs which output 0 and

play02:17

bucket of inputs are output 1.

play02:20

so the intuitive argument here is that

play02:23

if we choose inputs randomly if we query

play02:26

the oracle on random set of points

play02:29

the probability of inputs coming from

play02:32

the same bucket like let's say bucket

play02:34

zero or bucket 1 it reduces

play02:36

exponentially as we keep querying so the

play02:38

motivation for bernstein and what's

play02:40

running is as follows

play02:43

they came up with a problem which

play02:45

quantum computers can solve with very

play02:47

high probability

play02:50

in some time

play02:51

but any classical computer cannot solve

play02:55

with

play02:56

probability greater than half using the

play02:58

same time as a one so

play03:02

extending this this for those who know

play03:05

this can be thought of as an oracle

play03:07

separation between the complexity

play03:09

classes b q b and b q b but again as i

play03:11

said for deutsche so if you don't know

play03:13

all right so this is the problem

play03:15

statement that bernstein and wazirani

play03:17

came up with

play03:18

like we had for deutsche

play03:20

we again

play03:21

are given an oracle for a function f

play03:25

which has which takes an n bits as input

play03:28

and outputs one bin either zero over one

play03:32

but the change here is

play03:34

here the function is

play03:37

of a type

play03:38

a dot x

play03:40

so earlier in deutsche we were given the

play03:42

guarantee that the function is either a

play03:44

constant function or a

play03:47

balanced function

play03:48

but here we are again given a guarantee

play03:50

but of a different form

play03:53

we are given a guarantee that there

play03:54

exists a value a embedded in f

play03:58

such that for any input x given to f the

play04:01

output is a dot x mod 2

play04:03

that is it's just a dot product between

play04:05

a and x

play04:06

okay

play04:09

so the

play04:11

the goal

play04:12

for

play04:13

bernstein vazirani is to

play04:16

or the goal for this problem is to

play04:18

output this

play04:19

uh n which string a that's embedded in f

play04:22

so given an oracle access to this f

play04:24

which has a bet in it

play04:26

the goal is to output this end bit

play04:28

string here

play04:31

okay

play04:32

let's see what's the classical solution

play04:33

to solve this problem

play04:35

it's quite straightforward

play04:37

uh the first solution that you can think

play04:38

of

play04:39

so the classical oracle we know that f

play04:41

of x is a dot x mod 2.

play04:43

so simply query the oracle with this

play04:45

sequence of inputs so the first input of

play04:47

the query is 1 for the all zeros

play04:50

the second input is 0 1 followed by all

play04:52

zeros and then third you'll have one at

play04:55

the third position and then zero to

play04:57

other positions so similarly you go on

play05:00

okay so you just have to make end

play05:02

queries

play05:04

and for the first query we'll get the

play05:07

first bit second query will give the

play05:09

second bit

play05:10

uh third query will to the third bit and

play05:12

so on

play05:13

so after end queries to the classical

play05:15

article we can obtain

play05:17

each of the n bits i mean n bits

play05:19

together

play05:22

just to give an example to again retrade

play05:25

what i mentioned earlier let's just

play05:26

assume that the a that's embedded in it

play05:29

is one zero one one let's assume that n

play05:31

is four and then

play05:32

a is one zero one one so we query the

play05:36

oracle with four inputs

play05:38

or yeah to generalize it

play05:40

we query first with one zero zero zero

play05:43

zero one zero zero zero zero one zero

play05:45

and zero zero zero one so one zero zero

play05:47

zero dot this will give the first bit

play05:49

one and then zero one zero zero will

play05:51

give the second bit that's zero zero

play05:52

zero one zero will be the third bit

play05:54

that's one and zero zero zero one will

play05:56

get the fourth bit it's one we can also

play05:58

prove that we cannot do any better than

play06:01

these n calls to the r for a classical

play06:03

article okay so consider

play06:05

that we have a function with the has an

play06:07

a embedded in it

play06:09

and then

play06:11

just writing the previous what i said in

play06:13

the previous layer set of equations

play06:16

uh we have a 1 to a n and let x 1 2

play06:21

x n minus 1 be the query okay so x 1 can

play06:25

be written as x 1 1 till x 1 n

play06:27

and then x n minus 1 can be written as x

play06:30

n minus 1 1 till x n minus 1 n because

play06:33

these are all n bit strings okay so

play06:36

it's like

play06:37

we have

play06:38

this system of n minus 1 equations

play06:41

with

play06:42

n variables a 1 to a n and we know that

play06:45

ah this is standard underdetermined

play06:47

system of equations which means there

play06:49

are less equations than

play06:51

ah variables and we cannot find a unique

play06:54

solution a for this system of equations

play06:58

so

play06:59

irrespective of what queries that we do

play07:01

to this classical article

play07:04

we have to use n queries to this article

play07:07

to determine a

play07:09

and as we saw in the previous slide it's

play07:11

also an upper point so we know

play07:14

an algorithm that after end queries will

play07:16

give the output and here with this slide

play07:18

with the intuition that we provided here

play07:20

we also know that we need at least n

play07:22

queries now let's look at the quantum

play07:24

solution for it i am just displaying the

play07:26

end to end quantum solution in a single

play07:28

picture but here i think you guys

play07:31

remember this diagram right

play07:34

the quantum algorithm to solve

play07:37

the bunching was irani problem it's same

play07:39

as the algorithm that's same as the set

play07:41

of steps that's used to solve the sub

play07:43

problem

play07:45

given that we have seen these individual

play07:46

steps i'll just briefly go over these

play07:49

steps in

play07:50

somewhat quickly

play07:52

so the first step it involves applying

play07:55

hadamard to all the inputs

play07:57

all right to step back a little bit the

play07:59

step 0 is the input state which is same

play08:02

as deutsche

play08:03

we have uh

play08:05

n qubits all 0s and n plus 1 qubit as 1

play08:09

and then step 1

play08:11

is applying the hadamard on all the

play08:12

qubits

play08:15

okay i'm just giving the final

play08:17

expression that we derived

play08:18

hadamard applied on a random state a

play08:22

it's summation over all x minus 1 to the

play08:25

a dot x x

play08:28

okay so now if you apply hadamard on

play08:31

this state all 0

play08:32

it's just 1 over root 2 to the n

play08:35

summation over all possible states x

play08:38

so that's the output of the first step

play08:41

and then

play08:43

we apply the article we saw earlier

play08:46

that

play08:47

when we apply the oracle it's same as

play08:51

having this phase that comes out minus 1

play08:54

to the f x but we know that f of x is a

play08:56

dot x so

play08:58

x

play08:59

when we apply

play09:00

the state x and minus when you give it

play09:03

to the article the output will be minus

play09:05

1 to the a dot x

play09:07

x and a minus so

play09:09

again this is focusing on the first n

play09:12

qubits

play09:13

so this is

play09:14

uh when we apply

play09:17

this is the output of step one and when

play09:18

we apply

play09:20

uh when we pass it to the article with

play09:22

the n plus one qubit

play09:25

answer the qubit to be minus minus state

play09:28

we will get this output where

play09:30

last summation over x minus one to the a

play09:33

dot xx

play09:35

okay the third step is applying the

play09:37

hadamard or to be more precise bernstein

play09:41

was irani

play09:42

we have to apply the inverse of hadamard

play09:44

but inverse of haram had a hadamard

play09:46

itself

play09:47

if you look at it

play09:48

this is the this is the state that we

play09:50

have got at the end of step 2

play09:53

i mean summation over x minus 1 to the a

play09:55

dot x x

play09:58

and

play10:00

interestingly

play10:01

if we apply the hadamard again

play10:04

or the inverse of hadamard on this state

play10:06

we'll get back

play10:08

the value that we want

play10:09

which is the value a

play10:12

which is the bit string a that we want

play10:14

right i mean we have to measure this

play10:17

the cubic state that we get and then

play10:20

once we measured it will get the bit

play10:22

string a

play10:23

okay so now let's look into the kisket

play10:25

implementation of bird seamless running

play10:29

all right so this is the circuit that we

play10:31

have for diesel so i'll just make a copy

play10:36

because it's the same circuit

play10:38

right

play10:40

so

play10:44

just call this the pv circuit

play10:47

all right

play10:48

so

play10:50

we know that

play10:51

the input is 0 0 0 1

play10:55

we know that the first step is hadamard

play10:56

applied on all qubits

play10:58

and then we have to apply the article

play11:00

let's come back to it a bit later we

play11:02

know that the third step is applying the

play11:05

hadamard and finally doing the

play11:06

measurement

play11:10

right okay

play11:12

let's come back to what the article is

play11:16

okay

play11:17

just think about it

play11:19

what do we want to implement

play11:21

we want to

play11:22

the oracle

play11:23

to take in

play11:25

x

play11:27

y

play11:28

and output

play11:30

x

play11:31

and y x or f of x

play11:34

so essentially

play11:36

we want the oracle to output

play11:38

the we want this final qubit to be xored

play11:41

with f of x and we know that f of x is a

play11:44

dot x

play11:49

okay so what is the implement of

play11:50

implementation of how a dot x how do we

play11:53

implement aerodynamics

play11:58

so

play11:59

for how do we

play12:01

implement aerobics for a particular a

play12:05

the answer is quite simple

play12:08

ah

play12:09

if

play12:10

a is 1 0 0

play12:14

then

play12:14

we just do this

play12:17

because

play12:19

what does this do

play12:22

if we input a y it just outputs y

play12:26

xr

play12:27

x

play12:28

1

play12:29

okay

play12:30

or okay here they call it q 0 q 1 q 2 so

play12:33

which means let's say the inputs are x 0

play12:36

x 1 x 2 so this just implements y xor x

play12:41

1

play12:44

ok which means a is 1 0 0 right it's 1

play12:48

dot

play12:49

x 0 plus

play12:51

0 dot x 1 plus 0 dot x 2

play12:55

and similarly if you want to implement 1

play12:57

0 1

play13:00

it is just this

play13:02

because this is y x are

play13:05

x 0

play13:06

x or x 2

play13:08

so this essentially says

play13:10

it's y

play13:11

x are

play13:13

1 dot

play13:14

x 0

play13:16

plus 0 dot x

play13:17

1

play13:18

plus 0 dot oh sorry 1 dot x 2

play13:23

okay let's see what the output is if it

play13:25

matches

play13:27

right so the output says it's 1 0 1

play13:32

and 1 0 one so yeah as

play13:34

before we ignored the ancillar qubit uh

play13:38

the fourth or the last qubit

play13:40

so that is zero with uh probability

play13:43

fifty and or fifty percent and one with

play13:45

probability half

play13:47

so

play13:49

right but the first three qubits are one

play13:51

zero one

play13:52

or i think we have to read it from here

play13:55

it's one zero one

play13:57

let's try to do this so if i put this

play14:00

here

play14:01

the output

play14:03

should be

play14:04

1 1 0

play14:06

okay

play14:09

yes

play14:10

that's what we got 1 1 0

play14:13

1 0

play14:15

okay and if i delete this

play14:18

it should be 0 1 0

play14:23

right we got 0 and 0 and 0

play14:26

so the implementation of oracle is

play14:28

straightforward uh if

play14:31

for whichever bits a is one

play14:34

we have a c naught

play14:36

with that particular bit as

play14:38

control and the answer the last qubit

play14:41

has started

play14:43

okay

play14:45

so that's about uh the implementation of

play14:48

the bernstein vazirani algorithm in

play14:50

kiskit

play14:51

i hope you enjoyed this part of the

play14:53

lecture

play14:54

in the next part

play14:56

dheeraj will talk about grover's

play14:58

algorithm

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
Quantum ComputingAlgorithmsBernstein VaziraniProblem SolvingOracle SeparationQuantum AlgorithmsClassical vs QuantumComputational ComplexityKisKit ImplementationLecture Series
¿Necesitas un resumen en inglés?