Skip to content

Commit

Permalink
Fix Rigetti check for Aspen family device kind (quantumlib#6734)
Browse files Browse the repository at this point in the history
* Sync with new API for checking device family in qcs-sdk-python,
  Ref: rigetti/qcs-sdk-rust#463 in isa.pyi

* Require qcs-sdk-python-0.20.1 which introduced the new family API

Fixes quantumlib#6732
  • Loading branch information
pavoljuhas authored and mhucka committed Sep 19, 2024
1 parent f77e4a0 commit 73278b4
Show file tree
Hide file tree
Showing 3 changed files with 7 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
3 changes: 3 additions & 0 deletions cirq-rigetti/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
pyquil>=4.11.0,<5.0.0

# TODO - remove once pyquil requires qcs-sdk-python >= 0.20.1
qcs-sdk-python>=0.20.1

0 comments on commit 73278b4

Please sign in to comment.