Skip to content

Commit

Permalink
Update iqm-client to 17.1+ to support new architecture (#128)
Browse files Browse the repository at this point in the history
* Update iqm-client to 17.1+ to support new architecture

* Update phased rx name to the new standard

* Update CHANGELOG.rst

---------

Co-authored-by: Tuukka Haapasalo <[email protected]>
Co-authored-by: Rakhim Davletkaliyev <[email protected]>
  • Loading branch information
3 people authored Mar 21, 2024
1 parent fc86af9 commit 40c4298
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
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

0 comments on commit 40c4298

Please sign in to comment.