iqm-pulla 11.0.0__tar.gz → 11.1.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 (75) hide show
  1. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/CHANGELOG.rst +8 -0
  2. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/PKG-INFO +1 -1
  3. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/__init__.py +2 -19
  4. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/compiler/compiler.py +70 -20
  5. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm_pulla.egg-info/PKG-INFO +1 -1
  6. iqm_pulla-11.1.0/version.txt +1 -0
  7. iqm_pulla-11.0.0/version.txt +0 -1
  8. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/AUTHORS.rst +0 -0
  9. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/LICENSE.txt +0 -0
  10. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/MANIFEST.in +0 -0
  11. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/README.rst +0 -0
  12. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/API.rst +0 -0
  13. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Compilation Stages.ipynb +0 -0
  14. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Configuration and Usage.ipynb +0 -0
  15. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Custom Gates and Implementations.ipynb +0 -0
  16. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Example - Compilation With Local Calibration Set.ipynb +0 -0
  17. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Example - Executing QIR programs.ipynb +0 -0
  18. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Example - Measuring T1.ipynb +0 -0
  19. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Example - Randomized Benchmarking.ipynb +0 -0
  20. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Example - Simple Dynamical Decoupling.ipynb +0 -0
  21. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/Quick Start.ipynb +0 -0
  22. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/_static/images/favicon.ico +0 -0
  23. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/_static/images/logo.png +0 -0
  24. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/_templates/autosummary-class-template.rst +0 -0
  25. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/_templates/autosummary-module-template.rst +0 -0
  26. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/authors.rst +0 -0
  27. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/changelog.rst +0 -0
  28. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/common_errors.rst +0 -0
  29. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/conf.py +0 -0
  30. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/examples.rst +0 -0
  31. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/index.rst +0 -0
  32. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/license.rst +0 -0
  33. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/migration_guide.rst +0 -0
  34. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/readme.rst +0 -0
  35. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/references.bib +0 -0
  36. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/references.rst +0 -0
  37. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/docs/user_guides.rst +0 -0
  38. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/pyproject.toml +0 -0
  39. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/base.in +0 -0
  40. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/base.in.internal +0 -0
  41. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/base.txt +0 -0
  42. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/notebook.in +0 -0
  43. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/notebook.txt +0 -0
  44. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/qir.in +0 -0
  45. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/qir.txt +0 -0
  46. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/qiskit.in.internal +0 -0
  47. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/requirements/qiskit.txt +0 -0
  48. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/setup.cfg +0 -0
  49. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/setup.py +0 -0
  50. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/compiler/__init__.py +0 -0
  51. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/compiler/dd.py +0 -0
  52. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/compiler/errors.py +0 -0
  53. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/compiler/standard_stages.py +0 -0
  54. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/compiler/station_settings.py +0 -0
  55. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/interface/__init__.py +0 -0
  56. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/interface/compiler.py +0 -0
  57. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/cpc/py.typed +0 -0
  58. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/__init__.py +0 -0
  59. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/calibration.py +0 -0
  60. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/interface.py +0 -0
  61. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/pulla.py +0 -0
  62. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/py.typed +0 -0
  63. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/quantum_architecture.py +0 -0
  64. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/utils.py +0 -0
  65. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/utils_cirq.py +0 -0
  66. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/utils_dd.py +0 -0
  67. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/utils_qir.py +0 -0
  68. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm/pulla/utils_qiskit.py +0 -0
  69. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm_pulla.egg-info/SOURCES.txt +0 -0
  70. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm_pulla.egg-info/dependency_links.txt +0 -0
  71. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm_pulla.egg-info/requires.txt +0 -0
  72. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/src/iqm_pulla.egg-info/top_level.txt +0 -0
  73. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/tests/.pylintrc +0 -0
  74. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/tests/__init__.py +0 -0
  75. {iqm_pulla-11.0.0 → iqm_pulla-11.1.0}/tests/conftest.py +0 -0
@@ -2,6 +2,14 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ Version 11.1.0 (2025-09-12)
6
+ ===========================
7
+
8
+ Features
9
+ --------
10
+
11
+ - Postprocessing stages.
12
+
5
13
  Version 11.0.0 (2025-09-11)
6
14
  ===========================
7
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-pulla
3
- Version: 11.0.0
3
+ Version: 11.1.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
@@ -14,26 +14,9 @@
14
14
  """IQM Circuit to Pulse Compiler.
15
15
 
16
16
  IQM Circuit to Pulse Compiler is a Python-based library for converting quantum circuits
17
- into :class:`instruction schedules <exa.pulse.pulse_schedule.PulseSchedule>`
18
- (which map ``Station Control`` controller names to their pulse playlists) and Station Control settings
17
+ into :class:`instruction schedules <iqm.pulse.playlist.schedule.Schedule>`
18
+ (which map ``Station Control`` controller names to lists of hardware instructions) and Station Control settings
19
19
  required for circuit execution, using the calibration data it is given.
20
20
  The generated schedules and settings can be sent to Station Control
21
21
  for execution on real or simulated quantum hardware.
22
-
23
- CPC is normally only accessed indirectly through Cocos or its reference client
24
- `IQM client <https://docs.meetiqm.com/iqm-client/index.html>`_,
25
- or a frontend such as
26
- `Cirq on IQM <https://docs.meetiqm.com/iqm-client/user_guide_cirq.html>`_ or
27
- `Qiskit on IQM <https://docs.meetiqm.com/iqm-client/user_guide_qiskit.html>`_.
28
22
  """
29
-
30
- # from importlib.metadata import PackageNotFoundError, version
31
-
32
- # try:
33
- # # Change here if project is renamed and does not equal the package name
34
- # DIST_NAME = "iqm-cocos"
35
- # __version__ = version(DIST_NAME)
36
- # except PackageNotFoundError: # pragma: no cover
37
- # __version__ = "unknown"
38
- # finally:
39
- # del version, PackageNotFoundError
@@ -20,7 +20,7 @@ can be executed by the IQM server on quantum hardware.
20
20
 
21
21
  from __future__ import annotations
22
22
 
23
- from collections.abc import Callable, Iterable
23
+ from collections.abc import Callable, Collection, Iterable
24
24
  from copy import deepcopy
25
25
  import functools
26
26
  import inspect
@@ -28,8 +28,10 @@ import logging
28
28
  from typing import TYPE_CHECKING, Any
29
29
 
30
30
  from opentelemetry import trace
31
+ from typing_extensions import deprecated
31
32
 
32
33
  from exa.common.data.setting_node import SettingNode
34
+ from exa.common.helpers.deprecation import format_deprecated
33
35
  from iqm.cpc.compiler.errors import CalibrationError, ClientError, InsufficientContextError
34
36
  from iqm.cpc.interface.compiler import (
35
37
  CircuitBoundaryMode,
@@ -187,13 +189,16 @@ class Compiler:
187
189
  Args:
188
190
  calibration_set: Calibration data.
189
191
  chip_topology: Physical layout and connectivity of the quantum chip.
190
- channel_properties: Channel properties.
191
- component_channels: Mapping between components and their control channels.
192
- component_mapping: Custom mapping of components. Defaults to None.
192
+ channel_properties: Control channel properties for the station.
193
+ component_channels: Mapping from QPU component name to a mapping from ``('drive', 'flux', 'readout')``
194
+ to the name of the control channel responsible for that function of the component.
195
+ component_mapping: Mapping of logical QPU component names to physical QPU component names.
196
+ ``None`` means the identity mapping.
193
197
  options: Circuit execution options.
194
198
  Defaults to STANDARD_CIRCUIT_EXECUTION_OPTIONS.
195
- stages: List of compilation stages. Defaults to None.
196
- Note that in the absence of stages, the compiler will not be ready to compile circuits.
199
+ stages: Compilation stages to use. ``None`` means none.
200
+ Note that meaningful circuit compilation requires at least some stages.
201
+ pp_stages: Post-processing stages to use. ``None`` means none.
197
202
  strict: If True, raises CalibrationError on calibration validation failures.
198
203
  If False, only logs warnings. Defaults to False.
199
204
 
@@ -202,7 +207,7 @@ class Compiler:
202
207
 
203
208
  """
204
209
 
205
- def __init__(
210
+ def __init__( # noqa: PLR0913
206
211
  self,
207
212
  *,
208
213
  calibration_set: CalibrationSet,
@@ -211,13 +216,15 @@ class Compiler:
211
216
  component_channels: dict[str, dict[str, str]],
212
217
  component_mapping: dict[str, str] | None = None,
213
218
  options: CircuitExecutionOptions = STANDARD_CIRCUIT_EXECUTION_OPTIONS,
214
- stages: list[CompilationStage] | None = None,
219
+ stages: Collection[CompilationStage] | None = None,
220
+ pp_stages: Collection[CompilationStage] | None = None,
215
221
  strict: bool = False, # consider extending to e.g. errors: Literal["raise", "warning", "ignore"] = "warning"
216
222
  ):
217
223
  self._calibration_set = calibration_set
218
224
  self.component_mapping = component_mapping
219
225
  self.options = options
220
226
  self.stages = stages or []
227
+ self.pp_stages = pp_stages or []
221
228
 
222
229
  self.builder: ScheduleBuilder = initialize_schedule_builder(
223
230
  calibration_set, chip_topology, channel_properties, component_channels
@@ -357,11 +364,12 @@ class Compiler:
357
364
  )
358
365
  self._refresh()
359
366
 
367
+ @deprecated(format_deprecated(old="`ready`", new=None, since="12.08.2025"))
360
368
  def ready(self) -> bool:
361
369
  """Check if the compiler is ready to compile circuits. The compiler is ready if at least one stage is defined, and
362
370
  all the stages are non-empty.
363
371
  """ # noqa: E501
364
- if len(self.stages) == 0:
372
+ if not self.stages:
365
373
  return False
366
374
  for stage in self.stages:
367
375
  if not stage.ready():
@@ -394,7 +402,7 @@ class Compiler:
394
402
  full: Iff True, also print the docstring of each pass function.
395
403
 
396
404
  """
397
- if len(self.stages) == 0:
405
+ if not self.stages:
398
406
  print("No stages defined.")
399
407
  return
400
408
 
@@ -409,7 +417,10 @@ class Compiler:
409
417
  print()
410
418
 
411
419
  def compiler_context(self) -> dict[str, Any]:
412
- """Return initial compiler context dictionary. Used automatically by :meth:`Compiler.compile`."""
420
+ """Return initial compiler context dictionary.
421
+
422
+ Used automatically by :meth:`compile`.
423
+ """
413
424
  return {
414
425
  "calibration_set": self._calibration_set,
415
426
  "builder": self.builder,
@@ -422,27 +433,66 @@ class Compiler:
422
433
  def compile(
423
434
  self, data: Iterable[Any], context: dict[str, Any] | None = None
424
435
  ) -> tuple[Iterable[Any], dict[str, Any]]:
425
- """Run all compiler stages. Initial context will be derived from :meth:`Compiler.compiler_context` unless a custom
436
+ """Run all compiler stages.
437
+
438
+ Initial context will be derived using :meth:`compiler_context` unless a custom
439
+ context dictionary is provided.
440
+
441
+ Args:
442
+ data: Circuits to be compiled.
443
+ context: Custom initial compiler context dictionary.
444
+
445
+ Returns:
446
+ Compiled ``data``, final context.
447
+
448
+ """
449
+ cpc_logger.info("Running compilation stages...")
450
+ return self.run_stages(self.stages, data, context or self.compiler_context())
451
+
452
+ def postprocess(
453
+ self, data: Iterable[Any], context: dict[str, Any] | None = None
454
+ ) -> tuple[Iterable[Any], dict[str, Any]]:
455
+ """Run all post-processing stages.
456
+
457
+ Initial context will be derived using :meth:`compiler_context` unless a custom
426
458
  context dictionary is provided.
427
459
 
428
460
  Args:
429
- data: An iterable of circuits to be compiled.
461
+ data: Any data, e.g. execution results derived from :meth:`Pulla.execute`
430
462
  context: Custom initial compiler context dictionary.
431
463
 
464
+ Returns:
465
+ Postprocessed ``data``, final context.
466
+
432
467
  """ # noqa: E501
433
- if not self.ready():
434
- raise RuntimeError("Compiler is not ready: no stages defined, or some stages have zero passes.")
468
+ cpc_logger.info("Running postprocessing stages...")
469
+ return self.run_stages(self.pp_stages, data, context or self.compiler_context())
470
+
471
+ def run_stages(
472
+ self, stages: Collection[CompilationStage], data: Iterable[Any], context: dict[str, Any]
473
+ ) -> tuple[Iterable[Any], dict[str, Any]]:
474
+ """Run the given stages in given order on the given data.
475
+
476
+ Args:
477
+ stages: Stages to run on ``data``.
478
+ data: The data to be processed.
479
+ context: Additional information that is passed to the first stage.
480
+ Each stage may make modifications to ``context`` before it is passed to the next stage.
435
481
 
436
- # Dictionary of context to be passed through all the passes
437
- if context is None:
438
- context = self.compiler_context()
482
+ Returns:
483
+ Processed data, final context.
439
484
 
440
- # Run the stages
485
+ """
486
+ if not stages:
487
+ raise RuntimeError("No stages defined.")
441
488
  for stage in self.stages:
489
+ if not stage.ready():
490
+ raise RuntimeError(f"Stage {stage.name} is not ready.")
491
+
492
+ for stage in stages:
442
493
  cpc_logger.info('Running stage "%s"...', stage.name)
443
494
  data, context = stage.run(data, context)
444
495
 
445
- cpc_logger.info("Compilation finished.")
446
496
  return data, context
447
497
 
448
498
  def build_settings(self, context: dict[str, Any], shots: int) -> tuple[SettingNode, dict[str, Any]]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-pulla
3
- Version: 11.0.0
3
+ Version: 11.1.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
@@ -0,0 +1 @@
1
+ 11.1.0
@@ -1 +0,0 @@
1
- 11.0.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