Understanding the oracle in Deutsch's algorithmHow is the oracle in Grover's search algorithm implemented?How exactly does Simon's algorithm solve the Simon's problem?Grover's algorithm: what to input to Oracle?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?How would I implement the quantum oracle in Deutsch's algorithm?How is the Deutsch-Jozsa algorithm faster than classical for practical implementation?How to create the oracle matrix in Grover's algorithm?How to prove that the query oracle is unitary?How does an oracle function in Grover's algorithm actually work?Grover's algorithm – DES circuit as oracle?
How could Catholicism have incorporated witchcraft into its dogma?
What is the best linguistic term for describing the kw > p / gw > b change, and its usual companion s > h
Is it ok to put a subplot to a story that is never meant to contribute to the development of the main plot?
Different PCB color ( is it different material? )
What does "Marchentalender" on the front of a postcard mean?
Is there any use case for the bottom type as a function parameter type?
How many chess players are over 2500 Elo?
1960s sci-fi novella with a character who is treated as invisible by being ignored
Restoring order in a deck of playing cards
Apparent Ring of Craters on the Moon
Crossword gone overboard
Why does the UK have more political parties than the US?
Yandex Programming Contest: Alarms
Black-and-white film where monster/alien gets fried
Why does the 6502 have the BIT instruction?
What is the 中 in ダウンロード中?
Is there an explanation for Austria's Freedom Party virtually retaining its vote share despite recent scandal?
NL - iterating all edges of a graph in log space
Ticket sales for Queen at the Live Aid
Could IPv6 make NAT / port numbers redundant?
What's the connection between "kicking a pigeon" and "how a bill becomes a law"?
How can I prevent interns from being expendable?
What does uniform continuity mean exactly?
Can a non-EU citizen travel within schengen zone freely without passport?
Understanding the oracle in Deutsch's algorithm
How is the oracle in Grover's search algorithm implemented?How exactly does Simon's algorithm solve the Simon's problem?Grover's algorithm: what to input to Oracle?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?How would I implement the quantum oracle in Deutsch's algorithm?How is the Deutsch-Jozsa algorithm faster than classical for practical implementation?How to create the oracle matrix in Grover's algorithm?How to prove that the query oracle is unitary?How does an oracle function in Grover's algorithm actually work?Grover's algorithm – DES circuit as oracle?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I am reading John Watrous' notes from his course CPSC 519 on quantum computing. In a pre-discussion before presenting Deutsch's algorithm to determine whether a function is constant or not, the author presents a function $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, and the diagram:
The inital state is $|0 rangle |1 rangle$, and after the first two Hadamard transforms, will be $$big(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1ranglebig)big(frac 1 sqrt 2 |0rangle-frac 1 sqrt 2 |1ranglebig) .$$
Up to this far I understand. The author then writes: "After performing the $B_f$ operation the state is transformed to:
$$frac 1 2 |0 rangle big(|0 oplus f(0)rangle - |1 oplus f(0)ranglebig) + frac 1 2 |1 rangle big(|0 oplus f(1)rangle) - |1 oplus f(1) ranglebig).$$
I am not sure how this was obtained, from what I understand, the operation should be
$$frac 1 sqrt 2 big( |0rangle + |1ranglebig) otimes big|(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) oplus f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) bigrangle$$ (simply subbing in $x,y$ to $B_f$). Any insights appreciated as this subject is completely new to me, although I have a decent mathematics and computer science background.
algorithm deutsch-jozsa-algorithm
$endgroup$
add a comment |
$begingroup$
I am reading John Watrous' notes from his course CPSC 519 on quantum computing. In a pre-discussion before presenting Deutsch's algorithm to determine whether a function is constant or not, the author presents a function $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, and the diagram:
The inital state is $|0 rangle |1 rangle$, and after the first two Hadamard transforms, will be $$big(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1ranglebig)big(frac 1 sqrt 2 |0rangle-frac 1 sqrt 2 |1ranglebig) .$$
Up to this far I understand. The author then writes: "After performing the $B_f$ operation the state is transformed to:
$$frac 1 2 |0 rangle big(|0 oplus f(0)rangle - |1 oplus f(0)ranglebig) + frac 1 2 |1 rangle big(|0 oplus f(1)rangle) - |1 oplus f(1) ranglebig).$$
I am not sure how this was obtained, from what I understand, the operation should be
$$frac 1 sqrt 2 big( |0rangle + |1ranglebig) otimes big|(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) oplus f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) bigrangle$$ (simply subbing in $x,y$ to $B_f$). Any insights appreciated as this subject is completely new to me, although I have a decent mathematics and computer science background.
algorithm deutsch-jozsa-algorithm
$endgroup$
add a comment |
$begingroup$
I am reading John Watrous' notes from his course CPSC 519 on quantum computing. In a pre-discussion before presenting Deutsch's algorithm to determine whether a function is constant or not, the author presents a function $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, and the diagram:
The inital state is $|0 rangle |1 rangle$, and after the first two Hadamard transforms, will be $$big(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1ranglebig)big(frac 1 sqrt 2 |0rangle-frac 1 sqrt 2 |1ranglebig) .$$
Up to this far I understand. The author then writes: "After performing the $B_f$ operation the state is transformed to:
$$frac 1 2 |0 rangle big(|0 oplus f(0)rangle - |1 oplus f(0)ranglebig) + frac 1 2 |1 rangle big(|0 oplus f(1)rangle) - |1 oplus f(1) ranglebig).$$
I am not sure how this was obtained, from what I understand, the operation should be
$$frac 1 sqrt 2 big( |0rangle + |1ranglebig) otimes big|(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) oplus f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) bigrangle$$ (simply subbing in $x,y$ to $B_f$). Any insights appreciated as this subject is completely new to me, although I have a decent mathematics and computer science background.
algorithm deutsch-jozsa-algorithm
$endgroup$
I am reading John Watrous' notes from his course CPSC 519 on quantum computing. In a pre-discussion before presenting Deutsch's algorithm to determine whether a function is constant or not, the author presents a function $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, and the diagram:
The inital state is $|0 rangle |1 rangle$, and after the first two Hadamard transforms, will be $$big(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1ranglebig)big(frac 1 sqrt 2 |0rangle-frac 1 sqrt 2 |1ranglebig) .$$
Up to this far I understand. The author then writes: "After performing the $B_f$ operation the state is transformed to:
$$frac 1 2 |0 rangle big(|0 oplus f(0)rangle - |1 oplus f(0)ranglebig) + frac 1 2 |1 rangle big(|0 oplus f(1)rangle) - |1 oplus f(1) ranglebig).$$
I am not sure how this was obtained, from what I understand, the operation should be
$$frac 1 sqrt 2 big( |0rangle + |1ranglebig) otimes big|(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) oplus f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle) bigrangle$$ (simply subbing in $x,y$ to $B_f$). Any insights appreciated as this subject is completely new to me, although I have a decent mathematics and computer science background.
algorithm deutsch-jozsa-algorithm
algorithm deutsch-jozsa-algorithm
edited May 15 at 9:34
Sanchayan Dutta
7,33241660
7,33241660
asked May 14 at 21:25
IntegrateThisIntegrateThis
1234
1234
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Remember that when you define the oracle effect as $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, $f(x)$ is a classical function of a classical 1-bit argument, so you do not have a way to compute $f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle)$ (a function of a quantum state).
The quantum oracles that implement classical functions are defined as follows:
Define the effect of the oracle on all basis states for $|xrangle$ and $|yrangle$: $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $.
This will automatically define the effect of the oracle on all superposition states: the oracle is a quantum operation and has to be linear in the state on which it acts. So if you start with a state $frac12 (|00rangle + |10rangle - |01rangle - |11rangle)$ (which is the state after applying Hadamard gates) and apply the oracle, you need to apply oracle to each basis state separately. You'll get
$$B_f frac12 (|00rangle + |10rangle - |01rangle - |11rangle) = frac12 (B_f|00rangle + B_f|10rangle - B_f|01rangle - B_f|11rangle) =$$
$$ = frac12 (|0rangle|0 oplus f(0)rangle + |1rangle|0 oplus f(1)rangle - |0rangle|1 oplus f(0)rangle - |1rangle|1 oplus f(1)rangle)$$
Which is the same as the expression in the notes, up to a different grouping or terms.
The part about the oracles being defined by their effect on basis states is implicit in a lot of sources I've seen, and is a frequent source of confusion. If you need more mathematical details on this, we ended up writing it up here.
$endgroup$
3
$begingroup$
Another resource that may be helpful is Learn Quantum Computing with Python and Q# which should have the chapter on Deutsch–Jozsa algorithm up shortly! We work though implementing Deutsch–Jozsa in Q# as well as in Python with QuTiP. <manning.com/books/…>
$endgroup$
– Dr. Sarah Kaiser
May 14 at 22:00
$begingroup$
Thanks so much for your help! I am very grateful :)
$endgroup$
– IntegrateThis
May 14 at 23:02
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "694"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fquantumcomputing.stackexchange.com%2fquestions%2f6146%2funderstanding-the-oracle-in-deutschs-algorithm%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Remember that when you define the oracle effect as $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, $f(x)$ is a classical function of a classical 1-bit argument, so you do not have a way to compute $f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle)$ (a function of a quantum state).
The quantum oracles that implement classical functions are defined as follows:
Define the effect of the oracle on all basis states for $|xrangle$ and $|yrangle$: $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $.
This will automatically define the effect of the oracle on all superposition states: the oracle is a quantum operation and has to be linear in the state on which it acts. So if you start with a state $frac12 (|00rangle + |10rangle - |01rangle - |11rangle)$ (which is the state after applying Hadamard gates) and apply the oracle, you need to apply oracle to each basis state separately. You'll get
$$B_f frac12 (|00rangle + |10rangle - |01rangle - |11rangle) = frac12 (B_f|00rangle + B_f|10rangle - B_f|01rangle - B_f|11rangle) =$$
$$ = frac12 (|0rangle|0 oplus f(0)rangle + |1rangle|0 oplus f(1)rangle - |0rangle|1 oplus f(0)rangle - |1rangle|1 oplus f(1)rangle)$$
Which is the same as the expression in the notes, up to a different grouping or terms.
The part about the oracles being defined by their effect on basis states is implicit in a lot of sources I've seen, and is a frequent source of confusion. If you need more mathematical details on this, we ended up writing it up here.
$endgroup$
3
$begingroup$
Another resource that may be helpful is Learn Quantum Computing with Python and Q# which should have the chapter on Deutsch–Jozsa algorithm up shortly! We work though implementing Deutsch–Jozsa in Q# as well as in Python with QuTiP. <manning.com/books/…>
$endgroup$
– Dr. Sarah Kaiser
May 14 at 22:00
$begingroup$
Thanks so much for your help! I am very grateful :)
$endgroup$
– IntegrateThis
May 14 at 23:02
add a comment |
$begingroup$
Remember that when you define the oracle effect as $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, $f(x)$ is a classical function of a classical 1-bit argument, so you do not have a way to compute $f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle)$ (a function of a quantum state).
The quantum oracles that implement classical functions are defined as follows:
Define the effect of the oracle on all basis states for $|xrangle$ and $|yrangle$: $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $.
This will automatically define the effect of the oracle on all superposition states: the oracle is a quantum operation and has to be linear in the state on which it acts. So if you start with a state $frac12 (|00rangle + |10rangle - |01rangle - |11rangle)$ (which is the state after applying Hadamard gates) and apply the oracle, you need to apply oracle to each basis state separately. You'll get
$$B_f frac12 (|00rangle + |10rangle - |01rangle - |11rangle) = frac12 (B_f|00rangle + B_f|10rangle - B_f|01rangle - B_f|11rangle) =$$
$$ = frac12 (|0rangle|0 oplus f(0)rangle + |1rangle|0 oplus f(1)rangle - |0rangle|1 oplus f(0)rangle - |1rangle|1 oplus f(1)rangle)$$
Which is the same as the expression in the notes, up to a different grouping or terms.
The part about the oracles being defined by their effect on basis states is implicit in a lot of sources I've seen, and is a frequent source of confusion. If you need more mathematical details on this, we ended up writing it up here.
$endgroup$
3
$begingroup$
Another resource that may be helpful is Learn Quantum Computing with Python and Q# which should have the chapter on Deutsch–Jozsa algorithm up shortly! We work though implementing Deutsch–Jozsa in Q# as well as in Python with QuTiP. <manning.com/books/…>
$endgroup$
– Dr. Sarah Kaiser
May 14 at 22:00
$begingroup$
Thanks so much for your help! I am very grateful :)
$endgroup$
– IntegrateThis
May 14 at 23:02
add a comment |
$begingroup$
Remember that when you define the oracle effect as $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, $f(x)$ is a classical function of a classical 1-bit argument, so you do not have a way to compute $f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle)$ (a function of a quantum state).
The quantum oracles that implement classical functions are defined as follows:
Define the effect of the oracle on all basis states for $|xrangle$ and $|yrangle$: $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $.
This will automatically define the effect of the oracle on all superposition states: the oracle is a quantum operation and has to be linear in the state on which it acts. So if you start with a state $frac12 (|00rangle + |10rangle - |01rangle - |11rangle)$ (which is the state after applying Hadamard gates) and apply the oracle, you need to apply oracle to each basis state separately. You'll get
$$B_f frac12 (|00rangle + |10rangle - |01rangle - |11rangle) = frac12 (B_f|00rangle + B_f|10rangle - B_f|01rangle - B_f|11rangle) =$$
$$ = frac12 (|0rangle|0 oplus f(0)rangle + |1rangle|0 oplus f(1)rangle - |0rangle|1 oplus f(0)rangle - |1rangle|1 oplus f(1)rangle)$$
Which is the same as the expression in the notes, up to a different grouping or terms.
The part about the oracles being defined by their effect on basis states is implicit in a lot of sources I've seen, and is a frequent source of confusion. If you need more mathematical details on this, we ended up writing it up here.
$endgroup$
Remember that when you define the oracle effect as $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $, $f(x)$ is a classical function of a classical 1-bit argument, so you do not have a way to compute $f(frac 1 sqrt 2 |0rangle +frac 1 sqrt 2 |1rangle)$ (a function of a quantum state).
The quantum oracles that implement classical functions are defined as follows:
Define the effect of the oracle on all basis states for $|xrangle$ and $|yrangle$: $B_f |x rangle |y rangle = |x rangle |y oplus f(x) rangle $.
This will automatically define the effect of the oracle on all superposition states: the oracle is a quantum operation and has to be linear in the state on which it acts. So if you start with a state $frac12 (|00rangle + |10rangle - |01rangle - |11rangle)$ (which is the state after applying Hadamard gates) and apply the oracle, you need to apply oracle to each basis state separately. You'll get
$$B_f frac12 (|00rangle + |10rangle - |01rangle - |11rangle) = frac12 (B_f|00rangle + B_f|10rangle - B_f|01rangle - B_f|11rangle) =$$
$$ = frac12 (|0rangle|0 oplus f(0)rangle + |1rangle|0 oplus f(1)rangle - |0rangle|1 oplus f(0)rangle - |1rangle|1 oplus f(1)rangle)$$
Which is the same as the expression in the notes, up to a different grouping or terms.
The part about the oracles being defined by their effect on basis states is implicit in a lot of sources I've seen, and is a frequent source of confusion. If you need more mathematical details on this, we ended up writing it up here.
answered May 14 at 21:50
Mariia MykhailovaMariia Mykhailova
2,2901212
2,2901212
3
$begingroup$
Another resource that may be helpful is Learn Quantum Computing with Python and Q# which should have the chapter on Deutsch–Jozsa algorithm up shortly! We work though implementing Deutsch–Jozsa in Q# as well as in Python with QuTiP. <manning.com/books/…>
$endgroup$
– Dr. Sarah Kaiser
May 14 at 22:00
$begingroup$
Thanks so much for your help! I am very grateful :)
$endgroup$
– IntegrateThis
May 14 at 23:02
add a comment |
3
$begingroup$
Another resource that may be helpful is Learn Quantum Computing with Python and Q# which should have the chapter on Deutsch–Jozsa algorithm up shortly! We work though implementing Deutsch–Jozsa in Q# as well as in Python with QuTiP. <manning.com/books/…>
$endgroup$
– Dr. Sarah Kaiser
May 14 at 22:00
$begingroup$
Thanks so much for your help! I am very grateful :)
$endgroup$
– IntegrateThis
May 14 at 23:02
3
3
$begingroup$
Another resource that may be helpful is Learn Quantum Computing with Python and Q# which should have the chapter on Deutsch–Jozsa algorithm up shortly! We work though implementing Deutsch–Jozsa in Q# as well as in Python with QuTiP. <manning.com/books/…>
$endgroup$
– Dr. Sarah Kaiser
May 14 at 22:00
$begingroup$
Another resource that may be helpful is Learn Quantum Computing with Python and Q# which should have the chapter on Deutsch–Jozsa algorithm up shortly! We work though implementing Deutsch–Jozsa in Q# as well as in Python with QuTiP. <manning.com/books/…>
$endgroup$
– Dr. Sarah Kaiser
May 14 at 22:00
$begingroup$
Thanks so much for your help! I am very grateful :)
$endgroup$
– IntegrateThis
May 14 at 23:02
$begingroup$
Thanks so much for your help! I am very grateful :)
$endgroup$
– IntegrateThis
May 14 at 23:02
add a comment |
Thanks for contributing an answer to Quantum Computing Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fquantumcomputing.stackexchange.com%2fquestions%2f6146%2funderstanding-the-oracle-in-deutschs-algorithm%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown