Skip to content

Commit 30b6638

Browse files
committed
Remove references from notebooks
1 parent 125cc62 commit 30b6638

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

docs/simulate/noisy_simulation.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@
476476
"outputs": [],
477477
"source": [
478478
"\"\"\"Minimal example of defining a custom channel.\"\"\"\n",
479-
"class BitAndPhaseFlipChannel(cirq.SingleQubitGate):\n",
479+
"class BitAndPhaseFlipChannel(cirq.Gate):\n",
480+
" def _num_qubits_(self) -> int:\n",
481+
" return 1\n",
480482
" def __init__(self, p: float) -> None:\n",
481483
" self._p = p\n",
482484
" \n",

docs/start/intro.ipynb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@
15251525
"\\end{array} \\right]\n",
15261526
"$$\n",
15271527
"\n",
1528-
"Below is a simple implementation of this gate in Cirq. To do this we simply define a class that inherits from `cirq.SingleQubitGate` and implements the `cirq.SupportsUnitary` protocol by implementing the `_unitary_(self)` method. We also define an optional `__str__` representation which Cirq will use when printing this gate out in a circuit diagram."
1528+
"Below is a simple implementation of this gate in Cirq. To do this we simply define a class that inherits from `cirq.Gate` and implements the `cirq.SupportsUnitary` protocol by implementing the `_unitary_(self)` method. We also define an optional `__str__` representation which Cirq will use when printing this gate out in a circuit diagram."
15291529
]
15301530
},
15311531
{
@@ -1539,7 +1539,9 @@
15391539
"\"\"\"Example of defining a custom gate in Cirq.\"\"\"\n",
15401540
"\n",
15411541
"\n",
1542-
"class RationalGate(cirq.SingleQubitGate):\n",
1542+
"class RationalGate(cirq.Gate):\n",
1543+
" def _num_qubits_(self) -> int:\n",
1544+
" return 1\n",
15431545
" def _unitary_(self):\n",
15441546
" return np.array([[3 / 5, 4 / 5], [-4 / 5, 3 / 5]])\n",
15451547
"\n",
@@ -1780,7 +1782,9 @@
17801782
"\"\"\"Example of a custom gate which supports the decompose protocol.\"\"\"\n",
17811783
"\n",
17821784
"\n",
1783-
"class HXGate(cirq.SingleQubitGate):\n",
1785+
"class HXGate(cirq.Gate):\n",
1786+
" def _num_qubits_(self) -> int:\n",
1787+
" return 1\n",
17841788
" def _decompose_(self, qubits):\n",
17851789
" return cirq.H(*qubits), cirq.X(*qubits)\n",
17861790
"\n",
@@ -2832,7 +2836,9 @@
28322836
},
28332837
"outputs": [],
28342838
"source": [
2835-
"class InconsistentXGate(cirq.SingleQubitGate):\n",
2839+
"class InconsistentXGate(cirq.Gate):\n",
2840+
" def _num_qubits_(self) -> int:\n",
2841+
" return 1\n",
28362842
" def _decompose_(self, qubits):\n",
28372843
" yield cirq.H(qubits[0])\n",
28382844
" yield cirq.Z(qubits[0])\n",

0 commit comments

Comments
 (0)