iqm-client 29.10.0__tar.gz → 29.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {iqm_client-29.10.0 → iqm_client-29.12.0}/CHANGELOG.rst +16 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/PKG-INFO +3 -3
- iqm_client-29.12.0/requirements/qiskit.in +2 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/requirements/qiskit.txt +2 -2
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/iqm_client.py +31 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/models.py +14 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_backend.py +26 -7
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_naive_move_pass.py +20 -4
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_transpilation.py +16 -5
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm_client.egg-info/PKG-INFO +3 -3
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm_client.egg-info/requires.txt +2 -2
- iqm_client-29.12.0/version.txt +1 -0
- iqm_client-29.10.0/requirements/qiskit.in +0 -2
- iqm_client-29.10.0/version.txt +0 -1
- {iqm_client-29.10.0 → iqm_client-29.12.0}/AUTHORS.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/CHANGELOG_cirq-iqm.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/CHANGELOG_cortex-cli.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/CHANGELOG_qiskit-iqm.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/INTEGRATION_GUIDE.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/LICENSE.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/MANIFEST.in +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/README.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docbuild +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/API.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/_static/images/favicon.ico +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/_static/images/logo.png +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/_templates/autosummary-class-template.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/_templates/autosummary-module-template.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/authors.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/changelog.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/conf.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/index.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/integration_guide.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/license.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/readme.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/user_guide_cirq.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/user_guide_cli.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/docs/user_guide_qiskit.rst +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/pyproject.toml +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/requirements/base.in +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/requirements/base.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/requirements/cirq.in +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/requirements/cirq.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/requirements/cli.in +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/requirements/cli.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/setup.cfg +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/setup.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/devices/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/devices/adonis.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/devices/aphrodite.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/devices/apollo.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/devices/iqm_device.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/devices/iqm_device_metadata.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/examples/demo_adonis.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/examples/demo_apollo.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/examples/demo_common.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/examples/demo_iqm_execution.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/examples/usage.ipynb +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/extended_qasm_parser.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/iqm_gates.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/iqm_sampler.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/optimizers.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/py.typed +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/serialize.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/cirq_iqm/transpiler.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/api.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/authentication.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/cli/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/cli/auth.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/cli/cli.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/cli/models.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/cli/token_manager.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/errors.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/py.typed +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/transpile.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/util.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/iqm_client/validation.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/examples/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/examples/bell_measure.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/examples/resonance_example.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/examples/transpile_example.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/fake_adonis.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/fake_aphrodite.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/fake_apollo.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/fake_deneb.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/fake_garnet.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/iqm_fake_backend.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_circuit.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_circuit_validation.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_job.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_move_layout.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/iqm_provider.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/move_gate.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/py.typed +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/qiskit_to_iqm.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/transpiler_plugins.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm_client.egg-info/SOURCES.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm_client.egg-info/dependency_links.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm_client.egg-info/entry_points.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm_client.egg-info/top_level.txt +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/test +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/tests/__init__.py +0 -0
- {iqm_client-29.10.0 → iqm_client-29.12.0}/tests/conftest.py +0 -0
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
Changelog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
Version 29.12.0 (2025-08-08)
|
|
6
|
+
============================
|
|
7
|
+
|
|
8
|
+
Features
|
|
9
|
+
--------
|
|
10
|
+
|
|
11
|
+
- Minimal changes needed to support Qiskit version 1.3 and version 1.4. :issue:`SW-944`.
|
|
12
|
+
|
|
13
|
+
Version 29.11.0 (2025-08-07)
|
|
14
|
+
============================
|
|
15
|
+
|
|
16
|
+
Features
|
|
17
|
+
--------
|
|
18
|
+
|
|
19
|
+
- Added :meth:`IQMClient.get_structured_metrics` for obtaining quality metric information.
|
|
20
|
+
|
|
5
21
|
Version 29.10.0 (2025-07-31)
|
|
6
22
|
============================
|
|
7
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: iqm-client
|
|
3
|
-
Version: 29.
|
|
3
|
+
Version: 29.12.0
|
|
4
4
|
Summary: Client library for accessing an IQM quantum computer
|
|
5
5
|
Author-email: IQM Finland Oy <developers@meetiqm.com>
|
|
6
6
|
License: Apache License
|
|
@@ -238,8 +238,8 @@ Requires-Dist: python-daemon>=2.3.0; extra == "cli"
|
|
|
238
238
|
Provides-Extra: qiskit
|
|
239
239
|
Requires-Dist: iqm-station-control-client<10,>=9; extra == "qiskit"
|
|
240
240
|
Requires-Dist: iqm-exa-common<27,>=26; extra == "qiskit"
|
|
241
|
-
Requires-Dist: qiskit
|
|
242
|
-
Requires-Dist: qiskit-aer<0.
|
|
241
|
+
Requires-Dist: qiskit<=1.4.2,>=1.0; extra == "qiskit"
|
|
242
|
+
Requires-Dist: qiskit-aer<0.18,>=0.13.1; extra == "qiskit"
|
|
243
243
|
|
|
244
244
|
IQM Client
|
|
245
245
|
###########
|
|
@@ -65,6 +65,7 @@ import requests
|
|
|
65
65
|
from requests import HTTPError
|
|
66
66
|
|
|
67
67
|
from iqm.station_control.client.iqm_server.iqm_server_client import IqmServerClient
|
|
68
|
+
from iqm.station_control.client.qon import ObservationFinder
|
|
68
69
|
from iqm.station_control.client.utils import init_station_control
|
|
69
70
|
from iqm.station_control.interface.models import ObservationLite
|
|
70
71
|
from iqm.station_control.interface.station_control import StationControlInterface
|
|
@@ -907,3 +908,33 @@ class IQMClient:
|
|
|
907
908
|
except json.decoder.JSONDecodeError as e:
|
|
908
909
|
raise EndpointRequestError(f"Invalid response: {response.text}, {e!r}") from e
|
|
909
910
|
return model
|
|
911
|
+
|
|
912
|
+
def get_structured_metrics(self, calibration_set_id: UUID | None = None) -> ObservationFinder:
|
|
913
|
+
"""Retrieve the given calibration set and related quality metrics from the server.
|
|
914
|
+
|
|
915
|
+
Args:
|
|
916
|
+
calibration_set_id: ID of the calibration set to retrieve.
|
|
917
|
+
If ``None``, the current default calibration set is retrieved.
|
|
918
|
+
|
|
919
|
+
Returns:
|
|
920
|
+
Requested calibration set and related quality metrics in a searchable structure.
|
|
921
|
+
|
|
922
|
+
Raises:
|
|
923
|
+
EndpointRequestError: did not understand the endpoint response
|
|
924
|
+
ClientAuthenticationError: no valid authentication provided
|
|
925
|
+
HTTPException: HTTP exceptions
|
|
926
|
+
|
|
927
|
+
"""
|
|
928
|
+
if isinstance(self._station_control, IqmServerClient):
|
|
929
|
+
raise ValueError("The get_structured_metrics method is not supported by IqmServerClient.")
|
|
930
|
+
|
|
931
|
+
if not calibration_set_id:
|
|
932
|
+
# find out the default calset id
|
|
933
|
+
default_calset = self._station_control.get_default_calibration_set()
|
|
934
|
+
calibration_set_id = default_calset.observation_set_id
|
|
935
|
+
|
|
936
|
+
calset_obs = self._station_control.get_observation_set_observations(calibration_set_id)
|
|
937
|
+
quality_metrics = self._station_control.get_calibration_set_quality_metrics(calibration_set_id)
|
|
938
|
+
qm_obs = quality_metrics.observations
|
|
939
|
+
|
|
940
|
+
return ObservationFinder(list(calset_obs) + qm_obs)
|
|
@@ -714,6 +714,20 @@ class GateInfo(BaseModel):
|
|
|
714
714
|
loci_sorted = sorted(loci_set, key=lambda locus: tuple(map(_component_sort_key, locus)))
|
|
715
715
|
return tuple(loci_sorted)
|
|
716
716
|
|
|
717
|
+
def get_default_implementation(self, locus: Locus) -> str:
|
|
718
|
+
"""Default implementation of this gate for the given locus.
|
|
719
|
+
|
|
720
|
+
Args:
|
|
721
|
+
locus: gate locus
|
|
722
|
+
|
|
723
|
+
Returns:
|
|
724
|
+
Name of the default implementation of this gate for ``locus``.
|
|
725
|
+
|
|
726
|
+
"""
|
|
727
|
+
if (impl := self.override_default_implementation.get(locus)) is not None:
|
|
728
|
+
return impl
|
|
729
|
+
return self.default_implementation
|
|
730
|
+
|
|
717
731
|
|
|
718
732
|
class DynamicQuantumArchitecture(BaseModel):
|
|
719
733
|
"""Dynamic quantum architecture as returned by server.
|
|
@@ -58,9 +58,11 @@ class IQMBackendBase(BackendV2, ABC):
|
|
|
58
58
|
# qubits, or else transpiling with optimization_level=0 will fail because of lacking resonator indices.
|
|
59
59
|
qb_to_idx = {qb: idx for idx, qb in enumerate(architecture.qubits + architecture.computational_resonators)}
|
|
60
60
|
|
|
61
|
-
self._target = IQMTarget(architecture, qb_to_idx, include_resonators=False)
|
|
61
|
+
self._target = IQMTarget(architecture, component_to_idx=qb_to_idx, include_resonators=False)
|
|
62
62
|
self._fake_target_with_moves = (
|
|
63
|
-
IQMTarget(architecture, qb_to_idx, include_resonators=True)
|
|
63
|
+
IQMTarget(architecture, component_to_idx=qb_to_idx, include_resonators=True)
|
|
64
|
+
if "move" in architecture.gates
|
|
65
|
+
else None
|
|
64
66
|
)
|
|
65
67
|
self._qb_to_idx = qb_to_idx
|
|
66
68
|
self._idx_to_qb = {v: k for k, v in qb_to_idx.items()}
|
|
@@ -135,7 +137,10 @@ class IQMBackendBase(BackendV2, ABC):
|
|
|
135
137
|
return "iqm_default_scheduling"
|
|
136
138
|
|
|
137
139
|
def restrict_to_qubits(
|
|
138
|
-
self,
|
|
140
|
+
self,
|
|
141
|
+
qubits: list[int] | list[str],
|
|
142
|
+
include_resonators: bool = False,
|
|
143
|
+
include_fake_czs: bool = True,
|
|
139
144
|
) -> IQMTarget:
|
|
140
145
|
"""Generated a restricted transpilation target from this backend that only contains the given qubits.
|
|
141
146
|
|
|
@@ -153,7 +158,10 @@ class IQMBackendBase(BackendV2, ABC):
|
|
|
153
158
|
|
|
154
159
|
|
|
155
160
|
def _restrict_dqa_to_qubits(
|
|
156
|
-
architecture: DynamicQuantumArchitecture,
|
|
161
|
+
architecture: DynamicQuantumArchitecture,
|
|
162
|
+
qubits: list[str],
|
|
163
|
+
include_resonators: bool,
|
|
164
|
+
include_fake_czs: bool = True,
|
|
157
165
|
) -> IQMTarget:
|
|
158
166
|
"""Generated a restricted transpilation target from this backend that only contains the given qubits.
|
|
159
167
|
|
|
@@ -170,7 +178,10 @@ def _restrict_dqa_to_qubits(
|
|
|
170
178
|
new_gates = {}
|
|
171
179
|
for gate_name, gate_info in architecture.gates.items():
|
|
172
180
|
new_implementations = {}
|
|
173
|
-
for
|
|
181
|
+
for (
|
|
182
|
+
implementation_name,
|
|
183
|
+
implementation_info,
|
|
184
|
+
) in gate_info.implementations.items():
|
|
174
185
|
new_loci = tuple(locus for locus in implementation_info.loci if all(q in qubits for q in locus))
|
|
175
186
|
if new_loci:
|
|
176
187
|
new_implementations[implementation_name] = GateImplementationInfo(loci=new_loci)
|
|
@@ -186,7 +197,12 @@ def _restrict_dqa_to_qubits(
|
|
|
186
197
|
computational_resonators=[q for q in qubits if q in architecture.computational_resonators],
|
|
187
198
|
gates=new_gates,
|
|
188
199
|
)
|
|
189
|
-
return IQMTarget(
|
|
200
|
+
return IQMTarget(
|
|
201
|
+
new_arch,
|
|
202
|
+
component_to_idx={name: idx for idx, name in enumerate(qubits)},
|
|
203
|
+
include_resonators=include_resonators,
|
|
204
|
+
include_fake_czs=include_fake_czs,
|
|
205
|
+
)
|
|
190
206
|
|
|
191
207
|
|
|
192
208
|
class IQMTarget(Target):
|
|
@@ -322,5 +338,8 @@ class IQMTarget(Target):
|
|
|
322
338
|
"""
|
|
323
339
|
qubits_str = [self.iqm_idx_to_component[q] if isinstance(q, int) else str(q) for q in qubits]
|
|
324
340
|
return _restrict_dqa_to_qubits(
|
|
325
|
-
self.iqm_dqa,
|
|
341
|
+
self.iqm_dqa,
|
|
342
|
+
qubits_str,
|
|
343
|
+
self.iqm_includes_resonators,
|
|
344
|
+
self.iqm_includes_fake_czs,
|
|
326
345
|
)
|
|
@@ -103,7 +103,9 @@ class IQMNaiveResonatorMoving(TransformationPass):
|
|
|
103
103
|
)
|
|
104
104
|
try:
|
|
105
105
|
routed_iqm_circuit = transpile_insert_moves(
|
|
106
|
-
iqm_circuit,
|
|
106
|
+
iqm_circuit,
|
|
107
|
+
self.architecture,
|
|
108
|
+
existing_moves=self.existing_moves_handling,
|
|
107
109
|
)
|
|
108
110
|
routed_circuit = deserialize_instructions(
|
|
109
111
|
list(routed_iqm_circuit.instructions), self.component_to_idx, layout
|
|
@@ -121,7 +123,11 @@ class IQMNaiveResonatorMoving(TransformationPass):
|
|
|
121
123
|
|
|
122
124
|
# Create the new DAG and make sure that the qubits are properly ordered.
|
|
123
125
|
ordered_qubits = [layout.get_physical_bits()[i] for i in range(len(layout.get_physical_bits()))]
|
|
124
|
-
new_dag = circuit_to_dag(
|
|
126
|
+
new_dag = circuit_to_dag(
|
|
127
|
+
routed_circuit,
|
|
128
|
+
qubit_order=ordered_qubits,
|
|
129
|
+
clbit_order=routed_circuit.clbits,
|
|
130
|
+
)
|
|
125
131
|
|
|
126
132
|
# Reinsert the symbolic parameters.
|
|
127
133
|
for node in new_dag.topological_op_nodes():
|
|
@@ -208,6 +214,11 @@ def transpile_to_IQM( # noqa: PLR0913
|
|
|
208
214
|
|
|
209
215
|
Works with both the Crystal and Star architectures.
|
|
210
216
|
|
|
217
|
+
Note: When transpiling a circuit with MOVE gates, you might need to set the `optimization_level` lower.
|
|
218
|
+
If the `optimization_level` is set too high, the transpiler might add single qubit gates onto the resonator,
|
|
219
|
+
which is not supported by the IQM Star architectures. If this in undesired, it is best to have the transpiler
|
|
220
|
+
add the MOVE gates automatically, rather than manually adding them to the circuit.
|
|
221
|
+
|
|
211
222
|
Args:
|
|
212
223
|
circuit: The circuit to be transpiled without MOVE gates.
|
|
213
224
|
backend: The target backend to compile to. Does not require a resonator.
|
|
@@ -233,7 +244,7 @@ def transpile_to_IQM( # noqa: PLR0913
|
|
|
233
244
|
restrict_to_qubits = [backend.qubit_name_to_index(q) if isinstance(q, str) else q for q in restrict_to_qubits]
|
|
234
245
|
|
|
235
246
|
if target is None:
|
|
236
|
-
if circuit.count_ops().get("move", 0) > 0:
|
|
247
|
+
if circuit.count_ops().get("move", 0) > 0 or circuit.num_qubits > backend.num_qubits:
|
|
237
248
|
target = backend.target_with_resonators
|
|
238
249
|
# Create a sensible initial layout if none is provided
|
|
239
250
|
if initial_layout is None:
|
|
@@ -263,5 +274,10 @@ def transpile_to_IQM( # noqa: PLR0913
|
|
|
263
274
|
+ "`ignore_barriers`, and `existing_moves_handling` arguments."
|
|
264
275
|
)
|
|
265
276
|
qiskit_transpiler_kwargs["scheduling_method"] = scheduling_method
|
|
266
|
-
new_circuit = transpile(
|
|
277
|
+
new_circuit = transpile(
|
|
278
|
+
circuit,
|
|
279
|
+
target=target,
|
|
280
|
+
initial_layout=initial_layout,
|
|
281
|
+
**qiskit_transpiler_kwargs,
|
|
282
|
+
)
|
|
267
283
|
return new_circuit
|
|
@@ -22,7 +22,11 @@ from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary
|
|
|
22
22
|
from qiskit.circuit.library import RGate, UnitaryGate
|
|
23
23
|
from qiskit.dagcircuit import DAGCircuit
|
|
24
24
|
from qiskit.transpiler.basepasses import TransformationPass
|
|
25
|
-
from qiskit.transpiler.passes import
|
|
25
|
+
from qiskit.transpiler.passes import (
|
|
26
|
+
BasisTranslator,
|
|
27
|
+
Optimize1qGatesDecomposition,
|
|
28
|
+
RemoveBarriers,
|
|
29
|
+
)
|
|
26
30
|
from qiskit.transpiler.passmanager import PassManager
|
|
27
31
|
|
|
28
32
|
TOLERANCE = 1e-10 # The tolerance for equivalence checking against zero.
|
|
@@ -73,12 +77,16 @@ class IQMOptimizeSingleQubitGates(TransformationPass):
|
|
|
73
77
|
for node in dag.topological_op_nodes():
|
|
74
78
|
if node.name == "u":
|
|
75
79
|
# convert into PRX + RZ
|
|
76
|
-
qubit_index = dag.find_bit(node.qargs[0])
|
|
80
|
+
qubit_index = dag.find_bit(node.qargs[0]).index
|
|
77
81
|
if isinstance(node.op.params[0], float) and math.isclose(node.op.params[0], 0, abs_tol=TOLERANCE):
|
|
78
82
|
dag.remove_op_node(node)
|
|
79
83
|
else:
|
|
80
84
|
dag.substitute_node(
|
|
81
|
-
node,
|
|
85
|
+
node,
|
|
86
|
+
RGate(
|
|
87
|
+
node.op.params[0],
|
|
88
|
+
np.pi / 2 - node.op.params[2] - rz_angles[qubit_index],
|
|
89
|
+
),
|
|
82
90
|
)
|
|
83
91
|
phase = node.op.params[1] + node.op.params[2]
|
|
84
92
|
dag.global_phase += phase / 2
|
|
@@ -89,7 +97,7 @@ class IQMOptimizeSingleQubitGates(TransformationPass):
|
|
|
89
97
|
# are arbitrary so we could set rz_angles to any values here, but zeroing the
|
|
90
98
|
# angles results in fewest changes to the circuit.
|
|
91
99
|
for qubit in node.qargs:
|
|
92
|
-
rz_angles[dag.find_bit(qubit)
|
|
100
|
+
rz_angles[dag.find_bit(qubit).index] = 0
|
|
93
101
|
elif node.name == "barrier":
|
|
94
102
|
# TODO barriers are meant to restrict circuit optimization, so strictly speaking
|
|
95
103
|
# we should output any accumulated ``rz_angles`` here as explicit z rotations (like
|
|
@@ -100,7 +108,10 @@ class IQMOptimizeSingleQubitGates(TransformationPass):
|
|
|
100
108
|
pass
|
|
101
109
|
elif node.name == "move":
|
|
102
110
|
# acts like iSWAP with RZ, moving it to the other component
|
|
103
|
-
qb, res =
|
|
111
|
+
qb, res = (
|
|
112
|
+
dag.find_bit(node.qargs[0]).index,
|
|
113
|
+
dag.find_bit(node.qargs[1]).index,
|
|
114
|
+
)
|
|
104
115
|
rz_angles[res], rz_angles[qb] = rz_angles[qb], rz_angles[res]
|
|
105
116
|
elif node.name in {"cz", "delay"}:
|
|
106
117
|
pass # commutes with RZ gates
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: iqm-client
|
|
3
|
-
Version: 29.
|
|
3
|
+
Version: 29.12.0
|
|
4
4
|
Summary: Client library for accessing an IQM quantum computer
|
|
5
5
|
Author-email: IQM Finland Oy <developers@meetiqm.com>
|
|
6
6
|
License: Apache License
|
|
@@ -238,8 +238,8 @@ Requires-Dist: python-daemon>=2.3.0; extra == "cli"
|
|
|
238
238
|
Provides-Extra: qiskit
|
|
239
239
|
Requires-Dist: iqm-station-control-client<10,>=9; extra == "qiskit"
|
|
240
240
|
Requires-Dist: iqm-exa-common<27,>=26; extra == "qiskit"
|
|
241
|
-
Requires-Dist: qiskit
|
|
242
|
-
Requires-Dist: qiskit-aer<0.
|
|
241
|
+
Requires-Dist: qiskit<=1.4.2,>=1.0; extra == "qiskit"
|
|
242
|
+
Requires-Dist: qiskit-aer<0.18,>=0.13.1; extra == "qiskit"
|
|
243
243
|
|
|
244
244
|
IQM Client
|
|
245
245
|
###########
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
29.12.0
|
iqm_client-29.10.0/version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
29.10.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/fake_aphrodite.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iqm_client-29.10.0 → iqm_client-29.12.0}/src/iqm/qiskit_iqm/fake_backends/iqm_fake_backend.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|