iqm-pulse 11.1.0__py3-none-any.whl → 11.2.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.
@@ -176,6 +176,50 @@ class PolynomialCosine(Waveform):
176
176
  return {"frequency": "Hz", "phase": "rad", "coefficients": ""}
177
177
 
178
178
 
179
+ @dataclass(frozen=True)
180
+ class PiecewiseConstant(Waveform):
181
+ r"""Piecewise constant waveform.
182
+
183
+ The values are assumed to be in the range :math:`[-1, 1]`, and the changepoints are
184
+ assumed to be in the Nyquist-zone of the duration,
185
+ i.e. in the range [-`duration`/2, `duration`/2]
186
+
187
+ Args:
188
+ changepoints: Array of the changepoints of the piecewise constant function.
189
+ values: Array of the values of the piecewise constant function.
190
+ Must have one more element than ``changepoints``.
191
+
192
+ """
193
+
194
+ changepoints: np.ndarray
195
+ values: np.ndarray
196
+
197
+ def __post_init__(self):
198
+ if len(self.values) != len(self.changepoints) + 1:
199
+ raise ValueError("The number of values must be one more than the number of changepoints.")
200
+
201
+ @staticmethod
202
+ def non_timelike_attributes() -> dict[str, str]:
203
+ return {
204
+ "values": "",
205
+ }
206
+
207
+ def _sample(self, sample_coords: np.ndarray) -> np.ndarray:
208
+ condlist = []
209
+ # Before first changepoint
210
+ condlist.append(sample_coords < self.changepoints[0])
211
+
212
+ for i in range(len(self.changepoints) - 1):
213
+ condlist.append((sample_coords >= self.changepoints[i]) & (sample_coords < self.changepoints[i + 1]))
214
+
215
+ condlist.append(sample_coords >= self.changepoints[-1])
216
+
217
+ funclist = (
218
+ [self.values[0]] + [self.values[i + 1] for i in range(len(self.changepoints) - 1)] + [self.values[-1]]
219
+ )
220
+ return np.piecewise(sample_coords, condlist, funclist)
221
+
222
+
179
223
  @dataclass(frozen=True)
180
224
  class Slepian(Waveform):
181
225
  r"""Slepian waveform, which minimizes non-adiabatic errors during a gate.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iqm-pulse
3
- Version: 11.1.0
3
+ Version: 11.2.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
@@ -31,7 +31,7 @@ iqm/pulse/playlist/hd_drag.py,sha256=JYRy3aPu0LD9y0H3UncOiWI39eV9-TARvgLonNUsaO0
31
31
  iqm/pulse/playlist/instructions.py,sha256=z9umJqFLTsSd26EuzW-X5raWVHGpSLds9s4m8tDAV-E,10249
32
32
  iqm/pulse/playlist/playlist.py,sha256=7MIX4iRfh2Nit8AnpNyqv5A5ZmK7JR-v201DXVL6kUk,685
33
33
  iqm/pulse/playlist/schedule.py,sha256=ToaHKgDxNxLUQalI2TAMMld-EH5Im9rZNktQkXhOyBk,18037
34
- iqm/pulse/playlist/waveforms.py,sha256=eYFmWAbaJkZtYc2IsejgyR_DqbeKXJy4tMqAcA18BeY,22577
34
+ iqm/pulse/playlist/waveforms.py,sha256=rbP87uMjieKTYi6g4Twx_oPiVIDCTcTuWz5LaYhsaCA,24101
35
35
  iqm/pulse/playlist/visualisation/__init__.py,sha256=wCNfJHIR_bqG3ZBlgm55v90Rih7VCpfctoIMfwRMgjk,567
36
36
  iqm/pulse/playlist/visualisation/base.py,sha256=qk7oHvMFk7d3ybNwJ7TpZEX8ahxfzB-kVCzqgjKM71Y,8932
37
37
  iqm/pulse/playlist/visualisation/templates/playlist_inspection.jinja2,sha256=4XPmpISH5LLOf3YjmK3OKfvkAWj4TlzD2K4ClFTvZhI,11511
@@ -39,8 +39,8 @@ iqm/pulse/playlist/visualisation/templates/static/logo.png,sha256=rbfQZ6_UEaztpY
39
39
  iqm/pulse/playlist/visualisation/templates/static/moment.min.js,sha256=4iQZ6BVL4qNKlQ27TExEhBN1HFPvAvAMbFavKKosSWQ,53324
40
40
  iqm/pulse/playlist/visualisation/templates/static/vis-timeline-graph2d.min.css,sha256=svzNasPg1yR5gvEaRei2jg-n4Pc3sVyMUWeS6xRAh6U,19837
41
41
  iqm/pulse/playlist/visualisation/templates/static/vis-timeline-graph2d.min.js,sha256=OqCqCyA6JnxPz3PGXq_P_9VuSqWptgNt5Ev3T-xjefQ,570288
42
- iqm_pulse-11.1.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
43
- iqm_pulse-11.1.0.dist-info/METADATA,sha256=kEcGLtU-Lxe7qpYcX0EPV_B0eKs4wKWiFzv4JXIaQKU,14551
44
- iqm_pulse-11.1.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
45
- iqm_pulse-11.1.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
46
- iqm_pulse-11.1.0.dist-info/RECORD,,
42
+ iqm_pulse-11.2.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
43
+ iqm_pulse-11.2.0.dist-info/METADATA,sha256=LwwqFnDeeW1USz6YKNHEJjkxIkkwenUhpOV0UmvOwIg,14551
44
+ iqm_pulse-11.2.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
45
+ iqm_pulse-11.2.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
46
+ iqm_pulse-11.2.0.dist-info/RECORD,,