We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Should an IonDevice accept any qubit type?
Some docstrings ([here](https://github.com/quantumlib/Cirq/blob/master/cirq/ion/ion_device.py#L26)) state qubits are one a line, while others ([here](https://github.com/quantumlib/Cirq/blob/master/cirq/ion/ion_device.py#L42)) state qubits are identified by their x, y location. I believe the latter is a typo due to the [annotation](https://github.com/quantumlib/Cirq/blob/master/cirq/ion/ion_device.py#L34).

If so, should `__init__` raise an error if the input qubits are not `LineQubit`s? (The `at` and `neighbors_of` methods assume `LineQubit`s.)

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cirq-core/cirq/ion/ion_device.py`
Content:
```
1 # Copyright 2018 The Cirq Developers
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     https://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 from typing import Any, FrozenSet, Iterable, Optional, Set, TYPE_CHECKING
16 
17 from cirq import circuits, value, devices, ops, protocols
18 from cirq.ion import convert_to_ion_gates
19 
20 if TYPE_CHECKING:
21     import cirq
22 
23 
24 def get_ion_gateset() -> ops.Gateset:
25     return ops.Gateset(
26         ops.XXPowGate,
27         ops.MeasurementGate,
28         ops.XPowGate,
29         ops.YPowGate,
30         ops.ZPowGate,
31         ops.PhasedXPowGate,
32         unroll_circuit_op=False,
33         accept_global_phase_op=False,
34     )
35 
36 
37 @value.value_equality
38 class IonDevice(devices.Device):
39     """A device with qubits placed on a line.
40 
41     Qubits have all-to-all connectivity.
42     """
43 
44     def __init__(
45         self,
46         measurement_duration: 'cirq.DURATION_LIKE',
47         twoq_gates_duration: 'cirq.DURATION_LIKE',
48         oneq_gates_duration: 'cirq.DURATION_LIKE',
49         qubits: Iterable[devices.LineQubit],
50     ) -> None:
51         """Initializes the description of an ion trap device.
52 
53         Args:
54             measurement_duration: The maximum duration of a measurement.
55             twoq_gates_duration: The maximum duration of a two qubit operation.
56             oneq_gates_duration: The maximum duration of a single qubit
57             operation.
58             qubits: Qubits on the device, identified by their x, y location.
59         """
60         self._measurement_duration = value.Duration(measurement_duration)
61         self._twoq_gates_duration = value.Duration(twoq_gates_duration)
62         self._oneq_gates_duration = value.Duration(oneq_gates_duration)
63         self.qubits = frozenset(qubits)
64         self.gateset = get_ion_gateset()
65 
66     def qubit_set(self) -> FrozenSet['cirq.LineQubit']:
67         return self.qubits
68 
69     def qid_pairs(self) -> FrozenSet['cirq.SymmetricalQidPair']:
70         """Qubits have all-to-all connectivity, so returns all pairs.
71 
72         Returns:
73             All qubit pairs on the device.
74         """
75         qs = self.qubits
76         return frozenset([devices.SymmetricalQidPair(q, q2) for q in qs for q2 in qs if q < q2])
77 
78     def decompose_operation(self, operation: ops.Operation) -> ops.OP_TREE:
79         return convert_to_ion_gates.ConvertToIonGates().convert_one(operation)
80 
81     def decompose_circuit(self, circuit: circuits.Circuit) -> circuits.Circuit:
82         return convert_to_ion_gates.ConvertToIonGates().convert_circuit(circuit)
83 
84     def duration_of(self, operation):
85         if isinstance(operation.gate, ops.XXPowGate):
86             return self._twoq_gates_duration
87         if isinstance(
88             operation.gate, (ops.XPowGate, ops.YPowGate, ops.ZPowGate, ops.PhasedXPowGate)
89         ):
90             return self._oneq_gates_duration
91         if isinstance(operation.gate, ops.MeasurementGate):
92             return self._measurement_duration
93         raise ValueError(f'Unsupported gate type: {operation!r}')
94 
95     def validate_gate(self, gate: ops.Gate):
96         if gate not in self.gateset:
97             raise ValueError(f'Unsupported gate type: {gate!r}')
98 
99     def validate_operation(self, operation):
100         if not isinstance(operation, ops.GateOperation):
101             raise ValueError(f'Unsupported operation: {operation!r}')
102 
103         self.validate_gate(operation.gate)
104 
105         for q in operation.qubits:
106             if not isinstance(q, devices.LineQubit):
107                 raise ValueError(f'Unsupported qubit type: {q!r}')
108             if q not in self.qubits:
109                 raise ValueError(f'Qubit not on device: {q!r}')
110 
111     def validate_circuit(self, circuit: circuits.AbstractCircuit):
112         super().validate_circuit(circuit)
113         _verify_unique_measurement_keys(circuit.all_operations())
114 
115     def at(self, position: int) -> Optional[devices.LineQubit]:
116         """Returns the qubit at the given position, if there is one, else None."""
117         q = devices.LineQubit(position)
118         return q if q in self.qubits else None
119 
120     def neighbors_of(self, qubit: devices.LineQubit) -> Iterable[devices.LineQubit]:
121         """Returns the qubits that the given qubit can interact with."""
122         possibles = [
123             devices.LineQubit(qubit.x + 1),
124             devices.LineQubit(qubit.x - 1),
125         ]
126         return [e for e in possibles if e in self.qubits]
127 
128     def __repr__(self) -> str:
129         return (
130             f'IonDevice(measurement_duration={self._measurement_duration!r}, '
131             f'twoq_gates_duration={self._twoq_gates_duration!r}, '
132             f'oneq_gates_duration={self._oneq_gates_duration!r} '
133             f'qubits={sorted(self.qubits)!r})'
134         )
135 
136     def __str__(self) -> str:
137         diagram = circuits.TextDiagramDrawer()
138 
139         for q in self.qubits:
140             diagram.write(q.x, 0, str(q))
141             for q2 in self.neighbors_of(q):
142                 diagram.grid_line(q.x, 0, q2.x, 0)
143 
144         return diagram.render(horizontal_spacing=3, vertical_spacing=2, use_unicode_characters=True)
145 
146     def _repr_pretty_(self, p: Any, cycle: bool):
147         """iPython (Jupyter) pretty print."""
148         p.text("IonDevice(...)" if cycle else self.__str__())
149 
150     def _value_equality_values_(self) -> Any:
151         return (
152             self._measurement_duration,
153             self._twoq_gates_duration,
154             self._oneq_gates_duration,
155             self.qubits,
156         )
157 
158 
159 def _verify_unique_measurement_keys(operations: Iterable[ops.Operation]):
160     seen: Set[str] = set()
161     for op in operations:
162         if isinstance(op.gate, ops.MeasurementGate):
163             meas = op.gate
164             key = protocols.measurement_key_name(meas)
165             if key in seen:
166                 raise ValueError(f'Measurement key {key} repeated')
167             seen.add(key)
168
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/cirq-core/cirq/ion/ion_device.py b/cirq-core/cirq/ion/ion_device.py
--- a/cirq-core/cirq/ion/ion_device.py
+++ b/cirq-core/cirq/ion/ion_device.py
@@ -55,11 +55,19 @@
             twoq_gates_duration: The maximum duration of a two qubit operation.
             oneq_gates_duration: The maximum duration of a single qubit
             operation.
-            qubits: Qubits on the device, identified by their x, y location.
+            qubits: Qubits on the device, identified by their x location.
+
+        Raises:
+            TypeError: If not all the qubits supplied are `cirq.LineQubit`s.
         """
         self._measurement_duration = value.Duration(measurement_duration)
         self._twoq_gates_duration = value.Duration(twoq_gates_duration)
         self._oneq_gates_duration = value.Duration(oneq_gates_duration)
+        if not all(isinstance(qubit, devices.LineQubit) for qubit in qubits):
+            raise TypeError(
+                "All qubits were not of type cirq.LineQubit, instead were "
+                f"{set(type(qubit) for qubit in qubits)}"
+            )
         self.qubits = frozenset(qubits)
         self.gateset = get_ion_gateset()

{"golden_diff": "diff --git a/cirq-core/cirq/ion/ion_device.py b/cirq-core/cirq/ion/ion_device.py\n--- a/cirq-core/cirq/ion/ion_device.py\n+++ b/cirq-core/cirq/ion/ion_device.py\n@@ -55,11 +55,19 @@\n             twoq_gates_duration: The maximum duration of a two qubit operation.\n             oneq_gates_duration: The maximum duration of a single qubit\n             operation.\n-            qubits: Qubits on the device, identified by their x, y location.\n+            qubits: Qubits on the device, identified by their x location.\n+\n+        Raises:\n+            TypeError: If not all the qubits supplied are `cirq.LineQubit`s.\n         \"\"\"\n         self._measurement_duration = value.Duration(measurement_duration)\n         self._twoq_gates_duration = value.Duration(twoq_gates_duration)\n         self._oneq_gates_duration = value.Duration(oneq_gates_duration)\n+        if not all(isinstance(qubit, devices.LineQubit) for qubit in qubits):\n+            raise TypeError(\n+                \"All qubits were not of type cirq.LineQubit, instead were \"\n+                f\"{set(type(qubit) for qubit in qubits)}\"\n+            )\n         self.qubits = frozenset(qubits)\n         self.gateset = get_ion_gateset()\n", "issue": "Should an IonDevice accept any qubit type?\nSome docstrings ([here](https://github.com/quantumlib/Cirq/blob/master/cirq/ion/ion_device.py#L26)) state qubits are one a line, while others ([here](https://github.com/quantumlib/Cirq/blob/master/cirq/ion/ion_device.py#L42)) state qubits are identified by their x, y location. I believe the latter is a typo due to the [annotation](https://github.com/quantumlib/Cirq/blob/master/cirq/ion/ion_device.py#L34).\r\n\r\nIf so, should `__init__` raise an error if the input qubits are not `LineQubit`s? (The `at` and `neighbors_of` methods assume `LineQubit`s.)\n", "before_files": [{"content": "# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import Any, FrozenSet, Iterable, Optional, Set, TYPE_CHECKING\n\nfrom cirq import circuits, value, devices, ops, protocols\nfrom cirq.ion import convert_to_ion_gates\n\nif TYPE_CHECKING:\n    import cirq\n\n\ndef get_ion_gateset() -> ops.Gateset:\n    return ops.Gateset(\n        ops.XXPowGate,\n        ops.MeasurementGate,\n        ops.XPowGate,\n        ops.YPowGate,\n        ops.ZPowGate,\n        ops.PhasedXPowGate,\n        unroll_circuit_op=False,\n        accept_global_phase_op=False,\n    )\n\n\n@value.value_equality\nclass IonDevice(devices.Device):\n    \"\"\"A device with qubits placed on a line.\n\n    Qubits have all-to-all connectivity.\n    \"\"\"\n\n    def __init__(\n        self,\n        measurement_duration: 'cirq.DURATION_LIKE',\n        twoq_gates_duration: 'cirq.DURATION_LIKE',\n        oneq_gates_duration: 'cirq.DURATION_LIKE',\n        qubits: Iterable[devices.LineQubit],\n    ) -> None:\n        \"\"\"Initializes the description of an ion trap device.\n\n        Args:\n            measurement_duration: The maximum duration of a measurement.\n            twoq_gates_duration: The maximum duration of a two qubit operation.\n            oneq_gates_duration: The maximum duration of a single qubit\n            operation.\n            qubits: Qubits on the device, identified by their x, y location.\n        \"\"\"\n        self._measurement_duration = value.Duration(measurement_duration)\n        self._twoq_gates_duration = value.Duration(twoq_gates_duration)\n        self._oneq_gates_duration = value.Duration(oneq_gates_duration)\n        self.qubits = frozenset(qubits)\n        self.gateset = get_ion_gateset()\n\n    def qubit_set(self) -> FrozenSet['cirq.LineQubit']:\n        return self.qubits\n\n    def qid_pairs(self) -> FrozenSet['cirq.SymmetricalQidPair']:\n        \"\"\"Qubits have all-to-all connectivity, so returns all pairs.\n\n        Returns:\n            All qubit pairs on the device.\n        \"\"\"\n        qs = self.qubits\n        return frozenset([devices.SymmetricalQidPair(q, q2) for q in qs for q2 in qs if q < q2])\n\n    def decompose_operation(self, operation: ops.Operation) -> ops.OP_TREE:\n        return convert_to_ion_gates.ConvertToIonGates().convert_one(operation)\n\n    def decompose_circuit(self, circuit: circuits.Circuit) -> circuits.Circuit:\n        return convert_to_ion_gates.ConvertToIonGates().convert_circuit(circuit)\n\n    def duration_of(self, operation):\n        if isinstance(operation.gate, ops.XXPowGate):\n            return self._twoq_gates_duration\n        if isinstance(\n            operation.gate, (ops.XPowGate, ops.YPowGate, ops.ZPowGate, ops.PhasedXPowGate)\n        ):\n            return self._oneq_gates_duration\n        if isinstance(operation.gate, ops.MeasurementGate):\n            return self._measurement_duration\n        raise ValueError(f'Unsupported gate type: {operation!r}')\n\n    def validate_gate(self, gate: ops.Gate):\n        if gate not in self.gateset:\n            raise ValueError(f'Unsupported gate type: {gate!r}')\n\n    def validate_operation(self, operation):\n        if not isinstance(operation, ops.GateOperation):\n            raise ValueError(f'Unsupported operation: {operation!r}')\n\n        self.validate_gate(operation.gate)\n\n        for q in operation.qubits:\n            if not isinstance(q, devices.LineQubit):\n                raise ValueError(f'Unsupported qubit type: {q!r}')\n            if q not in self.qubits:\n                raise ValueError(f'Qubit not on device: {q!r}')\n\n    def validate_circuit(self, circuit: circuits.AbstractCircuit):\n        super().validate_circuit(circuit)\n        _verify_unique_measurement_keys(circuit.all_operations())\n\n    def at(self, position: int) -> Optional[devices.LineQubit]:\n        \"\"\"Returns the qubit at the given position, if there is one, else None.\"\"\"\n        q = devices.LineQubit(position)\n        return q if q in self.qubits else None\n\n    def neighbors_of(self, qubit: devices.LineQubit) -> Iterable[devices.LineQubit]:\n        \"\"\"Returns the qubits that the given qubit can interact with.\"\"\"\n        possibles = [\n            devices.LineQubit(qubit.x + 1),\n            devices.LineQubit(qubit.x - 1),\n        ]\n        return [e for e in possibles if e in self.qubits]\n\n    def __repr__(self) -> str:\n        return (\n            f'IonDevice(measurement_duration={self._measurement_duration!r}, '\n            f'twoq_gates_duration={self._twoq_gates_duration!r}, '\n            f'oneq_gates_duration={self._oneq_gates_duration!r} '\n            f'qubits={sorted(self.qubits)!r})'\n        )\n\n    def __str__(self) -> str:\n        diagram = circuits.TextDiagramDrawer()\n\n        for q in self.qubits:\n            diagram.write(q.x, 0, str(q))\n            for q2 in self.neighbors_of(q):\n                diagram.grid_line(q.x, 0, q2.x, 0)\n\n        return diagram.render(horizontal_spacing=3, vertical_spacing=2, use_unicode_characters=True)\n\n    def _repr_pretty_(self, p: Any, cycle: bool):\n        \"\"\"iPython (Jupyter) pretty print.\"\"\"\n        p.text(\"IonDevice(...)\" if cycle else self.__str__())\n\n    def _value_equality_values_(self) -> Any:\n        return (\n            self._measurement_duration,\n            self._twoq_gates_duration,\n            self._oneq_gates_duration,\n            self.qubits,\n        )\n\n\ndef _verify_unique_measurement_keys(operations: Iterable[ops.Operation]):\n    seen: Set[str] = set()\n    for op in operations:\n        if isinstance(op.gate, ops.MeasurementGate):\n            meas = op.gate\n            key = protocols.measurement_key_name(meas)\n            if key in seen:\n                raise ValueError(f'Measurement key {key} repeated')\n            seen.add(key)\n", "path": "cirq-core/cirq/ion/ion_device.py"}], "after_files": [{"content": "# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom typing import Any, FrozenSet, Iterable, Optional, Set, TYPE_CHECKING\n\nfrom cirq import circuits, value, devices, ops, protocols\nfrom cirq.ion import convert_to_ion_gates\n\nif TYPE_CHECKING:\n    import cirq\n\n\ndef get_ion_gateset() -> ops.Gateset:\n    return ops.Gateset(\n        ops.XXPowGate,\n        ops.MeasurementGate,\n        ops.XPowGate,\n        ops.YPowGate,\n        ops.ZPowGate,\n        ops.PhasedXPowGate,\n        unroll_circuit_op=False,\n        accept_global_phase_op=False,\n    )\n\n\n@value.value_equality\nclass IonDevice(devices.Device):\n    \"\"\"A device with qubits placed on a line.\n\n    Qubits have all-to-all connectivity.\n    \"\"\"\n\n    def __init__(\n        self,\n        measurement_duration: 'cirq.DURATION_LIKE',\n        twoq_gates_duration: 'cirq.DURATION_LIKE',\n        oneq_gates_duration: 'cirq.DURATION_LIKE',\n        qubits: Iterable[devices.LineQubit],\n    ) -> None:\n        \"\"\"Initializes the description of an ion trap device.\n\n        Args:\n            measurement_duration: The maximum duration of a measurement.\n            twoq_gates_duration: The maximum duration of a two qubit operation.\n            oneq_gates_duration: The maximum duration of a single qubit\n            operation.\n            qubits: Qubits on the device, identified by their x location.\n\n        Raises:\n            TypeError: If not all the qubits supplied are `cirq.LineQubit`s.\n        \"\"\"\n        self._measurement_duration = value.Duration(measurement_duration)\n        self._twoq_gates_duration = value.Duration(twoq_gates_duration)\n        self._oneq_gates_duration = value.Duration(oneq_gates_duration)\n        if not all(isinstance(qubit, devices.LineQubit) for qubit in qubits):\n            raise TypeError(\n                \"All qubits were not of type cirq.LineQubit, instead were \"\n                f\"{set(type(qubit) for qubit in qubits)}\"\n            )\n        self.qubits = frozenset(qubits)\n        self.gateset = get_ion_gateset()\n\n    def qubit_set(self) -> FrozenSet['cirq.LineQubit']:\n        return self.qubits\n\n    def qid_pairs(self) -> FrozenSet['cirq.SymmetricalQidPair']:\n        \"\"\"Qubits have all-to-all connectivity, so returns all pairs.\n\n        Returns:\n            All qubit pairs on the device.\n        \"\"\"\n        qs = self.qubits\n        return frozenset([devices.SymmetricalQidPair(q, q2) for q in qs for q2 in qs if q < q2])\n\n    def decompose_operation(self, operation: ops.Operation) -> ops.OP_TREE:\n        return convert_to_ion_gates.ConvertToIonGates().convert_one(operation)\n\n    def decompose_circuit(self, circuit: circuits.Circuit) -> circuits.Circuit:\n        return convert_to_ion_gates.ConvertToIonGates().convert_circuit(circuit)\n\n    def duration_of(self, operation):\n        if isinstance(operation.gate, ops.XXPowGate):\n            return self._twoq_gates_duration\n        if isinstance(\n            operation.gate, (ops.XPowGate, ops.YPowGate, ops.ZPowGate, ops.PhasedXPowGate)\n        ):\n            return self._oneq_gates_duration\n        if isinstance(operation.gate, ops.MeasurementGate):\n            return self._measurement_duration\n        raise ValueError(f'Unsupported gate type: {operation!r}')\n\n    def validate_gate(self, gate: ops.Gate):\n        if gate not in self.gateset:\n            raise ValueError(f'Unsupported gate type: {gate!r}')\n\n    def validate_operation(self, operation):\n        if not isinstance(operation, ops.GateOperation):\n            raise ValueError(f'Unsupported operation: {operation!r}')\n\n        self.validate_gate(operation.gate)\n\n        for q in operation.qubits:\n            if not isinstance(q, devices.LineQubit):\n                raise ValueError(f'Unsupported qubit type: {q!r}')\n            if q not in self.qubits:\n                raise ValueError(f'Qubit not on device: {q!r}')\n\n    def validate_circuit(self, circuit: circuits.AbstractCircuit):\n        super().validate_circuit(circuit)\n        _verify_unique_measurement_keys(circuit.all_operations())\n\n    def at(self, position: int) -> Optional[devices.LineQubit]:\n        \"\"\"Returns the qubit at the given position, if there is one, else None.\"\"\"\n        q = devices.LineQubit(position)\n        return q if q in self.qubits else None\n\n    def neighbors_of(self, qubit: devices.LineQubit) -> Iterable[devices.LineQubit]:\n        \"\"\"Returns the qubits that the given qubit can interact with.\"\"\"\n        possibles = [\n            devices.LineQubit(qubit.x + 1),\n            devices.LineQubit(qubit.x - 1),\n        ]\n        return [e for e in possibles if e in self.qubits]\n\n    def __repr__(self) -> str:\n        return (\n            f'IonDevice(measurement_duration={self._measurement_duration!r}, '\n            f'twoq_gates_duration={self._twoq_gates_duration!r}, '\n            f'oneq_gates_duration={self._oneq_gates_duration!r} '\n            f'qubits={sorted(self.qubits)!r})'\n        )\n\n    def __str__(self) -> str:\n        diagram = circuits.TextDiagramDrawer()\n\n        for q in self.qubits:\n            diagram.write(q.x, 0, str(q))\n            for q2 in self.neighbors_of(q):\n                diagram.grid_line(q.x, 0, q2.x, 0)\n\n        return diagram.render(horizontal_spacing=3, vertical_spacing=2, use_unicode_characters=True)\n\n    def _repr_pretty_(self, p: Any, cycle: bool):\n        \"\"\"iPython (Jupyter) pretty print.\"\"\"\n        p.text(\"IonDevice(...)\" if cycle else self.__str__())\n\n    def _value_equality_values_(self) -> Any:\n        return (\n            self._measurement_duration,\n            self._twoq_gates_duration,\n            self._oneq_gates_duration,\n            self.qubits,\n        )\n\n\ndef _verify_unique_measurement_keys(operations: Iterable[ops.Operation]):\n    seen: Set[str] = set()\n    for op in operations:\n        if isinstance(op.gate, ops.MeasurementGate):\n            meas = op.gate\n            key = protocols.measurement_key_name(meas)\n            if key in seen:\n                raise ValueError(f'Measurement key {key} repeated')\n            seen.add(key)\n", "path": "cirq-core/cirq/ion/ion_device.py"}]}