iqm-pulla 9.8.0__py3-none-any.whl → 10.0.0__py3-none-any.whl

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.
@@ -71,6 +71,7 @@ STANDARD_CIRCUIT_EXECUTION_OPTIONS_DICT = {
71
71
  "move_gate_frame_tracking": MoveGateFrameTrackingMode.FULL,
72
72
  "move_gate_validation": MoveGateValidationMode.STRICT,
73
73
  "active_reset_cycles": None,
74
+ "convert_terminal_measurements": True,
74
75
  }
75
76
 
76
77
  STANDARD_CIRCUIT_EXECUTION_OPTIONS = CircuitExecutionOptions(**STANDARD_CIRCUIT_EXECUTION_OPTIONS_DICT) # type: ignore
@@ -93,7 +94,7 @@ def pass_function_idempotent(function: PassFunction) -> PassFunction:
93
94
  return pass_with_idempotency
94
95
 
95
96
 
96
- def compiler_pass(function) -> PassFunction:
97
+ def compiler_pass(function) -> PassFunction: # noqa: ANN001
97
98
  """Convenience wrapper to create a valid compiler pass.
98
99
 
99
100
  When the wrapped function is called, the compilation data (e.g. circuits) is passed as the first argument.
@@ -248,6 +248,7 @@ def _build_readout_mappings(
248
248
  builder: ScheduleBuilder,
249
249
  measurement_mode: MeasurementMode,
250
250
  heralding_mode: HeraldingMode,
251
+ convert_terminal_measurements: bool,
251
252
  ) -> tuple[tuple[ReadoutMapping, ...], tuple[tuple[str, ...], ...]]:
252
253
  """Create a readout mapping for each circuit, add required measurement instructions.
253
254
 
@@ -264,6 +265,8 @@ def _build_readout_mappings(
264
265
  builder: schedule builder object, encapsulating station properties and gate calibration data
265
266
  measurement_mode: measurement mode to be used
266
267
  heralding_mode: type of heralding used
268
+ convert_terminal_measurements: whether to convert terminal measurements into the ``"measure_fidelity"``
269
+ operation.
267
270
 
268
271
  Returns:
269
272
  readout mappings, heralded components
@@ -323,13 +326,21 @@ def _build_readout_mappings(
323
326
  final_measurements.append(inst)
324
327
  eclipsed_qubits.update(inst.locus)
325
328
 
329
+ if convert_terminal_measurements:
330
+ final_measurements_name = "measure_fidelity"
331
+ for measurement in final_measurements:
332
+ measurement.name = final_measurements_name
333
+ else:
334
+ final_measurements_name = "measure"
326
335
  # Add a single final measurement instruction for qubits that still need to be measured
327
336
  # (order does not matter). this measurement instruction is not reflected in circuit_metrics,
328
337
  # nor are the results returned by SC. NOTE we assume that iqm-pulse is clever enough to
329
338
  # combine the separate final measurement instructions into simultaneous ReadoutTriggers.
330
339
  if missing := final_components_to_measure - set(q for inst in final_measurements for q in inst.locus):
331
340
  # TODO which implementation to use? Now we leave it to None.
332
- c.instructions += (CircuitOperation("measure", tuple(missing), {"key": MEASUREMENT_MODE_KEY}),)
341
+ c.instructions += (
342
+ CircuitOperation(final_measurements_name, tuple(missing), {"key": MEASUREMENT_MODE_KEY}),
343
+ )
333
344
 
334
345
  if heralding_mode != HeraldingMode.NONE:
335
346
  # heralding must return results for the components used in the circuit, if they can be measured
@@ -364,7 +375,7 @@ def _get_op_calibration_errors(calibration: OpCalibrationDataTree, ops: QuantumO
364
375
 
365
376
  """
366
377
 
367
- def diff_dicts(cal_data: dict[str, Any], impl_parameters: dict[str, Any], path) -> None | str:
378
+ def diff_dicts(cal_data: dict[str, Any], impl_parameters: dict[str, Any], path) -> None | str: # noqa: ANN001
368
379
  """Compare the calibration"""
369
380
  full = set(impl_parameters)
370
381
  have = set(cal_data)
@@ -498,7 +509,7 @@ def merge_multiplexed_timeboxes(circuit_box: TimeBox) -> TimeBox:
498
509
  # Passes of the standard stages
499
510
  # CIRCUIT-LEVEL PASSES
500
511
  @compiler_pass
501
- def validate_execution_options(circuits: Iterable[Circuit_], options: CircuitExecutionOptions):
512
+ def validate_execution_options(circuits: Iterable[Circuit_], options: CircuitExecutionOptions): # noqa: ANN201
502
513
  """Validate the circuit execution options (only some combinations make sense)."""
503
514
  if options.move_gate_frame_tracking == MoveGateFrameTrackingMode.FULL and options.move_gate_validation not in [
504
515
  MoveGateValidationMode.STRICT,
@@ -510,7 +521,7 @@ def validate_execution_options(circuits: Iterable[Circuit_], options: CircuitExe
510
521
 
511
522
 
512
523
  @compiler_pass
513
- def map_old_operations(circuits: Iterable[Circuit_]):
524
+ def map_old_operations(circuits: Iterable[Circuit_]): # noqa: ANN201
514
525
  """Map backwards-compatible aliases for quantum operation names into the current name."""
515
526
  for c in circuits:
516
527
  _map_old_operation_names(c.instructions)
@@ -519,7 +530,7 @@ def map_old_operations(circuits: Iterable[Circuit_]):
519
530
 
520
531
 
521
532
  @compiler_pass
522
- def validate_circuits(circuits: Iterable[Circuit_], builder: ScheduleBuilder):
533
+ def validate_circuits(circuits: Iterable[Circuit_], builder: ScheduleBuilder): # noqa: ANN201
523
534
  """Validate the contents of the quantum circuits."""
524
535
  for idx, c in enumerate(circuits):
525
536
  try:
@@ -530,7 +541,7 @@ def validate_circuits(circuits: Iterable[Circuit_], builder: ScheduleBuilder):
530
541
 
531
542
 
532
543
  @compiler_pass
533
- def map_components(
544
+ def map_components( # noqa: ANN201
534
545
  circuits: Iterable[Circuit_],
535
546
  builder: ScheduleBuilder,
536
547
  component_mapping: dict[str, str],
@@ -591,7 +602,12 @@ def derive_readout_mappings(
591
602
  ) -> tuple[list[Circuit_], dict[str, Any]]:
592
603
  """Derive mapping between station acquisition labels and user's measurement keys."""
593
604
  readout_mappings, heralded_components = _build_readout_mappings(
594
- circuits, tuple(circuit_metrics), builder, options.measurement_mode, options.heralding_mode
605
+ circuits,
606
+ tuple(circuit_metrics),
607
+ builder,
608
+ options.measurement_mode,
609
+ options.heralding_mode,
610
+ options.convert_terminal_measurements,
595
611
  )
596
612
  return list(circuits), {"readout_mappings": readout_mappings, "heralded_components": heralded_components}
597
613
 
@@ -609,7 +625,7 @@ def resolve_circuits(circuits: Iterable[Circuit_], builder: ScheduleBuilder) ->
609
625
 
610
626
  # TIMEBOX-LEVEL PASSES
611
627
  @compiler_pass
612
- def multiplex_readout(timeboxes: Iterable[TimeBox]):
628
+ def multiplex_readout(timeboxes: Iterable[TimeBox]): # noqa: ANN201
613
629
  """Merge any MultiplexedProbeTimeBoxes inside a TimeBox representing a circuit."""
614
630
  return [merge_multiplexed_timeboxes(circuit_box) for circuit_box in timeboxes]
615
631
 
@@ -178,6 +178,8 @@ class CircuitExecutionOptions:
178
178
  move_gate_validation: MoveGateValidationMode
179
179
  move_gate_frame_tracking: MoveGateFrameTrackingMode
180
180
  active_reset_cycles: int | None
181
+ convert_terminal_measurements: bool
182
+ """Iff True, convert terminal measurements to a non-QND, high-fidelity measurement."""
181
183
 
182
184
 
183
185
  ReadoutMapping: TypeAlias = dict[str, tuple[str, ...]]
iqm/pulla/utils.py CHANGED
@@ -456,7 +456,7 @@ def initialize_schedule_builder(
456
456
  return builder
457
457
 
458
458
 
459
- def _update_channel_props_from_calibration(
459
+ def _update_channel_props_from_calibration( # noqa: ANN202
460
460
  channel_properties: dict[str, ChannelProperties],
461
461
  component_channels: dict[str, dict[str, str]],
462
462
  calset: CalibrationSet,
iqm/pulla/utils_cirq.py CHANGED
@@ -15,6 +15,6 @@
15
15
  """Utilities for working with Cirq objects."""
16
16
 
17
17
 
18
- def cirq_to_cpc():
18
+ def cirq_to_cpc(): # noqa: ANN201
19
19
  """Convert a Cirq Circuit to an IQM CPC Circuit."""
20
20
  raise NotImplementedError("Cirq to IQM conversion is not yet implemented.")
iqm/pulla/utils_qir.py CHANGED
@@ -118,14 +118,14 @@ def _gate_inst_to_str(inst: Call) -> CircuitOperation | None:
118
118
  raise ValueError(f"Error processing operation {operation}: {e}") from e
119
119
 
120
120
 
121
- def _find_arg_by_type(args, type_check_func):
121
+ def _find_arg_by_type(args, type_check_func): # noqa: ANN001, ANN202
122
122
  for arg in args:
123
123
  if type_check_func(arg.type):
124
124
  return arg
125
125
  raise ValueError(f"Expected exactly one argument of type {type_check_func}")
126
126
 
127
127
 
128
- def _find_args_by_type(args, type_check_func):
128
+ def _find_args_by_type(args, type_check_func): # noqa: ANN001, ANN202
129
129
  matches = []
130
130
  for arg in args:
131
131
  if type_check_func(arg.type):
@@ -133,7 +133,7 @@ def _find_args_by_type(args, type_check_func):
133
133
  return matches
134
134
 
135
135
 
136
- def _find_double_args(args):
136
+ def _find_double_args(args): # noqa: ANN001, ANN202
137
137
  """Return non-qubit, non-result arguments which should be doubles."""
138
138
  return [arg for arg in args if arg.type.is_double]
139
139
 
iqm/pulla/utils_qiskit.py CHANGED
@@ -231,7 +231,7 @@ class IQMPullaBackend(IQMBackendBase):
231
231
  self.name = "IQMPullaBackend"
232
232
  self.compiler = compiler
233
233
 
234
- def run(self, run_input, **options):
234
+ def run(self, run_input, **options): # noqa: ANN001, ANN201
235
235
  # Convert Qiskit circuits to Pulla circuits
236
236
  pulla_circuits = qiskit_circuits_to_pulla(run_input, self._idx_to_qb)
237
237
 
@@ -266,15 +266,15 @@ class DummyJob(JobV1):
266
266
  The ``job_id`` is the same as the ``sweep_id`` of the ``StationControlResult``.
267
267
  """
268
268
 
269
- def __init__(self, backend, qiskit_result):
269
+ def __init__(self, backend, qiskit_result): # noqa: ANN001
270
270
  super().__init__(backend=backend, job_id=qiskit_result.job_id)
271
271
  self.qiskit_result = qiskit_result
272
272
 
273
- def result(self):
273
+ def result(self): # noqa: ANN201
274
274
  return self.qiskit_result
275
275
 
276
- def status(self):
276
+ def status(self): # noqa: ANN201
277
277
  return JobStatus.DONE
278
278
 
279
- def submit(self):
279
+ def submit(self): # noqa: ANN201
280
280
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-pulla
3
- Version: 9.8.0
3
+ Version: 10.0.0
4
4
  Summary: Client library for pulse-level access to an IQM quantum computer
5
5
  Author-email: IQM Finland Oy <developers@meetiqm.com>
6
6
  License: Apache License
@@ -218,27 +218,27 @@ License-File: LICENSE.txt
218
218
  License-File: AUTHORS.rst
219
219
  Requires-Dist: iqm-exa-common <27,>=26
220
220
  Requires-Dist: iqm-station-control-client <10,>=9
221
- Requires-Dist: iqm-pulse <11,>=10
221
+ Requires-Dist: iqm-pulse <12,>=11
222
222
  Requires-Dist: iqm-data-definitions <3.0,>=2.13
223
223
  Requires-Dist: pylatexenc ==2.10
224
224
  Requires-Dist: pydantic <3.0,>=2.10.4
225
225
  Provides-Extra: notebook
226
226
  Requires-Dist: iqm-exa-common <27,>=26 ; extra == 'notebook'
227
227
  Requires-Dist: iqm-station-control-client <10,>=9 ; extra == 'notebook'
228
- Requires-Dist: iqm-pulse <11,>=10 ; extra == 'notebook'
228
+ Requires-Dist: iqm-pulse <12,>=11 ; extra == 'notebook'
229
229
  Requires-Dist: notebook <7,>=6.4.11 ; extra == 'notebook'
230
230
  Requires-Dist: matplotlib <4,>=3.6.3 ; extra == 'notebook'
231
231
  Requires-Dist: nbclient ~=0.5.10 ; extra == 'notebook'
232
232
  Provides-Extra: qir
233
233
  Requires-Dist: iqm-exa-common <27,>=26 ; extra == 'qir'
234
234
  Requires-Dist: iqm-station-control-client <10,>=9 ; extra == 'qir'
235
- Requires-Dist: iqm-pulse <11,>=10 ; extra == 'qir'
235
+ Requires-Dist: iqm-pulse <12,>=11 ; extra == 'qir'
236
236
  Requires-Dist: iqm-pyqir ==0.12.0 ; extra == 'qir'
237
237
  Requires-Dist: iqm-qiskit-qir ==0.8.0 ; extra == 'qir'
238
238
  Provides-Extra: qiskit
239
239
  Requires-Dist: iqm-exa-common <27,>=26 ; extra == 'qiskit'
240
240
  Requires-Dist: iqm-station-control-client <10,>=9 ; extra == 'qiskit'
241
- Requires-Dist: iqm-pulse <11,>=10 ; extra == 'qiskit'
241
+ Requires-Dist: iqm-pulse <12,>=11 ; extra == 'qiskit'
242
242
  Requires-Dist: iqm-client[qiskit] <31,>=30 ; extra == 'qiskit'
243
243
  Requires-Dist: iqm-client <31,>=30 ; extra == 'qiskit'
244
244
 
@@ -1,27 +1,27 @@
1
1
  iqm/cpc/__init__.py,sha256=qw_SFgwld1YOYYyBE-NSticm60xx5aCAw5LJJzjou8Y,1745
2
2
  iqm/cpc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  iqm/cpc/compiler/__init__.py,sha256=ieYyHzb2IyevDm5swU--rPMsh5GdUtLrw8773Cd0ens,678
4
- iqm/cpc/compiler/compiler.py,sha256=KsxRrpfPawZYqg3gvTYch58GXlSW8mr3p-11hejbZ_0,20383
4
+ iqm/cpc/compiler/compiler.py,sha256=paWwALMbLQwMBoujKMnUUfybwaoXXYBYHYPLZUXWoyQ,20442
5
5
  iqm/cpc/compiler/dd.py,sha256=j4onTod24RPxRwwsM3EMBBgX4hDO0k_nW9R762AocXo,21674
6
6
  iqm/cpc/compiler/errors.py,sha256=tz-8g1QtDvCAPmAjjCYK3FoULrazkpSTmXIvyqukaT4,1949
7
- iqm/cpc/compiler/standard_stages.py,sha256=W3CizQJDpxyz_4iHsQ-dxv7DxGxL_MMwOlIiiBjO6KY,33858
7
+ iqm/cpc/compiler/standard_stages.py,sha256=JucA3Y2Vy_7mKmIh69vMN6rRFhhZ5rG8O9zTX3vWpzw,34557
8
8
  iqm/cpc/compiler/station_settings.py,sha256=l4cJYcNtMar_BoChJaUbmVfpXv7liTCeLWpSv7fAipg,16903
9
9
  iqm/cpc/interface/__init__.py,sha256=mvhNx1I9K5Sg40CwPntWj35M3Bni__23PWEw_qYaXtQ,611
10
- iqm/cpc/interface/compiler.py,sha256=2x3ZhL4WcyjwlSoZ3KhlmRcLxboz_ptS0M_rdX1z0c8,9861
10
+ iqm/cpc/interface/compiler.py,sha256=_3sFYVoqqGH7XyBpYm2bLPnnz-1wiBuUee6WYdFJeXE,9992
11
11
  iqm/pulla/__init__.py,sha256=fj5Qh8R9K-z6q5g9-CySBZsG8d33nU7hCHrqIIB8_-0,901
12
12
  iqm/pulla/calibration.py,sha256=c_SNlTxXC0y-ahDY7JY53N7SofU5WUWMrNBogtdfHl4,4523
13
13
  iqm/pulla/interface.py,sha256=yymQo4REHYcUOWgPxPYq9IixS9bBZ27LXLQgJhzET58,5400
14
14
  iqm/pulla/pulla.py,sha256=RWsUgtCy_wAgm8TDk6uZEmaG_v-lTBFzx43qpA1CfQU,14243
15
15
  iqm/pulla/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  iqm/pulla/quantum_architecture.py,sha256=mJH9e9fdkblg6LrgN7qd-Ui3Igawf-hGd2Z7ZclQg04,6260
17
- iqm/pulla/utils.py,sha256=TTAOFhNW59VFAjnu6ZicmHXvp-GI_f66oh6IC1zFQKE,24732
18
- iqm/pulla/utils_cirq.py,sha256=8SBy6w7cr4AmnCgKwh7dBWwBGfGKxnoEMv9-1yfKs0A,777
17
+ iqm/pulla/utils.py,sha256=xVu4jLlSHX-_YQT1kB-zBiGy4wNy0YyOKZg4AGMB5DE,24748
18
+ iqm/pulla/utils_cirq.py,sha256=VtdO356D2RAh2lSVdaPm3ClJ9-nvC4jzhR9hP5QSQhI,793
19
19
  iqm/pulla/utils_dd.py,sha256=SxYAuRBgvYELKjeXpFbP4mM0xCCivDk7WUHw7oEXfMo,1695
20
- iqm/pulla/utils_qir.py,sha256=SKQyYwqluMOqfts6jdhP6ik8BvAIppwaq6-_sY0MO8M,11503
21
- iqm/pulla/utils_qiskit.py,sha256=RBrAf_KbxlL8DI078mtN8nK1pdfAbd4yk7DJSZVEFSs,10397
22
- iqm_pulla-9.8.0.dist-info/AUTHORS.rst,sha256=iCStz7WP5Jk7uMnn9jRA4ybS14X4yeUW2SsWE-OTaRk,328
23
- iqm_pulla-9.8.0.dist-info/LICENSE.txt,sha256=cCj_biRA4Q8A77vxR8AuvAf-DZ5G79yxR_3lYY6TrmA,11333
24
- iqm_pulla-9.8.0.dist-info/METADATA,sha256=1pt45T-YC8ejygXb1q90CZKSQr4sAZcfwK0mN4e9U_0,17695
25
- iqm_pulla-9.8.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
26
- iqm_pulla-9.8.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
27
- iqm_pulla-9.8.0.dist-info/RECORD,,
20
+ iqm/pulla/utils_qir.py,sha256=SJK8N8xZyv9seXj1lJJfyt3YMht50VzUxzm8NiblSEw,11575
21
+ iqm/pulla/utils_qiskit.py,sha256=4NTNDWICFh3B0v509w3CfBHrB-GzBm-2TMlKRfgkTTI,10485
22
+ iqm_pulla-10.0.0.dist-info/AUTHORS.rst,sha256=iCStz7WP5Jk7uMnn9jRA4ybS14X4yeUW2SsWE-OTaRk,328
23
+ iqm_pulla-10.0.0.dist-info/LICENSE.txt,sha256=cCj_biRA4Q8A77vxR8AuvAf-DZ5G79yxR_3lYY6TrmA,11333
24
+ iqm_pulla-10.0.0.dist-info/METADATA,sha256=vbgt4u_7QaK0BVMs6MbmpOtL3x_k2oyLkeDMS-uW2-Q,17696
25
+ iqm_pulla-10.0.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
26
+ iqm_pulla-10.0.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
27
+ iqm_pulla-10.0.0.dist-info/RECORD,,