Skip to content

Commit

Permalink
Remove deprecated qubits in contrib graphdevice. (#5582)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBroughton authored Jun 23, 2022
1 parent 2adb34f commit eb2a1dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 2 additions & 6 deletions cirq-core/cirq/contrib/graph_device/graph_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import abc
import itertools

from typing import Iterable, Optional, FrozenSet, TYPE_CHECKING, Tuple, cast
from typing import Iterable, Optional, TYPE_CHECKING, Tuple, cast

from cirq import _compat, devices, ops, value
from cirq import devices, ops, value

from cirq.contrib.graph_device.hypergraph import UndirectedHypergraph

Expand Down Expand Up @@ -155,10 +155,6 @@ def __init__(
def qubits(self) -> Tuple['cirq.Qid', ...]:
return cast(Tuple['cirq.Qid', ...], tuple(sorted(self.device_graph.vertices)))

@_compat.deprecated(fix='Please use UndirectedGraphDevice.qubits', deadline='v0.15')
def qubit_set(self) -> FrozenSet['cirq.Qid']:
return frozenset(self.qubits)

@property
def edges(self):
return tuple(sorted(self.device_graph.edges))
Expand Down
8 changes: 0 additions & 8 deletions cirq-core/cirq/contrib/graph_device/graph_device_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,3 @@ def test_graph_device_copy_and_add():
device_copy += device_addend
assert device != device_copy
assert device_copy == device_sum


def test_qubit_set_deprecated():
a, b, c, d = cirq.LineQubit.range(4)
device_graph = ccgd.UndirectedHypergraph(labelled_edges={(a, b): None, (c, d): None})
device = ccgd.UndirectedGraphDevice(device_graph=device_graph)
with cirq.testing.assert_deprecated('qubit_set', deadline='v0.15'):
assert device.qubit_set() == {a, b, c, d}

0 comments on commit eb2a1dc

Please sign in to comment.