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?
Preserving culinary oils
Tic-Tac-Toe for the terminal
What does the term “mohel” mean in Hilchot Melicha (salting)?
How could Catholicism have incorporated witchcraft into its dogma?
Do you play the upbeat when beginning to play a series of notes, and then after?
In what episode of TOS did a character on the bridge make a comment about raising one to some power?
Is my router's IP address really public?
What are these (utility?) boxes at the side of the house?
How were these pictures of spacecraft wind tunnel testing taken?
What are the problems in teaching guitar via Skype?
What is a subpixel in Super Mario Bros, and how does it relate to wall clipping?
If a massive object like Jupiter flew past the Earth how close would it need to come to pull people off of the surface?
Is this story about US tax office reasonable?
Where did the “Vikings wear helmets with horn” stereotype come from and why?
A Mathematical Discussion: Fill in the Blank
What caused the tendency for conservatives to not support climate change reform?
Draw a checker pattern with a black X in the center
Is a post-climate apocolypse city in which many or most insects have disappeared realistic?
Why do Russians call their women expensive ("дорогая")?
Where can I find the list of all tendons in the human body?
Question about exercise 11.5 in TeXbook
Leading and Suffering Numbers
Plot exactly N bounce of a ball
Looking after a wayward brother in mother's will
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