Skip to content

Commit

Permalink
cirq-rigetti - sync with new API for checking device family in qcs-sd…
Browse files Browse the repository at this point in the history
…k-python

Ref: rigetti/qcs-sdk-rust#463 in isa.pyi
  • Loading branch information
pavoljuhas committed Sep 18, 2024
1 parent d74e0dc commit dd395fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cirq-rigetti/cirq_rigetti/aspen_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, isa: Union[InstructionSetArchitecture, Dict[str, Any]]) -> No
else:
self.isa = InstructionSetArchitecture.from_raw(json.dumps(isa))

if self.isa.architecture.family != Family.Aspen:
if not Family.is_aspen(self.isa.architecture.family):
raise UnsupportedRigettiQCSQuantumProcessor(
'this integration currently only supports Aspen devices, '
f'but client provided a {self.isa.architecture.family} device'
Expand Down
6 changes: 3 additions & 3 deletions cirq-rigetti/cirq_rigetti/aspen_device_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ def test_rigetti_qcs_aspen_device_repr(qcs_aspen8_isa: InstructionSetArchitectur
def test_rigetti_qcs_aspen_device_family_validation(qcs_aspen8_isa: InstructionSetArchitecture):
"""test RigettiQCSAspenDevice validates architecture family on initialization"""
non_aspen_isa = InstructionSetArchitecture.from_raw(qcs_aspen8_isa.json())
non_aspen_isa.architecture.family = Family.NONE
non_aspen_isa.architecture.family = Family.new_none()

assert (
non_aspen_isa.architecture.family == Family.Aspen
assert Family.is_aspen(
non_aspen_isa.architecture.family
), 'ISA family is read-only and should still be Aspen'


Expand Down

0 comments on commit dd395fb

Please sign in to comment.