boulder-opal-scale-up-sdk 1.0.0__py3-none-any.whl → 1.0.1__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.
- boulder_opal_scale_up_sdk-1.0.1.dist-info/LICENSE +805 -0
- {boulder_opal_scale_up_sdk-1.0.0.dist-info → boulder_opal_scale_up_sdk-1.0.1.dist-info}/METADATA +17 -7
- boulder_opal_scale_up_sdk-1.0.1.dist-info/RECORD +60 -0
- boulderopalscaleupsdk/agent/worker.py +22 -11
- boulderopalscaleupsdk/common/dtypes.py +68 -111
- boulderopalscaleupsdk/device/__init__.py +5 -1
- boulderopalscaleupsdk/device/config_loader.py +10 -8
- boulderopalscaleupsdk/device/controller/__init__.py +17 -14
- boulderopalscaleupsdk/device/controller/base.py +12 -3
- boulderopalscaleupsdk/device/controller/qblox.py +43 -17
- boulderopalscaleupsdk/device/controller/quantum_machines.py +60 -59
- boulderopalscaleupsdk/device/controller/resolver.py +117 -0
- boulderopalscaleupsdk/device/defcal.py +61 -0
- boulderopalscaleupsdk/device/device.py +8 -2
- boulderopalscaleupsdk/device/processor/__init__.py +9 -1
- boulderopalscaleupsdk/device/processor/common.py +129 -20
- boulderopalscaleupsdk/device/processor/superconducting_processor.py +59 -13
- boulderopalscaleupsdk/experiments/__init__.py +8 -0
- boulderopalscaleupsdk/experiments/common.py +8 -4
- boulderopalscaleupsdk/experiments/power_rabi.py +3 -3
- boulderopalscaleupsdk/experiments/ramsey.py +13 -6
- boulderopalscaleupsdk/experiments/readout_classifier_calibration.py +24 -0
- boulderopalscaleupsdk/experiments/resonator_spectroscopy.py +3 -3
- boulderopalscaleupsdk/experiments/resonator_spectroscopy_by_bias.py +10 -10
- boulderopalscaleupsdk/experiments/resonator_spectroscopy_by_power.py +3 -3
- boulderopalscaleupsdk/experiments/transmon_anharmonicity.py +68 -0
- boulderopalscaleupsdk/experiments/transmon_resonator_chi_scan.py +56 -0
- boulderopalscaleupsdk/experiments/transmon_spectroscopy.py +69 -0
- boulderopalscaleupsdk/grpc_interceptors/auth.py +5 -2
- boulderopalscaleupsdk/plotting/__init__.py +20 -2
- boulderopalscaleupsdk/plotting/dtypes.py +81 -117
- boulderopalscaleupsdk/protobuf/v1/agent_pb2.py +17 -17
- boulderopalscaleupsdk/protobuf/v1/agent_pb2.pyi +8 -6
- boulderopalscaleupsdk/protobuf/v1/agent_pb2_grpc.py +13 -13
- boulderopalscaleupsdk/protobuf/v1/device_pb2.py +35 -17
- boulderopalscaleupsdk/protobuf/v1/device_pb2.pyi +40 -6
- boulderopalscaleupsdk/protobuf/v1/device_pb2_grpc.py +116 -14
- boulderopalscaleupsdk/routines/__init__.py +1 -4
- boulderopalscaleupsdk/routines/resonator_mapping.py +8 -2
- boulderopalscaleupsdk/stubs/__init__.py +12 -0
- boulderopalscaleupsdk/stubs/dtypes.py +47 -0
- boulderopalscaleupsdk/stubs/maps.py +9 -0
- boulderopalscaleupsdk/third_party/quantum_machines/__init__.py +32 -0
- boulderopalscaleupsdk/third_party/quantum_machines/config.py +30 -9
- boulder_opal_scale_up_sdk-1.0.0.dist-info/RECORD +0 -50
- {boulder_opal_scale_up_sdk-1.0.0.dist-info → boulder_opal_scale_up_sdk-1.0.1.dist-info}/WHEEL +0 -0
@@ -16,7 +16,7 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
|
|
16
16
|
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
17
17
|
|
18
18
|
|
19
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.boulderopalscaleupsdk/protobuf/v1/device.proto\x12!boulderopalscaleupsdk.protobuf.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\"-\n\x14GetJobSummaryRequest\x12\x15\n\x06job_id\x18\x01 \x01(\tR\x05jobId\"Z\n\x15GetJobSummaryResponse\x12\x41\n\x10job_summary_data\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x0ejobSummaryData\"&\n\rGetJobRequest\x12\x15\n\x06job_id\x18\x01 \x01(\tR\x05jobId\"D\n\x0eGetJobResponse\x12\x32\n\x08job_data\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x07jobData\"2\n\x0fListJobsRequest\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\"?\n\x10ListJobsResponse\x12+\n\x04jobs\x18\x01 \x03(\x0b\x32\x17.google.protobuf.StructR\x04jobs\"\x85\x01\n\rCreateRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\x12\x38\n\x0b\x64\x65vice_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\ndeviceData\"$\n\x0e\x43reateResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"
|
19
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.boulderopalscaleupsdk/protobuf/v1/device.proto\x12!boulderopalscaleupsdk.protobuf.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\"-\n\x14GetJobSummaryRequest\x12\x15\n\x06job_id\x18\x01 \x01(\tR\x05jobId\"Z\n\x15GetJobSummaryResponse\x12\x41\n\x10job_summary_data\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x0ejobSummaryData\"&\n\rGetJobRequest\x12\x15\n\x06job_id\x18\x01 \x01(\tR\x05jobId\"D\n\x0eGetJobResponse\x12\x32\n\x08job_data\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x07jobData\"2\n\x0fListJobsRequest\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\"?\n\x10ListJobsResponse\x12+\n\x04jobs\x18\x01 \x03(\x0b\x32\x17.google.protobuf.StructR\x04jobs\"\x85\x01\n\rCreateRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\x12\x38\n\x0b\x64\x65vice_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\ndeviceData\"$\n\x0e\x43reateResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"]\n\x0b\x43opyRequest\x12(\n\x10\x66rom_device_name\x18\x01 \x01(\tR\x0e\x66romDeviceName\x12$\n\x0eto_device_name\x18\x02 \x01(\tR\x0ctoDeviceName\"\"\n\x0c\x43opyResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"L\n\x0eGetDataRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\"\x93\x01\n\x0fGetDataResponse\x12>\n\x0eprocessor_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\rprocessorData\x12@\n\x0f\x63ontroller_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\x0e\x63ontrollerData\"\x8b\x01\n\rUpdateRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\x12>\n\x0eprocessor_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\rprocessorData\"\x92\x01\n\x0eUpdateResponse\x12>\n\x0eprocessor_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\rprocessorData\x12@\n\x0f\x63ontroller_data\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x0e\x63ontrollerData\"K\n\rDeleteRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\"$\n\x0e\x44\x65leteResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"5\n\x12GetMetadataRequest\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\"J\n\x13GetMetadataResponse\x12\x33\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"\x1e\n\x1cGetAllDevicesMetadataRequest\"V\n\x1dGetAllDevicesMetadataResponse\x12\x35\n\tmetadatas\x18\x01 \x03(\x0b\x32\x17.google.protobuf.StructR\tmetadatas2\xb0\x0c\n\x14\x44\x65viceManagerService\x12\x8b\x01\n\x06\x43reate\x12\x30.boulderopalscaleupsdk.protobuf.v1.CreateRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.CreateResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/device/create:\x01*\x12\x83\x01\n\x04\x43opy\x12..boulderopalscaleupsdk.protobuf.v1.CopyRequest\x1a/.boulderopalscaleupsdk.protobuf.v1.CopyResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/v1/device/copy:\x01*\x12\x97\x01\n\x07GetData\x12\x31.boulderopalscaleupsdk.protobuf.v1.GetDataRequest\x1a\x32.boulderopalscaleupsdk.protobuf.v1.GetDataResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/v1/device/get_device_data:\x01*\x12\x8b\x01\n\x06Update\x12\x30.boulderopalscaleupsdk.protobuf.v1.UpdateRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.UpdateResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/device/update:\x01*\x12\x8b\x01\n\x06\x44\x65lete\x12\x30.boulderopalscaleupsdk.protobuf.v1.DeleteRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.DeleteResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/device/delete:\x01*\x12\x94\x01\n\x08ListJobs\x12\x32.boulderopalscaleupsdk.protobuf.v1.ListJobsRequest\x1a\x33.boulderopalscaleupsdk.protobuf.v1.ListJobsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/v1/device/list_jobs:\x01*\x12\x8c\x01\n\x06GetJob\x12\x30.boulderopalscaleupsdk.protobuf.v1.GetJobRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.GetJobResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/v1/device/get_job:\x01*\x12\xa9\x01\n\rGetJobSummary\x12\x37.boulderopalscaleupsdk.protobuf.v1.GetJobSummaryRequest\x1a\x38.boulderopalscaleupsdk.protobuf.v1.GetJobSummaryResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/v1/device/get_job_summary:\x01*\x12\xa7\x01\n\x0bGetMetadata\x12\x35.boulderopalscaleupsdk.protobuf.v1.GetMetadataRequest\x1a\x36.boulderopalscaleupsdk.protobuf.v1.GetMetadataResponse\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/device/get_device_metadata:\x01*\x12\xd1\x01\n\x15GetAllDevicesMetadata\x12?.boulderopalscaleupsdk.protobuf.v1.GetAllDevicesMetadataRequest\x1a@.boulderopalscaleupsdk.protobuf.v1.GetAllDevicesMetadataResponse\"5\x82\xd3\xe4\x93\x02/\"*/v1/device/get_all_devices_metadata_by_org:\x01*B\xaa\x02\n%com.boulderopalscaleupsdk.protobuf.v1B\x0b\x44\x65viceProtoP\x01ZNgithub.com/qctrl/boulder-opal-scale-up/proto/boulderopalscaleupsdk/protobuf/v1\xa2\x02\x03\x42PX\xaa\x02!Boulderopalscaleupsdk.Protobuf.V1\xca\x02!Boulderopalscaleupsdk\\Protobuf\\V1\xe2\x02-Boulderopalscaleupsdk\\Protobuf\\V1\\GPBMetadata\xea\x02#Boulderopalscaleupsdk::Protobuf::V1b\x06proto3')
|
20
20
|
|
21
21
|
_globals = globals()
|
22
22
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -26,8 +26,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
26
26
|
_globals['DESCRIPTOR']._serialized_options = b'\n%com.boulderopalscaleupsdk.protobuf.v1B\013DeviceProtoP\001ZNgithub.com/qctrl/boulder-opal-scale-up/proto/boulderopalscaleupsdk/protobuf/v1\242\002\003BPX\252\002!Boulderopalscaleupsdk.Protobuf.V1\312\002!Boulderopalscaleupsdk\\Protobuf\\V1\342\002-Boulderopalscaleupsdk\\Protobuf\\V1\\GPBMetadata\352\002#Boulderopalscaleupsdk::Protobuf::V1'
|
27
27
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Create']._loaded_options = None
|
28
28
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Create']._serialized_options = b'\202\323\344\223\002\026\"\021/v1/device/create:\001*'
|
29
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['
|
30
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['
|
29
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Copy']._loaded_options = None
|
30
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Copy']._serialized_options = b'\202\323\344\223\002\024\"\017/v1/device/copy:\001*'
|
31
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetData']._loaded_options = None
|
32
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetData']._serialized_options = b'\202\323\344\223\002\037\"\032/v1/device/get_device_data:\001*'
|
31
33
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Update']._loaded_options = None
|
32
34
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Update']._serialized_options = b'\202\323\344\223\002\026\"\021/v1/device/update:\001*'
|
33
35
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Delete']._loaded_options = None
|
@@ -38,6 +40,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
38
40
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetJob']._serialized_options = b'\202\323\344\223\002\027\"\022/v1/device/get_job:\001*'
|
39
41
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetJobSummary']._loaded_options = None
|
40
42
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetJobSummary']._serialized_options = b'\202\323\344\223\002\037\"\032/v1/device/get_job_summary:\001*'
|
43
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetMetadata']._loaded_options = None
|
44
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetMetadata']._serialized_options = b'\202\323\344\223\002#\"\036/v1/device/get_device_metadata:\001*'
|
45
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetAllDevicesMetadata']._loaded_options = None
|
46
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetAllDevicesMetadata']._serialized_options = b'\202\323\344\223\002/\"*/v1/device/get_all_devices_metadata_by_org:\001*'
|
41
47
|
_globals['_GETJOBSUMMARYREQUEST']._serialized_start=145
|
42
48
|
_globals['_GETJOBSUMMARYREQUEST']._serialized_end=190
|
43
49
|
_globals['_GETJOBSUMMARYRESPONSE']._serialized_start=192
|
@@ -54,18 +60,30 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
54
60
|
_globals['_CREATEREQUEST']._serialized_end=645
|
55
61
|
_globals['_CREATERESPONSE']._serialized_start=647
|
56
62
|
_globals['_CREATERESPONSE']._serialized_end=683
|
57
|
-
_globals['
|
58
|
-
_globals['
|
59
|
-
_globals['
|
60
|
-
_globals['
|
61
|
-
_globals['
|
62
|
-
_globals['
|
63
|
-
_globals['
|
64
|
-
_globals['
|
65
|
-
_globals['
|
66
|
-
_globals['
|
67
|
-
_globals['
|
68
|
-
_globals['
|
69
|
-
_globals['
|
70
|
-
_globals['
|
63
|
+
_globals['_COPYREQUEST']._serialized_start=685
|
64
|
+
_globals['_COPYREQUEST']._serialized_end=778
|
65
|
+
_globals['_COPYRESPONSE']._serialized_start=780
|
66
|
+
_globals['_COPYRESPONSE']._serialized_end=814
|
67
|
+
_globals['_GETDATAREQUEST']._serialized_start=816
|
68
|
+
_globals['_GETDATAREQUEST']._serialized_end=892
|
69
|
+
_globals['_GETDATARESPONSE']._serialized_start=895
|
70
|
+
_globals['_GETDATARESPONSE']._serialized_end=1042
|
71
|
+
_globals['_UPDATEREQUEST']._serialized_start=1045
|
72
|
+
_globals['_UPDATEREQUEST']._serialized_end=1184
|
73
|
+
_globals['_UPDATERESPONSE']._serialized_start=1187
|
74
|
+
_globals['_UPDATERESPONSE']._serialized_end=1333
|
75
|
+
_globals['_DELETEREQUEST']._serialized_start=1335
|
76
|
+
_globals['_DELETEREQUEST']._serialized_end=1410
|
77
|
+
_globals['_DELETERESPONSE']._serialized_start=1412
|
78
|
+
_globals['_DELETERESPONSE']._serialized_end=1448
|
79
|
+
_globals['_GETMETADATAREQUEST']._serialized_start=1450
|
80
|
+
_globals['_GETMETADATAREQUEST']._serialized_end=1503
|
81
|
+
_globals['_GETMETADATARESPONSE']._serialized_start=1505
|
82
|
+
_globals['_GETMETADATARESPONSE']._serialized_end=1579
|
83
|
+
_globals['_GETALLDEVICESMETADATAREQUEST']._serialized_start=1581
|
84
|
+
_globals['_GETALLDEVICESMETADATAREQUEST']._serialized_end=1611
|
85
|
+
_globals['_GETALLDEVICESMETADATARESPONSE']._serialized_start=1613
|
86
|
+
_globals['_GETALLDEVICESMETADATARESPONSE']._serialized_end=1699
|
87
|
+
_globals['_DEVICEMANAGERSERVICE']._serialized_start=1702
|
88
|
+
_globals['_DEVICEMANAGERSERVICE']._serialized_end=3286
|
71
89
|
# @@protoc_insertion_point(module_scope)
|
@@ -59,7 +59,21 @@ class CreateResponse(_message.Message):
|
|
59
59
|
done: bool
|
60
60
|
def __init__(self, done: bool = ...) -> None: ...
|
61
61
|
|
62
|
-
class
|
62
|
+
class CopyRequest(_message.Message):
|
63
|
+
__slots__ = ("from_device_name", "to_device_name")
|
64
|
+
FROM_DEVICE_NAME_FIELD_NUMBER: _ClassVar[int]
|
65
|
+
TO_DEVICE_NAME_FIELD_NUMBER: _ClassVar[int]
|
66
|
+
from_device_name: str
|
67
|
+
to_device_name: str
|
68
|
+
def __init__(self, from_device_name: _Optional[str] = ..., to_device_name: _Optional[str] = ...) -> None: ...
|
69
|
+
|
70
|
+
class CopyResponse(_message.Message):
|
71
|
+
__slots__ = ("done",)
|
72
|
+
DONE_FIELD_NUMBER: _ClassVar[int]
|
73
|
+
done: bool
|
74
|
+
def __init__(self, done: bool = ...) -> None: ...
|
75
|
+
|
76
|
+
class GetDataRequest(_message.Message):
|
63
77
|
__slots__ = ("app_name", "device_name")
|
64
78
|
APP_NAME_FIELD_NUMBER: _ClassVar[int]
|
65
79
|
DEVICE_NAME_FIELD_NUMBER: _ClassVar[int]
|
@@ -67,7 +81,7 @@ class LoadRequest(_message.Message):
|
|
67
81
|
device_name: str
|
68
82
|
def __init__(self, app_name: _Optional[str] = ..., device_name: _Optional[str] = ...) -> None: ...
|
69
83
|
|
70
|
-
class
|
84
|
+
class GetDataResponse(_message.Message):
|
71
85
|
__slots__ = ("processor_data", "controller_data")
|
72
86
|
PROCESSOR_DATA_FIELD_NUMBER: _ClassVar[int]
|
73
87
|
CONTROLLER_DATA_FIELD_NUMBER: _ClassVar[int]
|
@@ -76,16 +90,14 @@ class LoadResponse(_message.Message):
|
|
76
90
|
def __init__(self, processor_data: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., controller_data: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
|
77
91
|
|
78
92
|
class UpdateRequest(_message.Message):
|
79
|
-
__slots__ = ("app_name", "device_name", "processor_data"
|
93
|
+
__slots__ = ("app_name", "device_name", "processor_data")
|
80
94
|
APP_NAME_FIELD_NUMBER: _ClassVar[int]
|
81
95
|
DEVICE_NAME_FIELD_NUMBER: _ClassVar[int]
|
82
96
|
PROCESSOR_DATA_FIELD_NUMBER: _ClassVar[int]
|
83
|
-
CONTROLLER_DATA_FIELD_NUMBER: _ClassVar[int]
|
84
97
|
app_name: str
|
85
98
|
device_name: str
|
86
99
|
processor_data: _struct_pb2.Struct
|
87
|
-
|
88
|
-
def __init__(self, app_name: _Optional[str] = ..., device_name: _Optional[str] = ..., processor_data: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., controller_data: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
|
100
|
+
def __init__(self, app_name: _Optional[str] = ..., device_name: _Optional[str] = ..., processor_data: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
|
89
101
|
|
90
102
|
class UpdateResponse(_message.Message):
|
91
103
|
__slots__ = ("processor_data", "controller_data")
|
@@ -108,3 +120,25 @@ class DeleteResponse(_message.Message):
|
|
108
120
|
DONE_FIELD_NUMBER: _ClassVar[int]
|
109
121
|
done: bool
|
110
122
|
def __init__(self, done: bool = ...) -> None: ...
|
123
|
+
|
124
|
+
class GetMetadataRequest(_message.Message):
|
125
|
+
__slots__ = ("device_name",)
|
126
|
+
DEVICE_NAME_FIELD_NUMBER: _ClassVar[int]
|
127
|
+
device_name: str
|
128
|
+
def __init__(self, device_name: _Optional[str] = ...) -> None: ...
|
129
|
+
|
130
|
+
class GetMetadataResponse(_message.Message):
|
131
|
+
__slots__ = ("metadata",)
|
132
|
+
METADATA_FIELD_NUMBER: _ClassVar[int]
|
133
|
+
metadata: _struct_pb2.Struct
|
134
|
+
def __init__(self, metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
|
135
|
+
|
136
|
+
class GetAllDevicesMetadataRequest(_message.Message):
|
137
|
+
__slots__ = ()
|
138
|
+
def __init__(self) -> None: ...
|
139
|
+
|
140
|
+
class GetAllDevicesMetadataResponse(_message.Message):
|
141
|
+
__slots__ = ("metadatas",)
|
142
|
+
METADATAS_FIELD_NUMBER: _ClassVar[int]
|
143
|
+
metadatas: _containers.RepeatedCompositeFieldContainer[_struct_pb2.Struct]
|
144
|
+
def __init__(self, metadatas: _Optional[_Iterable[_Union[_struct_pb2.Struct, _Mapping]]] = ...) -> None: ...
|
@@ -20,10 +20,15 @@ class DeviceManagerServiceStub(object):
|
|
20
20
|
request_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CreateRequest.SerializeToString,
|
21
21
|
response_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CreateResponse.FromString,
|
22
22
|
)
|
23
|
-
self.
|
24
|
-
'/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/
|
25
|
-
request_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.
|
26
|
-
response_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.
|
23
|
+
self.Copy = channel.unary_unary(
|
24
|
+
'/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/Copy',
|
25
|
+
request_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CopyRequest.SerializeToString,
|
26
|
+
response_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CopyResponse.FromString,
|
27
|
+
)
|
28
|
+
self.GetData = channel.unary_unary(
|
29
|
+
'/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/GetData',
|
30
|
+
request_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetDataRequest.SerializeToString,
|
31
|
+
response_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetDataResponse.FromString,
|
27
32
|
)
|
28
33
|
self.Update = channel.unary_unary(
|
29
34
|
'/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/Update',
|
@@ -50,6 +55,16 @@ class DeviceManagerServiceStub(object):
|
|
50
55
|
request_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetJobSummaryRequest.SerializeToString,
|
51
56
|
response_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetJobSummaryResponse.FromString,
|
52
57
|
)
|
58
|
+
self.GetMetadata = channel.unary_unary(
|
59
|
+
'/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/GetMetadata',
|
60
|
+
request_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetMetadataRequest.SerializeToString,
|
61
|
+
response_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetMetadataResponse.FromString,
|
62
|
+
)
|
63
|
+
self.GetAllDevicesMetadata = channel.unary_unary(
|
64
|
+
'/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/GetAllDevicesMetadata',
|
65
|
+
request_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetAllDevicesMetadataRequest.SerializeToString,
|
66
|
+
response_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetAllDevicesMetadataResponse.FromString,
|
67
|
+
)
|
53
68
|
|
54
69
|
|
55
70
|
class DeviceManagerServiceServicer(object):
|
@@ -63,8 +78,15 @@ class DeviceManagerServiceServicer(object):
|
|
63
78
|
context.set_details('Method not implemented!')
|
64
79
|
raise NotImplementedError('Method not implemented!')
|
65
80
|
|
66
|
-
def
|
67
|
-
"""
|
81
|
+
def Copy(self, request, context):
|
82
|
+
"""Make a copy of an existing device with a new name
|
83
|
+
"""
|
84
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
85
|
+
context.set_details('Method not implemented!')
|
86
|
+
raise NotImplementedError('Method not implemented!')
|
87
|
+
|
88
|
+
def GetData(self, request, context):
|
89
|
+
"""Retrieve the device and controller states.
|
68
90
|
"""
|
69
91
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
70
92
|
context.set_details('Method not implemented!')
|
@@ -105,6 +127,20 @@ class DeviceManagerServiceServicer(object):
|
|
105
127
|
context.set_details('Method not implemented!')
|
106
128
|
raise NotImplementedError('Method not implemented!')
|
107
129
|
|
130
|
+
def GetMetadata(self, request, context):
|
131
|
+
"""Fetch the metadata for the given device.
|
132
|
+
"""
|
133
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
134
|
+
context.set_details('Method not implemented!')
|
135
|
+
raise NotImplementedError('Method not implemented!')
|
136
|
+
|
137
|
+
def GetAllDevicesMetadata(self, request, context):
|
138
|
+
"""Fetch information about all devices in this session.
|
139
|
+
"""
|
140
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
141
|
+
context.set_details('Method not implemented!')
|
142
|
+
raise NotImplementedError('Method not implemented!')
|
143
|
+
|
108
144
|
|
109
145
|
def add_DeviceManagerServiceServicer_to_server(servicer, server):
|
110
146
|
rpc_method_handlers = {
|
@@ -113,10 +149,15 @@ def add_DeviceManagerServiceServicer_to_server(servicer, server):
|
|
113
149
|
request_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CreateRequest.FromString,
|
114
150
|
response_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CreateResponse.SerializeToString,
|
115
151
|
),
|
116
|
-
'
|
117
|
-
servicer.
|
118
|
-
request_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.
|
119
|
-
response_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.
|
152
|
+
'Copy': grpc.unary_unary_rpc_method_handler(
|
153
|
+
servicer.Copy,
|
154
|
+
request_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CopyRequest.FromString,
|
155
|
+
response_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CopyResponse.SerializeToString,
|
156
|
+
),
|
157
|
+
'GetData': grpc.unary_unary_rpc_method_handler(
|
158
|
+
servicer.GetData,
|
159
|
+
request_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetDataRequest.FromString,
|
160
|
+
response_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetDataResponse.SerializeToString,
|
120
161
|
),
|
121
162
|
'Update': grpc.unary_unary_rpc_method_handler(
|
122
163
|
servicer.Update,
|
@@ -143,6 +184,16 @@ def add_DeviceManagerServiceServicer_to_server(servicer, server):
|
|
143
184
|
request_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetJobSummaryRequest.FromString,
|
144
185
|
response_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetJobSummaryResponse.SerializeToString,
|
145
186
|
),
|
187
|
+
'GetMetadata': grpc.unary_unary_rpc_method_handler(
|
188
|
+
servicer.GetMetadata,
|
189
|
+
request_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetMetadataRequest.FromString,
|
190
|
+
response_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetMetadataResponse.SerializeToString,
|
191
|
+
),
|
192
|
+
'GetAllDevicesMetadata': grpc.unary_unary_rpc_method_handler(
|
193
|
+
servicer.GetAllDevicesMetadata,
|
194
|
+
request_deserializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetAllDevicesMetadataRequest.FromString,
|
195
|
+
response_serializer=boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetAllDevicesMetadataResponse.SerializeToString,
|
196
|
+
),
|
146
197
|
}
|
147
198
|
generic_handler = grpc.method_handlers_generic_handler(
|
148
199
|
'boulderopalscaleupsdk.protobuf.v1.DeviceManagerService', rpc_method_handlers)
|
@@ -172,7 +223,24 @@ class DeviceManagerService(object):
|
|
172
223
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
173
224
|
|
174
225
|
@staticmethod
|
175
|
-
def
|
226
|
+
def Copy(request,
|
227
|
+
target,
|
228
|
+
options=(),
|
229
|
+
channel_credentials=None,
|
230
|
+
call_credentials=None,
|
231
|
+
insecure=False,
|
232
|
+
compression=None,
|
233
|
+
wait_for_ready=None,
|
234
|
+
timeout=None,
|
235
|
+
metadata=None):
|
236
|
+
return grpc.experimental.unary_unary(request, target, '/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/Copy',
|
237
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CopyRequest.SerializeToString,
|
238
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.CopyResponse.FromString,
|
239
|
+
options, channel_credentials,
|
240
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
241
|
+
|
242
|
+
@staticmethod
|
243
|
+
def GetData(request,
|
176
244
|
target,
|
177
245
|
options=(),
|
178
246
|
channel_credentials=None,
|
@@ -182,9 +250,9 @@ class DeviceManagerService(object):
|
|
182
250
|
wait_for_ready=None,
|
183
251
|
timeout=None,
|
184
252
|
metadata=None):
|
185
|
-
return grpc.experimental.unary_unary(request, target, '/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/
|
186
|
-
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.
|
187
|
-
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.
|
253
|
+
return grpc.experimental.unary_unary(request, target, '/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/GetData',
|
254
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetDataRequest.SerializeToString,
|
255
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetDataResponse.FromString,
|
188
256
|
options, channel_credentials,
|
189
257
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
190
258
|
|
@@ -272,3 +340,37 @@ class DeviceManagerService(object):
|
|
272
340
|
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetJobSummaryResponse.FromString,
|
273
341
|
options, channel_credentials,
|
274
342
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
343
|
+
|
344
|
+
@staticmethod
|
345
|
+
def GetMetadata(request,
|
346
|
+
target,
|
347
|
+
options=(),
|
348
|
+
channel_credentials=None,
|
349
|
+
call_credentials=None,
|
350
|
+
insecure=False,
|
351
|
+
compression=None,
|
352
|
+
wait_for_ready=None,
|
353
|
+
timeout=None,
|
354
|
+
metadata=None):
|
355
|
+
return grpc.experimental.unary_unary(request, target, '/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/GetMetadata',
|
356
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetMetadataRequest.SerializeToString,
|
357
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetMetadataResponse.FromString,
|
358
|
+
options, channel_credentials,
|
359
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
360
|
+
|
361
|
+
@staticmethod
|
362
|
+
def GetAllDevicesMetadata(request,
|
363
|
+
target,
|
364
|
+
options=(),
|
365
|
+
channel_credentials=None,
|
366
|
+
call_credentials=None,
|
367
|
+
insecure=False,
|
368
|
+
compression=None,
|
369
|
+
wait_for_ready=None,
|
370
|
+
timeout=None,
|
371
|
+
metadata=None):
|
372
|
+
return grpc.experimental.unary_unary(request, target, '/boulderopalscaleupsdk.protobuf.v1.DeviceManagerService/GetAllDevicesMetadata',
|
373
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetAllDevicesMetadataRequest.SerializeToString,
|
374
|
+
boulderopalscaleupsdk_dot_protobuf_dot_v1_dot_device__pb2.GetAllDevicesMetadataResponse.FromString,
|
375
|
+
options, channel_credentials,
|
376
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
@@ -1,13 +1,19 @@
|
|
1
1
|
from pydantic import PrivateAttr
|
2
2
|
|
3
|
-
from boulderopalscaleupsdk.routines
|
3
|
+
from boulderopalscaleupsdk.routines import Routine
|
4
4
|
|
5
5
|
|
6
6
|
class ResonatorMapping(Routine):
|
7
7
|
"""
|
8
8
|
Parameters for running a resonator mapping routine.
|
9
|
+
|
10
|
+
Parameters
|
11
|
+
----------
|
12
|
+
feedlines : list[str] or None
|
13
|
+
The feedlines to target in the routine.
|
14
|
+
If not provided, all feedlines in the device will be targeted.
|
9
15
|
"""
|
10
16
|
|
11
17
|
_routine_name: str = PrivateAttr("resonator_mapping")
|
12
18
|
|
13
|
-
feedlines: list[str]
|
19
|
+
feedlines: list[str] | None = None
|
@@ -0,0 +1,12 @@
|
|
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.
|
@@ -0,0 +1,47 @@
|
|
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 pathlib import Path
|
15
|
+
from typing import Any
|
16
|
+
|
17
|
+
from pydantic import TypeAdapter
|
18
|
+
from pydantic.dataclasses import dataclass
|
19
|
+
|
20
|
+
|
21
|
+
@dataclass
|
22
|
+
class StubMetadata:
|
23
|
+
api_url: str
|
24
|
+
app_name: str
|
25
|
+
device_name: str
|
26
|
+
controller_type: str
|
27
|
+
routine_name: str
|
28
|
+
parameters: dict[str, Any]
|
29
|
+
created_at: str
|
30
|
+
|
31
|
+
|
32
|
+
@dataclass
|
33
|
+
class StubData:
|
34
|
+
raw_data: dict[str, Any]
|
35
|
+
metadata: StubMetadata | None = None
|
36
|
+
|
37
|
+
def to_dict(self) -> dict[str, Any]:
|
38
|
+
return TypeAdapter(type(self)).dump_python(self)
|
39
|
+
|
40
|
+
@classmethod
|
41
|
+
def from_str(cls, data: str) -> "StubData":
|
42
|
+
return TypeAdapter(cls).validate_json(data)
|
43
|
+
|
44
|
+
@classmethod
|
45
|
+
def load_from_file(cls, file_path: Path) -> "StubData":
|
46
|
+
with file_path.open("rb") as file:
|
47
|
+
return cls.from_str(file.read().decode("utf-8"))
|
@@ -0,0 +1,9 @@
|
|
1
|
+
STUB_DATA_FILE_MAPPING: dict[str, list[str]] = {
|
2
|
+
"feedline_discovery": [f"QM/Tuna-5/feedline_discovery/{n}.json" for n in range(1, 7)],
|
3
|
+
"resonator_mapping": [f"QM/Tuna-5/resonator_mapping/{n}.json" for n in range(1, 17)],
|
4
|
+
"resonator_spectroscopy": ["QM/Tuna-5/resonator_spectroscopy.json"],
|
5
|
+
"resonator_spectroscopy_by_power": ["QM/Tuna-5/resonator_spectroscopy_by_power.json"],
|
6
|
+
"resonator_spectroscopy_by_bias": ["QM/Tuna-5/resonator_spectroscopy_by_bias.json"],
|
7
|
+
"ramsey": ["QM/Tuna-5/ramsey.json"],
|
8
|
+
"power_rabi": ["QM/Tuna-5/power_rabi.json"],
|
9
|
+
}
|
@@ -22,14 +22,46 @@ __all__ = [
|
|
22
22
|
"Constants",
|
23
23
|
"QuaExpression",
|
24
24
|
"QuaProgram",
|
25
|
+
"QuaProgramMessage",
|
25
26
|
"version",
|
26
27
|
]
|
27
28
|
|
28
29
|
|
29
30
|
import importlib.metadata
|
31
|
+
import logging
|
32
|
+
import os
|
33
|
+
from unittest.mock import patch
|
30
34
|
|
31
35
|
from packaging.version import Version
|
32
36
|
|
37
|
+
if os.environ.get("QCTRL_SU_DISABLE_QM_LOGGING", "False") == "True":
|
38
|
+
# Disable QM logging and telemetry
|
39
|
+
os.environ["QM_DISABLE_STREAMOUTPUT"] = "true" # Used in 1.1.0
|
40
|
+
_qm_logger = logging.getLogger("qm")
|
41
|
+
_qm_logger.disabled = True
|
42
|
+
|
43
|
+
# Disable unwanted telemetry/logging modules in QM
|
44
|
+
_qm_patch_targets = [
|
45
|
+
"qm._loc._get_loc",
|
46
|
+
"qm.program.expressions._get_loc",
|
47
|
+
"qm.program.StatementsCollection._get_loc",
|
48
|
+
"qm.qua._get_loc",
|
49
|
+
"qm.qua._dsl._get_loc",
|
50
|
+
"qm.qua._expressions._get_loc",
|
51
|
+
"qm.qua.AnalogMeasureProcess._get_loc",
|
52
|
+
"qm.qua.DigitalMeasureProcess._get_loc",
|
53
|
+
"qm.datadog_api.DatadogHandler",
|
54
|
+
]
|
55
|
+
for target in _qm_patch_targets:
|
56
|
+
try:
|
57
|
+
_m = patch(target).__enter__()
|
58
|
+
_m.return_value = ""
|
59
|
+
except (AttributeError, ModuleNotFoundError):
|
60
|
+
pass
|
61
|
+
|
62
|
+
|
63
|
+
from qm.grpc.qua import QuaProgram as QuaProgramMessage # noqa: E402
|
64
|
+
|
33
65
|
version = Version(importlib.metadata.version("qm-qua"))
|
34
66
|
if version >= Version("1.2.0"):
|
35
67
|
from qm.api.models.capabilities import OPX_FEM_IDX
|
@@ -82,9 +82,9 @@ For information about PyPA's version specifiers:
|
|
82
82
|
|
83
83
|
# TODO: Migrate more validations from qm-qua.
|
84
84
|
|
85
|
-
# ruff: noqa:
|
85
|
+
# ruff: noqa: UP007, N815, E741
|
86
86
|
from collections.abc import MutableMapping
|
87
|
-
from typing import Annotated, Any, Literal, TypeVar, Union
|
87
|
+
from typing import Annotated, Any, Literal, Self, TypeVar, Union
|
88
88
|
|
89
89
|
from packaging.specifiers import SpecifierSet
|
90
90
|
from packaging.version import Version
|
@@ -101,8 +101,6 @@ from pydantic import (
|
|
101
101
|
)
|
102
102
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
103
103
|
|
104
|
-
from boulderopalscaleupsdk.common.dtypes import Self
|
105
|
-
|
106
104
|
Mapping = MutableMapping
|
107
105
|
Number = Union[int, float]
|
108
106
|
|
@@ -331,11 +329,34 @@ class OctaveConfig(BaseModel):
|
|
331
329
|
for output_num, output in self.RF_outputs.items():
|
332
330
|
if output.I_connection or output.Q_connection:
|
333
331
|
raise ValueError(
|
334
|
-
"Octave has ambiguous connectivity
|
335
|
-
f"both connectivity set and RF outputs set for {output_num}",
|
332
|
+
"Octave has ambiguous connectivity: "
|
333
|
+
f"both connectivity set and RF outputs set for {output_num}.",
|
336
334
|
)
|
337
335
|
return self
|
338
336
|
|
337
|
+
@model_validator(mode="after")
|
338
|
+
def validate_external_lo(self) -> Self:
|
339
|
+
rf_2 = self.RF_outputs.get(2)
|
340
|
+
rf_3 = self.RF_outputs.get(3)
|
341
|
+
if (rf_2 is not None and rf_3 is not None) and (
|
342
|
+
rf_3.LO_source == "external" and rf_2.LO_source == "internal"
|
343
|
+
):
|
344
|
+
raise ValueError(
|
345
|
+
"When utilizing both up-converters 2 and 3 from different sources, converter 2 "
|
346
|
+
"must use the external source.",
|
347
|
+
)
|
348
|
+
|
349
|
+
rf_4 = self.RF_outputs.get(4)
|
350
|
+
rf_5 = self.RF_outputs.get(5)
|
351
|
+
if (rf_4 is not None and rf_5 is not None) and (
|
352
|
+
rf_5.LO_source == "external" and rf_4.LO_source == "internal"
|
353
|
+
):
|
354
|
+
raise ValueError(
|
355
|
+
"When utilizing both up-converters 4 and 5 from different sources, converter 4 "
|
356
|
+
"must use the external source.",
|
357
|
+
)
|
358
|
+
return self
|
359
|
+
|
339
360
|
|
340
361
|
class OctaveConfig121(OctaveConfig):
|
341
362
|
"""Octave configuration for qm-qua 1.2.1."""
|
@@ -505,7 +526,7 @@ class _BaseQuaConfig(BaseModel):
|
|
505
526
|
"""The version specification that this model support.
|
506
527
|
Uses PyPA version specifiers."""
|
507
528
|
|
508
|
-
qm_version: str
|
529
|
+
qm_version: str
|
509
530
|
"""The qm-qua package version used."""
|
510
531
|
|
511
532
|
version: str = "1"
|
@@ -579,7 +600,7 @@ def _get_version(data: dict | BaseModel):
|
|
579
600
|
data.qm_version if isinstance(data, BaseModel) else data.get("qm_version") # type: ignore[attr-defined]
|
580
601
|
)
|
581
602
|
if not version_str:
|
582
|
-
raise AttributeError("No version specified")
|
603
|
+
raise AttributeError("No version specified.")
|
583
604
|
|
584
605
|
version = Version(version_str)
|
585
606
|
|
@@ -587,7 +608,7 @@ def _get_version(data: dict | BaseModel):
|
|
587
608
|
if version in spec:
|
588
609
|
return spec_name
|
589
610
|
|
590
|
-
raise ValueError(f"Version {version_str} not supported")
|
611
|
+
raise ValueError(f"Version {version_str} not supported.")
|
591
612
|
|
592
613
|
|
593
614
|
class QuaConfig(RootModel):
|