QPI Driver API Reference
qpi_driver
BlueforsGen1Driver
Bases: QpiDriver
Polls Bluefors Gen. 1 Control API channels and emits readings on a timer.
Attributes:
| Name | Type | Description |
|---|---|---|
bluefors_base_url |
Base URL of the Bluefors Control API, e.g.
|
|
channels |
Maps a value-tree channel path (e.g. |
|
api_key |
Optional Bluefors API access key, sent as the |
|
poll_interval |
Seconds between polls. |
|
timeout |
HTTP timeout per channel read, in seconds. |
|
read_channel |
ChannelReader
|
What reads one channel; see :data: |
Source code in qpi-driver/py/qpi_driver/builtins/bluefors_gen1.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
handle_event(event)
Ignore every inbound event — the monitor only reports upward.
It never handles JobDispatch; it is a separate driver from the
QPU, not part of it (RFC 0001 §4).
Source code in qpi-driver/py/qpi_driver/builtins/bluefors_gen1.py
106 107 108 109 110 111 112 113 114 115 116 | |
CalibrateDriver
Bases: QpiDriver
A QPI driver that calibrates a chip through a tuner backend.
Source code in qpi-driver/py/qpi_driver/builtins/calibrate.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
handle_event(event)
Queue a dispatched calibration; ignore everything else.
Source code in qpi-driver/py/qpi_driver/builtins/calibrate.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
CircuitPayload
dataclass
A single circuit within a batch job.
Source code in qpi-driver/py/qpi_driver/executors/base/dtos.py
6 7 8 9 10 11 12 | |
DeviceSpec
dataclass
One device: what --device names, and what to call when it does.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
How |
operation |
Operation
|
Which operation this device implements. |
build |
DeviceBuilder
|
Returns an unstarted driver; see :data: |
Source code in qpi-driver/py/qpi_driver/builtins/registry.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
Event
dataclass
A single typed message exchanged with QPI-UI in either direction.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
EventType
|
The event type, which determines the payload shape. |
payload |
dict[str, Any]
|
Type-specific body, validated by whoever handles the event. |
driver |
str
|
Identifier of the driver this event belongs to. |
id |
str
|
Unique identifier of this envelope. |
ts |
str
|
Creation time as an ISO-8601 UTC timestamp with millisecond precision. |
Source code in qpi-driver/py/qpi_driver/events.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
from_dict(data)
classmethod
Build an event from a decoded envelope dict.
Source code in qpi-driver/py/qpi_driver/events.py
71 72 73 74 75 76 77 78 79 80 | |
from_json(raw)
classmethod
Build an event from a JSON string or bytes received over NNG.
Source code in qpi-driver/py/qpi_driver/events.py
82 83 84 85 86 87 | |
to_dict()
Return the envelope as a plain dict matching the wire shape.
Source code in qpi-driver/py/qpi_driver/events.py
57 58 59 60 61 62 63 64 65 | |
to_json()
Serialise the envelope to a JSON string for sending over NNG.
Source code in qpi-driver/py/qpi_driver/events.py
67 68 69 | |
EventType
Bases: str, Enum
The fixed set of event types a QPI-UI version understands.
Maintainers grow the framework by adding new types over releases.
Source code in qpi-driver/py/qpi_driver/events.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
Executor
Bases: ABC
Source code in qpi-driver/py/qpi_driver/executors/base/__init__.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
close()
Release resources.
Source code in qpi-driver/py/qpi_driver/executors/base/__init__.py
47 48 49 | |
execute(payload)
abstractmethod
Execute the quantum circuit/instructions payload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
JobPayload
|
JobPayload object containing circuit QASM, qubit count, shots, etc. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Dataset mimicking the raw measurement counts and frequencies. |
Source code in qpi-driver/py/qpi_driver/executors/base/__init__.py
15 16 17 18 19 20 21 22 23 24 25 | |
process_result(dataset, job_id)
abstractmethod
Convert a raw xr.Dataset from execute() into a Qiskit-compatible result dict.
Each executor knows its own data format and how to: - Perform state discrimination (if meas_level=2) - Return IQ memory (if meas_level=1) - Return raw traces (if meas_level=0) - Handle meas_return averaging
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
The xr.Dataset returned by execute(). |
required |
job_id
|
str
|
The unique ID of the quantum job. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Qiskit-compatible result dict with keys like 'counts', 'memory', 'shots', 'backend', 'success', etc. |
Source code in qpi-driver/py/qpi_driver/executors/base/__init__.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
JobPayload
dataclass
Source code in qpi-driver/py/qpi_driver/executors/base/dtos.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
qasm
property
Backward-compatible accessor: returns the first circuit's QASM string.
MockExecutor
Bases: Executor
Source code in qpi-driver/py/qpi_driver/executors/mock/__init__.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
execute(payload)
Execute quantum circuit simulation using Qiskit BasicSimulator.
Every circuit is run honouring its per-circuit shots override. A
single-circuit payload returns that circuit's flat dataset; multi-circuit
payloads are bundled so circuits with different classical-bit widths or
shot counts stay independent (see combine_circuit_datasets).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
JobPayload
|
JobPayload specifying shots and circuits. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Dataset containing measured state outcomes. |
Source code in qpi-driver/py/qpi_driver/executors/mock/__init__.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
process_result(dataset, job_id)
Convert the simulator's xr.Dataset into a Qiskit-compatible result dict.
Supports meas_level 1 (IQ memory) and 2 (classified counts). meas_level 0 is not supported for simulators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
xr.Dataset from execute(). |
required |
job_id
|
str
|
Unique job ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Qiskit-compatible result dict. |
Source code in qpi-driver/py/qpi_driver/executors/mock/__init__.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
Operation
Bases: str, Enum
What a driver does, and the contract QPI-UI implements for it.
Closed by design: every value needs a handler on the server side, so a new operation is a coordinated change across the SDKs and QPI-UI, never a third-party extension (RFC 0003 §13.1). Devices are the open half.
Source code in qpi-driver/py/qpi_driver/builtins/registry.py
28 29 30 31 32 33 34 35 36 37 38 | |
Options
Raw -o values, read by the device that understands them.
Every accessor takes the fallback used when the key is absent, written as the value itself rather than as a string to parse: the default belongs to the one piece of code that acts on it.
A value the accessor cannot read raises :class:ValueError naming the option,
which the CLI turns into a single line.
Source code in qpi-driver/py/qpi_driver/options.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
get_bool(key, default=False)
The value of key as a boolean, or default.
1, true, yes and on are true in any case; every other
value, the empty string included, is false. Nothing here can fail, so a
misspelled -o is_dummy=ture is false rather than an error — the
alternative is refusing to start over a flag.
Source code in qpi-driver/py/qpi_driver/options.py
68 69 70 71 72 73 74 75 76 77 78 79 | |
get_dir(key, default, *, default_name='')
The value of key as a directory a driver may write to, or default.
The safe-location check of :func:~qpi_driver.paths.as_safe_dir applies to
the given value and to default alike, so a device cannot default itself
somewhere it may not write.
default_name is what to call default in that error, for a fallback the
operator set themselves — --data-dir, rather than -o <key> (default).
Source code in qpi-driver/py/qpi_driver/options.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
get_float(key, default)
The value of key as a float, or default.
Source code in qpi-driver/py/qpi_driver/options.py
64 65 66 | |
get_int(key, default)
The value of key as an integer, or default.
Source code in qpi-driver/py/qpi_driver/options.py
60 61 62 | |
get_path(key, default)
The value of key as a path, or default. Not checked for safety.
Source code in qpi-driver/py/qpi_driver/options.py
81 82 83 | |
get_str(key, default='')
The value of key as typed, or default.
Source code in qpi-driver/py/qpi_driver/options.py
42 43 44 45 | |
remaining()
Every option not read yet, as typed, and marks them read.
For a device that passes options on to something this SDK has never seen — an executor named by import path, whose constructor is the only thing that knows its keys. A device that reads its own options should not need this.
Source code in qpi-driver/py/qpi_driver/options.py
103 104 105 106 107 108 109 110 111 112 113 114 | |
require(key, example='')
The value of key, or raise because the device cannot run without it.
Raises:
| Type | Description |
|---|---|
ValueError
|
if key was not given. example is appended as a
ready-to-paste |
Source code in qpi-driver/py/qpi_driver/options.py
47 48 49 50 51 52 53 54 55 56 57 58 | |
unread()
The keys given that nothing read, sorted.
The caller reports them: the device has finished building by then, so a key left over is one it does not understand.
Source code in qpi-driver/py/qpi_driver/options.py
116 117 118 119 120 121 122 | |
PrestoExecutor
Bases: Executor
Executor subclass for interacting with Presto RF signal generators.
Source code in qpi-driver/py/qpi_driver/executors/presto/__init__.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
execute(payload)
Execute quantum instructions on Presto hardware.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
dict
|
Dictionary containing circuit execution options. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: The control acquisition dataset. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Always raised since the executor is a placeholder. |
Source code in qpi-driver/py/qpi_driver/executors/presto/__init__.py
9 10 11 12 13 14 15 16 17 18 19 20 21 | |
process_result(dataset, job_id)
Convert raw dataset to Qiskit-compatible result dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
The xr.Dataset returned by execute(). |
required |
job_id
|
str
|
The unique ID of the quantum job. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Qiskit-compatible result dict. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Always raised since the executor is a placeholder. |
Source code in qpi-driver/py/qpi_driver/executors/presto/__init__.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
QbloxExecutor
Bases: Executor
Executor subclass for interacting with Qblox instruments and modules via qblox-scheduler.
Source code in qpi-driver/py/qpi_driver/executors/qblox/__init__.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | |
__init__(name='qblox', quantify_hardware_config=Path('quantify.hardware.json'), quantify_device_config=Path('quantify.device.json'), is_dummy=False, data_dir=Path('data'), acquisition_timeout=10, save_raw_data=False, **kwargs)
Initialize the QbloxExecutor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the name of the executor |
'qblox'
|
quantify_hardware_config
|
QbloxHardwareCompilationConfig | Path | dict
|
Hardware-layer configuration dictionary, file path, or config as dict. |
Path('quantify.hardware.json')
|
quantify_device_config
|
Path | dict
|
Device-layer configuration dictionary, file path or config as dict |
Path('quantify.device.json')
|
is_dummy
|
bool
|
If True, uses a dummy Cluster instrument. |
False
|
data_dir
|
Path
|
Directory to where data is temporarily stored. |
Path('data')
|
acquisition_timeout
|
int
|
Timeout in seconds to wait for acquisition. |
10
|
save_raw_data
|
bool
|
If True, the agent writes a dataset and an instrument snapshot under data_dir for every job. Off by default: nothing here reads them and nothing prunes them, so a QPU serving jobs would fill its data directory over a run of months. |
False
|
**kwargs
|
Any
|
Arbitrary keyword arguments passed to the base class. |
{}
|
Source code in qpi-driver/py/qpi_driver/executors/qblox/__init__.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
close()
Release resources.
Source code in qpi-driver/py/qpi_driver/executors/qblox/__init__.py
566 567 568 569 | |
execute(payload)
Execute quantum instructions using the Qblox scheduler.
Every circuit in payload.circuits is executed, honouring each
circuit's shots override and parameter_values bindings. A
single-circuit payload returns that circuit's flat dataset; multi-circuit
payloads are bundled so circuits with different qubit widths or shot
counts stay independent (see combine_circuit_datasets).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
JobPayload
|
JobPayload specifying shots, circuits, meas_level, etc. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Raw acquisition dataset. |
Source code in qpi-driver/py/qpi_driver/executors/qblox/__init__.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
process_result(dataset, job_id)
Convert a qblox-scheduler acquisition dataset into a Qiskit-compatible result dict.
Handles all meas_levels: - meas_level=0 (Trace): Returns raw complex waveform data as [[real, imag], ...] per time sample. - meas_level=1 (SSBIntegrationComplex): Returns IQ values as [[real, imag]] per shot per qubit. - meas_level=2 with ThresholdedAcquisition: Aggregates 0/1 values into counts dict. - meas_level=2 with SSBIntegrationComplex: Performs software discrimination using acq_threshold and acq_rotation from the device config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
xr.Dataset from execute(). |
required |
job_id
|
str
|
Unique job ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Qiskit-compatible result dict. |
Source code in qpi-driver/py/qpi_driver/executors/qblox/__init__.py
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |
QiskitAerExecutor
Bases: Executor
Source code in qpi-driver/py/qpi_driver/executors/qiskit_aer/__init__.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
execute(payload)
Run quantum circuit simulation using Qiskit Aer backend.
Every circuit is run honouring its per-circuit shots override. A
single-circuit payload returns that circuit's flat dataset; multi-circuit
payloads are bundled so circuits with different classical-bit widths or
shot counts stay independent (see combine_circuit_datasets).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
JobPayload
|
JobPayload specifying shots and circuits. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Dataset containing measured state outcomes, counts, and frequencies. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If qiskit-aer is not installed. |
ValueError
|
If the provided QASM circuit cannot be loaded. |
Source code in qpi-driver/py/qpi_driver/executors/qiskit_aer/__init__.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
process_result(dataset, job_id)
Convert the simulator's xr.Dataset into a Qiskit-compatible result dict.
Supports meas_level 1 (IQ memory) and 2 (classified counts). meas_level 0 is not supported for simulators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
xr.Dataset from execute(). |
required |
job_id
|
str
|
Unique job ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Qiskit-compatible result dict. |
Source code in qpi-driver/py/qpi_driver/executors/qiskit_aer/__init__.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
QpiDriver
Bases: ABC
Base class for a QPI driver: handles inbound events, emits its own.
Attributes:
| Name | Type | Description |
|---|---|---|
qpi_addr |
Full URL of the QPI-UI server. |
|
token |
The driver's access token; identifies it (and its QPU) to QPI-UI. |
|
name |
The display label QPI-UI has this driver registered under, used to
tag emitted events. It comes from the |
|
ca_fingerprint |
Expected SHA-256 of the server root CA, pinned over TLS. |
|
ca_file_path |
Where the downloaded root CA certificate is written. |
|
recv_timeout_ms |
How long the inbound receive loop blocks per attempt before checking for a shutdown signal, in milliseconds. |
Source code in qpi-driver/py/qpi_driver/sdk.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
emit(event)
Send an event upward to QPI-UI over the outbound NNG channel.
Delivery is best-effort, as today: if nothing is listening the event is dropped rather than buffered (RFC 0001 §5).
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If called before the driver has connected. |
Source code in qpi-driver/py/qpi_driver/sdk.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
every(interval, fn)
Register a callback to run every interval seconds while the driver runs.
Used by drivers that report on their own schedule — e.g. a monitor that emits a reading on a timer — independently of any inbound event.
Source code in qpi-driver/py/qpi_driver/sdk.py
112 113 114 115 116 117 118 | |
handle_event(event)
abstractmethod
Act on a single inbound event, dispatching on event.type.
Implemented per driver. An event a driver does not care about is simply ignored; raising signals a rejected event, which is logged and dropped. There is no application-level ACK/NACK (RFC 0001 §4).
Source code in qpi-driver/py/qpi_driver/sdk.py
172 173 174 175 176 177 178 179 | |
run()
Connect to QPI-UI and process events until interrupted.
Performs the handshake, opens the outbound channel, starts any periodic callbacks, then blocks on the inbound receive loop.
Source code in qpi-driver/py/qpi_driver/sdk.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
QpuDriver
Bases: QpiDriver
A QPI driver that runs quantum jobs on an executor.
Source code in qpi-driver/py/qpi_driver/builtins/qpu.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
handle_event(event)
Run dispatched jobs; ignore everything else (RFC 0001 §8).
A JobDispatch payload is the job envelope QPI-UI's dispatcher builds —
{job_id, payload} — which is exactly what the worker consumes.
Source code in qpi-driver/py/qpi_driver/builtins/qpu.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
QuantifyExecutor
Bases: Executor
Executor subclass for interacting with Quantify-scheduler acquisition backends.
Source code in qpi-driver/py/qpi_driver/executors/quantify/__init__.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | |
__init__(name='quantify', quantify_hardware_config=Path('quantify.hardware.json'), quantify_device_config=Path('quantify.device.json'), is_dummy=False, is_simulated=False, data_dir=Path('data'), acquisition_timeout=10, **kwargs)
Initialize the QuantifyExecutor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the name of the executor |
'quantify'
|
quantify_hardware_config
|
QbloxHardwareCompilationConfig | Path | dict
|
Hardware-layer configuration dictionary, file path, or config as dict. |
Path('quantify.hardware.json')
|
quantify_device_config
|
Path | dict
|
Device-layer configuration dictionary, file path or config as dict |
Path('quantify.device.json')
|
is_dummy
|
bool
|
If True, uses a dummy Cluster instrument. It compiles and
runs, but every acquisition comes back |
False
|
is_simulated
|
bool
|
If True, plays the compiled schedule through
|
False
|
data_dir
|
Path
|
Directory to where data is temporarily stored. |
Path('data')
|
acquisition_timeout
|
int
|
Timeout in seconds to wait for acquisition. |
10
|
**kwargs
|
Any
|
Arbitrary keyword arguments passed to the base class. |
{}
|
Source code in qpi-driver/py/qpi_driver/executors/quantify/__init__.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
close()
Detach the coordinator's components, then release it.
InstrumentCoordinator.components is a qcodes ManualParameter
holding component names, so it has to be called — iterating it
directly raises, and a shutdown that raises leaves the cluster held
against the next driver that wants it.
Source code in qpi-driver/py/qpi_driver/executors/quantify/__init__.py
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | |
execute(payload)
Execute quantum instructions using the Quantify scheduler.
The acquisition protocol is selected based on payload.meas_level:
meas_level=0→Trace(raw waveform)meas_level=1→SSBIntegrationComplex(kerneled IQ)meas_level=2→ThresholdedAcquisitionif threshold params are configured on the device elements, elseSSBIntegrationComplex(software discrimination deferred toprocess_result()).
Every circuit in payload.circuits is executed, honouring each
circuit's shots override and parameter_values bindings. A
single-circuit payload returns that circuit's flat dataset; multi-circuit
payloads are bundled so circuits with different qubit widths or shot
counts stay independent (see combine_circuit_datasets).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
JobPayload
|
JobPayload specifying shots, circuits, meas_level, etc. |
required |
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Raw acquisition dataset. |
Source code in qpi-driver/py/qpi_driver/executors/quantify/__init__.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
process_result(dataset, job_id)
Convert a quantify-scheduler acquisition dataset into a Qiskit-compatible result dict.
Handles all meas_levels: - meas_level=0 (Trace): Returns raw complex waveform data as [[real, imag], ...] per time sample. - meas_level=1 (SSBIntegrationComplex): Returns IQ values as [[real, imag]] per shot per qubit. - meas_level=2 with ThresholdedAcquisition: Aggregates 0/1 values into counts dict. - meas_level=2 with SSBIntegrationComplex: Performs software discrimination using acq_threshold and acq_rotation from the device config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
xr.Dataset from execute(). |
required |
job_id
|
str
|
Unique job ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Qiskit-compatible result dict. |
Source code in qpi-driver/py/qpi_driver/executors/quantify/__init__.py
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | |
Tuner
Bases: ABC
Runs calibration routines against a quantum device and updates it.
Subclasses supply :meth:backend and :attr:device; the three entry points
below — full calibration, partial recalibration and the drift check — are
the same DAG walk over different subsets, so they are implemented once here.
Source code in qpi-driver/py/qpi_driver/tuners/base/__init__.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
backend
abstractmethod
property
The scheduler this tuner composes and runs schedules through.
bias
property
Something that can park a coupler at a DC current, or None.
Only coupler_anticrossing asks for it, and only because the bias is not a
pulse: it is held over qcodes for as long as the fridge is cold, so a routine
sweeping it has to set instrument state between acquisitions. A tuner with no
rack to talk to returns None and that routine declines.
device
abstractmethod
property
The in-memory QuantumDevice being calibrated.
calibrate(config)
Walk the whole enabled DAG, then persist what it calibrated.
Source code in qpi-driver/py/qpi_driver/tuners/base/__init__.py
132 133 134 135 136 137 138 139 140 141 142 | |
check_fidelity(config)
Run only the benchmarks, calibrating nothing.
Returns a report rather than a bare mapping so the caller emits the same
payload shape it does for every other mode; :meth:CalibrationReport.fidelities
is what reduces it to the per-target numbers a threshold is compared with.
Source code in qpi-driver/py/qpi_driver/tuners/base/__init__.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
close()
Release instruments. Safe to call more than once.
Source code in qpi-driver/py/qpi_driver/tuners/base/__init__.py
312 313 | |
recalibrate(qubits, config)
Recalibrate qubits only, running whichever routines the checks blame.
Two narrowings, and both matter: this is what a drift check triggers, and it has to be meaningfully cheaper than a full run to be worth having.
The targets narrow to qubits plus any edge touching one of them. The
routines narrow by :meth:CalibrationDAG.diagnose — each routine is asked
whether its parameters still hold, and the shallowest node with evidence
against it is recalibrated along with everything downstream of it.
Downstream because recalibrating a frequency invalidates the gates tuned
against it, so re-running the blamed node alone would leave the chip in a
worse state than not running at all.
Where RFC 0004 assumed the boundary, this measures it. A run in which every check passes recalibrates nothing and says so, which is the cheapest possible outcome and was not previously reachable.
Source code in qpi-driver/py/qpi_driver/tuners/base/__init__.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
routines()
The routines this tuner can run. Every tuner runs the same set.
Source code in qpi-driver/py/qpi_driver/tuners/base/__init__.py
128 129 130 | |
load_installed_devices()
Register every device advertised under :data:ENTRY_POINT_GROUP.
An entry point must resolve to a :class:DeviceSpec or an iterable of them.
One that does not — because it will not import, resolves to something else, or
names a device already registered — is logged and skipped: a third party's
mistake must not stop the CLI from starting or --help from printing.
Returns the names of the devices registered, for the caller to log or test.
Source code in qpi-driver/py/qpi_driver/builtins/discovery.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
register(spec)
Add spec to the registry, or raise if its name is already taken.
Names are unique per operation, not globally: nothing stops a process
and a monitor device from sharing a name, since --device is always
read in the context of an operation.
Raises:
| Type | Description |
|---|---|
ValueError
|
if a device of the same name is already registered for the same operation. Silently replacing it would make the winner depend on import order. |
Source code in qpi-driver/py/qpi_driver/builtins/registry.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |