iqm-pulse 9.12.0__py3-none-any.whl → 9.14.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.
@@ -47,7 +47,7 @@ from iqm.pulse.gates.cz import (
47
47
  from iqm.pulse.gates.default_gates import _quantum_ops_library
48
48
  from iqm.pulse.gates.delay import Delay
49
49
  from iqm.pulse.gates.flux_multiplexer import FluxMultiplexer_SampleLinear
50
- from iqm.pulse.gates.measure import Measure_Constant, Measure_Constant_Qnd
50
+ from iqm.pulse.gates.measure import Measure_Constant, Measure_Constant_Qnd, Shelved_Measure_Constant
51
51
  from iqm.pulse.gates.move import MOVE_CRF_CRF, MOVE_TGSS_CRF
52
52
  from iqm.pulse.gates.prx import (
53
53
  Constant_PRX_with_smooth_rise_fall,
@@ -102,6 +102,7 @@ _exposed_implementations: dict[str, type[GateImplementation]] = {
102
102
  FluxPulseGate_CRF_CRF,
103
103
  Measure_Constant,
104
104
  Measure_Constant_Qnd,
105
+ Shelved_Measure_Constant,
105
106
  PRX_ModulatedDRAGCosineRiseFall,
106
107
  MOVE_CRF_CRF,
107
108
  MOVE_TGSS_CRF,
@@ -34,7 +34,7 @@ from iqm.pulse.gates.cz import (
34
34
  )
35
35
  from iqm.pulse.gates.delay import Delay
36
36
  from iqm.pulse.gates.flux_multiplexer import FluxMultiplexer_SampleLinear
37
- from iqm.pulse.gates.measure import Measure_Constant
37
+ from iqm.pulse.gates.measure import Measure_Constant, Shelved_Measure_Constant
38
38
  from iqm.pulse.gates.move import MOVE_CRF_CRF, MOVE_TGSS_CRF
39
39
  from iqm.pulse.gates.prx import (
40
40
  PRX_DRAGCosineRiseFall,
@@ -60,7 +60,11 @@ for different gates."""
60
60
  _default_implementations = {
61
61
  "barrier": {"": Barrier},
62
62
  "delay": {"wait": Delay},
63
- "measure": {"constant": Measure_Constant, "constant_qnd": Measure_Constant},
63
+ "measure": {
64
+ "constant": Measure_Constant,
65
+ "constant_qnd": Measure_Constant,
66
+ "shelved_constant": Shelved_Measure_Constant,
67
+ },
64
68
  "prx": {
65
69
  "drag_gaussian": PRX_DRAGGaussian,
66
70
  "drag_crf": PRX_DRAGCosineRiseFall,
@@ -214,7 +214,7 @@ class Measure_CustomWaveforms(CustomIQWaveforms):
214
214
  return probe_pulse, acquisition_method
215
215
 
216
216
  def probe_timebox(
217
- self, key: str = "", feedback_key: str = "", do_acquisition: bool = True
217
+ self, key: str = "", feedback_key: str = "", do_acquisition: bool = True, **kwargs
218
218
  ) -> MultiplexedProbeTimeBox:
219
219
  """Returns a "naked" probe timebox that supports convenient multiplexing through
220
220
  ``MultiplexedProbeTimeBox.__add__``.
@@ -286,10 +286,12 @@ class Measure_CustomWaveforms(CustomIQWaveforms):
286
286
  label=f"{self.__class__.__name__} on {self.locus}",
287
287
  )
288
288
  else:
289
+ # _skip_override used for child classes build on `Measure_CustomWaveforms` to not call `.probe_timebox`
290
+ # from the parent class, but from this class instead.
289
291
  probe_timeboxes = [
290
292
  self.builder.get_implementation(
291
293
  self.parent.name, (c,), impl_name=self.name, priority_calibration=self._prio_calibration
292
- ).probe_timebox(key, feedback_key, do_acquisition)
294
+ ).probe_timebox(key, feedback_key, do_acquisition, _skip_override=True)
293
295
  for c in self.locus
294
296
  ]
295
297
  probe_timebox = functools.reduce(lambda x, y: x + y, probe_timeboxes)
@@ -377,7 +379,7 @@ class Measure_CustomWaveforms(CustomIQWaveforms):
377
379
  args = (key, acquisition_delay, acquisition_duration, feedback_key)
378
380
  # additional caching for time traces since the acquisitions differ from the ones in _call
379
381
  if args not in self._time_traces:
380
- probe_timebox = deepcopy(self.probe_timebox(key=key, feedback_key=feedback_key))
382
+ probe_timebox = deepcopy(self.probe_timebox(key=key, feedback_key=feedback_key, _skip_override=True))
381
383
  for probe_channel, segment in probe_timebox.atom.items():
382
384
  readout_trigger = segment[0]
383
385
  # TODO instead of editing the probe_timebox output contents, we should make the function itself do this
@@ -785,3 +787,68 @@ class Probe_Constant(ProbePulse_CustomWaveforms_noIntegration, wave_i=Constant,
785
787
 
786
788
  Uses a constant probe pulse.
787
789
  """
790
+
791
+
792
+ class Shelved_Measure_CustomWaveforms(Measure_CustomWaveforms):
793
+ """Base class for shelved readout.
794
+
795
+ Shelved readout applies a ``prx_12(pi)`` gate before and after a standard dispersive readout on each qubit measured.
796
+ The first ``prx_12(pi)`` swaps the amplitudes of the |1> and |2> states, and the second one swaps them back after
797
+ the measurement has (roughtly) collapsed the state. If the discriminator of the readout is calibrated such that
798
+ the |0> state is on one side and the |1> and |2> states are on the other, the end result is equivalent to the
799
+ standard readout operation but with the advantage that the population in the |2> state is less susceptible to
800
+ :math:`T_1` decay during the readout than the population in the |1> state.
801
+
802
+ .. note:: Mixed implementation multiplexing is not supported.
803
+ """
804
+
805
+ # Copied from `CompositeGate` to refresh caching after any calibration changes (in particular for the `prx_12`
806
+ # calibration)
807
+ def __call__(self, *args, **kwargs):
808
+ default_cache_key = tuple(args) + tuple(kwargs.items())
809
+ try:
810
+ hash(default_cache_key)
811
+ key_is_hashable = True
812
+ except TypeError:
813
+ key_is_hashable = False
814
+ if key_is_hashable:
815
+ if box := self.builder.composite_cache.get(self, default_cache_key):
816
+ return box
817
+ box = self._call(*args, **kwargs)
818
+ if key_is_hashable:
819
+ self.builder.composite_cache.set(self, default_cache_key, box)
820
+ return box
821
+
822
+ # `probe_timebox` is needed for making certain experiments work (e.g. `MeasurementQNDness`), since they call this
823
+ # function explicitly. However, the main functionality of this method will not work: Enabling mixed
824
+ # implementation multiplexing. This is because the method has to return time boxes due to the `prx_12` pulses,
825
+ # instead of `MultiplexedProbeTimeBox`
826
+ # TODO: Enable mixed implementation multiplexing for shelved readout
827
+ def probe_timebox(
828
+ self, key: str = "", feedback_key: str = "", do_acquisition: bool = True, _skip_override: bool = False
829
+ ) -> TimeBox:
830
+ # type: ignore[override]
831
+ if _skip_override:
832
+ return super().probe_timebox(key, feedback_key, do_acquisition)
833
+ multiplexed_timeboxes = super().probe_timebox(key, feedback_key)
834
+ prx_12_impl = [self.builder.get_implementation("prx_12", [q])(np.pi) for q in self.locus]
835
+
836
+ boxes = prx_12_impl + multiplexed_timeboxes + prx_12_impl
837
+ return boxes
838
+
839
+ def _call(self, key: str = "", feedback_key: str = "") -> TimeBox: # type: ignore[override]
840
+ shelved_measure_box = TimeBox.composite(
841
+ self.probe_timebox(key=key, feedback_key=feedback_key), label=f"Readout on {self.locus}"
842
+ )
843
+ shelved_measure_box.neighborhood_components[0] = shelved_measure_box.children[
844
+ len(self.locus)
845
+ ].neighborhood_components[0]
846
+
847
+ return shelved_measure_box
848
+
849
+
850
+ class Shelved_Measure_Constant(Shelved_Measure_CustomWaveforms, wave_i=Constant, wave_q=Constant):
851
+ """Implementation of a shelved readout.
852
+
853
+ A measure gate implemented as a constant waveform is surrounded by two `prx_12` gates.
854
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-pulse
3
- Version: 9.12.0
3
+ Version: 9.14.0
4
4
  Summary: A Python-based project for providing interface and implementations for control pulses.
5
5
  Author-email: IQM Finland Oy <info@meetiqm.com>
6
6
  License: Apache License
@@ -214,7 +214,7 @@ Requires-Python: >=3.11
214
214
  Description-Content-Type: text/x-rst
215
215
  License-File: LICENSE.txt
216
216
  Requires-Dist: iqm-exa-common <27,>=26
217
- Requires-Dist: iqm-data-definitions <3.0,>=2.6
217
+ Requires-Dist: iqm-data-definitions <3.0,>=2.13
218
218
  Requires-Dist: python-rapidjson ==1.20
219
219
  Requires-Dist: jinja2 ==3.0.3
220
220
  Requires-Dist: numpy <3.0,>=1.26.4
@@ -8,15 +8,15 @@ iqm/pulse/scheduler.py,sha256=jBi68_Y1RVNe3aDmP4wmudDs5vXCHZm-UXl3IpgNDDM,22738
8
8
  iqm/pulse/timebox.py,sha256=w3R6VafBXx_cGWrcvI_6x1e6JII_9v1vxQoRSGIjtXE,16591
9
9
  iqm/pulse/utils.py,sha256=HyTkMD0er_rZnvDZWM1WscOFxaxGMyRAW_Aw36b0Hdc,7998
10
10
  iqm/pulse/validation.py,sha256=-tZWrW201t4nbTQWeZ8M9DixzoN8B0Q63IP57BfDAz0,10733
11
- iqm/pulse/gates/__init__.py,sha256=zMz1jDQg6EFsTreNu0NyhOWpecWnbAntrvSlJQa7Xoo,12926
11
+ iqm/pulse/gates/__init__.py,sha256=UI6kx0MrXw4Fqz8OFkVo8rZirNbSfT1dlWpnnG8ELwQ,12986
12
12
  iqm/pulse/gates/barrier.py,sha256=WhYV70lf4lh4Wa9UZuMk2lp9JbUQIu8lzewRC2P7pNE,2546
13
13
  iqm/pulse/gates/conditional.py,sha256=3tW5kVt2M2xaTJxaixTErU5DTe91F0uE9BN9kopBEkQ,6242
14
14
  iqm/pulse/gates/cz.py,sha256=QgV-mn2aPDbfNplwEi18Lll4Zle-IELpn43IPM6Q_w8,20141
15
- iqm/pulse/gates/default_gates.py,sha256=kLNYjt-ZXYPvfBS1p8pi7e3gZz2UnMSWS4S2Xmj6omg,9413
15
+ iqm/pulse/gates/default_gates.py,sha256=choy57ODXqXvpqY7rFMsZDHqxbDaIosu5Zy70sVbRL8,9516
16
16
  iqm/pulse/gates/delay.py,sha256=nST9dY2JFp_mpKhiSfsYa5yL4hFKcNJSAyCzXjhauQg,3767
17
17
  iqm/pulse/gates/enums.py,sha256=ATwb6vZYpfgQ1gQyFPW53JyIKrdAP3FPHm6jV-t9OAk,2532
18
18
  iqm/pulse/gates/flux_multiplexer.py,sha256=5psam8_3z796z2nL-A2RKzDGTRDE-7GJ4F0aYCgaPUY,9691
19
- iqm/pulse/gates/measure.py,sha256=izqaO4Pxxb7THJhs6tx3QT_YCFDpdt8Mi30E-gwvM7g,40429
19
+ iqm/pulse/gates/measure.py,sha256=jUofgAZENB9pNXuChD4wzxvRYJ_LlfOnn12-M-N3hJw,43892
20
20
  iqm/pulse/gates/move.py,sha256=yKY-Et4YJV0KmcDwN0yE3oHgDtLL-Xfgy1G_InsJN0U,17182
21
21
  iqm/pulse/gates/prx.py,sha256=SaJHcVu-NURUBTF5LtmTwwK1qcCtXA89NA5VwJXBM1o,24504
22
22
  iqm/pulse/gates/reset.py,sha256=vYbzaA0pg3r5Oh6Edpu6NPlYoq1M7_tEWnf-7SHig4o,7589
@@ -38,8 +38,8 @@ iqm/pulse/playlist/visualisation/templates/static/logo.png,sha256=rbfQZ6_UEaztpY
38
38
  iqm/pulse/playlist/visualisation/templates/static/moment.min.js,sha256=4iQZ6BVL4qNKlQ27TExEhBN1HFPvAvAMbFavKKosSWQ,53324
39
39
  iqm/pulse/playlist/visualisation/templates/static/vis-timeline-graph2d.min.css,sha256=svzNasPg1yR5gvEaRei2jg-n4Pc3sVyMUWeS6xRAh6U,19837
40
40
  iqm/pulse/playlist/visualisation/templates/static/vis-timeline-graph2d.min.js,sha256=OqCqCyA6JnxPz3PGXq_P_9VuSqWptgNt5Ev3T-xjefQ,570288
41
- iqm_pulse-9.12.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
42
- iqm_pulse-9.12.0.dist-info/METADATA,sha256=1p7ml90Petlk05mvVYIuJFhZuIrsxb5y3d23PBwGUgs,14523
43
- iqm_pulse-9.12.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
44
- iqm_pulse-9.12.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
45
- iqm_pulse-9.12.0.dist-info/RECORD,,
41
+ iqm_pulse-9.14.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
42
+ iqm_pulse-9.14.0.dist-info/METADATA,sha256=TqnEuz_4eFndGLja-YbC8wNkP-nZNk2O_PQvbItwuZc,14524
43
+ iqm_pulse-9.14.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
44
+ iqm_pulse-9.14.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
45
+ iqm_pulse-9.14.0.dist-info/RECORD,,