Skip to content

Commit

Permalink
Fix gates.ipynb formatting (quantumlib#5175)
Browse files Browse the repository at this point in the history
- Move import cirq up into top block.
- Clear outputs.
  • Loading branch information
dstrain115 authored and rht committed May 1, 2023
1 parent 834373c commit a2ee582
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions docs/gates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
"except ImportError:\n",
" print(\"installing cirq...\")\n",
" !pip install --quiet cirq\n",
" print(\"installed cirq.\")"
" print(\"installed cirq.\")\n",
" import cirq"
]
},
{
Expand Down Expand Up @@ -128,22 +129,8 @@
"metadata": {
"id": "psYGZcjUEF5V"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"H(b)\n",
"CNOT(b, c)\n",
"CNOT(a, b)\n",
"H(a)\n",
"cirq.MeasurementGate(2, 'a,b', ())(a, b)\n"
]
}
],
"outputs": [],
"source": [
"import cirq\n",
"\n",
"# This examples uses named qubits to remain abstract.\n",
"# However, we can also use LineQubits or GridQubits to specify a geometry\n",
"a = cirq.NamedQubit('a')\n",
Expand Down Expand Up @@ -354,9 +341,7 @@
],
"metadata": {
"colab": {
"collapsed_sections": [
"Sh9QBnKbFf_B"
],
"collapsed_sections": [],
"name": "gates.ipynb",
"toc_visible": true
},
Expand Down

0 comments on commit a2ee582

Please sign in to comment.