uniqc.calibration.results module¶
Calibration result schemas for UnifiedQuantum.
All calibration results include a calibrated_at ISO-8601 timestamp set by the calibration module. Results are saved to ~/.uniqc/calibration_cache/.
- class uniqc.calibration.results.CalibrationResult(calibrated_at, backend, type)[source]¶
Bases:
objectBase class for all calibration results.
- backend¶
- calibrated_at¶
- type¶
- class uniqc.calibration.results.ReadoutCalibrationResult(calibrated_at, backend, type='readout_1q', qubit=0, confusion_matrix=(), assignment_fidelity=0.0)[source]¶
Bases:
CalibrationResultResult of a readout calibration experiment.
- Variables:
type (Literal['readout_1q', 'readout_2q']) – “readout_1q” or “readout_2q”
qubit (int | tuple[int, int]) – int for 1q, tuple[int, int] for 2q
confusion_matrix (tuple[tuple[float, ...], ...]) – For 1q, a 2x2 matrix where rows are measured states and columns are prepared states. The entry
confusion_matrix[i][j] = P(measure=i | prep=j)gives the conditional probability. For 2q, this is a 4x4 matrix ordered as|00⟩,|01⟩,|10⟩,|11⟩.assignment_fidelity (float) – average diagonal element = (p00+p11)/2 (1q) or avg(diagonal) (2q)
- assignment_fidelity¶
- confusion_matrix¶
- qubit¶
- class uniqc.calibration.results.XEBResult(calibrated_at, backend, type='xeb_1q', qubit=None, pairs=None, fidelity_per_layer=0.0, fidelity_std_error=0.0, fit_a=0.0, fit_b=0.0, fit_r=0.0, depths=(), n_circuits=0, shots=0)[source]¶
Bases:
CalibrationResultResult of a cross-entropy benchmarking experiment.
- depths¶
- fidelity_per_layer¶
- fidelity_std_error¶
- fit_a¶
- fit_b¶
- fit_r¶
- n_circuits¶
- pairs¶
- qubit¶
- shots¶
- uniqc.calibration.results.ensure_cache_dir()[source]¶
Ensure the calibration cache directory exists.
- uniqc.calibration.results.find_cached_results(backend, result_type, *, max_age_hours=None, cache_dir=None)[source]¶
Find cached calibration result files matching backend + type.
Optionally filters by age.