Skip to content

Commit 041413c

Browse files
Remove PasqalConverter deprecation. (#5672)
* Remove PasqalConverter deprecation. * lint. Co-authored-by: Dave Bacon <[email protected]>
1 parent 2657c53 commit 041413c

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
lines changed

cirq-pasqal/cirq_pasqal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from cirq_pasqal.pasqal_gateset import PasqalGateset
2222

23-
from cirq_pasqal.pasqal_device import PasqalDevice, PasqalVirtualDevice, PasqalConverter
23+
from cirq_pasqal.pasqal_device import PasqalDevice, PasqalVirtualDevice
2424

2525
from cirq_pasqal.pasqal_noise_model import PasqalNoiseModel
2626

cirq-pasqal/cirq_pasqal/json_test_data/spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
packages=[cirq_pasqal],
3131
test_data_path=pathlib.Path(__file__).parent,
3232
not_yet_serializable=[],
33-
should_not_be_serialized=["PasqalConverter", "PasqalNoiseModel", "PasqalSampler"],
33+
should_not_be_serialized=["PasqalNoiseModel", "PasqalSampler"],
3434
resolver_cache=_class_resolver_dictionary(),
3535
deprecated={},
3636
)

cirq-pasqal/cirq_pasqal/pasqal_device.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from typing import Callable, List, Sequence, Any, Union, Dict
14+
from typing import Sequence, Any, Union, Dict
1515
import numpy as np
1616
import networkx as nx
1717

1818
import cirq
19-
from cirq import _compat, GridQubit, LineQubit
19+
from cirq import GridQubit, LineQubit
2020
from cirq.ops import NamedQubit
2121
from cirq_pasqal import ThreeDQubit, TwoDQubit, PasqalGateset
2222

@@ -286,32 +286,3 @@ def _value_equality_values_(self) -> Any:
286286

287287
def _json_dict_(self) -> Dict[str, Any]:
288288
return cirq.protocols.obj_to_dict_helper(self, ['control_radius', 'qubits'])
289-
290-
291-
@_compat.deprecated_class(
292-
deadline='v0.16', fix='Use cirq.optimize_for_target_gateset(circuit, gateset=PasqalGateset()).'
293-
)
294-
class PasqalConverter(cirq.neutral_atoms.ConvertToNeutralAtomGates):
295-
"""A gate converter for compatibility with Pasqal processors.
296-
297-
Modified version of ConvertToNeutralAtomGates, where a new 'convert' method
298-
'pasqal_convert' takes the 'keep' function as an input.
299-
"""
300-
301-
def pasqal_convert(
302-
self, op: cirq.Operation, keep: Callable[[cirq.Operation], bool]
303-
) -> List[cirq.Operation]:
304-
def on_stuck_raise(bad):
305-
return TypeError(
306-
"Don't know how to work with {!r}. "
307-
"It isn't a native PasqalDevice operation, "
308-
"a 1 or 2 qubit gate with a known unitary, "
309-
"or composite.".format(bad)
310-
)
311-
312-
return cirq.protocols.decompose(
313-
op,
314-
keep=keep,
315-
intercepting_decomposer=self._convert_one,
316-
on_stuck_raise=None if self.ignore_failures else on_stuck_raise,
317-
)

0 commit comments

Comments
 (0)