|
214 | 214 | "\n",
|
215 | 215 | "**Input:** A qubit in state $|\\psi\\rangle = \\alpha |0\\rangle + \\beta |1\\rangle$.\n",
|
216 | 216 | "\n",
|
217 |
| - "**Goal:** Change the qubit state to $\\alpha |0\\rangle + \\color{red}i\\beta |1\\rangle$ (add a relative phase $i$ to $|1\\rangle$ component of the superposition).\n" |
| 217 | + "**Goal:** Change the qubit state to $\\alpha |0\\rangle + {\\color{red}i}\\beta |1\\rangle$ (add a relative phase $i$ to $|1\\rangle$ component of the superposition).\n" |
218 | 218 | ]
|
219 | 219 | },
|
220 | 220 | {
|
|
251 | 251 | "**Goal:** Change the state of the qubit as follows:\n",
|
252 | 252 | "- If the qubit is in state $|0\\rangle$, don't change its state.\n",
|
253 | 253 | "- If the qubit is in state $|1\\rangle$, change its state to $e^{i\\alpha} |1\\rangle$.\n",
|
254 |
| - "- If the qubit is in superposition, change its state according to the effect on basis vectors: $\\beta |0\\rangle + \\color{red}{e^{i\\alpha}} \\gamma |1\\rangle$.\n" |
| 254 | + "- If the qubit is in superposition, change its state according to the effect on basis vectors: $\\beta |0\\rangle + {\\color{red}{e^{i\\alpha}}} \\gamma |1\\rangle$.\n" |
255 | 255 | ]
|
256 | 256 | },
|
257 | 257 | {
|
|
479 | 479 | "source": [
|
480 | 480 | "### Task 2.2. Two-qubit gate - 2\n",
|
481 | 481 | "\n",
|
482 |
| - "**Input:** Two unentangled qubits (stored in an array of length 2) in state $|+\\rangle \\otimes |+\\rangle = \\frac{1}{2} \\big( |00\\rangle + |01\\rangle + |10\\rangle \\color{blue}+ |11\\rangle \\big)$.\n", |
| 482 | + "**Input:** Two unentangled qubits (stored in an array of length 2) in state $|+\\rangle \\otimes |+\\rangle = \\frac{1}{2} \\big( |00\\rangle + |01\\rangle + |10\\rangle {\\color{blue}+} |11\\rangle \\big)$.\n", |
483 | 483 | "\n",
|
484 | 484 | "\n",
|
485 |
| - "**Goal:** Change the two-qubit state to $\\frac{1}{2} \\big( |00\\rangle + |01\\rangle + |10\\rangle \\color{red}- |11\\rangle \\big)$.\n", |
| 485 | + "**Goal:** Change the two-qubit state to $\\frac{1}{2} \\big( |00\\rangle + |01\\rangle + |10\\rangle {\\color{red}-} |11\\rangle \\big)$.\n", |
486 | 486 | "\n",
|
487 | 487 | "> Note that while the starting state can be represented as a tensor product of single-qubit states,\n",
|
488 | 488 | "> the resulting two-qubit state can not be represented in such a way."
|
|
514 | 514 | "source": [
|
515 | 515 | "### Task 2.3. Two-qubit gate - 3\n",
|
516 | 516 | "\n",
|
517 |
| - "**Input:** Two unentangled qubits (stored in an array of length 2) in an arbitrary two-qubit state $\\alpha |00\\rangle + \\color{blue}\\beta |01\\rangle + \\color{blue}\\gamma |10\\rangle + \\delta |11\\rangle$.\n", |
| 517 | + "**Input:** Two unentangled qubits (stored in an array of length 2) in an arbitrary two-qubit state $\\alpha |00\\rangle + {\\color{blue}\\beta} |01\\rangle + {\\color{blue}\\gamma} |10\\rangle + \\delta |11\\rangle$.\n", |
518 | 518 | "\n",
|
519 | 519 | "\n",
|
520 |
| - "**Goal:** Change the two-qubit state to $\\alpha |00\\rangle + \\color{red}\\gamma |01\\rangle + \\color{red}\\beta |10\\rangle + \\delta |11\\rangle$.\n", |
| 520 | + "**Goal:** Change the two-qubit state to $\\alpha |00\\rangle + {\\color{red}\\gamma} |01\\rangle + {\\color{red}\\beta} |10\\rangle + \\delta |11\\rangle$.\n", |
521 | 521 | "\n",
|
522 | 522 | "> This task can be solved using one intrinsic gate; as an exercise, try to express the solution using several (possibly controlled) Pauli gates."
|
523 | 523 | ]
|
|
549 | 549 | "### Task 2.4. Toffoli gate\n",
|
550 | 550 | "\n",
|
551 | 551 | "**Input:** Three qubits (stored in an array of length 3) in an arbitrary three-qubit state \n",
|
552 |
| - "$\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + \\zeta|101\\rangle + \\color{blue}\\eta|110\\rangle + \\color{blue}\\theta|111\\rangle$.\n", |
| 552 | + "$\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + \\zeta|101\\rangle + {\\color{blue}\\eta}|110\\rangle + {\\color{blue}\\theta}|111\\rangle$.\n", |
553 | 553 | "\n",
|
554 |
| - "**Goal:** Flip the state of the third qubit if the state of the first two is $|11\\rangle$, i.e., change the three-qubit state to $\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + \\zeta|101\\rangle + \\color{red}\\theta|110\\rangle + \\color{red}\\eta|111\\rangle$." |
| 554 | + "**Goal:** Flip the state of the third qubit if the state of the first two is $|11\\rangle$, i.e., change the three-qubit state to $\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + \\zeta|101\\rangle + {\\color{red}\\theta}|110\\rangle + {\\color{red}\\eta}|111\\rangle$." |
555 | 555 | ]
|
556 | 556 | },
|
557 | 557 | {
|
|
581 | 581 | "### Task 2.5. Fredkin gate\n",
|
582 | 582 | "\n",
|
583 | 583 | "**Input:** Three qubits (stored in an array of length 3) in an arbitrary three-qubit state \n",
|
584 |
| - "$\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + \\color{blue}\\zeta|101\\rangle + \\color{blue}\\eta|110\\rangle + \\theta|111\\rangle$.\n", |
| 584 | + "$\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + {\\color{blue}\\zeta}|101\\rangle + {\\color{blue}\\eta}|110\\rangle + \\theta|111\\rangle$.\n", |
585 | 585 | "\n",
|
586 |
| - "**Goal:** Swap the states of second and third qubit if and only if the state of the first qubit is $|1\\rangle$, i.e., change the three-qubit state to $\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + \\color{red}\\eta|101\\rangle + \\color{red}\\zeta|110\\rangle + \\theta|111\\rangle$." |
| 586 | + "**Goal:** Swap the states of second and third qubit if and only if the state of the first qubit is $|1\\rangle$, i.e., change the three-qubit state to $\\alpha |000\\rangle + \\beta |001\\rangle + \\gamma |010\\rangle + \\delta |011\\rangle + \\epsilon |100\\rangle + {\\color{red}\\eta}|101\\rangle + {\\color{red}\\zeta}|110\\rangle + \\theta|111\\rangle$." |
587 | 587 | ]
|
588 | 588 | },
|
589 | 589 | {
|
|
0 commit comments