boulder-opal-scale-up-sdk 1.0.3__py3-none-any.whl → 1.0.5__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.
Files changed (49) hide show
  1. {boulder_opal_scale_up_sdk-1.0.3.dist-info → boulder_opal_scale_up_sdk-1.0.5.dist-info}/METADATA +1 -1
  2. boulder_opal_scale_up_sdk-1.0.5.dist-info/RECORD +73 -0
  3. boulderopalscaleupsdk/agent/worker.py +23 -4
  4. boulderopalscaleupsdk/common/dtypes.py +31 -1
  5. boulderopalscaleupsdk/device/__init__.py +0 -7
  6. boulderopalscaleupsdk/device/config_loader.py +1 -0
  7. boulderopalscaleupsdk/device/controller/qblox.py +222 -25
  8. boulderopalscaleupsdk/device/defcal.py +5 -44
  9. boulderopalscaleupsdk/device/device.py +45 -3
  10. boulderopalscaleupsdk/device/processor/__init__.py +0 -2
  11. boulderopalscaleupsdk/device/processor/common.py +1 -6
  12. boulderopalscaleupsdk/device/processor/superconducting_processor.py +34 -7
  13. boulderopalscaleupsdk/experiments/__init__.py +24 -2
  14. boulderopalscaleupsdk/experiments/chi01_scan.py +18 -15
  15. boulderopalscaleupsdk/experiments/common.py +0 -16
  16. boulderopalscaleupsdk/experiments/drag_leakage_calibration.py +66 -0
  17. boulderopalscaleupsdk/experiments/fine_amplitude_calibration.py +54 -0
  18. boulderopalscaleupsdk/experiments/power_rabi.py +22 -16
  19. boulderopalscaleupsdk/experiments/power_rabi_ef.py +67 -0
  20. boulderopalscaleupsdk/experiments/ramsey.py +21 -18
  21. boulderopalscaleupsdk/experiments/readout_classifier_calibration.py +30 -8
  22. boulderopalscaleupsdk/experiments/resonator_spectroscopy.py +20 -18
  23. boulderopalscaleupsdk/experiments/resonator_spectroscopy_by_bias.py +23 -20
  24. boulderopalscaleupsdk/experiments/resonator_spectroscopy_by_power.py +22 -21
  25. boulderopalscaleupsdk/experiments/t1.py +16 -22
  26. boulderopalscaleupsdk/experiments/t2.py +19 -16
  27. boulderopalscaleupsdk/experiments/t2_echo.py +51 -0
  28. boulderopalscaleupsdk/experiments/transmon_anharmonicity.py +26 -24
  29. boulderopalscaleupsdk/experiments/transmon_spectroscopy.py +19 -17
  30. boulderopalscaleupsdk/experiments/voltage_bias_fine_tune.py +58 -0
  31. boulderopalscaleupsdk/experiments/waveforms.py +63 -0
  32. boulderopalscaleupsdk/experiments/zz_ramsey.py +59 -0
  33. boulderopalscaleupsdk/plotting/dtypes.py +6 -3
  34. boulderopalscaleupsdk/protobuf/v1/agent_pb2.py +9 -3
  35. boulderopalscaleupsdk/protobuf/v1/agent_pb2.pyi +14 -0
  36. boulderopalscaleupsdk/protobuf/v1/agent_pb2_grpc.py +34 -0
  37. boulderopalscaleupsdk/protobuf/v1/device_pb2.py +32 -32
  38. boulderopalscaleupsdk/protobuf/v1/device_pb2.pyi +8 -4
  39. boulderopalscaleupsdk/routines/__init__.py +25 -1
  40. boulderopalscaleupsdk/routines/common.py +13 -0
  41. boulderopalscaleupsdk/routines/one_qubit_calibration.py +36 -0
  42. boulderopalscaleupsdk/routines/resonator_mapping.py +17 -1
  43. boulderopalscaleupsdk/routines/transmon_coherence.py +34 -0
  44. boulderopalscaleupsdk/routines/transmon_discovery.py +41 -0
  45. boulderopalscaleupsdk/routines/transmon_retuning.py +41 -0
  46. boulderopalscaleupsdk/stubs/maps.py +11 -2
  47. boulder_opal_scale_up_sdk-1.0.3.dist-info/RECORD +0 -62
  48. {boulder_opal_scale_up_sdk-1.0.3.dist-info → boulder_opal_scale_up_sdk-1.0.5.dist-info}/LICENSE +0 -0
  49. {boulder_opal_scale_up_sdk-1.0.3.dist-info → boulder_opal_scale_up_sdk-1.0.5.dist-info}/WHEEL +0 -0
@@ -12,14 +12,56 @@
12
12
  # License for the specific language.
13
13
 
14
14
 
15
+ from pydantic import BaseModel
15
16
  from pydantic.dataclasses import dataclass
16
17
 
18
+ from boulderopalscaleupsdk.common.dtypes import ISO8601DatetimeUTCLike
19
+ from boulderopalscaleupsdk.device.controller import (
20
+ QBLOXControllerInfo,
21
+ QuantumMachinesControllerInfo,
22
+ )
23
+ from boulderopalscaleupsdk.device.defcal import DefCalData
24
+ from boulderopalscaleupsdk.device.processor import SuperconductingProcessor
25
+
17
26
 
18
27
  @dataclass
19
- class InvalidDevice:
28
+ class EmptyDefCalData:
20
29
  message: str
21
30
 
22
31
 
32
+ DeviceName = str
33
+
34
+
23
35
  @dataclass
24
- class InvalidDeviceComponent:
25
- message: str
36
+ class DeviceData:
37
+ # TODO: retire DeviceInfo the next SDK release
38
+ qpu: SuperconductingProcessor # | OtherSDKProcessorType
39
+ controller_info: QBLOXControllerInfo | QuantumMachinesControllerInfo
40
+ _defcals: dict[tuple[str, tuple[str, ...]], DefCalData]
41
+
42
+ def get_defcal(self, gate: str, addr: tuple[str, ...]) -> DefCalData | EmptyDefCalData:
43
+ """
44
+ Get the defcal data for a specific gate and address alias.
45
+ """
46
+ if self._defcals == {}:
47
+ return EmptyDefCalData(message="No defcal data available in a fresh device.")
48
+ _addr = tuple(i.lower() for i in sorted(addr))
49
+ defcal = self._defcals.get((gate, _addr))
50
+ if defcal is None:
51
+ return EmptyDefCalData(
52
+ message=f"No defcal data found for gate '{gate}' and address '{_addr}'.",
53
+ )
54
+ return defcal
55
+
56
+
57
+ class DeviceSummary(BaseModel):
58
+ id: str
59
+ organization_id: str
60
+ name: str
61
+ provider: str
62
+ updated_at: ISO8601DatetimeUTCLike
63
+ created_at: ISO8601DatetimeUTCLike
64
+ copied_from: DeviceName | None = None
65
+
66
+ def __str__(self):
67
+ return f'DeviceSummary(name="{self.name}", id="{self.id}")'
@@ -14,7 +14,6 @@
14
14
  __all__ = [
15
15
  "CalibrationThresholds",
16
16
  "ComponentParameter",
17
- "DurationComponentParameter",
18
17
  "FloatComponentParameter",
19
18
  "SuperconductingProcessor",
20
19
  "SuperconductingProcessorTemplate",
@@ -24,7 +23,6 @@ __all__ = [
24
23
  from .common import (
25
24
  CalibrationThresholds,
26
25
  ComponentParameter,
27
- DurationComponentParameter,
28
26
  FloatComponentParameter,
29
27
  update_parameter,
30
28
  )
@@ -200,7 +200,7 @@ class ComponentParameter(Generic[T]):
200
200
  ):
201
201
  self.calibration_status = _get_calibration_status_from_thresholds(
202
202
  value=to_float(self.value),
203
- confidence_interval=to_float(self.err_plus) - to_float(self.err_minus),
203
+ confidence_interval=to_float(self.err_plus) + to_float(self.err_minus),
204
204
  calibration_thresholds=calibration_thresholds,
205
205
  )
206
206
  self.updated_at = datetime.now(UTC)
@@ -272,8 +272,3 @@ FloatComponentParameter = Annotated[
272
272
  ComponentParameter[float],
273
273
  BeforeValidator(lambda value: ComponentParameter.from_value(value, float)),
274
274
  ]
275
-
276
- DurationComponentParameter = Annotated[
277
- ComponentParameter[Duration],
278
- BeforeValidator(lambda value: ComponentParameter.from_value(value, Duration)),
279
- ]
@@ -26,7 +26,6 @@ from boulderopalscaleupsdk.device.common import (
26
26
  )
27
27
  from boulderopalscaleupsdk.device.processor import (
28
28
  ComponentParameter,
29
- DurationComponentParameter,
30
29
  FloatComponentParameter,
31
30
  )
32
31
 
@@ -44,15 +43,15 @@ class Transmon(Component[Literal["tunable"]]):
44
43
  default=ComponentParameter(value=0.0),
45
44
  json_schema_extra={"display": {"label": "anharm", "unit": "MHz", "scale": 1e-6}},
46
45
  )
47
- t1: DurationComponentParameter = Field(
46
+ t1: ComponentParameter[Duration] = Field(
48
47
  default=ComponentParameter(value=Duration(0, TimeUnit.NS)),
49
48
  json_schema_extra={"display": {"label": "t1", "unit": "µs", "scale": 1e6}},
50
49
  )
51
- t2: DurationComponentParameter = Field(
50
+ t2: ComponentParameter[Duration] = Field(
52
51
  default=ComponentParameter(value=Duration(0, TimeUnit.NS)),
53
52
  json_schema_extra={"display": {"label": "t2", "unit": "µs", "scale": 1e6}},
54
53
  )
55
- t2_echo: DurationComponentParameter = Field(
54
+ t2_echo: ComponentParameter[Duration] = Field(
56
55
  default=ComponentParameter(value=Duration(0, TimeUnit.NS)),
57
56
  json_schema_extra={"display": {"label": "t2_echo", "unit": "µs", "scale": 1e6}},
58
57
  )
@@ -64,6 +63,14 @@ class Transmon(Component[Literal["tunable"]]):
64
63
  default=ComponentParameter(value=0.0),
65
64
  json_schema_extra={"display": {"label": "sx_vp", "unit": "V", "scale": 1}},
66
65
  )
66
+ x_ef_vp: FloatComponentParameter = Field(
67
+ default=ComponentParameter(value=0.0),
68
+ json_schema_extra={"display": {"label": "x_ef_vp", "unit": "V", "scale": 1}},
69
+ )
70
+ sx_ef_vp: FloatComponentParameter = Field(
71
+ default=ComponentParameter(value=0.0),
72
+ json_schema_extra={"display": {"label": "sx_ef_vp", "unit": "V", "scale": 1}},
73
+ )
67
74
 
68
75
  # Tunable transmon parameters.
69
76
  dc_bias: FloatComponentParameter = Field(
@@ -154,7 +161,27 @@ class Feedline(Component[Literal["feedline"]]):
154
161
  traits: list = Field(default=[])
155
162
 
156
163
 
157
- SuperconductingComponentType = Transmon | Resonator | Port | Feedline | Filter | Coupler
164
+ class TWPA(Component[Literal["twpa"]]):
165
+ dtype: Literal["twpa"] = "twpa"
166
+ traits: list = Field(default=[])
167
+
168
+ impedance: FloatComponentParameter = Field(
169
+ default=ComponentParameter(value=0.0),
170
+ json_schema_extra={"display": {"label": "impedance", "unit": "Ohm", "scale": 1}},
171
+ )
172
+
173
+ # Tunable TWPA parameters
174
+ pump_power: FloatComponentParameter = Field(
175
+ default=ComponentParameter(value=0.0),
176
+ json_schema_extra={"display": {"label": "pump_power", "unit": "dBm", "scale": 1}},
177
+ )
178
+ pump_freq: FloatComponentParameter = Field(
179
+ default=ComponentParameter(value=(0.0)),
180
+ json_schema_extra={"display": {"label": "pump_freq", "unit": "MHz", "scale": 1e-6}},
181
+ )
182
+
183
+
184
+ SuperconductingComponentType = Transmon | Resonator | Port | Feedline | Filter | Coupler | TWPA
158
185
 
159
186
 
160
187
  class Edge(BaseModel):
@@ -169,14 +196,14 @@ class TemplateParam(BaseModel):
169
196
 
170
197
 
171
198
  class ProcessorTemplate(BaseModel):
172
- elements: dict[str, Transmon | Resonator | Port | Feedline | Filter | Coupler]
199
+ elements: dict[str, SuperconductingComponentType]
173
200
  edges: list[Edge]
174
201
 
175
202
 
176
203
  class SuperconductingProcessorTemplate(BaseModel):
177
204
  build: list[TemplateParam]
178
205
  templates: dict[str, ProcessorTemplate]
179
- device_parameters: dict[str, Transmon | Resonator | Port | Feedline | Filter | Coupler] = Field(
206
+ device_parameters: dict[str, SuperconductingComponentType] = Field(
180
207
  default={},
181
208
  )
182
209
 
@@ -19,32 +19,44 @@ __all__ = [
19
19
  "CWSIterable",
20
20
  "Chi01Scan",
21
21
  "ConstantWaveform",
22
+ "DragCosineWaveform",
23
+ "DragLeakageCalibration",
22
24
  "Experiment",
25
+ "FineAmplitudeCalibration",
23
26
  "GaussianWaveform",
24
27
  "HypIterable",
25
28
  "LinspaceIterable",
29
+ "LogspaceIterable",
26
30
  "PowerRabi",
31
+ "PowerRabiEF",
27
32
  "Ramsey",
28
33
  "RangeIterable",
29
34
  "ReadoutClassifierCalibration",
30
35
  "ResonatorSpectroscopy",
31
36
  "ResonatorSpectroscopyByBias",
32
37
  "ResonatorSpectroscopyByPower",
38
+ "T2Echo",
33
39
  "TransmonAnharmonicity",
34
40
  "TransmonSpectroscopy",
41
+ "VoltageBiasFineTune",
42
+ "Waveform",
43
+ "ZZRamsey",
44
+ "update_amplitude",
35
45
  ]
36
46
 
37
47
  from .chi01_scan import Chi01Scan
38
48
  from .common import (
39
- ConstantWaveform,
40
49
  CWSIterable,
41
50
  Experiment,
42
- GaussianWaveform,
43
51
  HypIterable,
44
52
  LinspaceIterable,
53
+ LogspaceIterable,
45
54
  RangeIterable,
46
55
  )
56
+ from .drag_leakage_calibration import DragLeakageCalibration
57
+ from .fine_amplitude_calibration import FineAmplitudeCalibration
47
58
  from .power_rabi import PowerRabi
59
+ from .power_rabi_ef import PowerRabiEF
48
60
  from .ramsey import Ramsey
49
61
  from .readout_classifier_calibration import ReadoutClassifierCalibration
50
62
  from .resonator_spectroscopy import ResonatorSpectroscopy
@@ -52,5 +64,15 @@ from .resonator_spectroscopy_by_bias import ResonatorSpectroscopyByBias
52
64
  from .resonator_spectroscopy_by_power import ResonatorSpectroscopyByPower
53
65
  from .t1 import T1
54
66
  from .t2 import T2
67
+ from .t2_echo import T2Echo
55
68
  from .transmon_anharmonicity import TransmonAnharmonicity
56
69
  from .transmon_spectroscopy import TransmonSpectroscopy
70
+ from .voltage_bias_fine_tune import VoltageBiasFineTune
71
+ from .waveforms import (
72
+ ConstantWaveform,
73
+ DragCosineWaveform,
74
+ GaussianWaveform,
75
+ Waveform,
76
+ update_amplitude,
77
+ )
78
+ from .zz_ramsey import ZZRamsey
@@ -11,19 +11,18 @@
11
11
  # distributed under the License is distributed on an "AS IS" BASIS. See the
12
12
  # License for the specific language.
13
13
 
14
+ from typing import Literal
15
+
14
16
  from pydantic import PrivateAttr
15
17
 
16
18
  from .common import (
17
- ConstantWaveform,
18
19
  CWSIterable,
19
20
  Experiment,
20
21
  HypIterable,
21
22
  LinspaceIterable,
22
23
  RangeIterable,
23
24
  )
24
-
25
- DEFAULT_RECYCLE_DELAY_NS = 10_000
26
- DEFAULT_SHOT_COUNT = 100
25
+ from .waveforms import ConstantWaveform
27
26
 
28
27
 
29
28
  class Chi01Scan(Experiment):
@@ -34,20 +33,22 @@ class Chi01Scan(Experiment):
34
33
  Attributes
35
34
  ----------
36
35
  transmon : str
37
- The reference for the transmon to target in the experiment.
38
- frequencies : list[int] or LinspaceIterable or RangeIterable or CWSIterable
36
+ The reference for the transmon to target.
37
+ frequencies : list[int] or LinspaceIterable or RangeIterable or CWSIterable \
39
38
  or HypIterable or None, optional
40
- The frequencies at which to scan.
41
- If None, frequencies around the readout frequency will be used.
39
+ The frequencies at which to scan, in Hz.
40
+ Defaults to a scan around the readout frequency.
42
41
  recycle_delay_ns : int, optional
43
- The delay time between consecutive shots of the experiment, in nanoseconds.
44
- Defaults to 10000 ns.
42
+ The delay between consecutive shots, in nanoseconds. Defaults to 200,000 ns.
45
43
  shot_count : int, optional
46
- The number of shots to be taken in the experiment.
47
- Defaults to 100.
44
+ The number of shots to take. Defaults to 100.
48
45
  measure_waveform : ConstantWaveform or None, optional
49
46
  The waveform to use for the measurement pulse.
50
- If not provided, the measurement defcal will be used.
47
+ Defaults to the measurement defcal.
48
+ run_mixer_calibration: bool
49
+ Whether to run mixer calibrations before running a program. Defaults to False.
50
+ update : "auto" or "off" or "prompt", optional
51
+ How the device should be updated after an experiment run. Defaults to auto.
51
52
  """
52
53
 
53
54
  _experiment_name: str = PrivateAttr("chi01_scan")
@@ -56,6 +57,8 @@ class Chi01Scan(Experiment):
56
57
  frequencies: list[int] | LinspaceIterable | RangeIterable | CWSIterable | HypIterable | None = (
57
58
  None
58
59
  )
59
- recycle_delay_ns: int = DEFAULT_RECYCLE_DELAY_NS
60
- shot_count: int = DEFAULT_SHOT_COUNT
60
+ recycle_delay_ns: int = 200_000
61
+ shot_count: int = 100
61
62
  measure_waveform: ConstantWaveform | None = None
63
+ run_mixer_calibration: bool = False
64
+ update: Literal["auto", "off", "prompt"] = "auto"
@@ -14,7 +14,6 @@
14
14
  from typing import Literal
15
15
 
16
16
  from pydantic import BaseModel, ConfigDict, Field
17
- from pydantic.dataclasses import dataclass
18
17
 
19
18
 
20
19
  class Experiment(BaseModel):
@@ -98,18 +97,3 @@ class HypIterable(_RangeIterable):
98
97
  width: float
99
98
  # The number of values. Defaults to 51.
100
99
  count: int = Field(default=51)
101
-
102
-
103
- @dataclass
104
- class ConstantWaveform:
105
- duration_ns: int
106
- scale: float
107
- waveform_type: Literal["constant"] = "constant"
108
-
109
-
110
- @dataclass
111
- class GaussianWaveform:
112
- duration_ns: int
113
- amplitude: float
114
- sigma: float
115
- waveform_type: Literal["gaussian"] = "gaussian"
@@ -0,0 +1,66 @@
1
+ # Copyright 2025 Q-CTRL. All rights reserved.
2
+ #
3
+ # Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
4
+ # copying or use of this file, via any medium, is strictly prohibited.
5
+ # Proprietary and confidential. You may not use this file except in compliance
6
+ # with the License. You may obtain a copy of the License at
7
+ #
8
+ # https://q-ctrl.com/terms
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS. See the
12
+ # License for the specific language.
13
+
14
+ from typing import Literal
15
+
16
+ from pydantic import PrivateAttr, field_validator
17
+
18
+ from .common import CWSIterable, Experiment
19
+
20
+
21
+ class DragLeakageCalibration(Experiment):
22
+ """
23
+ Parameters for running a DRAG leakage calibration experiment for
24
+ a specified gate on a transmon.
25
+
26
+ Attributes
27
+ ----------
28
+ transmon : str
29
+ The reference for the transmon to target.
30
+ recycle_delay_ns : int
31
+ The delay between consecutive shots, in nanoseconds. Defaults to 10,000 ns.
32
+ shot_count : int, optional
33
+ The number of shots to take. Defaults to 1,000.
34
+ alphas: list[float] or CWSIterable
35
+ List of values to sweep for DRAG parameter alpha.
36
+ repetitions : list[int]
37
+ List of repetition counts for the calibration experiment.
38
+ gate : "sx" or "x"
39
+ The gate to calibrate.
40
+ anharmonicity : float or None, optional
41
+ The anharmonicity of the transmon, in Hz.
42
+ Defaults to None, in which case the anharmonicity of the transmon will be used.
43
+ drag_guess : float
44
+ Initial guess for the DRAG parameter.
45
+ update : "auto" or "off" or "prompt", optional
46
+ How the device should be updated after an experiment run. Defaults to auto.
47
+ """
48
+
49
+ _experiment_name: str = PrivateAttr("drag_leakage_calibration")
50
+
51
+ transmon: str
52
+ recycle_delay_ns: int = 10_000
53
+ shot_count: int = 1_000
54
+ alphas: list[float] | CWSIterable
55
+ repetitions: list[int]
56
+ gate: Literal["x", "sx"]
57
+ anharmonicity: float | None = None
58
+ drag_guess: float
59
+ update: Literal["auto", "off", "prompt"] = "auto"
60
+
61
+ @field_validator("alphas")
62
+ @classmethod
63
+ def validate_alphas(cls, value: list[float] | CWSIterable):
64
+ if isinstance(value, CWSIterable) and value.center is None:
65
+ raise TypeError("The center of alphas must not be None.")
66
+ return value
@@ -0,0 +1,54 @@
1
+ # Copyright 2025 Q-CTRL. All rights reserved.
2
+ #
3
+ # Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
4
+ # copying or use of this file, via any medium, is strictly prohibited.
5
+ # Proprietary and confidential. You may not use this file except in compliance
6
+ # with the License. You may obtain a copy of the License at
7
+ #
8
+ # https://q-ctrl.com/terms
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS. See the
12
+ # License for the specific language.
13
+
14
+ from typing import Literal
15
+
16
+ from pydantic import Field, PrivateAttr
17
+
18
+ from .common import Experiment
19
+ from .waveforms import ConstantWaveform
20
+
21
+
22
+ class FineAmplitudeCalibration(Experiment):
23
+ """
24
+ Parameters for running a fine amplitude calibration experiment for
25
+ a specified gate on a transmon.
26
+
27
+ Attributes
28
+ ----------
29
+ transmon : str
30
+ The reference for the transmon to target.
31
+ gate : Literal["sx", "x"]
32
+ The gate to be calibrated.
33
+ repetitions : list[int]
34
+ List of repetition counts for the calibration experiment.
35
+ recycle_delay_ns : int
36
+ The delay between consecutive shots, in nanoseconds. Defaults to 10,000 ns.
37
+ shot_count : int, optional
38
+ The number of shots to take. Defaults to 1000.
39
+ measure_waveform : ConstantWaveform or None, optional
40
+ The waveform to use for the measurement pulse.
41
+ Defaults to the measurement defcal.
42
+ update : "auto" or "off" or "prompt", optional
43
+ How the device should be updated after an experiment run. Defaults to auto.
44
+ """
45
+
46
+ _experiment_name: str = PrivateAttr("fine_amplitude_calibration")
47
+
48
+ transmon: str
49
+ gate: Literal["sx", "x"]
50
+ repetitions: list[int] = Field(default=list(range(0, 100, 4)))
51
+ recycle_delay_ns: int = 10_000
52
+ shot_count: int = 1000
53
+ measure_waveform: ConstantWaveform | None = None
54
+ update: Literal["auto", "off", "prompt"] = "auto"
@@ -11,51 +11,57 @@
11
11
  # distributed under the License is distributed on an "AS IS" BASIS. See the
12
12
  # License for the specific language.
13
13
 
14
+ from typing import Literal
15
+
14
16
  from pydantic import PrivateAttr
15
17
 
16
18
  from .common import (
17
- ConstantWaveform,
18
19
  CWSIterable,
19
20
  Experiment,
20
- GaussianWaveform,
21
21
  HypIterable,
22
22
  LinspaceIterable,
23
23
  RangeIterable,
24
24
  )
25
-
26
- DEFAULT_SHOT_COUNT = 400
25
+ from .waveforms import ConstantWaveform, Waveform
27
26
 
28
27
 
29
28
  class PowerRabi(Experiment):
30
29
  """
31
30
  Parameters for running a Power Rabi experiment.
32
31
 
33
- Parameters
32
+ Attributes
34
33
  ----------
35
34
  transmon : str
36
- The reference for the transmon to target in the experiment.
37
- scales : list[float] or LinspaceIterable or RangeIterable
35
+ The reference for the transmon to target.
36
+ scales : list[float] or LinspaceIterable or RangeIterable \
38
37
  or CWSIterable or HypIterable or None, optional
39
- The scaling factors for the drive pulse amplitude. If None, a default scan will be used.
40
- drive_waveform : GaussianWaveform
38
+ The scaling factors for the drive pulse amplitude.
39
+ If None, a default scan will be used.
40
+ drive_waveform : Waveform
41
41
  The waveform to use for the drive pulse.
42
42
  recycle_delay_ns : int
43
- The delay time between consecutive shots of the experiment, in nanoseconds.
43
+ The delay between consecutive shots, in nanoseconds. Defaults to 200,000 ns.
44
44
  shot_count : int, optional
45
- The number of shots to be taken in the experiment. Defaults to 400.
45
+ The number of shots to take. Defaults to 400.
46
46
  pulse_vp : float, optional
47
- The voltage per pulse. If None, a default value will be used.
47
+ The voltage per pulse, in Volts. Defaults to the amplitude of the X gate.
48
48
  measure_waveform : ConstantWaveform or None, optional
49
49
  The waveform to use for the measurement pulse.
50
- If not provided, the measurement defcal will be used.
50
+ Defaults to the measurement defcal.
51
+ run_mixer_calibration: bool
52
+ Whether to run mixer calibrations before running a program. Defaults to False.
53
+ update : "auto" or "off" or "prompt", optional
54
+ How the device should be updated after an experiment run. Defaults to auto.
51
55
  """
52
56
 
53
57
  _experiment_name: str = PrivateAttr("power_rabi")
54
58
 
55
59
  transmon: str
56
60
  scales: list[float] | LinspaceIterable | RangeIterable | CWSIterable | HypIterable | None = None
57
- drive_waveform: GaussianWaveform
58
- recycle_delay_ns: int
59
- shot_count: int = DEFAULT_SHOT_COUNT
61
+ drive_waveform: Waveform
62
+ recycle_delay_ns: int = 200_000
63
+ shot_count: int = 400
60
64
  pulse_vp: float | None = None
61
65
  measure_waveform: ConstantWaveform | None = None
66
+ run_mixer_calibration: bool = False
67
+ update: Literal["auto", "off", "prompt"] = "auto"
@@ -0,0 +1,67 @@
1
+ # Copyright 2025 Q-CTRL. All rights reserved.
2
+ #
3
+ # Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
4
+ # copying or use of this file, via any medium, is strictly prohibited.
5
+ # Proprietary and confidential. You may not use this file except in compliance
6
+ # with the License. You may obtain a copy of the License at
7
+ #
8
+ # https://q-ctrl.com/terms
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS. See the
12
+ # License for the specific language.
13
+
14
+ from typing import Literal
15
+
16
+ from pydantic import PrivateAttr
17
+
18
+ from .common import (
19
+ CWSIterable,
20
+ Experiment,
21
+ HypIterable,
22
+ LinspaceIterable,
23
+ RangeIterable,
24
+ )
25
+ from .waveforms import ConstantWaveform, Waveform
26
+
27
+
28
+ class PowerRabiEF(Experiment):
29
+ """
30
+ Parameters for running a Power Rabi EF experiment.
31
+
32
+ Attributes
33
+ ----------
34
+ transmon : str
35
+ The reference for the transmon to target.
36
+ scales : list[float] or LinspaceIterable or RangeIterable \
37
+ or CWSIterable or HypIterable or None, optional
38
+ The scaling factors for the drive pulse amplitude.
39
+ If None, a default scan will be used.
40
+ drive_waveform : Waveform
41
+ The waveform to use for the drive pulse.
42
+ recycle_delay_ns : int
43
+ The delay between consecutive shots, in nanoseconds. Defaults to 200,000 ns.
44
+ shot_count : int, optional
45
+ The number of shots to take. Defaults to 400.
46
+ pulse_vp : float, optional
47
+ The voltage per pulse, in Volts. Defaults to the amplitude of the X gate.
48
+ measure_waveform : ConstantWaveform or None, optional
49
+ The waveform to use for the measurement pulse.
50
+ Defaults to the measurement defcal.
51
+ run_mixer_calibration: bool
52
+ Whether to run mixer calibrations before running a program. Defaults to False.
53
+ update : "auto" or "off" or "prompt", optional
54
+ How the device should be updated after an experiment run. Defaults to auto.
55
+ """
56
+
57
+ _experiment_name: str = PrivateAttr("power_rabi_ef")
58
+
59
+ transmon: str
60
+ scales: list[float] | LinspaceIterable | RangeIterable | CWSIterable | HypIterable | None = None
61
+ drive_waveform: Waveform
62
+ recycle_delay_ns: int = 200_000
63
+ shot_count: int = 400
64
+ pulse_vp: float | None = None
65
+ measure_waveform: ConstantWaveform | None = None
66
+ run_mixer_calibration: bool = False
67
+ update: Literal["auto", "off", "prompt"] = "auto"
@@ -11,49 +11,52 @@
11
11
  # distributed under the License is distributed on an "AS IS" BASIS. See the
12
12
  # License for the specific language.
13
13
 
14
- from pydantic import PrivateAttr
14
+ from typing import Literal
15
15
 
16
- from .common import ConstantWaveform, Experiment
16
+ from pydantic import PrivateAttr
17
17
 
18
- DEFAULT_RECYCLE_DELAY_NS = 10_000
19
- DEFAULT_SHOT_COUNT = 400
20
- DEFAULT_DURATION_NS = 2_000
18
+ from .common import Experiment
19
+ from .waveforms import ConstantWaveform
21
20
 
22
21
 
23
22
  class Ramsey(Experiment):
24
23
  """
25
24
  Parameters for running a Ramsey experiment.
26
25
 
27
- Parameters
26
+ Attributes
28
27
  ----------
29
28
  transmon : str
30
- The reference for the transmon to target in the experiment.
31
- max_delay_ns : int
32
- The maximum delay time, in nanoseconds.
29
+ The reference for the transmon to target.
33
30
  min_delay_ns : int
34
31
  The minimum delay time, in nanoseconds.
32
+ max_delay_ns : int
33
+ The maximum delay time, in nanoseconds.
35
34
  delay_step_ns : int
36
35
  The step for generating the list of delays, in nanoseconds.
37
36
  virtual_detuning : float
38
- The difference between the drive signal frequency and the qubit frequency, in Hz.
37
+ The virtual detuning added between SX pulses, in Hz.
39
38
  recycle_delay_ns : int, optional
40
- The delay time between consecutive shots of the experiment, in nanoseconds.
41
- Defaults to 10000 ns.
39
+ The delay between consecutive shots, in nanoseconds. Defaults to 200,000 ns.
42
40
  shot_count : int, optional
43
- The number of shots to be taken in the experiment.
44
- Defaults to 400.
41
+ The number of shots to take. Defaults to 400.
45
42
  measure_waveform : ConstantWaveform or None, optional
46
43
  The waveform to use for the measurement pulse.
47
- If not provided, the measurement defcal will be used.
44
+ Defaults to the measurement defcal.
45
+ run_mixer_calibration: bool
46
+ Whether to run mixer calibrations before running a program. Defaults to False.
47
+ update : "auto" or "off" or "prompt", optional
48
+ How the device should be updated after an experiment run. Defaults to auto.
48
49
  """
49
50
 
50
51
  _experiment_name: str = PrivateAttr("ramsey")
51
52
 
52
53
  transmon: str
53
- max_delay_ns: int
54
54
  min_delay_ns: int
55
+ max_delay_ns: int
55
56
  delay_step_ns: int
56
57
  virtual_detuning: float
57
- recycle_delay_ns: int = DEFAULT_RECYCLE_DELAY_NS
58
- shot_count: int = DEFAULT_SHOT_COUNT
58
+ recycle_delay_ns: int = 200_000
59
+ shot_count: int = 400
59
60
  measure_waveform: ConstantWaveform | None = None
61
+ run_mixer_calibration: bool = False
62
+ update: Literal["auto", "off", "prompt"] = "auto"