How to create quantum circuits from scratchGeneral construction of $W_n$-stateTips and tricks for constructing circuits to generate arbitrary quantum statesWhat do double wires mean in quantum circuits, and how do they relate to if statements?Do multi-qubit measurements make a difference in quantum circuits?Simulating Clifford + few-T circuitsHow to re-create the following circuit image?Automatic compilation of quantum circuitsHow to analyze highly entangled quantum circuits?How to complete this teleportation circuit? How to create a copy of $|psi〉$?How to derive a circuit from given equations?How to create an $n$-qubit normally controlled gate?How to create an Ising coupling gate with Qiskit
Calculating Fibonacci sequence in several different ways
What should I watch before playing Alien: Isolation?
I have a domain, static IP and many devices I'd like to access outside my house. How to route them?
Found old paper shares of Motorola Inc that has since been broken up
Why does airflow separate from the wing during stall?
"It is what it is"
What kind of curve (or model) should I fit to my percentage data?
Host telling me to cancel my booking in exchange for a discount?
Can a warlock shoot multiple beams from the Eldritch Blast cantrip with only a single free hand?
Is there an English word to describe when a sound "protrudes"?
I am a dual citizen of United States and Mexico, can I use my Mexican license in california when visiting?
Reissue US, UK, Canada visas in stolen passports
Is it better to deliver many low-value stories or few high-value stories?
What is the best word describing the nature of expiring in a short amount of time, connoting "losing public attention"?
Would using carbon dioxide as fuel work to reduce the greenhouse effect?
Substitute dried pig's blood for fresh
How can I show that the speed of light in vacuum is the same in all reference frames?
Cargo capacity of a kayak
Strange LED behavior
How to use AppendTo in a While loop?
Longest to Shortest tractates of Yerushalmi by daf
You have no, but can try for yes
Why didn't NASA launch communications relay satellites for the Apollo missions?
Is it OK to accept a job opportunity while planning on not taking it?
How to create quantum circuits from scratch
General construction of $W_n$-stateTips and tricks for constructing circuits to generate arbitrary quantum statesWhat do double wires mean in quantum circuits, and how do they relate to if statements?Do multi-qubit measurements make a difference in quantum circuits?Simulating Clifford + few-T circuitsHow to re-create the following circuit image?Automatic compilation of quantum circuitsHow to analyze highly entangled quantum circuits?How to complete this teleportation circuit? How to create a copy of $|psi〉$?How to derive a circuit from given equations?How to create an $n$-qubit normally controlled gate?How to create an Ising coupling gate with Qiskit
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak.
Getting through the earlier chapters and exercises went quite well (fortunately the earlier chapters had plenty of examples), however I got stuck on the 5th chapter on quantum circuits. Although I understand the concepts the authors present, perhaps due to a lack of examples, I have trouble applying said concepts to the exercises.
The exercises I have trouble with (and where I can't find a solution or thorough/ introductory explanation for) are the following:
$\$
Questions:
Design a circuit for creating:
$left| W_n right> = frac1sqrtn(left| 0 dots 001 right> + left| 0 dots 010 right> + left| 0dots 100 right>) + cdots + left| 1dots 000 right>)$ from $left| 0 dots 000 right>$
And design a circuit for creating "the Hardy state":
$frac1sqrt12(3left| 00 right> + left| 01 right> + left| 10 right> + left| 11 right>)$
$\$
Can somebody point me in the right direction or refer me to some literature/ tutorials so I can grasp these kind of exercises better?
$\$
Perhaps a related question:
Tips and tricks for constructing circuits to generate arbitrary quantum states
quantum-gate circuit-construction
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak.
Getting through the earlier chapters and exercises went quite well (fortunately the earlier chapters had plenty of examples), however I got stuck on the 5th chapter on quantum circuits. Although I understand the concepts the authors present, perhaps due to a lack of examples, I have trouble applying said concepts to the exercises.
The exercises I have trouble with (and where I can't find a solution or thorough/ introductory explanation for) are the following:
$\$
Questions:
Design a circuit for creating:
$left| W_n right> = frac1sqrtn(left| 0 dots 001 right> + left| 0 dots 010 right> + left| 0dots 100 right>) + cdots + left| 1dots 000 right>)$ from $left| 0 dots 000 right>$
And design a circuit for creating "the Hardy state":
$frac1sqrt12(3left| 00 right> + left| 01 right> + left| 10 right> + left| 11 right>)$
$\$
Can somebody point me in the right direction or refer me to some literature/ tutorials so I can grasp these kind of exercises better?
$\$
Perhaps a related question:
Tips and tricks for constructing circuits to generate arbitrary quantum states
quantum-gate circuit-construction
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
$begingroup$
I'm not familiar with the Hardy state, but can you check what you've written? It's not normalised (and kind of trivial), so I'm guessing it's not what you intended. For the W-state, you probably want to check out this question.
$endgroup$
– DaftWullie
8 hours ago
$begingroup$
You're right, I made some typos. I've edited them, now they are correct/ normalized. And thank you!
$endgroup$
– Joery
8 hours ago
add a comment |
$begingroup$
I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak.
Getting through the earlier chapters and exercises went quite well (fortunately the earlier chapters had plenty of examples), however I got stuck on the 5th chapter on quantum circuits. Although I understand the concepts the authors present, perhaps due to a lack of examples, I have trouble applying said concepts to the exercises.
The exercises I have trouble with (and where I can't find a solution or thorough/ introductory explanation for) are the following:
$\$
Questions:
Design a circuit for creating:
$left| W_n right> = frac1sqrtn(left| 0 dots 001 right> + left| 0 dots 010 right> + left| 0dots 100 right>) + cdots + left| 1dots 000 right>)$ from $left| 0 dots 000 right>$
And design a circuit for creating "the Hardy state":
$frac1sqrt12(3left| 00 right> + left| 01 right> + left| 10 right> + left| 11 right>)$
$\$
Can somebody point me in the right direction or refer me to some literature/ tutorials so I can grasp these kind of exercises better?
$\$
Perhaps a related question:
Tips and tricks for constructing circuits to generate arbitrary quantum states
quantum-gate circuit-construction
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak.
Getting through the earlier chapters and exercises went quite well (fortunately the earlier chapters had plenty of examples), however I got stuck on the 5th chapter on quantum circuits. Although I understand the concepts the authors present, perhaps due to a lack of examples, I have trouble applying said concepts to the exercises.
The exercises I have trouble with (and where I can't find a solution or thorough/ introductory explanation for) are the following:
$\$
Questions:
Design a circuit for creating:
$left| W_n right> = frac1sqrtn(left| 0 dots 001 right> + left| 0 dots 010 right> + left| 0dots 100 right>) + cdots + left| 1dots 000 right>)$ from $left| 0 dots 000 right>$
And design a circuit for creating "the Hardy state":
$frac1sqrt12(3left| 00 right> + left| 01 right> + left| 10 right> + left| 11 right>)$
$\$
Can somebody point me in the right direction or refer me to some literature/ tutorials so I can grasp these kind of exercises better?
$\$
Perhaps a related question:
Tips and tricks for constructing circuits to generate arbitrary quantum states
quantum-gate circuit-construction
quantum-gate circuit-construction
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 8 hours ago
Joery
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 8 hours ago
JoeryJoery
264 bronze badges
264 bronze badges
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Joery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$begingroup$
I'm not familiar with the Hardy state, but can you check what you've written? It's not normalised (and kind of trivial), so I'm guessing it's not what you intended. For the W-state, you probably want to check out this question.
$endgroup$
– DaftWullie
8 hours ago
$begingroup$
You're right, I made some typos. I've edited them, now they are correct/ normalized. And thank you!
$endgroup$
– Joery
8 hours ago
add a comment |
$begingroup$
I'm not familiar with the Hardy state, but can you check what you've written? It's not normalised (and kind of trivial), so I'm guessing it's not what you intended. For the W-state, you probably want to check out this question.
$endgroup$
– DaftWullie
8 hours ago
$begingroup$
You're right, I made some typos. I've edited them, now they are correct/ normalized. And thank you!
$endgroup$
– Joery
8 hours ago
$begingroup$
I'm not familiar with the Hardy state, but can you check what you've written? It's not normalised (and kind of trivial), so I'm guessing it's not what you intended. For the W-state, you probably want to check out this question.
$endgroup$
– DaftWullie
8 hours ago
$begingroup$
I'm not familiar with the Hardy state, but can you check what you've written? It's not normalised (and kind of trivial), so I'm guessing it's not what you intended. For the W-state, you probably want to check out this question.
$endgroup$
– DaftWullie
8 hours ago
$begingroup$
You're right, I made some typos. I've edited them, now they are correct/ normalized. And thank you!
$endgroup$
– Joery
8 hours ago
$begingroup$
You're right, I made some typos. I've edited them, now they are correct/ normalized. And thank you!
$endgroup$
– Joery
8 hours ago
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
As DaftWullie pointed out, the question about $W_n$ has an excellent collection of answers here.
For the Hardy state question (and a lot of other tasks like it), you can approach it as follows.
- Start with the $|0...0rangle$ state.
- Start by putting the first qubit "in the right state", which is a state $(alpha |0rangle + beta |1rangle) otimes |0...0rangle$, where $alpha$ and $beta$ are the relative weights of all basis states which start with 0 and with 1, respectively. For Hardy state specifically, two basis states start with 0: $frac1sqrt12(3left| 00 right> + left| 01 right>)$ and two basis states start with 1: $frac1sqrt12(left| 10 right> + left| 11 right>)$; their relative weights are just the sums of squares of their amplitudes: $frac912 + frac112 = frac1012$ and $frac112 + frac112 = frac212$, respectively. So you'll need to put the first qubit in the state $(sqrtfrac1012 |0rangle + sqrtfrac212 |1rangle)$ using $R_y$ gate.
- Continue by putting the second qubit in the right state, applying controlled $R_y$ gates with the first qubit as the control. To get the first two terms right, you need to convert the term $sqrtfrac1012 |0rangle otimes |0rangle$ into the term $frac1sqrt12(3left| 00 right> + left| 01 right>)$, which is the same as convert normal state $|0rangle otimes |0rangle$ into $frac1sqrt10(3left| 00 right> + left| 01 right>)$ without affecting the state $|1rangle otimes |0rangle$ (note the renormalization when switching from terms of a larger expression to standalone states!) To do this, you can do a 0-controlled $R_y$ with the first qubit as control and the second qubit as target.
- If you have more qubits, you will continue doing this, using more control qubits to make your rotations more and more specific.
You can see this paper by Shende, Bullock and Markov if you want a more formal and less ad-hoc explanation.
$endgroup$
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
);
);
Joery 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%2f6836%2fhow-to-create-quantum-circuits-from-scratch%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$
As DaftWullie pointed out, the question about $W_n$ has an excellent collection of answers here.
For the Hardy state question (and a lot of other tasks like it), you can approach it as follows.
- Start with the $|0...0rangle$ state.
- Start by putting the first qubit "in the right state", which is a state $(alpha |0rangle + beta |1rangle) otimes |0...0rangle$, where $alpha$ and $beta$ are the relative weights of all basis states which start with 0 and with 1, respectively. For Hardy state specifically, two basis states start with 0: $frac1sqrt12(3left| 00 right> + left| 01 right>)$ and two basis states start with 1: $frac1sqrt12(left| 10 right> + left| 11 right>)$; their relative weights are just the sums of squares of their amplitudes: $frac912 + frac112 = frac1012$ and $frac112 + frac112 = frac212$, respectively. So you'll need to put the first qubit in the state $(sqrtfrac1012 |0rangle + sqrtfrac212 |1rangle)$ using $R_y$ gate.
- Continue by putting the second qubit in the right state, applying controlled $R_y$ gates with the first qubit as the control. To get the first two terms right, you need to convert the term $sqrtfrac1012 |0rangle otimes |0rangle$ into the term $frac1sqrt12(3left| 00 right> + left| 01 right>)$, which is the same as convert normal state $|0rangle otimes |0rangle$ into $frac1sqrt10(3left| 00 right> + left| 01 right>)$ without affecting the state $|1rangle otimes |0rangle$ (note the renormalization when switching from terms of a larger expression to standalone states!) To do this, you can do a 0-controlled $R_y$ with the first qubit as control and the second qubit as target.
- If you have more qubits, you will continue doing this, using more control qubits to make your rotations more and more specific.
You can see this paper by Shende, Bullock and Markov if you want a more formal and less ad-hoc explanation.
$endgroup$
add a comment |
$begingroup$
As DaftWullie pointed out, the question about $W_n$ has an excellent collection of answers here.
For the Hardy state question (and a lot of other tasks like it), you can approach it as follows.
- Start with the $|0...0rangle$ state.
- Start by putting the first qubit "in the right state", which is a state $(alpha |0rangle + beta |1rangle) otimes |0...0rangle$, where $alpha$ and $beta$ are the relative weights of all basis states which start with 0 and with 1, respectively. For Hardy state specifically, two basis states start with 0: $frac1sqrt12(3left| 00 right> + left| 01 right>)$ and two basis states start with 1: $frac1sqrt12(left| 10 right> + left| 11 right>)$; their relative weights are just the sums of squares of their amplitudes: $frac912 + frac112 = frac1012$ and $frac112 + frac112 = frac212$, respectively. So you'll need to put the first qubit in the state $(sqrtfrac1012 |0rangle + sqrtfrac212 |1rangle)$ using $R_y$ gate.
- Continue by putting the second qubit in the right state, applying controlled $R_y$ gates with the first qubit as the control. To get the first two terms right, you need to convert the term $sqrtfrac1012 |0rangle otimes |0rangle$ into the term $frac1sqrt12(3left| 00 right> + left| 01 right>)$, which is the same as convert normal state $|0rangle otimes |0rangle$ into $frac1sqrt10(3left| 00 right> + left| 01 right>)$ without affecting the state $|1rangle otimes |0rangle$ (note the renormalization when switching from terms of a larger expression to standalone states!) To do this, you can do a 0-controlled $R_y$ with the first qubit as control and the second qubit as target.
- If you have more qubits, you will continue doing this, using more control qubits to make your rotations more and more specific.
You can see this paper by Shende, Bullock and Markov if you want a more formal and less ad-hoc explanation.
$endgroup$
add a comment |
$begingroup$
As DaftWullie pointed out, the question about $W_n$ has an excellent collection of answers here.
For the Hardy state question (and a lot of other tasks like it), you can approach it as follows.
- Start with the $|0...0rangle$ state.
- Start by putting the first qubit "in the right state", which is a state $(alpha |0rangle + beta |1rangle) otimes |0...0rangle$, where $alpha$ and $beta$ are the relative weights of all basis states which start with 0 and with 1, respectively. For Hardy state specifically, two basis states start with 0: $frac1sqrt12(3left| 00 right> + left| 01 right>)$ and two basis states start with 1: $frac1sqrt12(left| 10 right> + left| 11 right>)$; their relative weights are just the sums of squares of their amplitudes: $frac912 + frac112 = frac1012$ and $frac112 + frac112 = frac212$, respectively. So you'll need to put the first qubit in the state $(sqrtfrac1012 |0rangle + sqrtfrac212 |1rangle)$ using $R_y$ gate.
- Continue by putting the second qubit in the right state, applying controlled $R_y$ gates with the first qubit as the control. To get the first two terms right, you need to convert the term $sqrtfrac1012 |0rangle otimes |0rangle$ into the term $frac1sqrt12(3left| 00 right> + left| 01 right>)$, which is the same as convert normal state $|0rangle otimes |0rangle$ into $frac1sqrt10(3left| 00 right> + left| 01 right>)$ without affecting the state $|1rangle otimes |0rangle$ (note the renormalization when switching from terms of a larger expression to standalone states!) To do this, you can do a 0-controlled $R_y$ with the first qubit as control and the second qubit as target.
- If you have more qubits, you will continue doing this, using more control qubits to make your rotations more and more specific.
You can see this paper by Shende, Bullock and Markov if you want a more formal and less ad-hoc explanation.
$endgroup$
As DaftWullie pointed out, the question about $W_n$ has an excellent collection of answers here.
For the Hardy state question (and a lot of other tasks like it), you can approach it as follows.
- Start with the $|0...0rangle$ state.
- Start by putting the first qubit "in the right state", which is a state $(alpha |0rangle + beta |1rangle) otimes |0...0rangle$, where $alpha$ and $beta$ are the relative weights of all basis states which start with 0 and with 1, respectively. For Hardy state specifically, two basis states start with 0: $frac1sqrt12(3left| 00 right> + left| 01 right>)$ and two basis states start with 1: $frac1sqrt12(left| 10 right> + left| 11 right>)$; their relative weights are just the sums of squares of their amplitudes: $frac912 + frac112 = frac1012$ and $frac112 + frac112 = frac212$, respectively. So you'll need to put the first qubit in the state $(sqrtfrac1012 |0rangle + sqrtfrac212 |1rangle)$ using $R_y$ gate.
- Continue by putting the second qubit in the right state, applying controlled $R_y$ gates with the first qubit as the control. To get the first two terms right, you need to convert the term $sqrtfrac1012 |0rangle otimes |0rangle$ into the term $frac1sqrt12(3left| 00 right> + left| 01 right>)$, which is the same as convert normal state $|0rangle otimes |0rangle$ into $frac1sqrt10(3left| 00 right> + left| 01 right>)$ without affecting the state $|1rangle otimes |0rangle$ (note the renormalization when switching from terms of a larger expression to standalone states!) To do this, you can do a 0-controlled $R_y$ with the first qubit as control and the second qubit as target.
- If you have more qubits, you will continue doing this, using more control qubits to make your rotations more and more specific.
You can see this paper by Shende, Bullock and Markov if you want a more formal and less ad-hoc explanation.
answered 2 hours ago
Mariia MykhailovaMariia Mykhailova
2,8451 gold badge3 silver badges17 bronze badges
2,8451 gold badge3 silver badges17 bronze badges
add a comment |
add a comment |
Joery is a new contributor. Be nice, and check out our Code of Conduct.
Joery is a new contributor. Be nice, and check out our Code of Conduct.
Joery is a new contributor. Be nice, and check out our Code of Conduct.
Joery 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%2f6836%2fhow-to-create-quantum-circuits-from-scratch%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
$begingroup$
I'm not familiar with the Hardy state, but can you check what you've written? It's not normalised (and kind of trivial), so I'm guessing it's not what you intended. For the W-state, you probably want to check out this question.
$endgroup$
– DaftWullie
8 hours ago
$begingroup$
You're right, I made some typos. I've edited them, now they are correct/ normalized. And thank you!
$endgroup$
– Joery
8 hours ago