Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iqm-client to 17.1+ to support new architecture #128

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

Version 14.0
============

* Require iqm-client >= 17.1. `#128 <https://github.com/iqm-finland/cirq-on-iqm/pull/128>`_

Version 13.2
============

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
"numpy",
"cirq-core[contrib] ~= 1.2",
"ply", # Required by cirq.contrib.qasm_import
"iqm-client >= 16.0, < 17.0"
"iqm-client >= 17.1, < 18.0"
]

[project.urls]
Expand Down
2 changes: 2 additions & 0 deletions src/iqm/cirq_iqm/devices/iqm_device_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
_IQM_CIRQ_OP_MAP: dict[str, tuple[Union[type[cirq.Gate], cirq.Gate, cirq.GateFamily], ...]] = {
# XPow and YPow kept for convenience, Cirq does not know how to decompose them into PhasedX
# so we would have to add those rules...
'prx': (cirq.ops.PhasedXPowGate, cirq.ops.XPowGate, cirq.ops.YPowGate),
'phased_rx': (cirq.ops.PhasedXPowGate, cirq.ops.XPowGate, cirq.ops.YPowGate),
'cz': (cirq.ops.CZ,),
'measurement': (cirq.ops.MeasurementGate,),
'measure': (cirq.ops.MeasurementGate,),
'barrier': (),
}

Expand Down
2 changes: 1 addition & 1 deletion src/iqm/cirq_iqm/iqm_operation_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def map_operation(operation: Operation) -> Instruction:
OperationNotSupportedError When the circuit contains an unsupported operation.

"""
phased_rx_name = 'phased_rx'
phased_rx_name = 'prx'
qubits = [str(qubit) for qubit in operation.qubits]
if isinstance(operation.gate, PhasedXPowGate):
return Instruction(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_iqm_device_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_device_metadata_from_architecture():
qa = {
'name': 'Valkmusa',
'operations': [
'phased_rx',
'prx',
'measurement',
],
'qubits': ['QB1', 'QB2'],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_iqm_operation_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_maps_measurement_gate(qubit_1):
def test_maps_to_phased_rx(qubit_1, gate, expected_angle, expected_phase):
operation = GateOperation(gate, [qubit_1])
mapped = map_operation(operation)
assert mapped.name == 'phased_rx'
assert mapped.name == 'prx'
assert mapped.qubits == (str(qubit_1),)

# The unit for angle and phase is full turns
Expand Down