Skip to content

Commit

Permalink
Updating note on U-gate deprecation Qiskit#1330 (Qiskit#1333)
Browse files Browse the repository at this point in the history
* Updating note on U-gate deprecation Qiskit#1330

* Typo update

* Adding in formatting and code example

* Trying different html formatting

* fix alert info box

* split code

* Revert "split code"

This reverts commit d044496.

* improve format

* use bullet points

Co-authored-by: Junye Huang <h.jun.ye@gmail.com>
  • Loading branch information
2 people authored and ElePT committed Nov 23, 2022
1 parent ebe04a6 commit 23dbb6c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tutorials/circuits/3_summary_of_quantum_operations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,34 @@
"job.result().get_unitary(qc, decimals=3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-info\">\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",
"\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",
"\n",
"- $u3(\\theta, \\phi, \\lambda) = u(\\theta, \\phi, \\lambda) = p(\\phi + \\pi) \\cdot sx \\cdot p(\\theta + \\pi) \\cdot sx \\cdot p(\\lambda)$\n",
"\n",
"```python\n",
"# qc.u1(lambda) is now:\n",
"qc.p(lambda)\n",
"\n",
"# qc.u2(phi, lambda) is now:\n",
"qc.u(pi/2, phi, lambda)\n",
"\n",
"# qc.u3(theta, phi, lambda) is now:\n",
"qc.u(theta, phi, lambda)\n",
"```\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 23dbb6c

Please sign in to comment.