iqm-station-control-client 10.1.0__py3-none-any.whl → 11.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- iqm/station_control/client/qon.py +36 -20
- iqm/station_control/interface/models/jobs.py +9 -0
- {iqm_station_control_client-10.1.0.dist-info → iqm_station_control_client-11.0.0.dist-info}/METADATA +1 -1
- {iqm_station_control_client-10.1.0.dist-info → iqm_station_control_client-11.0.0.dist-info}/RECORD +7 -7
- {iqm_station_control_client-10.1.0.dist-info → iqm_station_control_client-11.0.0.dist-info}/LICENSE.txt +0 -0
- {iqm_station_control_client-10.1.0.dist-info → iqm_station_control_client-11.0.0.dist-info}/WHEEL +0 -0
- {iqm_station_control_client-10.1.0.dist-info → iqm_station_control_client-11.0.0.dist-info}/top_level.txt +0 -0
|
@@ -47,11 +47,16 @@ Suffixes: TypeAlias = dict[str, str]
|
|
|
47
47
|
"""Suffixes in a dut_field, split into key/value pairs."""
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
def locus_to_locus_str(locus:
|
|
50
|
+
def locus_to_locus_str(locus: Iterable[str]) -> str:
|
|
51
51
|
"""Convert a locus into a locus string."""
|
|
52
52
|
return LOCUS_SEPARATOR.join(locus)
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
def locus_str_to_locus(locus_str: str) -> Locus:
|
|
56
|
+
"""Convert a locus string into a locus."""
|
|
57
|
+
return tuple(locus_str.split(LOCUS_SEPARATOR))
|
|
58
|
+
|
|
59
|
+
|
|
55
60
|
class Domain(StrEnum):
|
|
56
61
|
"""Known observation domains/categories."""
|
|
57
62
|
|
|
@@ -251,8 +256,9 @@ class QONMetric(QON):
|
|
|
251
256
|
"""
|
|
252
257
|
|
|
253
258
|
method: Annotated[str, Field(pattern=_PATTERN)]
|
|
254
|
-
|
|
255
|
-
"""Sequence of names of QPU components on which the gate is applied, or on which the experiment is run
|
|
259
|
+
locus_str: str
|
|
260
|
+
"""Sequence of names of QPU components on which the gate is applied, or on which the experiment is run,
|
|
261
|
+
encoded into a string."""
|
|
256
262
|
metric: Annotated[str, Field(pattern=r"^[A-Za-z_0-9][A-Za-z0-9_]*$")]
|
|
257
263
|
"""Measured metric."""
|
|
258
264
|
|
|
@@ -267,6 +273,11 @@ class QONMetric(QON):
|
|
|
267
273
|
"""Return the QON domain for metrics."""
|
|
268
274
|
return Domain.METRIC
|
|
269
275
|
|
|
276
|
+
@property
|
|
277
|
+
def locus(self) -> Locus:
|
|
278
|
+
"""Locus of the metric."""
|
|
279
|
+
return locus_str_to_locus(self.locus_str)
|
|
280
|
+
|
|
270
281
|
@classmethod
|
|
271
282
|
def _parse(cls, method: str, method_specific_part: str) -> QONMetric:
|
|
272
283
|
"""Parse a metric observation name using the appropriate registered subclass.
|
|
@@ -316,7 +327,7 @@ class QONGateMetric(QONMetric):
|
|
|
316
327
|
method: ssro
|
|
317
328
|
gate: measure
|
|
318
329
|
implementation: constant
|
|
319
|
-
|
|
330
|
+
locus_str: QB1
|
|
320
331
|
metric: fidelity
|
|
321
332
|
suffixes: {"aaa": "bbb", "par": "d1"}
|
|
322
333
|
|
|
@@ -325,7 +336,7 @@ class QONGateMetric(QONMetric):
|
|
|
325
336
|
method: ssro
|
|
326
337
|
gate: measure
|
|
327
338
|
implementation: constant
|
|
328
|
-
|
|
339
|
+
locus_str: QB1
|
|
329
340
|
metric: fidelity
|
|
330
341
|
suffixes: {}
|
|
331
342
|
|
|
@@ -334,7 +345,7 @@ class QONGateMetric(QONMetric):
|
|
|
334
345
|
method: rb
|
|
335
346
|
gate: prx
|
|
336
347
|
implementation: drag_crf
|
|
337
|
-
|
|
348
|
+
locus_str: QB4
|
|
338
349
|
metric: fidelity
|
|
339
350
|
suffixes: {"par": "d2"}
|
|
340
351
|
"""
|
|
@@ -347,7 +358,7 @@ class QONGateMetric(QONMetric):
|
|
|
347
358
|
"""Suffixes defining the metric further (if any)."""
|
|
348
359
|
|
|
349
360
|
def __str__(self) -> str:
|
|
350
|
-
parts = [self.domain, self.method, self.gate, self.implementation, self.
|
|
361
|
+
parts = [self.domain, self.method, self.gate, self.implementation, self.locus_str, self.metric]
|
|
351
362
|
name = _FIELD_SEPARATOR.join(parts)
|
|
352
363
|
if self.suffixes:
|
|
353
364
|
suffix_str = _SUFFIX_SEPARATOR.join(f"{k}={v}" for k, v in sorted(self.suffixes.items()))
|
|
@@ -372,12 +383,12 @@ class QONGateMetric(QONMetric):
|
|
|
372
383
|
parts, suffixes = _split_obs_name(method_specific_part, maxsplit=3)
|
|
373
384
|
if len(parts) < 4:
|
|
374
385
|
raise ValueError(f"{method} gate quality metric name has less than 6 parts")
|
|
375
|
-
gate, implementation,
|
|
386
|
+
gate, implementation, locus_str, metric = parts
|
|
376
387
|
return cls(
|
|
377
388
|
method=method,
|
|
378
389
|
gate=gate,
|
|
379
390
|
implementation=implementation,
|
|
380
|
-
|
|
391
|
+
locus_str=locus_str,
|
|
381
392
|
metric=metric,
|
|
382
393
|
suffixes=suffixes,
|
|
383
394
|
)
|
|
@@ -388,7 +399,7 @@ class QONGateMetric(QONMetric):
|
|
|
388
399
|
class QONSystemMetric(QONMetric):
|
|
389
400
|
"""QON representing a system quality metric.
|
|
390
401
|
|
|
391
|
-
Has the form ``metrics.{method}.{
|
|
402
|
+
Has the form ``metrics.{method}.{locus_str}.{metric}``.
|
|
392
403
|
|
|
393
404
|
Can parse/represent e.g. the following metrics:
|
|
394
405
|
|
|
@@ -397,21 +408,21 @@ class QONSystemMetric(QONMetric):
|
|
|
397
408
|
method: irb
|
|
398
409
|
gate: circuit
|
|
399
410
|
implementation: random_circuit
|
|
400
|
-
|
|
411
|
+
locus_str: QB4
|
|
401
412
|
metric: fidelity
|
|
402
413
|
suffixes: {"par": "d2"}
|
|
403
414
|
|
|
404
415
|
``metrics.ghz_state.QB1__QB2.coherence_lower_bound``
|
|
405
416
|
|
|
406
417
|
method: ghz_state
|
|
407
|
-
|
|
418
|
+
locus_str: QB1__QB2
|
|
408
419
|
metric: coherence_lower_bound
|
|
409
420
|
|
|
410
421
|
Subclasses implement parsing and string representation for specific methods.
|
|
411
422
|
"""
|
|
412
423
|
|
|
413
424
|
def __str__(self) -> str:
|
|
414
|
-
parts = [self.domain, self.method, self.
|
|
425
|
+
parts = [self.domain, self.method, self.locus_str, self.metric]
|
|
415
426
|
return _FIELD_SEPARATOR.join(parts)
|
|
416
427
|
|
|
417
428
|
@classmethod
|
|
@@ -432,10 +443,10 @@ class QONSystemMetric(QONMetric):
|
|
|
432
443
|
parts = method_specific_part.split(_FIELD_SEPARATOR, maxsplit=1)
|
|
433
444
|
if len(parts) < 2:
|
|
434
445
|
raise ValueError(f"{method} system quality metric name has less than 4 parts")
|
|
435
|
-
|
|
446
|
+
locus_str, metric = parts
|
|
436
447
|
return cls(
|
|
437
448
|
method=method,
|
|
438
|
-
|
|
449
|
+
locus_str=locus_str,
|
|
439
450
|
metric=metric,
|
|
440
451
|
)
|
|
441
452
|
|
|
@@ -479,8 +490,8 @@ class QONGateParam(QON):
|
|
|
479
490
|
"""Name of the gate/quantum operation."""
|
|
480
491
|
implementation: Annotated[str, Field(pattern=_PATTERN)]
|
|
481
492
|
"""Name of the gate implementation."""
|
|
482
|
-
|
|
483
|
-
"""Sequence of names of QPU components on which the gate is applied."""
|
|
493
|
+
locus_str: str
|
|
494
|
+
"""Sequence of names of QPU components on which the gate is applied, encoded into a string."""
|
|
484
495
|
parameter: str
|
|
485
496
|
"""Name of the gate parameter. May have further dotted structure."""
|
|
486
497
|
|
|
@@ -488,8 +499,13 @@ class QONGateParam(QON):
|
|
|
488
499
|
def domain(self) -> Domain:
|
|
489
500
|
return Domain.GATE_PARAMETER
|
|
490
501
|
|
|
502
|
+
@property
|
|
503
|
+
def locus(self) -> Locus:
|
|
504
|
+
"""Locus of the gate parameter."""
|
|
505
|
+
return locus_str_to_locus(self.locus_str)
|
|
506
|
+
|
|
491
507
|
def __str__(self) -> str:
|
|
492
|
-
return _FIELD_SEPARATOR.join([self.domain, self.gate, self.implementation, self.
|
|
508
|
+
return _FIELD_SEPARATOR.join([self.domain, self.gate, self.implementation, self.locus_str, self.parameter])
|
|
493
509
|
|
|
494
510
|
@classmethod
|
|
495
511
|
def _parse(cls, gate: str, rest: str) -> QONGateParam:
|
|
@@ -497,11 +513,11 @@ class QONGateParam(QON):
|
|
|
497
513
|
parts = rest.split(_FIELD_SEPARATOR, maxsplit=2)
|
|
498
514
|
if len(parts) < 3:
|
|
499
515
|
raise ValueError("Gate parameter observation name has less than 5 parts")
|
|
500
|
-
implementation,
|
|
516
|
+
implementation, locus_str, param = parts
|
|
501
517
|
return cls(
|
|
502
518
|
gate=gate,
|
|
503
519
|
implementation=implementation,
|
|
504
|
-
|
|
520
|
+
locus_str=locus_str,
|
|
505
521
|
parameter=param,
|
|
506
522
|
)
|
|
507
523
|
|
|
@@ -181,3 +181,12 @@ class JobExecutorStatus(Enum):
|
|
|
181
181
|
def terminal_statuses(cls) -> set[JobExecutorStatus]:
|
|
182
182
|
"""Statuses from which the execution can't continue."""
|
|
183
183
|
return {cls.ABORTED, cls.FAILED, cls.READY}
|
|
184
|
+
|
|
185
|
+
@classmethod
|
|
186
|
+
def in_progress_statuses(cls) -> set[JobExecutorStatus]:
|
|
187
|
+
"""Statuses representing jobs that should be cleaned up on restart.
|
|
188
|
+
|
|
189
|
+
Returns all non-terminal statuses.
|
|
190
|
+
"""
|
|
191
|
+
all_statuses = set(cls)
|
|
192
|
+
return all_statuses - cls.terminal_statuses()
|
{iqm_station_control_client-10.1.0.dist-info → iqm_station_control_client-11.0.0.dist-info}/RECORD
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
iqm/station_control/client/__init__.py,sha256=1ND-AkIE9xLGIscH3WN44eyll9nlFhXeyCm-8EDFGQ4,942
|
|
2
2
|
iqm/station_control/client/list_models.py,sha256=jpnmUqFvmzGxhq6fDBrV2crIgGNY5NfYqj5odpyWO-w,2524
|
|
3
3
|
iqm/station_control/client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
iqm/station_control/client/qon.py,sha256=
|
|
4
|
+
iqm/station_control/client/qon.py,sha256=9URsapeqVXi2h6xX0BKpl2fYKKkwGicLN-isI_Mmh0s,27768
|
|
5
5
|
iqm/station_control/client/station_control.py,sha256=XbRkDvKiRvNsCQmMZPe1tkBDYR57q9oYLRC2HHsIRKg,29089
|
|
6
6
|
iqm/station_control/client/utils.py,sha256=-6K4KgOgA4iyUCqX-w26JvFxlwlGBehGj4tIWCEbn74,3360
|
|
7
7
|
iqm/station_control/client/iqm_server/__init__.py,sha256=nLsRHN1rnOKXwuzaq_liUpAYV3sis5jkyHccSdacV7U,624
|
|
@@ -43,7 +43,7 @@ iqm/station_control/interface/station_control.py,sha256=5gtDouAQ13KnyXNQUcBrpKG9
|
|
|
43
43
|
iqm/station_control/interface/models/__init__.py,sha256=BP9iIwHi0nw8CUzScXOsu8bhxnE_rRulOsRVO5L1hx0,1989
|
|
44
44
|
iqm/station_control/interface/models/dut.py,sha256=Hc_0XllXeIPGWhHsY7PC_jMpi7swpqo3jQQEQVnF3AM,1216
|
|
45
45
|
iqm/station_control/interface/models/dynamic_quantum_architecture.py,sha256=3YlI9e1XxdbkBzlOdxmzYTccJ8AJRnRSIp-JoBf8Yyw,4698
|
|
46
|
-
iqm/station_control/interface/models/jobs.py,sha256=
|
|
46
|
+
iqm/station_control/interface/models/jobs.py,sha256=MGo0MOg-mTw3rF7vNCYNGAns6-eyl30ubqiEQWCFJ9c,6876
|
|
47
47
|
iqm/station_control/interface/models/monitor.py,sha256=ItlgxtBup1hHg64uKeMKiFE7MaRRqSYdVRttsFD_XeU,1352
|
|
48
48
|
iqm/station_control/interface/models/observation.py,sha256=IblYdzJN88BNlyxUVR_dIx7BgD_GHGLhHUwy89Fib-I,3281
|
|
49
49
|
iqm/station_control/interface/models/observation_set.py,sha256=y6uqslVF2kO1zREPE6EtrvG9ZVrLo0S2Sk7ZhRL8pks,3993
|
|
@@ -52,8 +52,8 @@ iqm/station_control/interface/models/sequence.py,sha256=boWlMfP3woVgVObW3OaNbxsU
|
|
|
52
52
|
iqm/station_control/interface/models/static_quantum_architecture.py,sha256=gsfJKlYsfZVEK3dqEKXkBSIHiY14DGwNbhPJdNHMtNM,1435
|
|
53
53
|
iqm/station_control/interface/models/sweep.py,sha256=HFoFIrKhlYmHIBfGltY2O9_J28OvkkZILRbDHuqR0wc,2509
|
|
54
54
|
iqm/station_control/interface/models/type_aliases.py,sha256=StsUwqwPp1N9wh79w40C6eEp7OmQ8E5AnJX7w2mqTnQ,1153
|
|
55
|
-
iqm_station_control_client-
|
|
56
|
-
iqm_station_control_client-
|
|
57
|
-
iqm_station_control_client-
|
|
58
|
-
iqm_station_control_client-
|
|
59
|
-
iqm_station_control_client-
|
|
55
|
+
iqm_station_control_client-11.0.0.dist-info/LICENSE.txt,sha256=R6Q7eUrLyoCQgWYorQ8WJmVmWKYU3dxA3jYUp0wwQAw,11332
|
|
56
|
+
iqm_station_control_client-11.0.0.dist-info/METADATA,sha256=jiog131yThfz5_ybdxA9BcEAMm-kTtrqcaAMmpdFt4w,14107
|
|
57
|
+
iqm_station_control_client-11.0.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
58
|
+
iqm_station_control_client-11.0.0.dist-info/top_level.txt,sha256=NB4XRfyDS6_wG9gMsyX-9LTU7kWnTQxNvkbzIxGv3-c,4
|
|
59
|
+
iqm_station_control_client-11.0.0.dist-info/RECORD,,
|
|
File without changes
|
{iqm_station_control_client-10.1.0.dist-info → iqm_station_control_client-11.0.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|