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?
Are there any tips to help hummingbirds find a new feeder?
Why is this python script running in background consuming 100 % CPU?
Variable does not Exist: CaseTrigger
If a character has cast the Fly spell on themselves, can they "hand off" to the Levitate spell without interruption?
Can someone get a spouse off a deed that never lived together and was incarcerated?
Is there a word for pant sleeves?
Can diplomats be allowed on the flight deck of a commercial European airline?
What is the winged creature on the back of the Mordenkainen's Tome of Foes book?
Find this Unique UVC Palindrome ( ignoring signs and decimal) from Given Fractional Relationship
Is being an extrovert a necessary condition to be a manager?
VHDL: Why is it hard to design a floating point unit in hardware?
How would a physicist explain this starship engine?
How to safely discharge oneself
Way of refund if scammed?
Shell builtin `printf` line limit?
Download app bundles from App Store to run on iOS Emulator on Mac
Why is this integration method not valid?
Why do the i8080 I/O instructions take a byte-sized operand to determine the port?
Unary Enumeration
JavaScript: Access 'this' when calling function stored in variable
To exponential digit growth and beyond!
Would this be a dangerous impeller to use for a drone?
Illustrating that universal optimality is stronger than sphere packing
mmap: effect of other processes writing to a file previously mapped read-only
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
New contributor
$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
New contributor
$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
New contributor
$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
New contributor
New contributor
edited May 15 at 9:34
Sanchayan Dutta♦
7,15041658
7,15041658
New contributor
asked May 14 at 21:25
IntegrateThisIntegrateThis
1234
1234
New contributor
New contributor
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
);
);
IntegrateThis is a new contributor. Be nice, and check out our Code of Conduct.
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,1601212
2,1601212
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 |
IntegrateThis is a new contributor. Be nice, and check out our Code of Conduct.
IntegrateThis is a new contributor. Be nice, and check out our Code of Conduct.
IntegrateThis is a new contributor. Be nice, and check out our Code of Conduct.
IntegrateThis is a new contributor. Be nice, and check out our Code of Conduct.
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