Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Updating note on U-gate deprecation #1330 #1333

Merged
merged 9 commits into from
Jun 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>"
]
},
HuangJunye marked this conversation as resolved.
Show resolved Hide resolved
{
"cell_type": "markdown",
"metadata": {},
Expand Down