Skip to content

Commit

Permalink
split code
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangJunye committed Jun 14, 2022
1 parent 0722459 commit d044496
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions tutorials/circuits/3_summary_of_quantum_operations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,24 +234,33 @@
"source": [
"<div class=\"alert alert-info\">\n",
"\n",
"**Note on U gate deprecation**\n",
"Note on U gate deprecation\n",
"\n",
"The QuantumCircuit methods $u1$, $u2$ and $u3$ are now deprecated. Instead, the following replacements should be used.\n",
"The QuantumCircuit methods $u1$, $u2$ and $u3$ are now deprecated. Instead, the following\n",
"replacements should be used.\n",
"\n",
"$u1(\\lambda) = p(\\lambda) = u(0, 0, \\lambda)$\n",
"\n",
"$u2(\\phi, \\lambda) = u(\\frac{\\pi}{2}, \\phi, \\lambda) = p(\\frac{\\pi}{2} + \\phi) \\cdot sx \\cdot p(\\frac{\\pi}{2} - \\lambda)$\n",
"```python\n",
"# qc.u1(lambda) is now:\n",
"qc.p(lambda)\n",
"```\n",
"\n",
"$u3(\\theta, \\phi, \\lambda) = u(\\theta, \\phi, \\lambda) = p(\\phi + \\pi) \\cdot sx \\cdot p(\\theta + \\pi) \\cdot sx \\cdot p(\\lambda)$\n",
"$u2(\\phi, \\lambda) = u(\\frac{\\pi}{2}, \\phi, \\lambda) = p(\\frac{\\pi}{2} + \\phi) \\cdot sx \\cdot\n",
"p(\\frac{\\pi}{2} - \\lambda)$\n",
"\n",
" # qc.u1(lambda) is now:\n",
" qc.p(lambda)\n",
"```python\n",
"# qc.u2(phi, lambda) is now:\n",
"qc.u(pi/2, phi, lambda)\n",
"```\n",
"\n",
" # qc.u2(phi, lambda) is now:\n",
" qc.u(pi/2, phi, lambda)\n",
"$u3(\\theta, \\phi, \\lambda) = u(\\theta, \\phi, \\lambda) = p(\\phi + \\pi) \\cdot sx \\cdot p(\\theta + \\pi)\n",
"\\cdot sx \\cdot p(\\lambda)$\n",
"\n",
" # qc.u3(theta, phi, lambda) is now:\n",
" qc.u(theta, phi, lambda)\n",
"```python\n",
"# qc.u3(theta, phi, lambda) is now:\n",
"qc.u(theta, phi, lambda)\n",
"```\n",
"\n",
"</div>"
]
Expand Down

0 comments on commit d044496

Please sign in to comment.