QPI Driver API Reference
qpi_driver
Executor
Bases: ABC
Source code in qpi-driver/qpi_driver/executors/base.py
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 | |
close()
Release resources.
Source code in qpi-driver/qpi_driver/executors/base.py
155 156 157 | |
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/qpi_driver/executors/base.py
123 124 125 126 127 128 129 130 131 132 133 | |
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/qpi_driver/executors/base.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
MockExecutor
Bases: Executor
Source code in qpi-driver/qpi_driver/executors/mock.py
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 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 | |
execute(payload)
Execute quantum circuit simulation using Qiskit BasicSimulator.
For multi-circuit payloads, results are concatenated along a circuit_index
dimension. A single-circuit payload without parameter bindings returns the
legacy flat format (no circuit_index dimension) for backward compatibility.
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/qpi_driver/executors/mock.py
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 | |
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/qpi_driver/executors/mock.py
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 | |
PrestoExecutor
Bases: Executor
Executor subclass for interacting with Presto RF signal generators.
Source code in qpi-driver/qpi_driver/executors/presto.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/qpi_driver/executors/presto.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/qpi_driver/executors/presto.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/qpi_driver/executors/qblox.py
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 | |
__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, **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
|
**kwargs
|
Any
|
Arbitrary keyword arguments passed to the base class. |
{}
|
Source code in qpi-driver/qpi_driver/executors/qblox.py
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 | |
close()
Release resources.
Source code in qpi-driver/qpi_driver/executors/qblox.py
382 383 384 385 | |
execute(payload)
Execute quantum instructions using the Qblox scheduler.
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/qpi_driver/executors/qblox.py
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 | |
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/qpi_driver/executors/qblox.py
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 | |
QiskitAerExecutor
Bases: Executor
Source code in qpi-driver/qpi_driver/executors/qiskit_aer.py
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 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 | |
execute(payload)
Run quantum circuit simulation using Qiskit Aer backend.
For multi-circuit payloads, results are concatenated along a circuit_index
dimension. A single-circuit payload without parameter bindings returns the
legacy flat format (no circuit_index dimension) for backward compatibility.
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/qpi_driver/executors/qiskit_aer.py
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 | |
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/qpi_driver/executors/qiskit_aer.py
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 | |
QuantifyExecutor
Bases: Executor
Executor subclass for interacting with Quantify-scheduler acquisition backends.
Source code in qpi-driver/qpi_driver/executors/quantify.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 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 | |
__init__(name='quantify', quantify_hardware_config=Path('quantify.hardware.json'), quantify_device_config=Path('quantify.device.json'), is_dummy=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. |
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/qpi_driver/executors/quantify.py
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 | |
close()
Release resources.
Source code in qpi-driver/qpi_driver/executors/quantify.py
399 400 401 402 403 404 405 406 | |
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()).
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/qpi_driver/executors/quantify.py
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 | |
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/qpi_driver/executors/quantify.py
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 | |
run_driver(qpi_addr='http://127.0.0.1:8090', token='', name='qpu_sim_01', executor='mock', custom_executors=None, data_dir=Path('bin/data'), ca_fingerprint='', ca_file_path=Path('./bin/qpi.ca.pem'), **executor_options)
Run the QPI Python hardware driver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpi_addr
|
str
|
Full URL of the QPI orchestrator
(e.g. |
'http://127.0.0.1:8090'
|
token
|
str
|
QPU access token. |
''
|
name
|
str
|
Human-readable name for this QPU. |
'qpu_sim_01'
|
executor
|
str | type[Executor] | Executor
|
Executor specification (string key, class, or instance). |
'mock'
|
custom_executors
|
dict[str, type[Executor]] | None
|
Optional dict of custom executors for resolving string keys. |
None
|
data_dir
|
Path
|
Directory for executor working data. |
Path('bin/data')
|
ca_fingerprint
|
str
|
the fingerprint to verify that the downloaded CA file is the right one |
''
|
ca_file_path
|
Path
|
Path to the CA certificate file for TLS connections. |
Path('./bin/qpi.ca.pem')
|
executor_options
|
Any
|
other options to pass to the executor. |
{}
|
Source code in qpi-driver/qpi_driver/driver.py
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 | |