iqm-client 25.2.0__tar.gz → 25.4.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.
Files changed (106) hide show
  1. {iqm_client-25.2.0 → iqm_client-25.4.0}/CHANGELOG.rst +16 -0
  2. {iqm_client-25.2.0/src/iqm_client.egg-info → iqm_client-25.4.0}/PKG-INFO +1 -1
  3. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/authentication.py +2 -1
  4. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/iqm_client.py +50 -78
  5. {iqm_client-25.2.0 → iqm_client-25.4.0/src/iqm_client.egg-info}/PKG-INFO +1 -1
  6. iqm_client-25.4.0/version.txt +1 -0
  7. iqm_client-25.2.0/version.txt +0 -1
  8. {iqm_client-25.2.0 → iqm_client-25.4.0}/AUTHORS.rst +0 -0
  9. {iqm_client-25.2.0 → iqm_client-25.4.0}/CHANGELOG_cirq-iqm.rst +0 -0
  10. {iqm_client-25.2.0 → iqm_client-25.4.0}/CHANGELOG_cortex-cli.rst +0 -0
  11. {iqm_client-25.2.0 → iqm_client-25.4.0}/CHANGELOG_qiskit-iqm.rst +0 -0
  12. {iqm_client-25.2.0 → iqm_client-25.4.0}/INTEGRATION_GUIDE.rst +0 -0
  13. {iqm_client-25.2.0 → iqm_client-25.4.0}/LICENSE.txt +0 -0
  14. {iqm_client-25.2.0 → iqm_client-25.4.0}/MANIFEST.in +0 -0
  15. {iqm_client-25.2.0 → iqm_client-25.4.0}/README.rst +0 -0
  16. {iqm_client-25.2.0 → iqm_client-25.4.0}/docbuild +0 -0
  17. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/API.rst +0 -0
  18. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/_static/images/favicon.ico +0 -0
  19. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/_static/images/logo.png +0 -0
  20. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/_templates/autosummary-class-template.rst +0 -0
  21. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/_templates/autosummary-module-template.rst +0 -0
  22. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/authors.rst +0 -0
  23. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/changelog.rst +0 -0
  24. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/conf.py +0 -0
  25. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/index.rst +0 -0
  26. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/integration_guide.rst +0 -0
  27. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/license.rst +0 -0
  28. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/readme.rst +0 -0
  29. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/user_guide_cirq.rst +0 -0
  30. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/user_guide_cli.rst +0 -0
  31. {iqm_client-25.2.0 → iqm_client-25.4.0}/docs/user_guide_qiskit.rst +0 -0
  32. {iqm_client-25.2.0 → iqm_client-25.4.0}/pyproject.toml +0 -0
  33. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/base.in +0 -0
  34. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/base.txt +0 -0
  35. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/cirq.in +0 -0
  36. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/cirq.txt +0 -0
  37. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/cli.in +0 -0
  38. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/cli.txt +0 -0
  39. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/qiskit.in +0 -0
  40. {iqm_client-25.2.0 → iqm_client-25.4.0}/requirements/qiskit.txt +0 -0
  41. {iqm_client-25.2.0 → iqm_client-25.4.0}/setup.cfg +0 -0
  42. {iqm_client-25.2.0 → iqm_client-25.4.0}/setup.py +0 -0
  43. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/__init__.py +0 -0
  44. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/devices/__init__.py +0 -0
  45. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/devices/adonis.py +0 -0
  46. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/devices/aphrodite.py +0 -0
  47. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/devices/apollo.py +0 -0
  48. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/devices/iqm_device.py +0 -0
  49. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/devices/iqm_device_metadata.py +0 -0
  50. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/examples/demo_adonis.py +0 -0
  51. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/examples/demo_apollo.py +0 -0
  52. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/examples/demo_common.py +0 -0
  53. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/examples/demo_iqm_execution.py +0 -0
  54. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/examples/usage.ipynb +0 -0
  55. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/extended_qasm_parser.py +0 -0
  56. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/iqm_gates.py +0 -0
  57. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/iqm_sampler.py +0 -0
  58. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/optimizers.py +0 -0
  59. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/py.typed +0 -0
  60. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/serialize.py +0 -0
  61. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/cirq_iqm/transpiler.py +0 -0
  62. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/__init__.py +0 -0
  63. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/api.py +0 -0
  64. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/cli/__init__.py +0 -0
  65. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/cli/auth.py +0 -0
  66. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/cli/cli.py +0 -0
  67. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/cli/models.py +0 -0
  68. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/cli/py.typed +0 -0
  69. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/cli/token_manager.py +0 -0
  70. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/errors.py +0 -0
  71. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/models.py +0 -0
  72. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/py.typed +0 -0
  73. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/transpile.py +0 -0
  74. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/iqm_client/util.py +0 -0
  75. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/__init__.py +0 -0
  76. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/examples/__init__.py +0 -0
  77. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/examples/bell_measure.py +0 -0
  78. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/examples/resonance_example.py +0 -0
  79. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/examples/transpile_example.py +0 -0
  80. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/fake_backends/__init__.py +0 -0
  81. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/fake_backends/fake_adonis.py +0 -0
  82. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/fake_backends/fake_aphrodite.py +0 -0
  83. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/fake_backends/fake_apollo.py +0 -0
  84. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/fake_backends/fake_deneb.py +0 -0
  85. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/fake_backends/fake_garnet.py +0 -0
  86. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/fake_backends/iqm_fake_backend.py +0 -0
  87. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_backend.py +0 -0
  88. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_circuit.py +0 -0
  89. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_circuit_validation.py +0 -0
  90. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_job.py +0 -0
  91. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_move_layout.py +0 -0
  92. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_naive_move_pass.py +0 -0
  93. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_provider.py +0 -0
  94. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/iqm_transpilation.py +0 -0
  95. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/move_gate.py +0 -0
  96. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/py.typed +0 -0
  97. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/qiskit_to_iqm.py +0 -0
  98. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm/qiskit_iqm/transpiler_plugins.py +0 -0
  99. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm_client.egg-info/SOURCES.txt +0 -0
  100. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm_client.egg-info/dependency_links.txt +0 -0
  101. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm_client.egg-info/entry_points.txt +0 -0
  102. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm_client.egg-info/requires.txt +0 -0
  103. {iqm_client-25.2.0 → iqm_client-25.4.0}/src/iqm_client.egg-info/top_level.txt +0 -0
  104. {iqm_client-25.2.0 → iqm_client-25.4.0}/test +0 -0
  105. {iqm_client-25.2.0 → iqm_client-25.4.0}/tests/__init__.py +0 -0
  106. {iqm_client-25.2.0 → iqm_client-25.4.0}/tests/conftest.py +0 -0
@@ -2,6 +2,22 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ Version 25.4.0 (2025-05-30)
6
+ ===========================
7
+
8
+ Bug fixes
9
+ ---------
10
+
11
+ - Improve auth error message
12
+
13
+ Version 25.3.0 (2025-05-28)
14
+ ===========================
15
+
16
+ Features
17
+ --------
18
+
19
+ - Use new error log artifact format when obtaining job error message from station using V2 API.
20
+
5
21
  Version 25.2.0 (2025-05-23)
6
22
  ===========================
7
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-client
3
- Version: 25.2.0
3
+ Version: 25.4.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
@@ -130,7 +130,8 @@ class TokenManager:
130
130
  )
131
131
  else:
132
132
  raise ClientConfigurationError(
133
- f"Invalid combination of authentication parameters specified: {list(auth_parameters)}",
133
+ f"""Invalid combination of authentication parameters specified: {list(auth_parameters)},
134
+ Use either ['token'] or ['username', 'password'].""",
134
135
  )
135
136
 
136
137
  def get_bearer_token(self, retries: int = 1) -> str | None:
@@ -170,6 +170,7 @@ class IQMClient:
170
170
  *,
171
171
  timeout: float,
172
172
  retry: bool = False,
173
+ allow_errors: bool = False,
173
174
  ) -> requests.Response:
174
175
  """Make a HTTP GET request to an IQM server endpoint.
175
176
 
@@ -180,6 +181,7 @@ class IQMClient:
180
181
  endpoint_args: Arguments for the endpoint.
181
182
  timeout: HTTP request timeout (in seconds).
182
183
  retry: Iff True, keep trying if you get a 502 error.
184
+ allow_errors: Iff true, don't raise exceptions for error responses.
183
185
 
184
186
  Returns:
185
187
  HTTP response to the request.
@@ -199,9 +201,10 @@ class IQMClient:
199
201
  )
200
202
 
201
203
  response = self._retry_request_on_error(request) if retry else request()
202
- self._check_not_found_error(response)
203
- self._check_authentication_errors(response)
204
- response.raise_for_status()
204
+ if not allow_errors:
205
+ self._check_not_found_error(response)
206
+ self._check_authentication_errors(response)
207
+ response.raise_for_status()
205
208
  return response
206
209
 
207
210
  def _deserialize_response(
@@ -672,91 +675,60 @@ class IQMClient:
672
675
  )
673
676
  status = status_response.json()
674
677
  if Status(status["status"]) not in Status.terminal_statuses():
675
- return RunResult.from_dict(
676
- {
677
- "measurements": [],
678
- "status": status["status"],
679
- "message": "",
680
- "metadata": {
681
- "calibration_set_id": None,
682
- "circuits_batch": [],
683
- "parameters": None,
684
- "timestamps": {},
685
- },
686
- }
687
- )
678
+ return RunResult.from_dict({"status": status["status"], "metadata": {}})
688
679
 
689
- result = self._retry_request_on_error(
690
- lambda: requests.get(
691
- self._api.url(APIEndpoint.GET_JOB_RESULT, str(job_id)),
692
- headers=self._default_headers(),
693
- timeout=timeout_secs,
694
- )
695
- )
696
- if result.status_code != 404:
697
- result.raise_for_status()
698
- measurements = [] if result.status_code == 404 else result.json()
699
- request_parameters = (
700
- {}
701
- if result.status_code == 404
702
- else requests.get(
703
- self._api.url(APIEndpoint.GET_JOB_REQUEST_PARAMETERS, str(job_id)),
704
- headers=self._default_headers(),
705
- timeout=timeout_secs,
706
- ).json()
707
- )
708
- calibration_set_id = (
709
- None
710
- if result.status_code == 404
711
- else requests.get(
712
- self._api.url(APIEndpoint.GET_JOB_CALIBRATION_SET_ID, str(job_id)),
713
- headers=self._default_headers(),
714
- timeout=timeout_secs,
715
- ).json()
716
- )
717
- circuits_batch = (
718
- []
719
- if result.status_code == 404
720
- else requests.get(
721
- self._api.url(APIEndpoint.GET_JOB_CIRCUITS_BATCH, str(job_id)),
722
- headers=self._default_headers(),
723
- timeout=timeout_secs,
724
- ).json()
680
+ result = self._get_request(
681
+ APIEndpoint.GET_JOB_RESULT, (str(job_id),), timeout=timeout_secs, retry=True, allow_errors=True
725
682
  )
726
- timeline = (
727
- []
728
- if result.status_code == 404
729
- else requests.get(
730
- self._api.url(APIEndpoint.GET_JOB_TIMELINE, str(job_id)),
731
- headers=self._default_headers(),
732
- timeout=timeout_secs,
733
- ).json()
734
- )
735
- error_message_response = requests.get(
736
- self._api.url(APIEndpoint.GET_JOB_ERROR_LOG, str(job_id)),
737
- headers=self._default_headers(),
738
- timeout=timeout_secs,
683
+
684
+ error_log_response = self._get_request(
685
+ APIEndpoint.GET_JOB_ERROR_LOG, (str(job_id),), timeout=timeout_secs, allow_errors=True
739
686
  )
740
- error_message = error_message_response.text if error_message_response.status_code == 200 else None
687
+ if error_log_response.status_code == 200:
688
+ error_log = error_log_response.json()
689
+ if isinstance(error_log, dict) and "user_error_message" in error_log:
690
+ error_message = error_log["user_error_message"]
691
+ else:
692
+ # backwards compatibility for older error_log format
693
+ # TODO: remove when not needed anymore
694
+ error_message = error_log_response.text
695
+ else:
696
+ error_message = None
697
+
698
+ if result.status_code == 404:
699
+ return RunResult.from_dict({"status": status["status"], "message": error_message, "metadata": {}})
700
+ else:
701
+ result.raise_for_status()
702
+
703
+ measurements = result.json()
704
+ request_parameters = self._get_request(
705
+ APIEndpoint.GET_JOB_REQUEST_PARAMETERS, (str(job_id),), timeout=timeout_secs, allow_errors=True
706
+ ).json()
707
+ calibration_set_id = self._get_request(
708
+ APIEndpoint.GET_JOB_CALIBRATION_SET_ID, (str(job_id),), timeout=timeout_secs, allow_errors=True
709
+ ).json()
710
+ circuits_batch = self._get_request(
711
+ APIEndpoint.GET_JOB_CIRCUITS_BATCH, (str(job_id),), timeout=timeout_secs, allow_errors=True
712
+ ).json()
713
+ timeline = self._get_request(
714
+ APIEndpoint.GET_JOB_TIMELINE, (str(job_id),), timeout=timeout_secs, allow_errors=True
715
+ ).json()
716
+
741
717
  return RunResult.from_dict(
742
718
  {
743
719
  "measurements": measurements,
744
720
  "status": status["status"],
745
721
  "message": error_message,
746
722
  "metadata": {
747
- "`": calibration_set_id,
723
+ "calibration_set_id": calibration_set_id,
748
724
  "circuits_batch": circuits_batch,
749
- "parameters": (
750
- None
751
- if result.status_code == 404
752
- else {
753
- "shots": request_parameters["shots"],
754
- "max_circuit_duration_over_t2": request_parameters["max_circuit_duration_over_t2"],
755
- "heralding_mode": request_parameters["heralding_mode"],
756
- "move_validation_mode": request_parameters["move_validation_mode"],
757
- "move_gate_frame_tracking_mode": request_parameters["move_gate_frame_tracking_mode"],
758
- }
759
- ),
725
+ "parameters": {
726
+ "shots": request_parameters["shots"],
727
+ "max_circuit_duration_over_t2": request_parameters["max_circuit_duration_over_t2"],
728
+ "heralding_mode": request_parameters["heralding_mode"],
729
+ "move_validation_mode": request_parameters["move_validation_mode"],
730
+ "move_gate_frame_tracking_mode": request_parameters["move_gate_frame_tracking_mode"],
731
+ },
760
732
  "timestamps": {datapoint["status"]: datapoint["timestamp"] for datapoint in timeline},
761
733
  },
762
734
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-client
3
- Version: 25.2.0
3
+ Version: 25.4.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
@@ -0,0 +1 @@
1
+ 25.4.0
@@ -1 +0,0 @@
1
- 25.2.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