|
23 | 23 | import attrs |
24 | 24 | import numpy as np |
25 | 25 |
|
26 | | -from cirq import circuits, ops, work |
27 | | -from cirq.contrib.shuffle_circuits import run_shuffled_with_readout_benchmarking |
| 26 | +import cirq.contrib.shuffle_circuits.shuffle_circuits_with_readout_benchmarking as sc_readout |
| 27 | +from cirq import circuits, ops, study, work |
28 | 28 | from cirq.experiments.readout_confusion_matrix import TensoredConfusionMatrices |
29 | 29 |
|
30 | 30 | if TYPE_CHECKING: |
@@ -288,7 +288,7 @@ def _build_many_one_qubits_empty_confusion_matrix(qubits_length: int) -> list[np |
288 | 288 | def _process_pauli_measurement_results( |
289 | 289 | qubits: Sequence[ops.Qid], |
290 | 290 | pauli_string_groups: list[list[ops.PauliString]], |
291 | | - circuit_results: list[ResultDict], |
| 291 | + circuit_results: list[ResultDict] | Sequence[study.Result], |
292 | 292 | calibration_results: dict[tuple[ops.Qid, ...], SingleQubitReadoutCalibrationResult], |
293 | 293 | pauli_repetitions: int, |
294 | 294 | timestamp: float, |
@@ -474,14 +474,18 @@ def measure_pauli_strings( |
474 | 474 | pauli_measurement_circuits.extend(basis_change_circuits) |
475 | 475 |
|
476 | 476 | # Run shuffled benchmarking for readout calibration |
477 | | - circuits_results, calibration_results = run_shuffled_with_readout_benchmarking( |
478 | | - input_circuits=pauli_measurement_circuits, |
479 | | - sampler=sampler, |
480 | | - circuit_repetitions=pauli_repetitions, |
481 | | - rng_or_seed=rng_or_seed, |
482 | | - qubits=[list(qubits) for qubits in qubits_list], |
483 | | - num_random_bitstrings=num_random_bitstrings, |
484 | | - readout_repetitions=readout_repetitions, |
| 477 | + circuits_results, calibration_results = ( |
| 478 | + sc_readout.run_shuffled_circuits_with_readout_benchmarking( |
| 479 | + sampler=sampler, |
| 480 | + input_circuits=pauli_measurement_circuits, |
| 481 | + parameters=sc_readout.ReadoutBenchmarkingParams( |
| 482 | + circuit_repetitions=pauli_repetitions, |
| 483 | + num_random_bitstrings=num_random_bitstrings, |
| 484 | + readout_repetitions=readout_repetitions, |
| 485 | + ), |
| 486 | + rng_or_seed=rng_or_seed, |
| 487 | + qubits=[list(qubits) for qubits in qubits_list], |
| 488 | + ) |
485 | 489 | ) |
486 | 490 |
|
487 | 491 | # Process the results to calculate expectation values |
|
0 commit comments