diff --git a/cirq-core/cirq/experiments/qubit_characterizations.py b/cirq-core/cirq/experiments/qubit_characterizations.py index 33a36b616a2c..a1a5a9ec73c8 100644 --- a/cirq-core/cirq/experiments/qubit_characterizations.py +++ b/cirq-core/cirq/experiments/qubit_characterizations.py @@ -230,18 +230,6 @@ def single_qubit_randomized_benchmarking( return RandomizedBenchMarkResult(num_clifford_range, gnd_probs) -def _create_parallel_rb_circuit( - qubits: tuple[cirq.GridQubit], num_cfds: int, c1: list, cfd_mats: np.array -) -> cirq.Circuit: - circuits_to_zip = [_random_single_q_clifford(qubit, num_cfds, c1, cfd_mats) for qubit in qubits] - circuit = cirq.Circuit.zip(*circuits_to_zip) - measure_moment = cirq.Moment( - cirq.measure_each(*qubits, key_func=lambda q: "q{}_{}".format(q.row, q.col)) - ) - circuit_with_meas = cirq.Circuit.from_moments(*(circuit.moments + [measure_moment])) - return circuit_with_meas - - def parallel_single_qubit_randomized_benchmarking( sampler: cirq.Sampler, use_xy_basis: bool = True, @@ -541,6 +529,18 @@ def _measurement(two_qubit_circuit: circuits.Circuit) -> np.ndarray: return TomographyResult(rho) +def _create_parallel_rb_circuit( + qubits: tuple[cirq.GridQubit], num_cfds: int, c1: list, cfd_mats: np.array +) -> cirq.Circuit: + circuits_to_zip = [_random_single_q_clifford(qubit, num_cfds, c1, cfd_mats) for qubit in qubits] + circuit = cirq.Circuit.zip(*circuits_to_zip) + measure_moment = cirq.Moment( + cirq.measure_each(*qubits, key_func=lambda q: "q{}_{}".format(q.row, q.col)) + ) + circuit_with_meas = cirq.Circuit.from_moments(*(circuit.moments + [measure_moment])) + return circuit_with_meas + + def _indices_after_basis_rot(i: int, j: int) -> Tuple[int, Sequence[int], Sequence[int]]: mat_idx = 3 * (3 * i + j) q_0_i = 3 - i